doc2vec 2.12.0 → 2.13.1

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.
@@ -1,126 +0,0 @@
1
- function l9(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Ov(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zb={exports:{}},yf={};var $2;function o9(){if($2)return yf;$2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var s in i)s!=="key"&&(a[s]=i[s])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:a}}return yf.Fragment=t,yf.jsx=n,yf.jsxs=n,yf}var U2;function s9(){return U2||(U2=1,Zb.exports=o9()),Zb.exports}var M=s9(),Jb={exports:{}},Pe={};var H2;function u9(){if(H2)return Pe;H2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function v(R){return R===null||typeof R!="object"?null:(R=g&&R[g]||R["@@iterator"],typeof R=="function"?R:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,w={};function A(R,X,re){this.props=R,this.context=X,this.refs=w,this.updater=re||y}A.prototype.isReactComponent={},A.prototype.setState=function(R,X){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,X,"setState")},A.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function C(){}C.prototype=A.prototype;function k(R,X,re){this.props=R,this.context=X,this.refs=w,this.updater=re||y}var P=k.prototype=new C;P.constructor=k,x(P,A.prototype),P.isPureReactComponent=!0;var T=Array.isArray;function D(){}var N={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function U(R,X,re){var le=re.ref;return{$$typeof:e,type:R,key:X,ref:le!==void 0?le:null,props:re}}function K(R,X){return U(R.type,X,R.props)}function V(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function B(R){var X={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(re){return X[re]})}var ae=/\/+/g;function ie(R,X){return typeof R=="object"&&R!==null&&R.key!=null?B(""+R.key):X.toString(36)}function oe(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(D,D):(R.status="pending",R.then(function(X){R.status==="pending"&&(R.status="fulfilled",R.value=X)},function(X){R.status==="pending"&&(R.status="rejected",R.reason=X)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function z(R,X,re,le,ge){var Oe=typeof R;(Oe==="undefined"||Oe==="boolean")&&(R=null);var De=!1;if(R===null)De=!0;else switch(Oe){case"bigint":case"string":case"number":De=!0;break;case"object":switch(R.$$typeof){case e:case t:De=!0;break;case d:return De=R._init,z(De(R._payload),X,re,le,ge)}}if(De)return ge=ge(R),De=le===""?"."+ie(R,0):le,T(ge)?(re="",De!=null&&(re=De.replace(ae,"$&/")+"/"),z(ge,X,re,"",function(Te){return Te})):ge!=null&&(V(ge)&&(ge=K(ge,re+(ge.key==null||R&&R.key===ge.key?"":(""+ge.key).replace(ae,"$&/")+"/")+De)),X.push(ge)),1;De=0;var mt=le===""?".":le+":";if(T(R))for(var se=0;se<R.length;se++)le=R[se],Oe=mt+ie(le,se),De+=z(le,X,re,Oe,ge);else if(se=v(R),typeof se=="function")for(R=se.call(R),se=0;!(le=R.next()).done;)le=le.value,Oe=mt+ie(le,se++),De+=z(le,X,re,Oe,ge);else if(Oe==="object"){if(typeof R.then=="function")return z(oe(R),X,re,le,ge);throw X=String(R),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return De}function G(R,X,re){if(R==null)return R;var le=[],ge=0;return z(R,le,"","",function(Oe){return X.call(re,Oe,ge++)}),le}function ne(R){if(R._status===-1){var X=R._result;X=X(),X.then(function(re){(R._status===0||R._status===-1)&&(R._status=1,R._result=re)},function(re){(R._status===0||R._status===-1)&&(R._status=2,R._result=re)}),R._status===-1&&(R._status=0,R._result=X)}if(R._status===1)return R._result.default;throw R._result}var ce=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},fe={map:G,forEach:function(R,X,re){G(R,function(){X.apply(this,arguments)},re)},count:function(R){var X=0;return G(R,function(){X++}),X},toArray:function(R){return G(R,function(X){return X})||[]},only:function(R){if(!V(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Pe.Activity=p,Pe.Children=fe,Pe.Component=A,Pe.Fragment=n,Pe.Profiler=i,Pe.PureComponent=k,Pe.StrictMode=r,Pe.Suspense=c,Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,Pe.__COMPILER_RUNTIME={__proto__:null,c:function(R){return N.H.useMemoCache(R)}},Pe.cache=function(R){return function(){return R.apply(null,arguments)}},Pe.cacheSignal=function(){return null},Pe.cloneElement=function(R,X,re){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var le=x({},R.props),ge=R.key;if(X!=null)for(Oe in X.key!==void 0&&(ge=""+X.key),X)!I.call(X,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&X.ref===void 0||(le[Oe]=X[Oe]);var Oe=arguments.length-2;if(Oe===1)le.children=re;else if(1<Oe){for(var De=Array(Oe),mt=0;mt<Oe;mt++)De[mt]=arguments[mt+2];le.children=De}return U(R.type,ge,le)},Pe.createContext=function(R){return R={$$typeof:l,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:a,_context:R},R},Pe.createElement=function(R,X,re){var le,ge={},Oe=null;if(X!=null)for(le in X.key!==void 0&&(Oe=""+X.key),X)I.call(X,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ge[le]=X[le]);var De=arguments.length-2;if(De===1)ge.children=re;else if(1<De){for(var mt=Array(De),se=0;se<De;se++)mt[se]=arguments[se+2];ge.children=mt}if(R&&R.defaultProps)for(le in De=R.defaultProps,De)ge[le]===void 0&&(ge[le]=De[le]);return U(R,Oe,ge)},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function(R){return{$$typeof:s,render:R}},Pe.isValidElement=V,Pe.lazy=function(R){return{$$typeof:d,_payload:{_status:-1,_result:R},_init:ne}},Pe.memo=function(R,X){return{$$typeof:f,type:R,compare:X===void 0?null:X}},Pe.startTransition=function(R){var X=N.T,re={};N.T=re;try{var le=R(),ge=N.S;ge!==null&&ge(re,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(D,ce)}catch(Oe){ce(Oe)}finally{X!==null&&re.types!==null&&(X.types=re.types),N.T=X}},Pe.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},Pe.use=function(R){return N.H.use(R)},Pe.useActionState=function(R,X,re){return N.H.useActionState(R,X,re)},Pe.useCallback=function(R,X){return N.H.useCallback(R,X)},Pe.useContext=function(R){return N.H.useContext(R)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function(R,X){return N.H.useDeferredValue(R,X)},Pe.useEffect=function(R,X){return N.H.useEffect(R,X)},Pe.useEffectEvent=function(R){return N.H.useEffectEvent(R)},Pe.useId=function(){return N.H.useId()},Pe.useImperativeHandle=function(R,X,re){return N.H.useImperativeHandle(R,X,re)},Pe.useInsertionEffect=function(R,X){return N.H.useInsertionEffect(R,X)},Pe.useLayoutEffect=function(R,X){return N.H.useLayoutEffect(R,X)},Pe.useMemo=function(R,X){return N.H.useMemo(R,X)},Pe.useOptimistic=function(R,X){return N.H.useOptimistic(R,X)},Pe.useReducer=function(R,X,re){return N.H.useReducer(R,X,re)},Pe.useRef=function(R){return N.H.useRef(R)},Pe.useState=function(R){return N.H.useState(R)},Pe.useSyncExternalStore=function(R,X,re){return N.H.useSyncExternalStore(R,X,re)},Pe.useTransition=function(){return N.H.useTransition()},Pe.version="19.2.7",Pe}var F2;function lc(){return F2||(F2=1,Jb.exports=u9()),Jb.exports}var O=lc();const Qj=Ov(O),c9=l9({__proto__:null,default:Qj},[O]);var ex={exports:{}},bf={},tx={exports:{}},nx={};var q2;function f9(){return q2||(q2=1,(function(e){function t(z,G){var ne=z.length;z.push(G);e:for(;0<ne;){var ce=ne-1>>>1,fe=z[ce];if(0<i(fe,G))z[ce]=G,z[ne]=fe,ne=ce;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var G=z[0],ne=z.pop();if(ne!==G){z[0]=ne;e:for(var ce=0,fe=z.length,R=fe>>>1;ce<R;){var X=2*(ce+1)-1,re=z[X],le=X+1,ge=z[le];if(0>i(re,ne))le<fe&&0>i(ge,re)?(z[ce]=ge,z[le]=ne,ce=le):(z[ce]=re,z[X]=ne,ce=X);else if(le<fe&&0>i(ge,ne))z[ce]=ge,z[le]=ne,ce=le;else break e}}return G}function i(z,G){var ne=z.sortIndex-G.sortIndex;return ne!==0?ne:z.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var c=[],f=[],d=1,p=null,g=3,v=!1,y=!1,x=!1,w=!1,A=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function P(z){for(var G=n(f);G!==null;){if(G.callback===null)r(f);else if(G.startTime<=z)r(f),G.sortIndex=G.expirationTime,t(c,G);else break;G=n(f)}}function T(z){if(x=!1,P(z),!y)if(n(c)!==null)y=!0,D||(D=!0,B());else{var G=n(f);G!==null&&oe(T,G.startTime-z)}}var D=!1,N=-1,I=5,U=-1;function K(){return w?!0:!(e.unstable_now()-U<I)}function V(){if(w=!1,D){var z=e.unstable_now();U=z;var G=!0;try{e:{y=!1,x&&(x=!1,C(N),N=-1),v=!0;var ne=g;try{t:{for(P(z),p=n(c);p!==null&&!(p.expirationTime>z&&K());){var ce=p.callback;if(typeof ce=="function"){p.callback=null,g=p.priorityLevel;var fe=ce(p.expirationTime<=z);if(z=e.unstable_now(),typeof fe=="function"){p.callback=fe,P(z),G=!0;break t}p===n(c)&&r(c),P(z)}else r(c);p=n(c)}if(p!==null)G=!0;else{var R=n(f);R!==null&&oe(T,R.startTime-z),G=!1}}break e}finally{p=null,g=ne,v=!1}G=void 0}}finally{G?B():D=!1}}}var B;if(typeof k=="function")B=function(){k(V)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,ie=ae.port2;ae.port1.onmessage=V,B=function(){ie.postMessage(null)}}else B=function(){A(V,0)};function oe(z,G){N=A(function(){z(e.unstable_now())},G)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(z){switch(g){case 1:case 2:case 3:var G=3;break;default:G=g}var ne=g;g=G;try{return z()}finally{g=ne}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(z,G){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ne=g;g=z;try{return G()}finally{g=ne}},e.unstable_scheduleCallback=function(z,G,ne){var ce=e.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?ce+ne:ce):ne=ce,z){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=ne+fe,z={id:d++,callback:G,priorityLevel:z,startTime:ne,expirationTime:fe,sortIndex:-1},ne>ce?(z.sortIndex=ne,t(f,z),n(c)===null&&z===n(f)&&(x?(C(N),N=-1):x=!0,oe(T,ne-ce))):(z.sortIndex=fe,t(c,z),y||v||(y=!0,D||(D=!0,B()))),z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(z){var G=g;return function(){var ne=g;g=G;try{return z.apply(this,arguments)}finally{g=ne}}}})(nx)),nx}var W2;function h9(){return W2||(W2=1,tx.exports=f9()),tx.exports}var rx={exports:{}},Cn={};var V2;function d9(){if(V2)return Cn;V2=1;var e=lc();function t(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)f+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(c,f,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:c,containerInfo:f,implementation:d}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function s(c,f){if(c==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Cn.createPortal=function(c,f){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(c,f,null,d)},Cn.flushSync=function(c){var f=l.T,d=r.p;try{if(l.T=null,r.p=2,c)return c()}finally{l.T=f,r.p=d,r.d.f()}},Cn.preconnect=function(c,f){typeof c=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(c,f))},Cn.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Cn.preinit=function(c,f){if(typeof c=="string"&&f&&typeof f.as=="string"){var d=f.as,p=s(d,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;d==="style"?r.d.S(c,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:v}):d==="script"&&r.d.X(c,{crossOrigin:p,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Cn.preinitModule=function(c,f){if(typeof c=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var d=s(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(c)},Cn.preload=function(c,f){if(typeof c=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var d=f.as,p=s(d,f.crossOrigin);r.d.L(c,d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Cn.preloadModule=function(c,f){if(typeof c=="string")if(f){var d=s(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(c)},Cn.requestFormReset=function(c){r.d.r(c)},Cn.unstable_batchedUpdates=function(c,f){return c(f)},Cn.useFormState=function(c,f,d){return l.H.useFormState(c,f,d)},Cn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Cn.version="19.2.7",Cn}var K2;function Yj(){if(K2)return rx.exports;K2=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(),rx.exports=d9(),rx.exports}var X2;function p9(){if(X2)return bf;X2=1;var e=h9(),t=lc(),n=Yj();function r(o){var u="https://react.dev/errors/"+o;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+o+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function a(o){var u=o,h=o;if(o.alternate)for(;u.return;)u=u.return;else{o=u;do u=o,(u.flags&4098)!==0&&(h=u.return),o=u.return;while(o)}return u.tag===3?h:null}function l(o){if(o.tag===13){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function s(o){if(o.tag===31){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function c(o){if(a(o)!==o)throw Error(r(188))}function f(o){var u=o.alternate;if(!u){if(u=a(o),u===null)throw Error(r(188));return u!==o?null:o}for(var h=o,m=u;;){var b=h.return;if(b===null)break;var S=b.alternate;if(S===null){if(m=b.return,m!==null){h=m;continue}break}if(b.child===S.child){for(S=b.child;S;){if(S===h)return c(b),o;if(S===m)return c(b),u;S=S.sibling}throw Error(r(188))}if(h.return!==m.return)h=b,m=S;else{for(var E=!1,_=b.child;_;){if(_===h){E=!0,h=b,m=S;break}if(_===m){E=!0,m=b,h=S;break}_=_.sibling}if(!E){for(_=S.child;_;){if(_===h){E=!0,h=S,m=b;break}if(_===m){E=!0,m=S,h=b;break}_=_.sibling}if(!E)throw Error(r(189))}}if(h.alternate!==m)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?o:u}function d(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o;for(o=o.child;o!==null;){if(u=d(o),u!==null)return u;o=o.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),k=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function B(o){return o===null||typeof o!="object"?null:(o=V&&o[V]||o["@@iterator"],typeof o=="function"?o:null)}var ae=Symbol.for("react.client.reference");function ie(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===ae?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case x:return"Fragment";case A:return"Profiler";case w:return"StrictMode";case T:return"Suspense";case D:return"SuspenseList";case U:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case y:return"Portal";case k:return o.displayName||"Context";case C:return(o._context.displayName||"Context")+".Consumer";case P:var u=o.render;return o=o.displayName,o||(o=u.displayName||u.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case N:return u=o.displayName||null,u!==null?u:ie(o.type)||"Memo";case I:u=o._payload,o=o._init;try{return ie(o(u))}catch{}}return null}var oe=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},ce=[],fe=-1;function R(o){return{current:o}}function X(o){0>fe||(o.current=ce[fe],ce[fe]=null,fe--)}function re(o,u){fe++,ce[fe]=o.current,o.current=u}var le=R(null),ge=R(null),Oe=R(null),De=R(null);function mt(o,u){switch(re(Oe,u),re(ge,o),re(le,null),u.nodeType){case 9:case 11:o=(o=u.documentElement)&&(o=o.namespaceURI)?u2(o):0;break;default:if(o=u.tagName,u=u.namespaceURI)u=u2(u),o=c2(u,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}X(le),re(le,o)}function se(){X(le),X(ge),X(Oe)}function Te(o){o.memoizedState!==null&&re(De,o);var u=le.current,h=c2(u,o.type);u!==h&&(re(ge,o),re(le,h))}function Ee(o){ge.current===o&&(X(le),X(ge)),De.current===o&&(X(De),pf._currentValue=ne)}var ue,Nt;function Ne(o){if(ue===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);ue=u&&u[1]||"",Nt=-1<h.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ue+o+Nt}var xe=!1;function gt(o,u){if(!o||xe)return"";xe=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(u){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(Q){var W=Q}Reflect.construct(o,[],te)}else{try{te.call()}catch(Q){W=Q}o.call(te.prototype)}}else{try{throw Error()}catch(Q){W=Q}(te=o())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(Q){if(Q&&W&&typeof Q.stack=="string")return[Q.stack,W.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=m.DetermineComponentFrameRoot(),E=S[0],_=S[1];if(E&&_){var j=E.split(`
4
- `),F=_.split(`
5
- `);for(b=m=0;m<j.length&&!j[m].includes("DetermineComponentFrameRoot");)m++;for(;b<F.length&&!F[b].includes("DetermineComponentFrameRoot");)b++;if(m===j.length||b===F.length)for(m=j.length-1,b=F.length-1;1<=m&&0<=b&&j[m]!==F[b];)b--;for(;1<=m&&0<=b;m--,b--)if(j[m]!==F[b]){if(m!==1||b!==1)do if(m--,b--,0>b||j[m]!==F[b]){var Z=`
6
- `+j[m].replace(" at new "," at ");return o.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",o.displayName)),Z}while(1<=m&&0<=b);break}}}finally{xe=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?Ne(h):""}function dn(o,u){switch(o.tag){case 26:case 27:case 5:return Ne(o.type);case 16:return Ne("Lazy");case 13:return o.child!==u&&u!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("SuspenseList");case 0:case 15:return gt(o.type,!1);case 11:return gt(o.type.render,!1);case 1:return gt(o.type,!0);case 31:return Ne("Activity");default:return""}}function sa(o){try{var u="",h=null;do u+=dn(o,h),h=o,o=o.return;while(o);return u}catch(m){return`
7
- Error generating stack: `+m.message+`
8
- `+m.stack}}var Ly=Object.prototype.hasOwnProperty,By=e.unstable_scheduleCallback,zy=e.unstable_cancelCallback,B6=e.unstable_shouldYield,z6=e.unstable_requestPaint,dr=e.unstable_now,$6=e.unstable_getCurrentPriorityLevel,Uk=e.unstable_ImmediatePriority,Hk=e.unstable_UserBlockingPriority,vd=e.unstable_NormalPriority,U6=e.unstable_LowPriority,Fk=e.unstable_IdlePriority,H6=e.log,F6=e.unstable_setDisableYieldValue,kc=null,pr=null;function al(o){if(typeof H6=="function"&&F6(o),pr&&typeof pr.setStrictMode=="function")try{pr.setStrictMode(kc,o)}catch{}}var mr=Math.clz32?Math.clz32:V6,q6=Math.log,W6=Math.LN2;function V6(o){return o>>>=0,o===0?32:31-(q6(o)/W6|0)|0}var yd=256,bd=262144,xd=4194304;function so(o){var u=o&42;if(u!==0)return u;switch(o&-o){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 o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Sd(o,u,h){var m=o.pendingLanes;if(m===0)return 0;var b=0,S=o.suspendedLanes,E=o.pingedLanes;o=o.warmLanes;var _=m&134217727;return _!==0?(m=_&~S,m!==0?b=so(m):(E&=_,E!==0?b=so(E):h||(h=_&~o,h!==0&&(b=so(h))))):(_=m&~S,_!==0?b=so(_):E!==0?b=so(E):h||(h=m&~o,h!==0&&(b=so(h)))),b===0?0:u!==0&&u!==b&&(u&S)===0&&(S=b&-b,h=u&-u,S>=h||S===32&&(h&4194048)!==0)?u:b}function Cc(o,u){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&u)===0}function K6(o,u){switch(o){case 1:case 2:case 4:case 8:case 64:return u+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 u+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 qk(){var o=xd;return xd<<=1,(xd&62914560)===0&&(xd=4194304),o}function $y(o){for(var u=[],h=0;31>h;h++)u.push(o);return u}function Ec(o,u){o.pendingLanes|=u,u!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function X6(o,u,h,m,b,S){var E=o.pendingLanes;o.pendingLanes=h,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=h,o.entangledLanes&=h,o.errorRecoveryDisabledLanes&=h,o.shellSuspendCounter=0;var _=o.entanglements,j=o.expirationTimes,F=o.hiddenUpdates;for(h=E&~h;0<h;){var Z=31-mr(h),te=1<<Z;_[Z]=0,j[Z]=-1;var W=F[Z];if(W!==null)for(F[Z]=null,Z=0;Z<W.length;Z++){var Q=W[Z];Q!==null&&(Q.lane&=-536870913)}h&=~te}m!==0&&Wk(o,m,0),S!==0&&b===0&&o.tag!==0&&(o.suspendedLanes|=S&~(E&~u))}function Wk(o,u,h){o.pendingLanes|=u,o.suspendedLanes&=~u;var m=31-mr(u);o.entangledLanes|=u,o.entanglements[m]=o.entanglements[m]|1073741824|h&261930}function Vk(o,u){var h=o.entangledLanes|=u;for(o=o.entanglements;h;){var m=31-mr(h),b=1<<m;b&u|o[m]&u&&(o[m]|=u),h&=~b}}function Kk(o,u){var h=u&-u;return h=(h&42)!==0?1:Uy(h),(h&(o.suspendedLanes|u))!==0?0:h}function Uy(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Hy(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Xk(){var o=G.p;return o!==0?o:(o=window.event,o===void 0?32:N2(o.type))}function Qk(o,u){var h=G.p;try{return G.p=o,u()}finally{G.p=h}}var ll=Math.random().toString(36).slice(2),pn="__reactFiber$"+ll,Xn="__reactProps$"+ll,ks="__reactContainer$"+ll,Fy="__reactEvents$"+ll,Q6="__reactListeners$"+ll,Y6="__reactHandles$"+ll,Yk="__reactResources$"+ll,Tc="__reactMarker$"+ll;function qy(o){delete o[pn],delete o[Xn],delete o[Fy],delete o[Q6],delete o[Y6]}function Cs(o){var u=o[pn];if(u)return u;for(var h=o.parentNode;h;){if(u=h[ks]||h[pn]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(o=v2(o);o!==null;){if(h=o[pn])return h;o=v2(o)}return u}o=h,h=o.parentNode}return null}function Es(o){if(o=o[pn]||o[ks]){var u=o.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return o}return null}function Mc(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o.stateNode;throw Error(r(33))}function Ts(o){var u=o[Yk];return u||(u=o[Yk]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function tn(o){o[Tc]=!0}var Gk=new Set,Zk={};function uo(o,u){Ms(o,u),Ms(o+"Capture",u)}function Ms(o,u){for(Zk[o]=u,o=0;o<u.length;o++)Gk.add(u[o])}var G6=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]*$"),Jk={},eC={};function Z6(o){return Ly.call(eC,o)?!0:Ly.call(Jk,o)?!1:G6.test(o)?eC[o]=!0:(Jk[o]=!0,!1)}function wd(o,u,h){if(Z6(u))if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":o.removeAttribute(u);return;case"boolean":var m=u.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){o.removeAttribute(u);return}}o.setAttribute(u,""+h)}}function Od(o,u,h){if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttribute(u,""+h)}}function ua(o,u,h,m){if(m===null)o.removeAttribute(h);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(u,h,""+m)}}function Rr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function tC(o){var u=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function J6(o,u,h){var m=Object.getOwnPropertyDescriptor(o.constructor.prototype,u);if(!o.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var b=m.get,S=m.set;return Object.defineProperty(o,u,{configurable:!0,get:function(){return b.call(this)},set:function(E){h=""+E,S.call(this,E)}}),Object.defineProperty(o,u,{enumerable:m.enumerable}),{getValue:function(){return h},setValue:function(E){h=""+E},stopTracking:function(){o._valueTracker=null,delete o[u]}}}}function Wy(o){if(!o._valueTracker){var u=tC(o)?"checked":"value";o._valueTracker=J6(o,u,""+o[u])}}function nC(o){if(!o)return!1;var u=o._valueTracker;if(!u)return!0;var h=u.getValue(),m="";return o&&(m=tC(o)?o.checked?"true":"false":o.value),o=m,o!==h?(u.setValue(o),!0):!1}function Ad(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var eU=/[\n"\\]/g;function jr(o){return o.replace(eU,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Vy(o,u,h,m,b,S,E,_){o.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?o.type=E:o.removeAttribute("type"),u!=null?E==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+Rr(u)):o.value!==""+Rr(u)&&(o.value=""+Rr(u)):E!=="submit"&&E!=="reset"||o.removeAttribute("value"),u!=null?Ky(o,E,Rr(u)):h!=null?Ky(o,E,Rr(h)):m!=null&&o.removeAttribute("value"),b==null&&S!=null&&(o.defaultChecked=!!S),b!=null&&(o.checked=b&&typeof b!="function"&&typeof b!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?o.name=""+Rr(_):o.removeAttribute("name")}function rC(o,u,h,m,b,S,E,_){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(o.type=S),u!=null||h!=null){if(!(S!=="submit"&&S!=="reset"||u!=null)){Wy(o);return}h=h!=null?""+Rr(h):"",u=u!=null?""+Rr(u):h,_||u===o.value||(o.value=u),o.defaultValue=u}m=m??b,m=typeof m!="function"&&typeof m!="symbol"&&!!m,o.checked=_?o.checked:!!m,o.defaultChecked=!!m,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.name=E),Wy(o)}function Ky(o,u,h){u==="number"&&Ad(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function Ds(o,u,h,m){if(o=o.options,u){u={};for(var b=0;b<h.length;b++)u["$"+h[b]]=!0;for(h=0;h<o.length;h++)b=u.hasOwnProperty("$"+o[h].value),o[h].selected!==b&&(o[h].selected=b),b&&m&&(o[h].defaultSelected=!0)}else{for(h=""+Rr(h),u=null,b=0;b<o.length;b++){if(o[b].value===h){o[b].selected=!0,m&&(o[b].defaultSelected=!0);return}u!==null||o[b].disabled||(u=o[b])}u!==null&&(u.selected=!0)}}function iC(o,u,h){if(u!=null&&(u=""+Rr(u),u!==o.value&&(o.value=u),h==null)){o.defaultValue!==u&&(o.defaultValue=u);return}o.defaultValue=h!=null?""+Rr(h):""}function aC(o,u,h,m){if(u==null){if(m!=null){if(h!=null)throw Error(r(92));if(oe(m)){if(1<m.length)throw Error(r(93));m=m[0]}h=m}h==null&&(h=""),u=h}h=Rr(u),o.defaultValue=h,m=o.textContent,m===h&&m!==""&&m!==null&&(o.value=m),Wy(o)}function Ps(o,u){if(u){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=u;return}}o.textContent=u}var tU=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 lC(o,u,h){var m=u.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?m?o.setProperty(u,""):u==="float"?o.cssFloat="":o[u]="":m?o.setProperty(u,h):typeof h!="number"||h===0||tU.has(u)?u==="float"?o.cssFloat=h:o[u]=(""+h).trim():o[u]=h+"px"}function oC(o,u,h){if(u!=null&&typeof u!="object")throw Error(r(62));if(o=o.style,h!=null){for(var m in h)!h.hasOwnProperty(m)||u!=null&&u.hasOwnProperty(m)||(m.indexOf("--")===0?o.setProperty(m,""):m==="float"?o.cssFloat="":o[m]="");for(var b in u)m=u[b],u.hasOwnProperty(b)&&h[b]!==m&&lC(o,b,m)}else for(var S in u)u.hasOwnProperty(S)&&lC(o,S,u[S])}function Xy(o){if(o.indexOf("-")===-1)return!1;switch(o){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 nU=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"]]),rU=/^[\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 kd(o){return rU.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function ca(){}var Qy=null;function Yy(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var _s=null,Ns=null;function sC(o){var u=Es(o);if(u&&(o=u.stateNode)){var h=o[Xn]||null;e:switch(o=u.stateNode,u.type){case"input":if(Vy(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),u=h.name,h.type==="radio"&&u!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+jr(""+u)+'"][type="radio"]'),u=0;u<h.length;u++){var m=h[u];if(m!==o&&m.form===o.form){var b=m[Xn]||null;if(!b)throw Error(r(90));Vy(m,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(u=0;u<h.length;u++)m=h[u],m.form===o.form&&nC(m)}break e;case"textarea":iC(o,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&Ds(o,!!h.multiple,u,!1)}}}var Gy=!1;function uC(o,u,h){if(Gy)return o(u,h);Gy=!0;try{var m=o(u);return m}finally{if(Gy=!1,(_s!==null||Ns!==null)&&(hp(),_s&&(u=_s,o=Ns,Ns=_s=null,sC(u),o)))for(u=0;u<o.length;u++)sC(o[u])}}function Dc(o,u){var h=o.stateNode;if(h===null)return null;var m=h[Xn]||null;if(m===null)return null;h=m[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(o=o.type,m=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!m;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(r(231,u,typeof h));return h}var fa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zy=!1;if(fa)try{var Pc={};Object.defineProperty(Pc,"passive",{get:function(){Zy=!0}}),window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch{Zy=!1}var ol=null,Jy=null,Cd=null;function cC(){if(Cd)return Cd;var o,u=Jy,h=u.length,m,b="value"in ol?ol.value:ol.textContent,S=b.length;for(o=0;o<h&&u[o]===b[o];o++);var E=h-o;for(m=1;m<=E&&u[h-m]===b[S-m];m++);return Cd=b.slice(o,1<m?1-m:void 0)}function Ed(o){var u=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&u===13&&(o=13)):o=u,o===10&&(o=13),32<=o||o===13?o:0}function Td(){return!0}function fC(){return!1}function Qn(o){function u(h,m,b,S,E){this._reactName=h,this._targetInst=b,this.type=m,this.nativeEvent=S,this.target=E,this.currentTarget=null;for(var _ in o)o.hasOwnProperty(_)&&(h=o[_],this[_]=h?h(S):S[_]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Td:fC,this.isPropagationStopped=fC,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Td)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Td)},persist:function(){},isPersistent:Td}),u}var co={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Md=Qn(co),_c=p({},co,{view:0,detail:0}),iU=Qn(_c),e0,t0,Nc,Dd=p({},_c,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:r0,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Nc&&(Nc&&o.type==="mousemove"?(e0=o.screenX-Nc.screenX,t0=o.screenY-Nc.screenY):t0=e0=0,Nc=o),e0)},movementY:function(o){return"movementY"in o?o.movementY:t0}}),hC=Qn(Dd),aU=p({},Dd,{dataTransfer:0}),lU=Qn(aU),oU=p({},_c,{relatedTarget:0}),n0=Qn(oU),sU=p({},co,{animationName:0,elapsedTime:0,pseudoElement:0}),uU=Qn(sU),cU=p({},co,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),fU=Qn(cU),hU=p({},co,{data:0}),dC=Qn(hU),dU={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pU={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"},mU={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gU(o){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(o):(o=mU[o])?!!u[o]:!1}function r0(){return gU}var vU=p({},_c,{key:function(o){if(o.key){var u=dU[o.key]||o.key;if(u!=="Unidentified")return u}return o.type==="keypress"?(o=Ed(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?pU[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:r0,charCode:function(o){return o.type==="keypress"?Ed(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Ed(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),yU=Qn(vU),bU=p({},Dd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pC=Qn(bU),xU=p({},_c,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:r0}),SU=Qn(xU),wU=p({},co,{propertyName:0,elapsedTime:0,pseudoElement:0}),OU=Qn(wU),AU=p({},Dd,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),kU=Qn(AU),CU=p({},co,{newState:0,oldState:0}),EU=Qn(CU),TU=[9,13,27,32],i0=fa&&"CompositionEvent"in window,Rc=null;fa&&"documentMode"in document&&(Rc=document.documentMode);var MU=fa&&"TextEvent"in window&&!Rc,mC=fa&&(!i0||Rc&&8<Rc&&11>=Rc),gC=" ",vC=!1;function yC(o,u){switch(o){case"keyup":return TU.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bC(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Rs=!1;function DU(o,u){switch(o){case"compositionend":return bC(u);case"keypress":return u.which!==32?null:(vC=!0,gC);case"textInput":return o=u.data,o===gC&&vC?null:o;default:return null}}function PU(o,u){if(Rs)return o==="compositionend"||!i0&&yC(o,u)?(o=cC(),Cd=Jy=ol=null,Rs=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return mC&&u.locale!=="ko"?null:u.data;default:return null}}var _U={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 xC(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u==="input"?!!_U[o.type]:u==="textarea"}function SC(o,u,h,m){_s?Ns?Ns.push(m):Ns=[m]:_s=m,u=bp(u,"onChange"),0<u.length&&(h=new Md("onChange","change",null,h,m),o.push({event:h,listeners:u}))}var jc=null,Ic=null;function NU(o){r2(o,0)}function Pd(o){var u=Mc(o);if(nC(u))return o}function wC(o,u){if(o==="change")return u}var OC=!1;if(fa){var a0;if(fa){var l0="oninput"in document;if(!l0){var AC=document.createElement("div");AC.setAttribute("oninput","return;"),l0=typeof AC.oninput=="function"}a0=l0}else a0=!1;OC=a0&&(!document.documentMode||9<document.documentMode)}function kC(){jc&&(jc.detachEvent("onpropertychange",CC),Ic=jc=null)}function CC(o){if(o.propertyName==="value"&&Pd(Ic)){var u=[];SC(u,Ic,o,Yy(o)),uC(NU,u)}}function RU(o,u,h){o==="focusin"?(kC(),jc=u,Ic=h,jc.attachEvent("onpropertychange",CC)):o==="focusout"&&kC()}function jU(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Pd(Ic)}function IU(o,u){if(o==="click")return Pd(u)}function LU(o,u){if(o==="input"||o==="change")return Pd(u)}function BU(o,u){return o===u&&(o!==0||1/o===1/u)||o!==o&&u!==u}var gr=typeof Object.is=="function"?Object.is:BU;function Lc(o,u){if(gr(o,u))return!0;if(typeof o!="object"||o===null||typeof u!="object"||u===null)return!1;var h=Object.keys(o),m=Object.keys(u);if(h.length!==m.length)return!1;for(m=0;m<h.length;m++){var b=h[m];if(!Ly.call(u,b)||!gr(o[b],u[b]))return!1}return!0}function EC(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function TC(o,u){var h=EC(o);o=0;for(var m;h;){if(h.nodeType===3){if(m=o+h.textContent.length,o<=u&&m>=u)return{node:h,offset:u-o};o=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=EC(h)}}function MC(o,u){return o&&u?o===u?!0:o&&o.nodeType===3?!1:u&&u.nodeType===3?MC(o,u.parentNode):"contains"in o?o.contains(u):o.compareDocumentPosition?!!(o.compareDocumentPosition(u)&16):!1:!1}function DC(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var u=Ad(o.document);u instanceof o.HTMLIFrameElement;){try{var h=typeof u.contentWindow.location.href=="string"}catch{h=!1}if(h)o=u.contentWindow;else break;u=Ad(o.document)}return u}function o0(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u&&(u==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||u==="textarea"||o.contentEditable==="true")}var zU=fa&&"documentMode"in document&&11>=document.documentMode,js=null,s0=null,Bc=null,u0=!1;function PC(o,u,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;u0||js==null||js!==Ad(m)||(m=js,"selectionStart"in m&&o0(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Bc&&Lc(Bc,m)||(Bc=m,m=bp(s0,"onSelect"),0<m.length&&(u=new Md("onSelect","select",null,u,h),o.push({event:u,listeners:m}),u.target=js)))}function fo(o,u){var h={};return h[o.toLowerCase()]=u.toLowerCase(),h["Webkit"+o]="webkit"+u,h["Moz"+o]="moz"+u,h}var Is={animationend:fo("Animation","AnimationEnd"),animationiteration:fo("Animation","AnimationIteration"),animationstart:fo("Animation","AnimationStart"),transitionrun:fo("Transition","TransitionRun"),transitionstart:fo("Transition","TransitionStart"),transitioncancel:fo("Transition","TransitionCancel"),transitionend:fo("Transition","TransitionEnd")},c0={},_C={};fa&&(_C=document.createElement("div").style,"AnimationEvent"in window||(delete Is.animationend.animation,delete Is.animationiteration.animation,delete Is.animationstart.animation),"TransitionEvent"in window||delete Is.transitionend.transition);function ho(o){if(c0[o])return c0[o];if(!Is[o])return o;var u=Is[o],h;for(h in u)if(u.hasOwnProperty(h)&&h in _C)return c0[o]=u[h];return o}var NC=ho("animationend"),RC=ho("animationiteration"),jC=ho("animationstart"),$U=ho("transitionrun"),UU=ho("transitionstart"),HU=ho("transitioncancel"),IC=ho("transitionend"),LC=new Map,f0="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(" ");f0.push("scrollEnd");function li(o,u){LC.set(o,u),uo(u,[o])}var _d=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Ir=[],Ls=0,h0=0;function Nd(){for(var o=Ls,u=h0=Ls=0;u<o;){var h=Ir[u];Ir[u++]=null;var m=Ir[u];Ir[u++]=null;var b=Ir[u];Ir[u++]=null;var S=Ir[u];if(Ir[u++]=null,m!==null&&b!==null){var E=m.pending;E===null?b.next=b:(b.next=E.next,E.next=b),m.pending=b}S!==0&&BC(h,b,S)}}function Rd(o,u,h,m){Ir[Ls++]=o,Ir[Ls++]=u,Ir[Ls++]=h,Ir[Ls++]=m,h0|=m,o.lanes|=m,o=o.alternate,o!==null&&(o.lanes|=m)}function d0(o,u,h,m){return Rd(o,u,h,m),jd(o)}function po(o,u){return Rd(o,null,null,u),jd(o)}function BC(o,u,h){o.lanes|=h;var m=o.alternate;m!==null&&(m.lanes|=h);for(var b=!1,S=o.return;S!==null;)S.childLanes|=h,m=S.alternate,m!==null&&(m.childLanes|=h),S.tag===22&&(o=S.stateNode,o===null||o._visibility&1||(b=!0)),o=S,S=S.return;return o.tag===3?(S=o.stateNode,b&&u!==null&&(b=31-mr(h),o=S.hiddenUpdates,m=o[b],m===null?o[b]=[u]:m.push(u),u.lane=h|536870912),S):null}function jd(o){if(50<of)throw of=0,wb=null,Error(r(185));for(var u=o.return;u!==null;)o=u,u=o.return;return o.tag===3?o.stateNode:null}var Bs={};function FU(o,u,h,m){this.tag=o,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vr(o,u,h,m){return new FU(o,u,h,m)}function p0(o){return o=o.prototype,!(!o||!o.isReactComponent)}function ha(o,u){var h=o.alternate;return h===null?(h=vr(o.tag,u,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=u,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&65011712,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,u=o.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h.refCleanup=o.refCleanup,h}function zC(o,u){o.flags&=65011714;var h=o.alternate;return h===null?(o.childLanes=0,o.lanes=u,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,u=h.dependencies,o.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),o}function Id(o,u,h,m,b,S){var E=0;if(m=o,typeof o=="function")p0(o)&&(E=1);else if(typeof o=="string")E=XH(o,h,le.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case U:return o=vr(31,h,u,b),o.elementType=U,o.lanes=S,o;case x:return mo(h.children,b,S,u);case w:E=8,b|=24;break;case A:return o=vr(12,h,u,b|2),o.elementType=A,o.lanes=S,o;case T:return o=vr(13,h,u,b),o.elementType=T,o.lanes=S,o;case D:return o=vr(19,h,u,b),o.elementType=D,o.lanes=S,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case k:E=10;break e;case C:E=9;break e;case P:E=11;break e;case N:E=14;break e;case I:E=16,m=null;break e}E=29,h=Error(r(130,o===null?"null":typeof o,"")),m=null}return u=vr(E,h,u,b),u.elementType=o,u.type=m,u.lanes=S,u}function mo(o,u,h,m){return o=vr(7,o,m,u),o.lanes=h,o}function m0(o,u,h){return o=vr(6,o,null,u),o.lanes=h,o}function $C(o){var u=vr(18,null,null,0);return u.stateNode=o,u}function g0(o,u,h){return u=vr(4,o.children!==null?o.children:[],o.key,u),u.lanes=h,u.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},u}var UC=new WeakMap;function Lr(o,u){if(typeof o=="object"&&o!==null){var h=UC.get(o);return h!==void 0?h:(u={value:o,source:u,stack:sa(u)},UC.set(o,u),u)}return{value:o,source:u,stack:sa(u)}}var zs=[],$s=0,Ld=null,zc=0,Br=[],zr=0,sl=null,Ei=1,Ti="";function da(o,u){zs[$s++]=zc,zs[$s++]=Ld,Ld=o,zc=u}function HC(o,u,h){Br[zr++]=Ei,Br[zr++]=Ti,Br[zr++]=sl,sl=o;var m=Ei;o=Ti;var b=32-mr(m)-1;m&=~(1<<b),h+=1;var S=32-mr(u)+b;if(30<S){var E=b-b%5;S=(m&(1<<E)-1).toString(32),m>>=E,b-=E,Ei=1<<32-mr(u)+b|h<<b|m,Ti=S+o}else Ei=1<<S|h<<b|m,Ti=o}function v0(o){o.return!==null&&(da(o,1),HC(o,1,0))}function y0(o){for(;o===Ld;)Ld=zs[--$s],zs[$s]=null,zc=zs[--$s],zs[$s]=null;for(;o===sl;)sl=Br[--zr],Br[zr]=null,Ti=Br[--zr],Br[zr]=null,Ei=Br[--zr],Br[zr]=null}function FC(o,u){Br[zr++]=Ei,Br[zr++]=Ti,Br[zr++]=sl,Ei=u.id,Ti=u.overflow,sl=o}var mn=null,vt=null,Fe=!1,ul=null,$r=!1,b0=Error(r(519));function cl(o){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw $c(Lr(u,o)),b0}function qC(o){var u=o.stateNode,h=o.type,m=o.memoizedProps;switch(u[pn]=o,u[Xn]=m,h){case"dialog":Be("cancel",u),Be("close",u);break;case"iframe":case"object":case"embed":Be("load",u);break;case"video":case"audio":for(h=0;h<uf.length;h++)Be(uf[h],u);break;case"source":Be("error",u);break;case"img":case"image":case"link":Be("error",u),Be("load",u);break;case"details":Be("toggle",u);break;case"input":Be("invalid",u),rC(u,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Be("invalid",u);break;case"textarea":Be("invalid",u),aC(u,m.value,m.defaultValue,m.children)}h=m.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||u.textContent===""+h||m.suppressHydrationWarning===!0||o2(u.textContent,h)?(m.popover!=null&&(Be("beforetoggle",u),Be("toggle",u)),m.onScroll!=null&&Be("scroll",u),m.onScrollEnd!=null&&Be("scrollend",u),m.onClick!=null&&(u.onclick=ca),u=!0):u=!1,u||cl(o,!0)}function WC(o){for(mn=o.return;mn;)switch(mn.tag){case 5:case 31:case 13:$r=!1;return;case 27:case 3:$r=!0;return;default:mn=mn.return}}function Us(o){if(o!==mn)return!1;if(!Fe)return WC(o),Fe=!0,!1;var u=o.tag,h;if((h=u!==3&&u!==27)&&((h=u===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||Lb(o.type,o.memoizedProps)),h=!h),h&&vt&&cl(o),WC(o),u===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));vt=g2(o)}else if(u===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));vt=g2(o)}else u===27?(u=vt,Al(o.type)?(o=Hb,Hb=null,vt=o):vt=u):vt=mn?Hr(o.stateNode.nextSibling):null;return!0}function go(){vt=mn=null,Fe=!1}function x0(){var o=ul;return o!==null&&(Jn===null?Jn=o:Jn.push.apply(Jn,o),ul=null),o}function $c(o){ul===null?ul=[o]:ul.push(o)}var S0=R(null),vo=null,pa=null;function fl(o,u,h){re(S0,u._currentValue),u._currentValue=h}function ma(o){o._currentValue=S0.current,X(S0)}function w0(o,u,h){for(;o!==null;){var m=o.alternate;if((o.childLanes&u)!==u?(o.childLanes|=u,m!==null&&(m.childLanes|=u)):m!==null&&(m.childLanes&u)!==u&&(m.childLanes|=u),o===h)break;o=o.return}}function O0(o,u,h,m){var b=o.child;for(b!==null&&(b.return=o);b!==null;){var S=b.dependencies;if(S!==null){var E=b.child;S=S.firstContext;e:for(;S!==null;){var _=S;S=b;for(var j=0;j<u.length;j++)if(_.context===u[j]){S.lanes|=h,_=S.alternate,_!==null&&(_.lanes|=h),w0(S.return,h,o),m||(E=null);break e}S=_.next}}else if(b.tag===18){if(E=b.return,E===null)throw Error(r(341));E.lanes|=h,S=E.alternate,S!==null&&(S.lanes|=h),w0(E,h,o),E=null}else E=b.child;if(E!==null)E.return=b;else for(E=b;E!==null;){if(E===o){E=null;break}if(b=E.sibling,b!==null){b.return=E.return,E=b;break}E=E.return}b=E}}function Hs(o,u,h,m){o=null;for(var b=u,S=!1;b!==null;){if(!S){if((b.flags&524288)!==0)S=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var E=b.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var _=b.type;gr(b.pendingProps.value,E.value)||(o!==null?o.push(_):o=[_])}}else if(b===De.current){if(E=b.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(o!==null?o.push(pf):o=[pf])}b=b.return}o!==null&&O0(u,o,h,m),u.flags|=262144}function Bd(o){for(o=o.firstContext;o!==null;){if(!gr(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function yo(o){vo=o,pa=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function gn(o){return VC(vo,o)}function zd(o,u){return vo===null&&yo(o),VC(o,u)}function VC(o,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},pa===null){if(o===null)throw Error(r(308));pa=u,o.dependencies={lanes:0,firstContext:u},o.flags|=524288}else pa=pa.next=u;return h}var qU=typeof AbortController<"u"?AbortController:function(){var o=[],u=this.signal={aborted:!1,addEventListener:function(h,m){o.push(m)}};this.abort=function(){u.aborted=!0,o.forEach(function(h){return h()})}},WU=e.unstable_scheduleCallback,VU=e.unstable_NormalPriority,zt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function A0(){return{controller:new qU,data:new Map,refCount:0}}function Uc(o){o.refCount--,o.refCount===0&&WU(VU,function(){o.controller.abort()})}var Hc=null,k0=0,Fs=0,qs=null;function KU(o,u){if(Hc===null){var h=Hc=[];k0=0,Fs=Tb(),qs={status:"pending",value:void 0,then:function(m){h.push(m)}}}return k0++,u.then(KC,KC),u}function KC(){if(--k0===0&&Hc!==null){qs!==null&&(qs.status="fulfilled");var o=Hc;Hc=null,Fs=0,qs=null;for(var u=0;u<o.length;u++)(0,o[u])()}}function XU(o,u){var h=[],m={status:"pending",value:null,reason:null,then:function(b){h.push(b)}};return o.then(function(){m.status="fulfilled",m.value=u;for(var b=0;b<h.length;b++)(0,h[b])(u)},function(b){for(m.status="rejected",m.reason=b,b=0;b<h.length;b++)(0,h[b])(void 0)}),m}var XC=z.S;z.S=function(o,u){PT=dr(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&KU(o,u),XC!==null&&XC(o,u)};var bo=R(null);function C0(){var o=bo.current;return o!==null?o:ut.pooledCache}function $d(o,u){u===null?re(bo,bo.current):re(bo,u.pool)}function QC(){var o=C0();return o===null?null:{parent:zt._currentValue,pool:o}}var Ws=Error(r(460)),E0=Error(r(474)),Ud=Error(r(542)),Hd={then:function(){}};function YC(o){return o=o.status,o==="fulfilled"||o==="rejected"}function GC(o,u,h){switch(h=o[h],h===void 0?o.push(u):h!==u&&(u.then(ca,ca),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,JC(o),o;default:if(typeof u.status=="string")u.then(ca,ca);else{if(o=ut,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=u,o.status="pending",o.then(function(m){if(u.status==="pending"){var b=u;b.status="fulfilled",b.value=m}},function(m){if(u.status==="pending"){var b=u;b.status="rejected",b.reason=m}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,JC(o),o}throw So=u,Ws}}function xo(o){try{var u=o._init;return u(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(So=h,Ws):h}}var So=null;function ZC(){if(So===null)throw Error(r(459));var o=So;return So=null,o}function JC(o){if(o===Ws||o===Ud)throw Error(r(483))}var Vs=null,Fc=0;function Fd(o){var u=Fc;return Fc+=1,Vs===null&&(Vs=[]),GC(Vs,o,u)}function qc(o,u){u=u.props.ref,o.ref=u!==void 0?u:null}function qd(o,u){throw u.$$typeof===g?Error(r(525)):(o=Object.prototype.toString.call(u),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":o)))}function eE(o){function u($,L){if(o){var H=$.deletions;H===null?($.deletions=[L],$.flags|=16):H.push(L)}}function h($,L){if(!o)return null;for(;L!==null;)u($,L),L=L.sibling;return null}function m($){for(var L=new Map;$!==null;)$.key!==null?L.set($.key,$):L.set($.index,$),$=$.sibling;return L}function b($,L){return $=ha($,L),$.index=0,$.sibling=null,$}function S($,L,H){return $.index=H,o?(H=$.alternate,H!==null?(H=H.index,H<L?($.flags|=67108866,L):H):($.flags|=67108866,L)):($.flags|=1048576,L)}function E($){return o&&$.alternate===null&&($.flags|=67108866),$}function _($,L,H,ee){return L===null||L.tag!==6?(L=m0(H,$.mode,ee),L.return=$,L):(L=b(L,H),L.return=$,L)}function j($,L,H,ee){var Ae=H.type;return Ae===x?Z($,L,H.props.children,ee,H.key):L!==null&&(L.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===I&&xo(Ae)===L.type)?(L=b(L,H.props),qc(L,H),L.return=$,L):(L=Id(H.type,H.key,H.props,null,$.mode,ee),qc(L,H),L.return=$,L)}function F($,L,H,ee){return L===null||L.tag!==4||L.stateNode.containerInfo!==H.containerInfo||L.stateNode.implementation!==H.implementation?(L=g0(H,$.mode,ee),L.return=$,L):(L=b(L,H.children||[]),L.return=$,L)}function Z($,L,H,ee,Ae){return L===null||L.tag!==7?(L=mo(H,$.mode,ee,Ae),L.return=$,L):(L=b(L,H),L.return=$,L)}function te($,L,H){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=m0(""+L,$.mode,H),L.return=$,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case v:return H=Id(L.type,L.key,L.props,null,$.mode,H),qc(H,L),H.return=$,H;case y:return L=g0(L,$.mode,H),L.return=$,L;case I:return L=xo(L),te($,L,H)}if(oe(L)||B(L))return L=mo(L,$.mode,H,null),L.return=$,L;if(typeof L.then=="function")return te($,Fd(L),H);if(L.$$typeof===k)return te($,zd($,L),H);qd($,L)}return null}function W($,L,H,ee){var Ae=L!==null?L.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Ae!==null?null:_($,L,""+H,ee);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case v:return H.key===Ae?j($,L,H,ee):null;case y:return H.key===Ae?F($,L,H,ee):null;case I:return H=xo(H),W($,L,H,ee)}if(oe(H)||B(H))return Ae!==null?null:Z($,L,H,ee,null);if(typeof H.then=="function")return W($,L,Fd(H),ee);if(H.$$typeof===k)return W($,L,zd($,H),ee);qd($,H)}return null}function Q($,L,H,ee,Ae){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return $=$.get(H)||null,_(L,$,""+ee,Ae);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case v:return $=$.get(ee.key===null?H:ee.key)||null,j(L,$,ee,Ae);case y:return $=$.get(ee.key===null?H:ee.key)||null,F(L,$,ee,Ae);case I:return ee=xo(ee),Q($,L,H,ee,Ae)}if(oe(ee)||B(ee))return $=$.get(H)||null,Z(L,$,ee,Ae,null);if(typeof ee.then=="function")return Q($,L,H,Fd(ee),Ae);if(ee.$$typeof===k)return Q($,L,H,zd(L,ee),Ae);qd(L,ee)}return null}function ye($,L,H,ee){for(var Ae=null,Xe=null,Se=L,je=L=0,Ue=null;Se!==null&&je<H.length;je++){Se.index>je?(Ue=Se,Se=null):Ue=Se.sibling;var Qe=W($,Se,H[je],ee);if(Qe===null){Se===null&&(Se=Ue);break}o&&Se&&Qe.alternate===null&&u($,Se),L=S(Qe,L,je),Xe===null?Ae=Qe:Xe.sibling=Qe,Xe=Qe,Se=Ue}if(je===H.length)return h($,Se),Fe&&da($,je),Ae;if(Se===null){for(;je<H.length;je++)Se=te($,H[je],ee),Se!==null&&(L=S(Se,L,je),Xe===null?Ae=Se:Xe.sibling=Se,Xe=Se);return Fe&&da($,je),Ae}for(Se=m(Se);je<H.length;je++)Ue=Q(Se,$,je,H[je],ee),Ue!==null&&(o&&Ue.alternate!==null&&Se.delete(Ue.key===null?je:Ue.key),L=S(Ue,L,je),Xe===null?Ae=Ue:Xe.sibling=Ue,Xe=Ue);return o&&Se.forEach(function(Ml){return u($,Ml)}),Fe&&da($,je),Ae}function Me($,L,H,ee){if(H==null)throw Error(r(151));for(var Ae=null,Xe=null,Se=L,je=L=0,Ue=null,Qe=H.next();Se!==null&&!Qe.done;je++,Qe=H.next()){Se.index>je?(Ue=Se,Se=null):Ue=Se.sibling;var Ml=W($,Se,Qe.value,ee);if(Ml===null){Se===null&&(Se=Ue);break}o&&Se&&Ml.alternate===null&&u($,Se),L=S(Ml,L,je),Xe===null?Ae=Ml:Xe.sibling=Ml,Xe=Ml,Se=Ue}if(Qe.done)return h($,Se),Fe&&da($,je),Ae;if(Se===null){for(;!Qe.done;je++,Qe=H.next())Qe=te($,Qe.value,ee),Qe!==null&&(L=S(Qe,L,je),Xe===null?Ae=Qe:Xe.sibling=Qe,Xe=Qe);return Fe&&da($,je),Ae}for(Se=m(Se);!Qe.done;je++,Qe=H.next())Qe=Q(Se,$,je,Qe.value,ee),Qe!==null&&(o&&Qe.alternate!==null&&Se.delete(Qe.key===null?je:Qe.key),L=S(Qe,L,je),Xe===null?Ae=Qe:Xe.sibling=Qe,Xe=Qe);return o&&Se.forEach(function(a9){return u($,a9)}),Fe&&da($,je),Ae}function at($,L,H,ee){if(typeof H=="object"&&H!==null&&H.type===x&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case v:e:{for(var Ae=H.key;L!==null;){if(L.key===Ae){if(Ae=H.type,Ae===x){if(L.tag===7){h($,L.sibling),ee=b(L,H.props.children),ee.return=$,$=ee;break e}}else if(L.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===I&&xo(Ae)===L.type){h($,L.sibling),ee=b(L,H.props),qc(ee,H),ee.return=$,$=ee;break e}h($,L);break}else u($,L);L=L.sibling}H.type===x?(ee=mo(H.props.children,$.mode,ee,H.key),ee.return=$,$=ee):(ee=Id(H.type,H.key,H.props,null,$.mode,ee),qc(ee,H),ee.return=$,$=ee)}return E($);case y:e:{for(Ae=H.key;L!==null;){if(L.key===Ae)if(L.tag===4&&L.stateNode.containerInfo===H.containerInfo&&L.stateNode.implementation===H.implementation){h($,L.sibling),ee=b(L,H.children||[]),ee.return=$,$=ee;break e}else{h($,L);break}else u($,L);L=L.sibling}ee=g0(H,$.mode,ee),ee.return=$,$=ee}return E($);case I:return H=xo(H),at($,L,H,ee)}if(oe(H))return ye($,L,H,ee);if(B(H)){if(Ae=B(H),typeof Ae!="function")throw Error(r(150));return H=Ae.call(H),Me($,L,H,ee)}if(typeof H.then=="function")return at($,L,Fd(H),ee);if(H.$$typeof===k)return at($,L,zd($,H),ee);qd($,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,L!==null&&L.tag===6?(h($,L.sibling),ee=b(L,H),ee.return=$,$=ee):(h($,L),ee=m0(H,$.mode,ee),ee.return=$,$=ee),E($)):h($,L)}return function($,L,H,ee){try{Fc=0;var Ae=at($,L,H,ee);return Vs=null,Ae}catch(Se){if(Se===Ws||Se===Ud)throw Se;var Xe=vr(29,Se,null,$.mode);return Xe.lanes=ee,Xe.return=$,Xe}}}var wo=eE(!0),tE=eE(!1),hl=!1;function T0(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function M0(o,u){o=o.updateQueue,u.updateQueue===o&&(u.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function dl(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function pl(o,u,h){var m=o.updateQueue;if(m===null)return null;if(m=m.shared,(Ze&2)!==0){var b=m.pending;return b===null?u.next=u:(u.next=b.next,b.next=u),m.pending=u,u=jd(o),BC(o,null,h),u}return Rd(o,m,u,h),jd(o)}function Wc(o,u,h){if(u=u.updateQueue,u!==null&&(u=u.shared,(h&4194048)!==0)){var m=u.lanes;m&=o.pendingLanes,h|=m,u.lanes=h,Vk(o,h)}}function D0(o,u){var h=o.updateQueue,m=o.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var b=null,S=null;if(h=h.firstBaseUpdate,h!==null){do{var E={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};S===null?b=S=E:S=S.next=E,h=h.next}while(h!==null);S===null?b=S=u:S=S.next=u}else b=S=u;h={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:S,shared:m.shared,callbacks:m.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=u:o.next=u,h.lastBaseUpdate=u}var P0=!1;function Vc(){if(P0){var o=qs;if(o!==null)throw o}}function Kc(o,u,h,m){P0=!1;var b=o.updateQueue;hl=!1;var S=b.firstBaseUpdate,E=b.lastBaseUpdate,_=b.shared.pending;if(_!==null){b.shared.pending=null;var j=_,F=j.next;j.next=null,E===null?S=F:E.next=F,E=j;var Z=o.alternate;Z!==null&&(Z=Z.updateQueue,_=Z.lastBaseUpdate,_!==E&&(_===null?Z.firstBaseUpdate=F:_.next=F,Z.lastBaseUpdate=j))}if(S!==null){var te=b.baseState;E=0,Z=F=j=null,_=S;do{var W=_.lane&-536870913,Q=W!==_.lane;if(Q?($e&W)===W:(m&W)===W){W!==0&&W===Fs&&(P0=!0),Z!==null&&(Z=Z.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ye=o,Me=_;W=u;var at=h;switch(Me.tag){case 1:if(ye=Me.payload,typeof ye=="function"){te=ye.call(at,te,W);break e}te=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Me.payload,W=typeof ye=="function"?ye.call(at,te,W):ye,W==null)break e;te=p({},te,W);break e;case 2:hl=!0}}W=_.callback,W!==null&&(o.flags|=64,Q&&(o.flags|=8192),Q=b.callbacks,Q===null?b.callbacks=[W]:Q.push(W))}else Q={lane:W,tag:_.tag,payload:_.payload,callback:_.callback,next:null},Z===null?(F=Z=Q,j=te):Z=Z.next=Q,E|=W;if(_=_.next,_===null){if(_=b.shared.pending,_===null)break;Q=_,_=Q.next,Q.next=null,b.lastBaseUpdate=Q,b.shared.pending=null}}while(!0);Z===null&&(j=te),b.baseState=j,b.firstBaseUpdate=F,b.lastBaseUpdate=Z,S===null&&(b.shared.lanes=0),bl|=E,o.lanes=E,o.memoizedState=te}}function nE(o,u){if(typeof o!="function")throw Error(r(191,o));o.call(u)}function rE(o,u){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)nE(h[o],u)}var Ks=R(null),Wd=R(0);function iE(o,u){o=Aa,re(Wd,o),re(Ks,u),Aa=o|u.baseLanes}function _0(){re(Wd,Aa),re(Ks,Ks.current)}function N0(){Aa=Wd.current,X(Ks),X(Wd)}var yr=R(null),Ur=null;function ml(o){var u=o.alternate;re(Rt,Rt.current&1),re(yr,o),Ur===null&&(u===null||Ks.current!==null||u.memoizedState!==null)&&(Ur=o)}function R0(o){re(Rt,Rt.current),re(yr,o),Ur===null&&(Ur=o)}function aE(o){o.tag===22?(re(Rt,Rt.current),re(yr,o),Ur===null&&(Ur=o)):gl()}function gl(){re(Rt,Rt.current),re(yr,yr.current)}function br(o){X(yr),Ur===o&&(Ur=null),X(Rt)}var Rt=R(0);function Vd(o){for(var u=o;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||$b(h)||Ub(h)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var ga=0,Re=null,rt=null,$t=null,Kd=!1,Xs=!1,Oo=!1,Xd=0,Xc=0,Qs=null,QU=0;function Et(){throw Error(r(321))}function j0(o,u){if(u===null)return!1;for(var h=0;h<u.length&&h<o.length;h++)if(!gr(o[h],u[h]))return!1;return!0}function I0(o,u,h,m,b,S){return ga=S,Re=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,z.H=o===null||o.memoizedState===null?HE:G0,Oo=!1,S=h(m,b),Oo=!1,Xs&&(S=oE(u,h,m,b)),lE(o),S}function lE(o){z.H=Gc;var u=rt!==null&&rt.next!==null;if(ga=0,$t=rt=Re=null,Kd=!1,Xc=0,Qs=null,u)throw Error(r(300));o===null||Ut||(o=o.dependencies,o!==null&&Bd(o)&&(Ut=!0))}function oE(o,u,h,m){Re=o;var b=0;do{if(Xs&&(Qs=null),Xc=0,Xs=!1,25<=b)throw Error(r(301));if(b+=1,$t=rt=null,o.updateQueue!=null){var S=o.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}z.H=FE,S=u(h,m)}while(Xs);return S}function YU(){var o=z.H,u=o.useState()[0];return u=typeof u.then=="function"?Qc(u):u,o=o.useState()[0],(rt!==null?rt.memoizedState:null)!==o&&(Re.flags|=1024),u}function L0(){var o=Xd!==0;return Xd=0,o}function B0(o,u,h){u.updateQueue=o.updateQueue,u.flags&=-2053,o.lanes&=~h}function z0(o){if(Kd){for(o=o.memoizedState;o!==null;){var u=o.queue;u!==null&&(u.pending=null),o=o.next}Kd=!1}ga=0,$t=rt=Re=null,Xs=!1,Xc=Xd=0,Qs=null}function zn(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Re.memoizedState=$t=o:$t=$t.next=o,$t}function jt(){if(rt===null){var o=Re.alternate;o=o!==null?o.memoizedState:null}else o=rt.next;var u=$t===null?Re.memoizedState:$t.next;if(u!==null)$t=u,rt=o;else{if(o===null)throw Re.alternate===null?Error(r(467)):Error(r(310));rt=o,o={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},$t===null?Re.memoizedState=$t=o:$t=$t.next=o}return $t}function Qd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qc(o){var u=Xc;return Xc+=1,Qs===null&&(Qs=[]),o=GC(Qs,o,u),u=Re,($t===null?u.memoizedState:$t.next)===null&&(u=u.alternate,z.H=u===null||u.memoizedState===null?HE:G0),o}function Yd(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Qc(o);if(o.$$typeof===k)return gn(o)}throw Error(r(438,String(o)))}function $0(o){var u=null,h=Re.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var m=Re.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(u={data:m.data.map(function(b){return b.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),h===null&&(h=Qd(),Re.updateQueue=h),h.memoCache=u,h=u.data[u.index],h===void 0)for(h=u.data[u.index]=Array(o),m=0;m<o;m++)h[m]=K;return u.index++,h}function va(o,u){return typeof u=="function"?u(o):u}function Gd(o){var u=jt();return U0(u,rt,o)}function U0(o,u,h){var m=o.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=h;var b=o.baseQueue,S=m.pending;if(S!==null){if(b!==null){var E=b.next;b.next=S.next,S.next=E}u.baseQueue=b=S,m.pending=null}if(S=o.baseState,b===null)o.memoizedState=S;else{u=b.next;var _=E=null,j=null,F=u,Z=!1;do{var te=F.lane&-536870913;if(te!==F.lane?($e&te)===te:(ga&te)===te){var W=F.revertLane;if(W===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),te===Fs&&(Z=!0);else if((ga&W)===W){F=F.next,W===Fs&&(Z=!0);continue}else te={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},j===null?(_=j=te,E=S):j=j.next=te,Re.lanes|=W,bl|=W;te=F.action,Oo&&h(S,te),S=F.hasEagerState?F.eagerState:h(S,te)}else W={lane:te,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},j===null?(_=j=W,E=S):j=j.next=W,Re.lanes|=te,bl|=te;F=F.next}while(F!==null&&F!==u);if(j===null?E=S:j.next=_,!gr(S,o.memoizedState)&&(Ut=!0,Z&&(h=qs,h!==null)))throw h;o.memoizedState=S,o.baseState=E,o.baseQueue=j,m.lastRenderedState=S}return b===null&&(m.lanes=0),[o.memoizedState,m.dispatch]}function H0(o){var u=jt(),h=u.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=o;var m=h.dispatch,b=h.pending,S=u.memoizedState;if(b!==null){h.pending=null;var E=b=b.next;do S=o(S,E.action),E=E.next;while(E!==b);gr(S,u.memoizedState)||(Ut=!0),u.memoizedState=S,u.baseQueue===null&&(u.baseState=S),h.lastRenderedState=S}return[S,m]}function sE(o,u,h){var m=Re,b=jt(),S=Fe;if(S){if(h===void 0)throw Error(r(407));h=h()}else h=u();var E=!gr((rt||b).memoizedState,h);if(E&&(b.memoizedState=h,Ut=!0),b=b.queue,W0(fE.bind(null,m,b,o),[o]),b.getSnapshot!==u||E||$t!==null&&$t.memoizedState.tag&1){if(m.flags|=2048,Ys(9,{destroy:void 0},cE.bind(null,m,b,h,u),null),ut===null)throw Error(r(349));S||(ga&127)!==0||uE(m,u,h)}return h}function uE(o,u,h){o.flags|=16384,o={getSnapshot:u,value:h},u=Re.updateQueue,u===null?(u=Qd(),Re.updateQueue=u,u.stores=[o]):(h=u.stores,h===null?u.stores=[o]:h.push(o))}function cE(o,u,h,m){u.value=h,u.getSnapshot=m,hE(u)&&dE(o)}function fE(o,u,h){return h(function(){hE(u)&&dE(o)})}function hE(o){var u=o.getSnapshot;o=o.value;try{var h=u();return!gr(o,h)}catch{return!0}}function dE(o){var u=po(o,2);u!==null&&er(u,o,2)}function F0(o){var u=zn();if(typeof o=="function"){var h=o;if(o=h(),Oo){al(!0);try{h()}finally{al(!1)}}}return u.memoizedState=u.baseState=o,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:o},u}function pE(o,u,h,m){return o.baseState=h,U0(o,rt,typeof m=="function"?m:va)}function GU(o,u,h,m,b){if(ep(o))throw Error(r(485));if(o=u.action,o!==null){var S={payload:b,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){S.listeners.push(E)}};z.T!==null?h(!0):S.isTransition=!1,m(S),h=u.pending,h===null?(S.next=u.pending=S,mE(u,S)):(S.next=h.next,u.pending=h.next=S)}}function mE(o,u){var h=u.action,m=u.payload,b=o.state;if(u.isTransition){var S=z.T,E={};z.T=E;try{var _=h(b,m),j=z.S;j!==null&&j(E,_),gE(o,u,_)}catch(F){q0(o,u,F)}finally{S!==null&&E.types!==null&&(S.types=E.types),z.T=S}}else try{S=h(b,m),gE(o,u,S)}catch(F){q0(o,u,F)}}function gE(o,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(m){vE(o,u,m)},function(m){return q0(o,u,m)}):vE(o,u,h)}function vE(o,u,h){u.status="fulfilled",u.value=h,yE(u),o.state=h,u=o.pending,u!==null&&(h=u.next,h===u?o.pending=null:(h=h.next,u.next=h,mE(o,h)))}function q0(o,u,h){var m=o.pending;if(o.pending=null,m!==null){m=m.next;do u.status="rejected",u.reason=h,yE(u),u=u.next;while(u!==m)}o.action=null}function yE(o){o=o.listeners;for(var u=0;u<o.length;u++)(0,o[u])()}function bE(o,u){return u}function xE(o,u){if(Fe){var h=ut.formState;if(h!==null){e:{var m=Re;if(Fe){if(vt){t:{for(var b=vt,S=$r;b.nodeType!==8;){if(!S){b=null;break t}if(b=Hr(b.nextSibling),b===null){b=null;break t}}S=b.data,b=S==="F!"||S==="F"?b:null}if(b){vt=Hr(b.nextSibling),m=b.data==="F!";break e}}cl(m)}m=!1}m&&(u=h[0])}}return h=zn(),h.memoizedState=h.baseState=u,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bE,lastRenderedState:u},h.queue=m,h=zE.bind(null,Re,m),m.dispatch=h,m=F0(!1),S=Y0.bind(null,Re,!1,m.queue),m=zn(),b={state:u,dispatch:null,action:o,pending:null},m.queue=b,h=GU.bind(null,Re,b,S,h),b.dispatch=h,m.memoizedState=o,[u,h,!1]}function SE(o){var u=jt();return wE(u,rt,o)}function wE(o,u,h){if(u=U0(o,u,bE)[0],o=Gd(va)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var m=Qc(u)}catch(E){throw E===Ws?Ud:E}else m=u;u=jt();var b=u.queue,S=b.dispatch;return h!==u.memoizedState&&(Re.flags|=2048,Ys(9,{destroy:void 0},ZU.bind(null,b,h),null)),[m,S,o]}function ZU(o,u){o.action=u}function OE(o){var u=jt(),h=rt;if(h!==null)return wE(u,h,o);jt(),u=u.memoizedState,h=jt();var m=h.queue.dispatch;return h.memoizedState=o,[u,m,!1]}function Ys(o,u,h,m){return o={tag:o,create:h,deps:m,inst:u,next:null},u=Re.updateQueue,u===null&&(u=Qd(),Re.updateQueue=u),h=u.lastEffect,h===null?u.lastEffect=o.next=o:(m=h.next,h.next=o,o.next=m,u.lastEffect=o),o}function AE(){return jt().memoizedState}function Zd(o,u,h,m){var b=zn();Re.flags|=o,b.memoizedState=Ys(1|u,{destroy:void 0},h,m===void 0?null:m)}function Jd(o,u,h,m){var b=jt();m=m===void 0?null:m;var S=b.memoizedState.inst;rt!==null&&m!==null&&j0(m,rt.memoizedState.deps)?b.memoizedState=Ys(u,S,h,m):(Re.flags|=o,b.memoizedState=Ys(1|u,S,h,m))}function kE(o,u){Zd(8390656,8,o,u)}function W0(o,u){Jd(2048,8,o,u)}function JU(o){Re.flags|=4;var u=Re.updateQueue;if(u===null)u=Qd(),Re.updateQueue=u,u.events=[o];else{var h=u.events;h===null?u.events=[o]:h.push(o)}}function CE(o){var u=jt().memoizedState;return JU({ref:u,nextImpl:o}),function(){if((Ze&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function EE(o,u){return Jd(4,2,o,u)}function TE(o,u){return Jd(4,4,o,u)}function ME(o,u){if(typeof u=="function"){o=o();var h=u(o);return function(){typeof h=="function"?h():u(null)}}if(u!=null)return o=o(),u.current=o,function(){u.current=null}}function DE(o,u,h){h=h!=null?h.concat([o]):null,Jd(4,4,ME.bind(null,u,o),h)}function V0(){}function PE(o,u){var h=jt();u=u===void 0?null:u;var m=h.memoizedState;return u!==null&&j0(u,m[1])?m[0]:(h.memoizedState=[o,u],o)}function _E(o,u){var h=jt();u=u===void 0?null:u;var m=h.memoizedState;if(u!==null&&j0(u,m[1]))return m[0];if(m=o(),Oo){al(!0);try{o()}finally{al(!1)}}return h.memoizedState=[m,u],m}function K0(o,u,h){return h===void 0||(ga&1073741824)!==0&&($e&261930)===0?o.memoizedState=u:(o.memoizedState=h,o=NT(),Re.lanes|=o,bl|=o,h)}function NE(o,u,h,m){return gr(h,u)?h:Ks.current!==null?(o=K0(o,h,m),gr(o,u)||(Ut=!0),o):(ga&42)===0||(ga&1073741824)!==0&&($e&261930)===0?(Ut=!0,o.memoizedState=h):(o=NT(),Re.lanes|=o,bl|=o,u)}function RE(o,u,h,m,b){var S=G.p;G.p=S!==0&&8>S?S:8;var E=z.T,_={};z.T=_,Y0(o,!1,u,h);try{var j=b(),F=z.S;if(F!==null&&F(_,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var Z=XU(j,m);Yc(o,u,Z,wr(o))}else Yc(o,u,m,wr(o))}catch(te){Yc(o,u,{then:function(){},status:"rejected",reason:te},wr())}finally{G.p=S,E!==null&&_.types!==null&&(E.types=_.types),z.T=E}}function eH(){}function X0(o,u,h,m){if(o.tag!==5)throw Error(r(476));var b=jE(o).queue;RE(o,b,u,ne,h===null?eH:function(){return IE(o),h(m)})}function jE(o){var u=o.memoizedState;if(u!==null)return u;u={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:ne},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:h},next:null},o.memoizedState=u,o=o.alternate,o!==null&&(o.memoizedState=u),u}function IE(o){var u=jE(o);u.next===null&&(u=o.alternate.memoizedState),Yc(o,u.next.queue,{},wr())}function Q0(){return gn(pf)}function LE(){return jt().memoizedState}function BE(){return jt().memoizedState}function tH(o){for(var u=o.return;u!==null;){switch(u.tag){case 24:case 3:var h=wr();o=dl(h);var m=pl(u,o,h);m!==null&&(er(m,u,h),Wc(m,u,h)),u={cache:A0()},o.payload=u;return}u=u.return}}function nH(o,u,h){var m=wr();h={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ep(o)?$E(u,h):(h=d0(o,u,h,m),h!==null&&(er(h,o,m),UE(h,u,m)))}function zE(o,u,h){var m=wr();Yc(o,u,h,m)}function Yc(o,u,h,m){var b={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(ep(o))$E(u,b);else{var S=o.alternate;if(o.lanes===0&&(S===null||S.lanes===0)&&(S=u.lastRenderedReducer,S!==null))try{var E=u.lastRenderedState,_=S(E,h);if(b.hasEagerState=!0,b.eagerState=_,gr(_,E))return Rd(o,u,b,0),ut===null&&Nd(),!1}catch{}if(h=d0(o,u,b,m),h!==null)return er(h,o,m),UE(h,u,m),!0}return!1}function Y0(o,u,h,m){if(m={lane:2,revertLane:Tb(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},ep(o)){if(u)throw Error(r(479))}else u=d0(o,h,m,2),u!==null&&er(u,o,2)}function ep(o){var u=o.alternate;return o===Re||u!==null&&u===Re}function $E(o,u){Xs=Kd=!0;var h=o.pending;h===null?u.next=u:(u.next=h.next,h.next=u),o.pending=u}function UE(o,u,h){if((h&4194048)!==0){var m=u.lanes;m&=o.pendingLanes,h|=m,u.lanes=h,Vk(o,h)}}var Gc={readContext:gn,use:Yd,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};Gc.useEffectEvent=Et;var HE={readContext:gn,use:Yd,useCallback:function(o,u){return zn().memoizedState=[o,u===void 0?null:u],o},useContext:gn,useEffect:kE,useImperativeHandle:function(o,u,h){h=h!=null?h.concat([o]):null,Zd(4194308,4,ME.bind(null,u,o),h)},useLayoutEffect:function(o,u){return Zd(4194308,4,o,u)},useInsertionEffect:function(o,u){Zd(4,2,o,u)},useMemo:function(o,u){var h=zn();u=u===void 0?null:u;var m=o();if(Oo){al(!0);try{o()}finally{al(!1)}}return h.memoizedState=[m,u],m},useReducer:function(o,u,h){var m=zn();if(h!==void 0){var b=h(u);if(Oo){al(!0);try{h(u)}finally{al(!1)}}}else b=u;return m.memoizedState=m.baseState=b,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:b},m.queue=o,o=o.dispatch=nH.bind(null,Re,o),[m.memoizedState,o]},useRef:function(o){var u=zn();return o={current:o},u.memoizedState=o},useState:function(o){o=F0(o);var u=o.queue,h=zE.bind(null,Re,u);return u.dispatch=h,[o.memoizedState,h]},useDebugValue:V0,useDeferredValue:function(o,u){var h=zn();return K0(h,o,u)},useTransition:function(){var o=F0(!1);return o=RE.bind(null,Re,o.queue,!0,!1),zn().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,u,h){var m=Re,b=zn();if(Fe){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),ut===null)throw Error(r(349));($e&127)!==0||uE(m,u,h)}b.memoizedState=h;var S={value:h,getSnapshot:u};return b.queue=S,kE(fE.bind(null,m,S,o),[o]),m.flags|=2048,Ys(9,{destroy:void 0},cE.bind(null,m,S,h,u),null),h},useId:function(){var o=zn(),u=ut.identifierPrefix;if(Fe){var h=Ti,m=Ei;h=(m&~(1<<32-mr(m)-1)).toString(32)+h,u="_"+u+"R_"+h,h=Xd++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=QU++,u="_"+u+"r_"+h.toString(32)+"_";return o.memoizedState=u},useHostTransitionStatus:Q0,useFormState:xE,useActionState:xE,useOptimistic:function(o){var u=zn();u.memoizedState=u.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=Y0.bind(null,Re,!0,h),h.dispatch=u,[o,u]},useMemoCache:$0,useCacheRefresh:function(){return zn().memoizedState=tH.bind(null,Re)},useEffectEvent:function(o){var u=zn(),h={impl:o};return u.memoizedState=h,function(){if((Ze&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},G0={readContext:gn,use:Yd,useCallback:PE,useContext:gn,useEffect:W0,useImperativeHandle:DE,useInsertionEffect:EE,useLayoutEffect:TE,useMemo:_E,useReducer:Gd,useRef:AE,useState:function(){return Gd(va)},useDebugValue:V0,useDeferredValue:function(o,u){var h=jt();return NE(h,rt.memoizedState,o,u)},useTransition:function(){var o=Gd(va)[0],u=jt().memoizedState;return[typeof o=="boolean"?o:Qc(o),u]},useSyncExternalStore:sE,useId:LE,useHostTransitionStatus:Q0,useFormState:SE,useActionState:SE,useOptimistic:function(o,u){var h=jt();return pE(h,rt,o,u)},useMemoCache:$0,useCacheRefresh:BE};G0.useEffectEvent=CE;var FE={readContext:gn,use:Yd,useCallback:PE,useContext:gn,useEffect:W0,useImperativeHandle:DE,useInsertionEffect:EE,useLayoutEffect:TE,useMemo:_E,useReducer:H0,useRef:AE,useState:function(){return H0(va)},useDebugValue:V0,useDeferredValue:function(o,u){var h=jt();return rt===null?K0(h,o,u):NE(h,rt.memoizedState,o,u)},useTransition:function(){var o=H0(va)[0],u=jt().memoizedState;return[typeof o=="boolean"?o:Qc(o),u]},useSyncExternalStore:sE,useId:LE,useHostTransitionStatus:Q0,useFormState:OE,useActionState:OE,useOptimistic:function(o,u){var h=jt();return rt!==null?pE(h,rt,o,u):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:$0,useCacheRefresh:BE};FE.useEffectEvent=CE;function Z0(o,u,h,m){u=o.memoizedState,h=h(m,u),h=h==null?u:p({},u,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var J0={enqueueSetState:function(o,u,h){o=o._reactInternals;var m=wr(),b=dl(m);b.payload=u,h!=null&&(b.callback=h),u=pl(o,b,m),u!==null&&(er(u,o,m),Wc(u,o,m))},enqueueReplaceState:function(o,u,h){o=o._reactInternals;var m=wr(),b=dl(m);b.tag=1,b.payload=u,h!=null&&(b.callback=h),u=pl(o,b,m),u!==null&&(er(u,o,m),Wc(u,o,m))},enqueueForceUpdate:function(o,u){o=o._reactInternals;var h=wr(),m=dl(h);m.tag=2,u!=null&&(m.callback=u),u=pl(o,m,h),u!==null&&(er(u,o,h),Wc(u,o,h))}};function qE(o,u,h,m,b,S,E){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(m,S,E):u.prototype&&u.prototype.isPureReactComponent?!Lc(h,m)||!Lc(b,S):!0}function WE(o,u,h,m){o=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(h,m),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(h,m),u.state!==o&&J0.enqueueReplaceState(u,u.state,null)}function Ao(o,u){var h=u;if("ref"in u){h={};for(var m in u)m!=="ref"&&(h[m]=u[m])}if(o=o.defaultProps){h===u&&(h=p({},h));for(var b in o)h[b]===void 0&&(h[b]=o[b])}return h}function VE(o){_d(o)}function KE(o){console.error(o)}function XE(o){_d(o)}function tp(o,u){try{var h=o.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(m){setTimeout(function(){throw m})}}function QE(o,u,h){try{var m=o.onCaughtError;m(h.value,{componentStack:h.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function eb(o,u,h){return h=dl(h),h.tag=3,h.payload={element:null},h.callback=function(){tp(o,u)},h}function YE(o){return o=dl(o),o.tag=3,o}function GE(o,u,h,m){var b=h.type.getDerivedStateFromError;if(typeof b=="function"){var S=m.value;o.payload=function(){return b(S)},o.callback=function(){QE(u,h,m)}}var E=h.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(o.callback=function(){QE(u,h,m),typeof b!="function"&&(xl===null?xl=new Set([this]):xl.add(this));var _=m.stack;this.componentDidCatch(m.value,{componentStack:_!==null?_:""})})}function rH(o,u,h,m,b){if(h.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(u=h.alternate,u!==null&&Hs(u,h,b,!0),h=yr.current,h!==null){switch(h.tag){case 31:case 13:return Ur===null?dp():h.alternate===null&&Tt===0&&(Tt=3),h.flags&=-257,h.flags|=65536,h.lanes=b,m===Hd?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([m]):u.add(m),kb(o,m,b)),!1;case 22:return h.flags|=65536,m===Hd?h.flags|=16384:(u=h.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([m])},h.updateQueue=u):(h=u.retryQueue,h===null?u.retryQueue=new Set([m]):h.add(m)),kb(o,m,b)),!1}throw Error(r(435,h.tag))}return kb(o,m,b),dp(),!1}if(Fe)return u=yr.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=b,m!==b0&&(o=Error(r(422),{cause:m}),$c(Lr(o,h)))):(m!==b0&&(u=Error(r(423),{cause:m}),$c(Lr(u,h))),o=o.current.alternate,o.flags|=65536,b&=-b,o.lanes|=b,m=Lr(m,h),b=eb(o.stateNode,m,b),D0(o,b),Tt!==4&&(Tt=2)),!1;var S=Error(r(520),{cause:m});if(S=Lr(S,h),lf===null?lf=[S]:lf.push(S),Tt!==4&&(Tt=2),u===null)return!0;m=Lr(m,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,o=b&-b,h.lanes|=o,o=eb(h.stateNode,m,o),D0(h,o),!1;case 1:if(u=h.type,S=h.stateNode,(h.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(xl===null||!xl.has(S))))return h.flags|=65536,b&=-b,h.lanes|=b,b=YE(b),GE(b,o,h,m),D0(h,b),!1}h=h.return}while(h!==null);return!1}var tb=Error(r(461)),Ut=!1;function vn(o,u,h,m){u.child=o===null?tE(u,null,h,m):wo(u,o.child,h,m)}function ZE(o,u,h,m,b){h=h.render;var S=u.ref;if("ref"in m){var E={};for(var _ in m)_!=="ref"&&(E[_]=m[_])}else E=m;return yo(u),m=I0(o,u,h,E,S,b),_=L0(),o!==null&&!Ut?(B0(o,u,b),ya(o,u,b)):(Fe&&_&&v0(u),u.flags|=1,vn(o,u,m,b),u.child)}function JE(o,u,h,m,b){if(o===null){var S=h.type;return typeof S=="function"&&!p0(S)&&S.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=S,eT(o,u,S,m,b)):(o=Id(h.type,null,m,u,u.mode,b),o.ref=u.ref,o.return=u,u.child=o)}if(S=o.child,!ub(o,b)){var E=S.memoizedProps;if(h=h.compare,h=h!==null?h:Lc,h(E,m)&&o.ref===u.ref)return ya(o,u,b)}return u.flags|=1,o=ha(S,m),o.ref=u.ref,o.return=u,u.child=o}function eT(o,u,h,m,b){if(o!==null){var S=o.memoizedProps;if(Lc(S,m)&&o.ref===u.ref)if(Ut=!1,u.pendingProps=m=S,ub(o,b))(o.flags&131072)!==0&&(Ut=!0);else return u.lanes=o.lanes,ya(o,u,b)}return nb(o,u,h,m,b)}function tT(o,u,h,m){var b=m.children,S=o!==null?o.memoizedState:null;if(o===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((u.flags&128)!==0){if(S=S!==null?S.baseLanes|h:h,o!==null){for(m=u.child=o.child,b=0;m!==null;)b=b|m.lanes|m.childLanes,m=m.sibling;m=b&~S}else m=0,u.child=null;return nT(o,u,S,h,m)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},o!==null&&$d(u,S!==null?S.cachePool:null),S!==null?iE(u,S):_0(),aE(u);else return m=u.lanes=536870912,nT(o,u,S!==null?S.baseLanes|h:h,h,m)}else S!==null?($d(u,S.cachePool),iE(u,S),gl(),u.memoizedState=null):(o!==null&&$d(u,null),_0(),gl());return vn(o,u,b,h),u.child}function Zc(o,u){return o!==null&&o.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function nT(o,u,h,m,b){var S=C0();return S=S===null?null:{parent:zt._currentValue,pool:S},u.memoizedState={baseLanes:h,cachePool:S},o!==null&&$d(u,null),_0(),aE(u),o!==null&&Hs(o,u,m,!0),u.childLanes=b,null}function np(o,u){return u=ip({mode:u.mode,children:u.children},o.mode),u.ref=o.ref,o.child=u,u.return=o,u}function rT(o,u,h){return wo(u,o.child,null,h),o=np(u,u.pendingProps),o.flags|=2,br(u),u.memoizedState=null,o}function iH(o,u,h){var m=u.pendingProps,b=(u.flags&128)!==0;if(u.flags&=-129,o===null){if(Fe){if(m.mode==="hidden")return o=np(u,m),u.lanes=536870912,Zc(null,o);if(R0(u),(o=vt)?(o=m2(o,$r),o=o!==null&&o.data==="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:sl!==null?{id:Ei,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},h=$C(o),h.return=u,u.child=h,mn=u,vt=null)):o=null,o===null)throw cl(u);return u.lanes=536870912,null}return np(u,m)}var S=o.memoizedState;if(S!==null){var E=S.dehydrated;if(R0(u),b)if(u.flags&256)u.flags&=-257,u=rT(o,u,h);else if(u.memoizedState!==null)u.child=o.child,u.flags|=128,u=null;else throw Error(r(558));else if(Ut||Hs(o,u,h,!1),b=(h&o.childLanes)!==0,Ut||b){if(m=ut,m!==null&&(E=Kk(m,h),E!==0&&E!==S.retryLane))throw S.retryLane=E,po(o,E),er(m,o,E),tb;dp(),u=rT(o,u,h)}else o=S.treeContext,vt=Hr(E.nextSibling),mn=u,Fe=!0,ul=null,$r=!1,o!==null&&FC(u,o),u=np(u,m),u.flags|=4096;return u}return o=ha(o.child,{mode:m.mode,children:m.children}),o.ref=u.ref,u.child=o,o.return=u,o}function rp(o,u){var h=u.ref;if(h===null)o!==null&&o.ref!==null&&(u.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(o===null||o.ref!==h)&&(u.flags|=4194816)}}function nb(o,u,h,m,b){return yo(u),h=I0(o,u,h,m,void 0,b),m=L0(),o!==null&&!Ut?(B0(o,u,b),ya(o,u,b)):(Fe&&m&&v0(u),u.flags|=1,vn(o,u,h,b),u.child)}function iT(o,u,h,m,b,S){return yo(u),u.updateQueue=null,h=oE(u,m,h,b),lE(o),m=L0(),o!==null&&!Ut?(B0(o,u,S),ya(o,u,S)):(Fe&&m&&v0(u),u.flags|=1,vn(o,u,h,S),u.child)}function aT(o,u,h,m,b){if(yo(u),u.stateNode===null){var S=Bs,E=h.contextType;typeof E=="object"&&E!==null&&(S=gn(E)),S=new h(m,S),u.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=J0,u.stateNode=S,S._reactInternals=u,S=u.stateNode,S.props=m,S.state=u.memoizedState,S.refs={},T0(u),E=h.contextType,S.context=typeof E=="object"&&E!==null?gn(E):Bs,S.state=u.memoizedState,E=h.getDerivedStateFromProps,typeof E=="function"&&(Z0(u,h,E,m),S.state=u.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(E=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),E!==S.state&&J0.enqueueReplaceState(S,S.state,null),Kc(u,m,S,b),Vc(),S.state=u.memoizedState),typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!0}else if(o===null){S=u.stateNode;var _=u.memoizedProps,j=Ao(h,_);S.props=j;var F=S.context,Z=h.contextType;E=Bs,typeof Z=="object"&&Z!==null&&(E=gn(Z));var te=h.getDerivedStateFromProps;Z=typeof te=="function"||typeof S.getSnapshotBeforeUpdate=="function",_=u.pendingProps!==_,Z||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(_||F!==E)&&WE(u,S,m,E),hl=!1;var W=u.memoizedState;S.state=W,Kc(u,m,S,b),Vc(),F=u.memoizedState,_||W!==F||hl?(typeof te=="function"&&(Z0(u,h,te,m),F=u.memoizedState),(j=hl||qE(u,h,j,m,W,F,E))?(Z||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(u.flags|=4194308)):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=m,u.memoizedState=F),S.props=m,S.state=F,S.context=E,m=j):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!1)}else{S=u.stateNode,M0(o,u),E=u.memoizedProps,Z=Ao(h,E),S.props=Z,te=u.pendingProps,W=S.context,F=h.contextType,j=Bs,typeof F=="object"&&F!==null&&(j=gn(F)),_=h.getDerivedStateFromProps,(F=typeof _=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(E!==te||W!==j)&&WE(u,S,m,j),hl=!1,W=u.memoizedState,S.state=W,Kc(u,m,S,b),Vc();var Q=u.memoizedState;E!==te||W!==Q||hl||o!==null&&o.dependencies!==null&&Bd(o.dependencies)?(typeof _=="function"&&(Z0(u,h,_,m),Q=u.memoizedState),(Z=hl||qE(u,h,Z,m,W,Q,j)||o!==null&&o.dependencies!==null&&Bd(o.dependencies))?(F||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(m,Q,j),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(m,Q,j)),typeof S.componentDidUpdate=="function"&&(u.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof S.componentDidUpdate!="function"||E===o.memoizedProps&&W===o.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||E===o.memoizedProps&&W===o.memoizedState||(u.flags|=1024),u.memoizedProps=m,u.memoizedState=Q),S.props=m,S.state=Q,S.context=j,m=Z):(typeof S.componentDidUpdate!="function"||E===o.memoizedProps&&W===o.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||E===o.memoizedProps&&W===o.memoizedState||(u.flags|=1024),m=!1)}return S=m,rp(o,u),m=(u.flags&128)!==0,S||m?(S=u.stateNode,h=m&&typeof h.getDerivedStateFromError!="function"?null:S.render(),u.flags|=1,o!==null&&m?(u.child=wo(u,o.child,null,b),u.child=wo(u,null,h,b)):vn(o,u,h,b),u.memoizedState=S.state,o=u.child):o=ya(o,u,b),o}function lT(o,u,h,m){return go(),u.flags|=256,vn(o,u,h,m),u.child}var rb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ib(o){return{baseLanes:o,cachePool:QC()}}function ab(o,u,h){return o=o!==null?o.childLanes&~h:0,u&&(o|=Sr),o}function oT(o,u,h){var m=u.pendingProps,b=!1,S=(u.flags&128)!==0,E;if((E=S)||(E=o!==null&&o.memoizedState===null?!1:(Rt.current&2)!==0),E&&(b=!0,u.flags&=-129),E=(u.flags&32)!==0,u.flags&=-33,o===null){if(Fe){if(b?ml(u):gl(),(o=vt)?(o=m2(o,$r),o=o!==null&&o.data!=="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:sl!==null?{id:Ei,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},h=$C(o),h.return=u,u.child=h,mn=u,vt=null)):o=null,o===null)throw cl(u);return Ub(o)?u.lanes=32:u.lanes=536870912,null}var _=m.children;return m=m.fallback,b?(gl(),b=u.mode,_=ip({mode:"hidden",children:_},b),m=mo(m,b,h,null),_.return=u,m.return=u,_.sibling=m,u.child=_,m=u.child,m.memoizedState=ib(h),m.childLanes=ab(o,E,h),u.memoizedState=rb,Zc(null,m)):(ml(u),lb(u,_))}var j=o.memoizedState;if(j!==null&&(_=j.dehydrated,_!==null)){if(S)u.flags&256?(ml(u),u.flags&=-257,u=ob(o,u,h)):u.memoizedState!==null?(gl(),u.child=o.child,u.flags|=128,u=null):(gl(),_=m.fallback,b=u.mode,m=ip({mode:"visible",children:m.children},b),_=mo(_,b,h,null),_.flags|=2,m.return=u,_.return=u,m.sibling=_,u.child=m,wo(u,o.child,null,h),m=u.child,m.memoizedState=ib(h),m.childLanes=ab(o,E,h),u.memoizedState=rb,u=Zc(null,m));else if(ml(u),Ub(_)){if(E=_.nextSibling&&_.nextSibling.dataset,E)var F=E.dgst;E=F,m=Error(r(419)),m.stack="",m.digest=E,$c({value:m,source:null,stack:null}),u=ob(o,u,h)}else if(Ut||Hs(o,u,h,!1),E=(h&o.childLanes)!==0,Ut||E){if(E=ut,E!==null&&(m=Kk(E,h),m!==0&&m!==j.retryLane))throw j.retryLane=m,po(o,m),er(E,o,m),tb;$b(_)||dp(),u=ob(o,u,h)}else $b(_)?(u.flags|=192,u.child=o.child,u=null):(o=j.treeContext,vt=Hr(_.nextSibling),mn=u,Fe=!0,ul=null,$r=!1,o!==null&&FC(u,o),u=lb(u,m.children),u.flags|=4096);return u}return b?(gl(),_=m.fallback,b=u.mode,j=o.child,F=j.sibling,m=ha(j,{mode:"hidden",children:m.children}),m.subtreeFlags=j.subtreeFlags&65011712,F!==null?_=ha(F,_):(_=mo(_,b,h,null),_.flags|=2),_.return=u,m.return=u,m.sibling=_,u.child=m,Zc(null,m),m=u.child,_=o.child.memoizedState,_===null?_=ib(h):(b=_.cachePool,b!==null?(j=zt._currentValue,b=b.parent!==j?{parent:j,pool:j}:b):b=QC(),_={baseLanes:_.baseLanes|h,cachePool:b}),m.memoizedState=_,m.childLanes=ab(o,E,h),u.memoizedState=rb,Zc(o.child,m)):(ml(u),h=o.child,o=h.sibling,h=ha(h,{mode:"visible",children:m.children}),h.return=u,h.sibling=null,o!==null&&(E=u.deletions,E===null?(u.deletions=[o],u.flags|=16):E.push(o)),u.child=h,u.memoizedState=null,h)}function lb(o,u){return u=ip({mode:"visible",children:u},o.mode),u.return=o,o.child=u}function ip(o,u){return o=vr(22,o,null,u),o.lanes=0,o}function ob(o,u,h){return wo(u,o.child,null,h),o=lb(u,u.pendingProps.children),o.flags|=2,u.memoizedState=null,o}function sT(o,u,h){o.lanes|=u;var m=o.alternate;m!==null&&(m.lanes|=u),w0(o.return,u,h)}function sb(o,u,h,m,b,S){var E=o.memoizedState;E===null?o.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:m,tail:h,tailMode:b,treeForkCount:S}:(E.isBackwards=u,E.rendering=null,E.renderingStartTime=0,E.last=m,E.tail=h,E.tailMode=b,E.treeForkCount=S)}function uT(o,u,h){var m=u.pendingProps,b=m.revealOrder,S=m.tail;m=m.children;var E=Rt.current,_=(E&2)!==0;if(_?(E=E&1|2,u.flags|=128):E&=1,re(Rt,E),vn(o,u,m,h),m=Fe?zc:0,!_&&o!==null&&(o.flags&128)!==0)e:for(o=u.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&sT(o,h,u);else if(o.tag===19)sT(o,h,u);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===u)break e;for(;o.sibling===null;){if(o.return===null||o.return===u)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(b){case"forwards":for(h=u.child,b=null;h!==null;)o=h.alternate,o!==null&&Vd(o)===null&&(b=h),h=h.sibling;h=b,h===null?(b=u.child,u.child=null):(b=h.sibling,h.sibling=null),sb(u,!1,b,h,S,m);break;case"backwards":case"unstable_legacy-backwards":for(h=null,b=u.child,u.child=null;b!==null;){if(o=b.alternate,o!==null&&Vd(o)===null){u.child=b;break}o=b.sibling,b.sibling=h,h=b,b=o}sb(u,!0,h,null,S,m);break;case"together":sb(u,!1,null,null,void 0,m);break;default:u.memoizedState=null}return u.child}function ya(o,u,h){if(o!==null&&(u.dependencies=o.dependencies),bl|=u.lanes,(h&u.childLanes)===0)if(o!==null){if(Hs(o,u,h,!1),(h&u.childLanes)===0)return null}else return null;if(o!==null&&u.child!==o.child)throw Error(r(153));if(u.child!==null){for(o=u.child,h=ha(o,o.pendingProps),u.child=h,h.return=u;o.sibling!==null;)o=o.sibling,h=h.sibling=ha(o,o.pendingProps),h.return=u;h.sibling=null}return u.child}function ub(o,u){return(o.lanes&u)!==0?!0:(o=o.dependencies,!!(o!==null&&Bd(o)))}function aH(o,u,h){switch(u.tag){case 3:mt(u,u.stateNode.containerInfo),fl(u,zt,o.memoizedState.cache),go();break;case 27:case 5:Te(u);break;case 4:mt(u,u.stateNode.containerInfo);break;case 10:fl(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,R0(u),null;break;case 13:var m=u.memoizedState;if(m!==null)return m.dehydrated!==null?(ml(u),u.flags|=128,null):(h&u.child.childLanes)!==0?oT(o,u,h):(ml(u),o=ya(o,u,h),o!==null?o.sibling:null);ml(u);break;case 19:var b=(o.flags&128)!==0;if(m=(h&u.childLanes)!==0,m||(Hs(o,u,h,!1),m=(h&u.childLanes)!==0),b){if(m)return uT(o,u,h);u.flags|=128}if(b=u.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),re(Rt,Rt.current),m)break;return null;case 22:return u.lanes=0,tT(o,u,h,u.pendingProps);case 24:fl(u,zt,o.memoizedState.cache)}return ya(o,u,h)}function cT(o,u,h){if(o!==null)if(o.memoizedProps!==u.pendingProps)Ut=!0;else{if(!ub(o,h)&&(u.flags&128)===0)return Ut=!1,aH(o,u,h);Ut=(o.flags&131072)!==0}else Ut=!1,Fe&&(u.flags&1048576)!==0&&HC(u,zc,u.index);switch(u.lanes=0,u.tag){case 16:e:{var m=u.pendingProps;if(o=xo(u.elementType),u.type=o,typeof o=="function")p0(o)?(m=Ao(o,m),u.tag=1,u=aT(null,u,o,m,h)):(u.tag=0,u=nb(null,u,o,m,h));else{if(o!=null){var b=o.$$typeof;if(b===P){u.tag=11,u=ZE(null,u,o,m,h);break e}else if(b===N){u.tag=14,u=JE(null,u,o,m,h);break e}}throw u=ie(o)||o,Error(r(306,u,""))}}return u;case 0:return nb(o,u,u.type,u.pendingProps,h);case 1:return m=u.type,b=Ao(m,u.pendingProps),aT(o,u,m,b,h);case 3:e:{if(mt(u,u.stateNode.containerInfo),o===null)throw Error(r(387));m=u.pendingProps;var S=u.memoizedState;b=S.element,M0(o,u),Kc(u,m,null,h);var E=u.memoizedState;if(m=E.cache,fl(u,zt,m),m!==S.cache&&O0(u,[zt],h,!0),Vc(),m=E.element,S.isDehydrated)if(S={element:m,isDehydrated:!1,cache:E.cache},u.updateQueue.baseState=S,u.memoizedState=S,u.flags&256){u=lT(o,u,m,h);break e}else if(m!==b){b=Lr(Error(r(424)),u),$c(b),u=lT(o,u,m,h);break e}else for(o=u.stateNode.containerInfo,o.nodeType===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,vt=Hr(o.firstChild),mn=u,Fe=!0,ul=null,$r=!0,h=tE(u,null,m,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(go(),m===b){u=ya(o,u,h);break e}vn(o,u,m,h)}u=u.child}return u;case 26:return rp(o,u),o===null?(h=S2(u.type,null,u.pendingProps,null))?u.memoizedState=h:Fe||(h=u.type,o=u.pendingProps,m=xp(Oe.current).createElement(h),m[pn]=u,m[Xn]=o,yn(m,h,o),tn(m),u.stateNode=m):u.memoizedState=S2(u.type,o.memoizedProps,u.pendingProps,o.memoizedState),null;case 27:return Te(u),o===null&&Fe&&(m=u.stateNode=y2(u.type,u.pendingProps,Oe.current),mn=u,$r=!0,b=vt,Al(u.type)?(Hb=b,vt=Hr(m.firstChild)):vt=b),vn(o,u,u.pendingProps.children,h),rp(o,u),o===null&&(u.flags|=4194304),u.child;case 5:return o===null&&Fe&&((b=m=vt)&&(m=jH(m,u.type,u.pendingProps,$r),m!==null?(u.stateNode=m,mn=u,vt=Hr(m.firstChild),$r=!1,b=!0):b=!1),b||cl(u)),Te(u),b=u.type,S=u.pendingProps,E=o!==null?o.memoizedProps:null,m=S.children,Lb(b,S)?m=null:E!==null&&Lb(b,E)&&(u.flags|=32),u.memoizedState!==null&&(b=I0(o,u,YU,null,null,h),pf._currentValue=b),rp(o,u),vn(o,u,m,h),u.child;case 6:return o===null&&Fe&&((o=h=vt)&&(h=IH(h,u.pendingProps,$r),h!==null?(u.stateNode=h,mn=u,vt=null,o=!0):o=!1),o||cl(u)),null;case 13:return oT(o,u,h);case 4:return mt(u,u.stateNode.containerInfo),m=u.pendingProps,o===null?u.child=wo(u,null,m,h):vn(o,u,m,h),u.child;case 11:return ZE(o,u,u.type,u.pendingProps,h);case 7:return vn(o,u,u.pendingProps,h),u.child;case 8:return vn(o,u,u.pendingProps.children,h),u.child;case 12:return vn(o,u,u.pendingProps.children,h),u.child;case 10:return m=u.pendingProps,fl(u,u.type,m.value),vn(o,u,m.children,h),u.child;case 9:return b=u.type._context,m=u.pendingProps.children,yo(u),b=gn(b),m=m(b),u.flags|=1,vn(o,u,m,h),u.child;case 14:return JE(o,u,u.type,u.pendingProps,h);case 15:return eT(o,u,u.type,u.pendingProps,h);case 19:return uT(o,u,h);case 31:return iH(o,u,h);case 22:return tT(o,u,h,u.pendingProps);case 24:return yo(u),m=gn(zt),o===null?(b=C0(),b===null&&(b=ut,S=A0(),b.pooledCache=S,S.refCount++,S!==null&&(b.pooledCacheLanes|=h),b=S),u.memoizedState={parent:m,cache:b},T0(u),fl(u,zt,b)):((o.lanes&h)!==0&&(M0(o,u),Kc(u,null,null,h),Vc()),b=o.memoizedState,S=u.memoizedState,b.parent!==m?(b={parent:m,cache:m},u.memoizedState=b,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=b),fl(u,zt,m)):(m=S.cache,fl(u,zt,m),m!==b.cache&&O0(u,[zt],h,!0))),vn(o,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function ba(o){o.flags|=4}function cb(o,u,h,m,b){if((u=(o.mode&32)!==0)&&(u=!1),u){if(o.flags|=16777216,(b&335544128)===b)if(o.stateNode.complete)o.flags|=8192;else if(LT())o.flags|=8192;else throw So=Hd,E0}else o.flags&=-16777217}function fT(o,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!C2(u))if(LT())o.flags|=8192;else throw So=Hd,E0}function ap(o,u){u!==null&&(o.flags|=4),o.flags&16384&&(u=o.tag!==22?qk():536870912,o.lanes|=u,eu|=u)}function Jc(o,u){if(!Fe)switch(o.tailMode){case"hidden":u=o.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?u||o.tail===null?o.tail=null:o.tail.sibling=null:m.sibling=null}}function yt(o){var u=o.alternate!==null&&o.alternate.child===o.child,h=0,m=0;if(u)for(var b=o.child;b!==null;)h|=b.lanes|b.childLanes,m|=b.subtreeFlags&65011712,m|=b.flags&65011712,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)h|=b.lanes|b.childLanes,m|=b.subtreeFlags,m|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=m,o.childLanes=h,u}function lH(o,u,h){var m=u.pendingProps;switch(y0(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(u),null;case 1:return yt(u),null;case 3:return h=u.stateNode,m=null,o!==null&&(m=o.memoizedState.cache),u.memoizedState.cache!==m&&(u.flags|=2048),ma(zt),se(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(Us(u)?ba(u):o===null||o.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,x0())),yt(u),null;case 26:var b=u.type,S=u.memoizedState;return o===null?(ba(u),S!==null?(yt(u),fT(u,S)):(yt(u),cb(u,b,null,m,h))):S?S!==o.memoizedState?(ba(u),yt(u),fT(u,S)):(yt(u),u.flags&=-16777217):(o=o.memoizedProps,o!==m&&ba(u),yt(u),cb(u,b,o,m,h)),null;case 27:if(Ee(u),h=Oe.current,b=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==m&&ba(u);else{if(!m){if(u.stateNode===null)throw Error(r(166));return yt(u),null}o=le.current,Us(u)?qC(u):(o=y2(b,m,h),u.stateNode=o,ba(u))}return yt(u),null;case 5:if(Ee(u),b=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==m&&ba(u);else{if(!m){if(u.stateNode===null)throw Error(r(166));return yt(u),null}if(S=le.current,Us(u))qC(u);else{var E=xp(Oe.current);switch(S){case 1:S=E.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:S=E.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":S=E.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":S=E.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":S=E.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof m.is=="string"?E.createElement("select",{is:m.is}):E.createElement("select"),m.multiple?S.multiple=!0:m.size&&(S.size=m.size);break;default:S=typeof m.is=="string"?E.createElement(b,{is:m.is}):E.createElement(b)}}S[pn]=u,S[Xn]=m;e:for(E=u.child;E!==null;){if(E.tag===5||E.tag===6)S.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===u)break e;for(;E.sibling===null;){if(E.return===null||E.return===u)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}u.stateNode=S;e:switch(yn(S,b,m),b){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&ba(u)}}return yt(u),cb(u,u.type,o===null?null:o.memoizedProps,u.pendingProps,h),null;case 6:if(o&&u.stateNode!=null)o.memoizedProps!==m&&ba(u);else{if(typeof m!="string"&&u.stateNode===null)throw Error(r(166));if(o=Oe.current,Us(u)){if(o=u.stateNode,h=u.memoizedProps,m=null,b=mn,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}o[pn]=u,o=!!(o.nodeValue===h||m!==null&&m.suppressHydrationWarning===!0||o2(o.nodeValue,h)),o||cl(u,!0)}else o=xp(o).createTextNode(m),o[pn]=u,u.stateNode=o}return yt(u),null;case 31:if(h=u.memoizedState,o===null||o.memoizedState!==null){if(m=Us(u),h!==null){if(o===null){if(!m)throw Error(r(318));if(o=u.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[pn]=u}else go(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;yt(u),o=!1}else h=x0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return u.flags&256?(br(u),u):(br(u),null);if((u.flags&128)!==0)throw Error(r(558))}return yt(u),null;case 13:if(m=u.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(b=Us(u),m!==null&&m.dehydrated!==null){if(o===null){if(!b)throw Error(r(318));if(b=u.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[pn]=u}else go(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;yt(u),b=!1}else b=x0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=b),b=!0;if(!b)return u.flags&256?(br(u),u):(br(u),null)}return br(u),(u.flags&128)!==0?(u.lanes=h,u):(h=m!==null,o=o!==null&&o.memoizedState!==null,h&&(m=u.child,b=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(b=m.alternate.memoizedState.cachePool.pool),S=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(S=m.memoizedState.cachePool.pool),S!==b&&(m.flags|=2048)),h!==o&&h&&(u.child.flags|=8192),ap(u,u.updateQueue),yt(u),null);case 4:return se(),o===null&&_b(u.stateNode.containerInfo),yt(u),null;case 10:return ma(u.type),yt(u),null;case 19:if(X(Rt),m=u.memoizedState,m===null)return yt(u),null;if(b=(u.flags&128)!==0,S=m.rendering,S===null)if(b)Jc(m,!1);else{if(Tt!==0||o!==null&&(o.flags&128)!==0)for(o=u.child;o!==null;){if(S=Vd(o),S!==null){for(u.flags|=128,Jc(m,!1),o=S.updateQueue,u.updateQueue=o,ap(u,o),u.subtreeFlags=0,o=h,h=u.child;h!==null;)zC(h,o),h=h.sibling;return re(Rt,Rt.current&1|2),Fe&&da(u,m.treeForkCount),u.child}o=o.sibling}m.tail!==null&&dr()>cp&&(u.flags|=128,b=!0,Jc(m,!1),u.lanes=4194304)}else{if(!b)if(o=Vd(S),o!==null){if(u.flags|=128,b=!0,o=o.updateQueue,u.updateQueue=o,ap(u,o),Jc(m,!0),m.tail===null&&m.tailMode==="hidden"&&!S.alternate&&!Fe)return yt(u),null}else 2*dr()-m.renderingStartTime>cp&&h!==536870912&&(u.flags|=128,b=!0,Jc(m,!1),u.lanes=4194304);m.isBackwards?(S.sibling=u.child,u.child=S):(o=m.last,o!==null?o.sibling=S:u.child=S,m.last=S)}return m.tail!==null?(o=m.tail,m.rendering=o,m.tail=o.sibling,m.renderingStartTime=dr(),o.sibling=null,h=Rt.current,re(Rt,b?h&1|2:h&1),Fe&&da(u,m.treeForkCount),o):(yt(u),null);case 22:case 23:return br(u),N0(),m=u.memoizedState!==null,o!==null?o.memoizedState!==null!==m&&(u.flags|=8192):m&&(u.flags|=8192),m?(h&536870912)!==0&&(u.flags&128)===0&&(yt(u),u.subtreeFlags&6&&(u.flags|=8192)):yt(u),h=u.updateQueue,h!==null&&ap(u,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),m=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),m!==h&&(u.flags|=2048),o!==null&&X(bo),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),ma(zt),yt(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function oH(o,u){switch(y0(u),u.tag){case 1:return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 3:return ma(zt),se(),o=u.flags,(o&65536)!==0&&(o&128)===0?(u.flags=o&-65537|128,u):null;case 26:case 27:case 5:return Ee(u),null;case 31:if(u.memoizedState!==null){if(br(u),u.alternate===null)throw Error(r(340));go()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 13:if(br(u),o=u.memoizedState,o!==null&&o.dehydrated!==null){if(u.alternate===null)throw Error(r(340));go()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 19:return X(Rt),null;case 4:return se(),null;case 10:return ma(u.type),null;case 22:case 23:return br(u),N0(),o!==null&&X(bo),o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 24:return ma(zt),null;case 25:return null;default:return null}}function hT(o,u){switch(y0(u),u.tag){case 3:ma(zt),se();break;case 26:case 27:case 5:Ee(u);break;case 4:se();break;case 31:u.memoizedState!==null&&br(u);break;case 13:br(u);break;case 19:X(Rt);break;case 10:ma(u.type);break;case 22:case 23:br(u),N0(),o!==null&&X(bo);break;case 24:ma(zt)}}function ef(o,u){try{var h=u.updateQueue,m=h!==null?h.lastEffect:null;if(m!==null){var b=m.next;h=b;do{if((h.tag&o)===o){m=void 0;var S=h.create,E=h.inst;m=S(),E.destroy=m}h=h.next}while(h!==b)}}catch(_){tt(u,u.return,_)}}function vl(o,u,h){try{var m=u.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var S=b.next;m=S;do{if((m.tag&o)===o){var E=m.inst,_=E.destroy;if(_!==void 0){E.destroy=void 0,b=u;var j=h,F=_;try{F()}catch(Z){tt(b,j,Z)}}}m=m.next}while(m!==S)}}catch(Z){tt(u,u.return,Z)}}function dT(o){var u=o.updateQueue;if(u!==null){var h=o.stateNode;try{rE(u,h)}catch(m){tt(o,o.return,m)}}}function pT(o,u,h){h.props=Ao(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(m){tt(o,u,m)}}function tf(o,u){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var m=o.stateNode;break;case 30:m=o.stateNode;break;default:m=o.stateNode}typeof h=="function"?o.refCleanup=h(m):h.current=m}}catch(b){tt(o,u,b)}}function Mi(o,u){var h=o.ref,m=o.refCleanup;if(h!==null)if(typeof m=="function")try{m()}catch(b){tt(o,u,b)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(b){tt(o,u,b)}else h.current=null}function mT(o){var u=o.type,h=o.memoizedProps,m=o.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":h.autoFocus&&m.focus();break e;case"img":h.src?m.src=h.src:h.srcSet&&(m.srcset=h.srcSet)}}catch(b){tt(o,o.return,b)}}function fb(o,u,h){try{var m=o.stateNode;MH(m,o.type,h,u),m[Xn]=u}catch(b){tt(o,o.return,b)}}function gT(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Al(o.type)||o.tag===4}function hb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||gT(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Al(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function db(o,u,h){var m=o.tag;if(m===5||m===6)o=o.stateNode,u?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,u):(u=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,u.appendChild(o),h=h._reactRootContainer,h!=null||u.onclick!==null||(u.onclick=ca));else if(m!==4&&(m===27&&Al(o.type)&&(h=o.stateNode,u=null),o=o.child,o!==null))for(db(o,u,h),o=o.sibling;o!==null;)db(o,u,h),o=o.sibling}function lp(o,u,h){var m=o.tag;if(m===5||m===6)o=o.stateNode,u?h.insertBefore(o,u):h.appendChild(o);else if(m!==4&&(m===27&&Al(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(lp(o,u,h),o=o.sibling;o!==null;)lp(o,u,h),o=o.sibling}function vT(o){var u=o.stateNode,h=o.memoizedProps;try{for(var m=o.type,b=u.attributes;b.length;)u.removeAttributeNode(b[0]);yn(u,m,h),u[pn]=o,u[Xn]=h}catch(S){tt(o,o.return,S)}}var xa=!1,Ht=!1,pb=!1,yT=typeof WeakSet=="function"?WeakSet:Set,nn=null;function sH(o,u){if(o=o.containerInfo,jb=Ep,o=DC(o),o0(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var b=m.anchorOffset,S=m.focusNode;m=m.focusOffset;try{h.nodeType,S.nodeType}catch{h=null;break e}var E=0,_=-1,j=-1,F=0,Z=0,te=o,W=null;t:for(;;){for(var Q;te!==h||b!==0&&te.nodeType!==3||(_=E+b),te!==S||m!==0&&te.nodeType!==3||(j=E+m),te.nodeType===3&&(E+=te.nodeValue.length),(Q=te.firstChild)!==null;)W=te,te=Q;for(;;){if(te===o)break t;if(W===h&&++F===b&&(_=E),W===S&&++Z===m&&(j=E),(Q=te.nextSibling)!==null)break;te=W,W=te.parentNode}te=Q}h=_===-1||j===-1?null:{start:_,end:j}}else h=null}h=h||{start:0,end:0}}else h=null;for(Ib={focusedElem:o,selectionRange:h},Ep=!1,nn=u;nn!==null;)if(u=nn,o=u.child,(u.subtreeFlags&1028)!==0&&o!==null)o.return=u,nn=o;else for(;nn!==null;){switch(u=nn,S=u.alternate,o=u.flags,u.tag){case 0:if((o&4)!==0&&(o=u.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h<o.length;h++)b=o[h],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&S!==null){o=void 0,h=u,b=S.memoizedProps,S=S.memoizedState,m=h.stateNode;try{var ye=Ao(h.type,b);o=m.getSnapshotBeforeUpdate(ye,S),m.__reactInternalSnapshotBeforeUpdate=o}catch(Me){tt(h,h.return,Me)}}break;case 3:if((o&1024)!==0){if(o=u.stateNode.containerInfo,h=o.nodeType,h===9)zb(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":zb(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=u.sibling,o!==null){o.return=u.return,nn=o;break}nn=u.return}}function bT(o,u,h){var m=h.flags;switch(h.tag){case 0:case 11:case 15:wa(o,h),m&4&&ef(5,h);break;case 1:if(wa(o,h),m&4)if(o=h.stateNode,u===null)try{o.componentDidMount()}catch(E){tt(h,h.return,E)}else{var b=Ao(h.type,u.memoizedProps);u=u.memoizedState;try{o.componentDidUpdate(b,u,o.__reactInternalSnapshotBeforeUpdate)}catch(E){tt(h,h.return,E)}}m&64&&dT(h),m&512&&tf(h,h.return);break;case 3:if(wa(o,h),m&64&&(o=h.updateQueue,o!==null)){if(u=null,h.child!==null)switch(h.child.tag){case 27:case 5:u=h.child.stateNode;break;case 1:u=h.child.stateNode}try{rE(o,u)}catch(E){tt(h,h.return,E)}}break;case 27:u===null&&m&4&&vT(h);case 26:case 5:wa(o,h),u===null&&m&4&&mT(h),m&512&&tf(h,h.return);break;case 12:wa(o,h);break;case 31:wa(o,h),m&4&&wT(o,h);break;case 13:wa(o,h),m&4&&OT(o,h),m&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=vH.bind(null,h),LH(o,h))));break;case 22:if(m=h.memoizedState!==null||xa,!m){u=u!==null&&u.memoizedState!==null||Ht,b=xa;var S=Ht;xa=m,(Ht=u)&&!S?Oa(o,h,(h.subtreeFlags&8772)!==0):wa(o,h),xa=b,Ht=S}break;case 30:break;default:wa(o,h)}}function xT(o){var u=o.alternate;u!==null&&(o.alternate=null,xT(u)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(u=o.stateNode,u!==null&&qy(u)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var wt=null,Yn=!1;function Sa(o,u,h){for(h=h.child;h!==null;)ST(o,u,h),h=h.sibling}function ST(o,u,h){if(pr&&typeof pr.onCommitFiberUnmount=="function")try{pr.onCommitFiberUnmount(kc,h)}catch{}switch(h.tag){case 26:Ht||Mi(h,u),Sa(o,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Ht||Mi(h,u);var m=wt,b=Yn;Al(h.type)&&(wt=h.stateNode,Yn=!1),Sa(o,u,h),ff(h.stateNode),wt=m,Yn=b;break;case 5:Ht||Mi(h,u);case 6:if(m=wt,b=Yn,wt=null,Sa(o,u,h),wt=m,Yn=b,wt!==null)if(Yn)try{(wt.nodeType===9?wt.body:wt.nodeName==="HTML"?wt.ownerDocument.body:wt).removeChild(h.stateNode)}catch(S){tt(h,u,S)}else try{wt.removeChild(h.stateNode)}catch(S){tt(h,u,S)}break;case 18:wt!==null&&(Yn?(o=wt,d2(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),su(o)):d2(wt,h.stateNode));break;case 4:m=wt,b=Yn,wt=h.stateNode.containerInfo,Yn=!0,Sa(o,u,h),wt=m,Yn=b;break;case 0:case 11:case 14:case 15:vl(2,h,u),Ht||vl(4,h,u),Sa(o,u,h);break;case 1:Ht||(Mi(h,u),m=h.stateNode,typeof m.componentWillUnmount=="function"&&pT(h,u,m)),Sa(o,u,h);break;case 21:Sa(o,u,h);break;case 22:Ht=(m=Ht)||h.memoizedState!==null,Sa(o,u,h),Ht=m;break;default:Sa(o,u,h)}}function wT(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{su(o)}catch(h){tt(u,u.return,h)}}}function OT(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{su(o)}catch(h){tt(u,u.return,h)}}function uH(o){switch(o.tag){case 31:case 13:case 19:var u=o.stateNode;return u===null&&(u=o.stateNode=new yT),u;case 22:return o=o.stateNode,u=o._retryCache,u===null&&(u=o._retryCache=new yT),u;default:throw Error(r(435,o.tag))}}function op(o,u){var h=uH(o);u.forEach(function(m){if(!h.has(m)){h.add(m);var b=yH.bind(null,o,m);m.then(b,b)}})}function Gn(o,u){var h=u.deletions;if(h!==null)for(var m=0;m<h.length;m++){var b=h[m],S=o,E=u,_=E;e:for(;_!==null;){switch(_.tag){case 27:if(Al(_.type)){wt=_.stateNode,Yn=!1;break e}break;case 5:wt=_.stateNode,Yn=!1;break e;case 3:case 4:wt=_.stateNode.containerInfo,Yn=!0;break e}_=_.return}if(wt===null)throw Error(r(160));ST(S,E,b),wt=null,Yn=!1,S=b.alternate,S!==null&&(S.return=null),b.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)AT(u,o),u=u.sibling}var oi=null;function AT(o,u){var h=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Gn(u,o),Zn(o),m&4&&(vl(3,o,o.return),ef(3,o),vl(5,o,o.return));break;case 1:Gn(u,o),Zn(o),m&512&&(Ht||h===null||Mi(h,h.return)),m&64&&xa&&(o=o.updateQueue,o!==null&&(m=o.callbacks,m!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?m:h.concat(m))));break;case 26:var b=oi;if(Gn(u,o),Zn(o),m&512&&(Ht||h===null||Mi(h,h.return)),m&4){var S=h!==null?h.memoizedState:null;if(m=o.memoizedState,h===null)if(m===null)if(o.stateNode===null){e:{m=o.type,h=o.memoizedProps,b=b.ownerDocument||b;t:switch(m){case"title":S=b.getElementsByTagName("title")[0],(!S||S[Tc]||S[pn]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=b.createElement(m),b.head.insertBefore(S,b.querySelector("head > title"))),yn(S,m,h),S[pn]=o,tn(S),m=S;break e;case"link":var E=A2("link","href",b).get(m+(h.href||""));if(E){for(var _=0;_<E.length;_++)if(S=E[_],S.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&S.getAttribute("rel")===(h.rel==null?null:h.rel)&&S.getAttribute("title")===(h.title==null?null:h.title)&&S.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){E.splice(_,1);break t}}S=b.createElement(m),yn(S,m,h),b.head.appendChild(S);break;case"meta":if(E=A2("meta","content",b).get(m+(h.content||""))){for(_=0;_<E.length;_++)if(S=E[_],S.getAttribute("content")===(h.content==null?null:""+h.content)&&S.getAttribute("name")===(h.name==null?null:h.name)&&S.getAttribute("property")===(h.property==null?null:h.property)&&S.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&S.getAttribute("charset")===(h.charSet==null?null:h.charSet)){E.splice(_,1);break t}}S=b.createElement(m),yn(S,m,h),b.head.appendChild(S);break;default:throw Error(r(468,m))}S[pn]=o,tn(S),m=S}o.stateNode=m}else k2(b,o.type,o.stateNode);else o.stateNode=O2(b,m,o.memoizedProps);else S!==m?(S===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):S.count--,m===null?k2(b,o.type,o.stateNode):O2(b,m,o.memoizedProps)):m===null&&o.stateNode!==null&&fb(o,o.memoizedProps,h.memoizedProps)}break;case 27:Gn(u,o),Zn(o),m&512&&(Ht||h===null||Mi(h,h.return)),h!==null&&m&4&&fb(o,o.memoizedProps,h.memoizedProps);break;case 5:if(Gn(u,o),Zn(o),m&512&&(Ht||h===null||Mi(h,h.return)),o.flags&32){b=o.stateNode;try{Ps(b,"")}catch(ye){tt(o,o.return,ye)}}m&4&&o.stateNode!=null&&(b=o.memoizedProps,fb(o,b,h!==null?h.memoizedProps:b)),m&1024&&(pb=!0);break;case 6:if(Gn(u,o),Zn(o),m&4){if(o.stateNode===null)throw Error(r(162));m=o.memoizedProps,h=o.stateNode;try{h.nodeValue=m}catch(ye){tt(o,o.return,ye)}}break;case 3:if(Op=null,b=oi,oi=Sp(u.containerInfo),Gn(u,o),oi=b,Zn(o),m&4&&h!==null&&h.memoizedState.isDehydrated)try{su(u.containerInfo)}catch(ye){tt(o,o.return,ye)}pb&&(pb=!1,kT(o));break;case 4:m=oi,oi=Sp(o.stateNode.containerInfo),Gn(u,o),Zn(o),oi=m;break;case 12:Gn(u,o),Zn(o);break;case 31:Gn(u,o),Zn(o),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,op(o,m)));break;case 13:Gn(u,o),Zn(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(up=dr()),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,op(o,m)));break;case 22:b=o.memoizedState!==null;var j=h!==null&&h.memoizedState!==null,F=xa,Z=Ht;if(xa=F||b,Ht=Z||j,Gn(u,o),Ht=Z,xa=F,Zn(o),m&8192)e:for(u=o.stateNode,u._visibility=b?u._visibility&-2:u._visibility|1,b&&(h===null||j||xa||Ht||ko(o)),h=null,u=o;;){if(u.tag===5||u.tag===26){if(h===null){j=h=u;try{if(S=j.stateNode,b)E=S.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{_=j.stateNode;var te=j.memoizedProps.style,W=te!=null&&te.hasOwnProperty("display")?te.display:null;_.style.display=W==null||typeof W=="boolean"?"":(""+W).trim()}}catch(ye){tt(j,j.return,ye)}}}else if(u.tag===6){if(h===null){j=u;try{j.stateNode.nodeValue=b?"":j.memoizedProps}catch(ye){tt(j,j.return,ye)}}}else if(u.tag===18){if(h===null){j=u;try{var Q=j.stateNode;b?p2(Q,!0):p2(j.stateNode,!1)}catch(ye){tt(j,j.return,ye)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===o)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break e;for(;u.sibling===null;){if(u.return===null||u.return===o)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}m&4&&(m=o.updateQueue,m!==null&&(h=m.retryQueue,h!==null&&(m.retryQueue=null,op(o,h))));break;case 19:Gn(u,o),Zn(o),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,op(o,m)));break;case 30:break;case 21:break;default:Gn(u,o),Zn(o)}}function Zn(o){var u=o.flags;if(u&2){try{for(var h,m=o.return;m!==null;){if(gT(m)){h=m;break}m=m.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var b=h.stateNode,S=hb(o);lp(o,S,b);break;case 5:var E=h.stateNode;h.flags&32&&(Ps(E,""),h.flags&=-33);var _=hb(o);lp(o,_,E);break;case 3:case 4:var j=h.stateNode.containerInfo,F=hb(o);db(o,F,j);break;default:throw Error(r(161))}}catch(Z){tt(o,o.return,Z)}o.flags&=-3}u&4096&&(o.flags&=-4097)}function kT(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var u=o;kT(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),o=o.sibling}}function wa(o,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)bT(o,u.alternate,u),u=u.sibling}function ko(o){for(o=o.child;o!==null;){var u=o;switch(u.tag){case 0:case 11:case 14:case 15:vl(4,u,u.return),ko(u);break;case 1:Mi(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&pT(u,u.return,h),ko(u);break;case 27:ff(u.stateNode);case 26:case 5:Mi(u,u.return),ko(u);break;case 22:u.memoizedState===null&&ko(u);break;case 30:ko(u);break;default:ko(u)}o=o.sibling}}function Oa(o,u,h){for(h=h&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var m=u.alternate,b=o,S=u,E=S.flags;switch(S.tag){case 0:case 11:case 15:Oa(b,S,h),ef(4,S);break;case 1:if(Oa(b,S,h),m=S,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(F){tt(m,m.return,F)}if(m=S,b=m.updateQueue,b!==null){var _=m.stateNode;try{var j=b.shared.hiddenCallbacks;if(j!==null)for(b.shared.hiddenCallbacks=null,b=0;b<j.length;b++)nE(j[b],_)}catch(F){tt(m,m.return,F)}}h&&E&64&&dT(S),tf(S,S.return);break;case 27:vT(S);case 26:case 5:Oa(b,S,h),h&&m===null&&E&4&&mT(S),tf(S,S.return);break;case 12:Oa(b,S,h);break;case 31:Oa(b,S,h),h&&E&4&&wT(b,S);break;case 13:Oa(b,S,h),h&&E&4&&OT(b,S);break;case 22:S.memoizedState===null&&Oa(b,S,h),tf(S,S.return);break;case 30:break;default:Oa(b,S,h)}u=u.sibling}}function mb(o,u){var h=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),o=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(o=u.memoizedState.cachePool.pool),o!==h&&(o!=null&&o.refCount++,h!=null&&Uc(h))}function gb(o,u){o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&Uc(o))}function si(o,u,h,m){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)CT(o,u,h,m),u=u.sibling}function CT(o,u,h,m){var b=u.flags;switch(u.tag){case 0:case 11:case 15:si(o,u,h,m),b&2048&&ef(9,u);break;case 1:si(o,u,h,m);break;case 3:si(o,u,h,m),b&2048&&(o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&Uc(o)));break;case 12:if(b&2048){si(o,u,h,m),o=u.stateNode;try{var S=u.memoizedProps,E=S.id,_=S.onPostCommit;typeof _=="function"&&_(E,u.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(j){tt(u,u.return,j)}}else si(o,u,h,m);break;case 31:si(o,u,h,m);break;case 13:si(o,u,h,m);break;case 23:break;case 22:S=u.stateNode,E=u.alternate,u.memoizedState!==null?S._visibility&2?si(o,u,h,m):nf(o,u):S._visibility&2?si(o,u,h,m):(S._visibility|=2,Gs(o,u,h,m,(u.subtreeFlags&10256)!==0||!1)),b&2048&&mb(E,u);break;case 24:si(o,u,h,m),b&2048&&gb(u.alternate,u);break;default:si(o,u,h,m)}}function Gs(o,u,h,m,b){for(b=b&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var S=o,E=u,_=h,j=m,F=E.flags;switch(E.tag){case 0:case 11:case 15:Gs(S,E,_,j,b),ef(8,E);break;case 23:break;case 22:var Z=E.stateNode;E.memoizedState!==null?Z._visibility&2?Gs(S,E,_,j,b):nf(S,E):(Z._visibility|=2,Gs(S,E,_,j,b)),b&&F&2048&&mb(E.alternate,E);break;case 24:Gs(S,E,_,j,b),b&&F&2048&&gb(E.alternate,E);break;default:Gs(S,E,_,j,b)}u=u.sibling}}function nf(o,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var h=o,m=u,b=m.flags;switch(m.tag){case 22:nf(h,m),b&2048&&mb(m.alternate,m);break;case 24:nf(h,m),b&2048&&gb(m.alternate,m);break;default:nf(h,m)}u=u.sibling}}var rf=8192;function Zs(o,u,h){if(o.subtreeFlags&rf)for(o=o.child;o!==null;)ET(o,u,h),o=o.sibling}function ET(o,u,h){switch(o.tag){case 26:Zs(o,u,h),o.flags&rf&&o.memoizedState!==null&&QH(h,oi,o.memoizedState,o.memoizedProps);break;case 5:Zs(o,u,h);break;case 3:case 4:var m=oi;oi=Sp(o.stateNode.containerInfo),Zs(o,u,h),oi=m;break;case 22:o.memoizedState===null&&(m=o.alternate,m!==null&&m.memoizedState!==null?(m=rf,rf=16777216,Zs(o,u,h),rf=m):Zs(o,u,h));break;default:Zs(o,u,h)}}function TT(o){var u=o.alternate;if(u!==null&&(o=u.child,o!==null)){u.child=null;do u=o.sibling,o.sibling=null,o=u;while(o!==null)}}function af(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var m=u[h];nn=m,DT(m,o)}TT(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)MT(o),o=o.sibling}function MT(o){switch(o.tag){case 0:case 11:case 15:af(o),o.flags&2048&&vl(9,o,o.return);break;case 3:af(o);break;case 12:af(o);break;case 22:var u=o.stateNode;o.memoizedState!==null&&u._visibility&2&&(o.return===null||o.return.tag!==13)?(u._visibility&=-3,sp(o)):af(o);break;default:af(o)}}function sp(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var m=u[h];nn=m,DT(m,o)}TT(o)}for(o=o.child;o!==null;){switch(u=o,u.tag){case 0:case 11:case 15:vl(8,u,u.return),sp(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,sp(u));break;default:sp(u)}o=o.sibling}}function DT(o,u){for(;nn!==null;){var h=nn;switch(h.tag){case 0:case 11:case 15:vl(8,h,u);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var m=h.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Uc(h.memoizedState.cache)}if(m=h.child,m!==null)m.return=h,nn=m;else e:for(h=o;nn!==null;){m=nn;var b=m.sibling,S=m.return;if(xT(m),m===h){nn=null;break e}if(b!==null){b.return=S,nn=b;break e}nn=S}}}var cH={getCacheForType:function(o){var u=gn(zt),h=u.data.get(o);return h===void 0&&(h=o(),u.data.set(o,h)),h},cacheSignal:function(){return gn(zt).controller.signal}},fH=typeof WeakMap=="function"?WeakMap:Map,Ze=0,ut=null,Le=null,$e=0,et=0,xr=null,yl=!1,Js=!1,vb=!1,Aa=0,Tt=0,bl=0,Co=0,yb=0,Sr=0,eu=0,lf=null,Jn=null,bb=!1,up=0,PT=0,cp=1/0,fp=null,xl=null,Vt=0,Sl=null,tu=null,ka=0,xb=0,Sb=null,_T=null,of=0,wb=null;function wr(){return(Ze&2)!==0&&$e!==0?$e&-$e:z.T!==null?Tb():Xk()}function NT(){if(Sr===0)if(($e&536870912)===0||Fe){var o=bd;bd<<=1,(bd&3932160)===0&&(bd=262144),Sr=o}else Sr=536870912;return o=yr.current,o!==null&&(o.flags|=32),Sr}function er(o,u,h){(o===ut&&(et===2||et===9)||o.cancelPendingCommit!==null)&&(nu(o,0),wl(o,$e,Sr,!1)),Ec(o,h),((Ze&2)===0||o!==ut)&&(o===ut&&((Ze&2)===0&&(Co|=h),Tt===4&&wl(o,$e,Sr,!1)),Di(o))}function RT(o,u,h){if((Ze&6)!==0)throw Error(r(327));var m=!h&&(u&127)===0&&(u&o.expiredLanes)===0||Cc(o,u),b=m?pH(o,u):Ab(o,u,!0),S=m;do{if(b===0){Js&&!m&&wl(o,u,0,!1);break}else{if(h=o.current.alternate,S&&!hH(h)){b=Ab(o,u,!1),S=!1;continue}if(b===2){if(S=u,o.errorRecoveryDisabledLanes&S)var E=0;else E=o.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){u=E;e:{var _=o;b=lf;var j=_.current.memoizedState.isDehydrated;if(j&&(nu(_,E).flags|=256),E=Ab(_,E,!1),E!==2){if(vb&&!j){_.errorRecoveryDisabledLanes|=S,Co|=S,b=4;break e}S=Jn,Jn=b,S!==null&&(Jn===null?Jn=S:Jn.push.apply(Jn,S))}b=E}if(S=!1,b!==2)continue}}if(b===1){nu(o,0),wl(o,u,0,!0);break}e:{switch(m=o,S=b,S){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:wl(m,u,Sr,!yl);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(b=up+300-dr(),10<b)){if(wl(m,u,Sr,!yl),Sd(m,0,!0)!==0)break e;ka=u,m.timeoutHandle=f2(jT.bind(null,m,h,Jn,fp,bb,u,Sr,Co,eu,yl,S,"Throttled",-0,0),b);break e}jT(m,h,Jn,fp,bb,u,Sr,Co,eu,yl,S,null,-0,0)}}break}while(!0);Di(o)}function jT(o,u,h,m,b,S,E,_,j,F,Z,te,W,Q){if(o.timeoutHandle=-1,te=u.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ca},ET(u,S,te);var ye=(S&62914560)===S?up-dr():(S&4194048)===S?PT-dr():0;if(ye=YH(te,ye),ye!==null){ka=S,o.cancelPendingCommit=ye(FT.bind(null,o,u,S,h,m,b,E,_,j,Z,te,null,W,Q)),wl(o,S,E,!F);return}}FT(o,u,S,h,m,b,E,_,j)}function hH(o){for(var u=o;;){var h=u.tag;if((h===0||h===11||h===15)&&u.flags&16384&&(h=u.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var m=0;m<h.length;m++){var b=h[m],S=b.getSnapshot;b=b.value;try{if(!gr(S(),b))return!1}catch{return!1}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function wl(o,u,h,m){u&=~yb,u&=~Co,o.suspendedLanes|=u,o.pingedLanes&=~u,m&&(o.warmLanes|=u),m=o.expirationTimes;for(var b=u;0<b;){var S=31-mr(b),E=1<<S;m[S]=-1,b&=~E}h!==0&&Wk(o,h,u)}function hp(){return(Ze&6)===0?(sf(0),!1):!0}function Ob(){if(Le!==null){if(et===0)var o=Le.return;else o=Le,pa=vo=null,z0(o),Vs=null,Fc=0,o=Le;for(;o!==null;)hT(o.alternate,o),o=o.return;Le=null}}function nu(o,u){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,_H(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),ka=0,Ob(),ut=o,Le=h=ha(o.current,null),$e=u,et=0,xr=null,yl=!1,Js=Cc(o,u),vb=!1,eu=Sr=yb=Co=bl=Tt=0,Jn=lf=null,bb=!1,(u&8)!==0&&(u|=u&32);var m=o.entangledLanes;if(m!==0)for(o=o.entanglements,m&=u;0<m;){var b=31-mr(m),S=1<<b;u|=o[b],m&=~S}return Aa=u,Nd(),h}function IT(o,u){Re=null,z.H=Gc,u===Ws||u===Ud?(u=ZC(),et=3):u===E0?(u=ZC(),et=4):et=u===tb?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,xr=u,Le===null&&(Tt=1,tp(o,Lr(u,o.current)))}function LT(){var o=yr.current;return o===null?!0:($e&4194048)===$e?Ur===null:($e&62914560)===$e||($e&536870912)!==0?o===Ur:!1}function BT(){var o=z.H;return z.H=Gc,o===null?Gc:o}function zT(){var o=z.A;return z.A=cH,o}function dp(){Tt=4,yl||($e&4194048)!==$e&&yr.current!==null||(Js=!0),(bl&134217727)===0&&(Co&134217727)===0||ut===null||wl(ut,$e,Sr,!1)}function Ab(o,u,h){var m=Ze;Ze|=2;var b=BT(),S=zT();(ut!==o||$e!==u)&&(fp=null,nu(o,u)),u=!1;var E=Tt;e:do try{if(et!==0&&Le!==null){var _=Le,j=xr;switch(et){case 8:Ob(),E=6;break e;case 3:case 2:case 9:case 6:yr.current===null&&(u=!0);var F=et;if(et=0,xr=null,ru(o,_,j,F),h&&Js){E=0;break e}break;default:F=et,et=0,xr=null,ru(o,_,j,F)}}dH(),E=Tt;break}catch(Z){IT(o,Z)}while(!0);return u&&o.shellSuspendCounter++,pa=vo=null,Ze=m,z.H=b,z.A=S,Le===null&&(ut=null,$e=0,Nd()),E}function dH(){for(;Le!==null;)$T(Le)}function pH(o,u){var h=Ze;Ze|=2;var m=BT(),b=zT();ut!==o||$e!==u?(fp=null,cp=dr()+500,nu(o,u)):Js=Cc(o,u);e:do try{if(et!==0&&Le!==null){u=Le;var S=xr;t:switch(et){case 1:et=0,xr=null,ru(o,u,S,1);break;case 2:case 9:if(YC(S)){et=0,xr=null,UT(u);break}u=function(){et!==2&&et!==9||ut!==o||(et=7),Di(o)},S.then(u,u);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:YC(S)?(et=0,xr=null,UT(u)):(et=0,xr=null,ru(o,u,S,7));break;case 5:var E=null;switch(Le.tag){case 26:E=Le.memoizedState;case 5:case 27:var _=Le;if(E?C2(E):_.stateNode.complete){et=0,xr=null;var j=_.sibling;if(j!==null)Le=j;else{var F=_.return;F!==null?(Le=F,pp(F)):Le=null}break t}}et=0,xr=null,ru(o,u,S,5);break;case 6:et=0,xr=null,ru(o,u,S,6);break;case 8:Ob(),Tt=6;break e;default:throw Error(r(462))}}mH();break}catch(Z){IT(o,Z)}while(!0);return pa=vo=null,z.H=m,z.A=b,Ze=h,Le!==null?0:(ut=null,$e=0,Nd(),Tt)}function mH(){for(;Le!==null&&!B6();)$T(Le)}function $T(o){var u=cT(o.alternate,o,Aa);o.memoizedProps=o.pendingProps,u===null?pp(o):Le=u}function UT(o){var u=o,h=u.alternate;switch(u.tag){case 15:case 0:u=iT(h,u,u.pendingProps,u.type,void 0,$e);break;case 11:u=iT(h,u,u.pendingProps,u.type.render,u.ref,$e);break;case 5:z0(u);default:hT(h,u),u=Le=zC(u,Aa),u=cT(h,u,Aa)}o.memoizedProps=o.pendingProps,u===null?pp(o):Le=u}function ru(o,u,h,m){pa=vo=null,z0(u),Vs=null,Fc=0;var b=u.return;try{if(rH(o,b,u,h,$e)){Tt=1,tp(o,Lr(h,o.current)),Le=null;return}}catch(S){if(b!==null)throw Le=b,S;Tt=1,tp(o,Lr(h,o.current)),Le=null;return}u.flags&32768?(Fe||m===1?o=!0:Js||($e&536870912)!==0?o=!1:(yl=o=!0,(m===2||m===9||m===3||m===6)&&(m=yr.current,m!==null&&m.tag===13&&(m.flags|=16384))),HT(u,o)):pp(u)}function pp(o){var u=o;do{if((u.flags&32768)!==0){HT(u,yl);return}o=u.return;var h=lH(u.alternate,u,Aa);if(h!==null){Le=h;return}if(u=u.sibling,u!==null){Le=u;return}Le=u=o}while(u!==null);Tt===0&&(Tt=5)}function HT(o,u){do{var h=oH(o.alternate,o);if(h!==null){h.flags&=32767,Le=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(o=o.sibling,o!==null)){Le=o;return}Le=o=h}while(o!==null);Tt=6,Le=null}function FT(o,u,h,m,b,S,E,_,j){o.cancelPendingCommit=null;do mp();while(Vt!==0);if((Ze&6)!==0)throw Error(r(327));if(u!==null){if(u===o.current)throw Error(r(177));if(S=u.lanes|u.childLanes,S|=h0,X6(o,h,S,E,_,j),o===ut&&(Le=ut=null,$e=0),tu=u,Sl=o,ka=h,xb=S,Sb=b,_T=m,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,bH(vd,function(){return XT(),null})):(o.callbackNode=null,o.callbackPriority=0),m=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||m){m=z.T,z.T=null,b=G.p,G.p=2,E=Ze,Ze|=4;try{sH(o,u,h)}finally{Ze=E,G.p=b,z.T=m}}Vt=1,qT(),WT(),VT()}}function qT(){if(Vt===1){Vt=0;var o=Sl,u=tu,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=z.T,z.T=null;var m=G.p;G.p=2;var b=Ze;Ze|=4;try{AT(u,o);var S=Ib,E=DC(o.containerInfo),_=S.focusedElem,j=S.selectionRange;if(E!==_&&_&&_.ownerDocument&&MC(_.ownerDocument.documentElement,_)){if(j!==null&&o0(_)){var F=j.start,Z=j.end;if(Z===void 0&&(Z=F),"selectionStart"in _)_.selectionStart=F,_.selectionEnd=Math.min(Z,_.value.length);else{var te=_.ownerDocument||document,W=te&&te.defaultView||window;if(W.getSelection){var Q=W.getSelection(),ye=_.textContent.length,Me=Math.min(j.start,ye),at=j.end===void 0?Me:Math.min(j.end,ye);!Q.extend&&Me>at&&(E=at,at=Me,Me=E);var $=TC(_,Me),L=TC(_,at);if($&&L&&(Q.rangeCount!==1||Q.anchorNode!==$.node||Q.anchorOffset!==$.offset||Q.focusNode!==L.node||Q.focusOffset!==L.offset)){var H=te.createRange();H.setStart($.node,$.offset),Q.removeAllRanges(),Me>at?(Q.addRange(H),Q.extend(L.node,L.offset)):(H.setEnd(L.node,L.offset),Q.addRange(H))}}}}for(te=[],Q=_;Q=Q.parentNode;)Q.nodeType===1&&te.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<te.length;_++){var ee=te[_];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}Ep=!!jb,Ib=jb=null}finally{Ze=b,G.p=m,z.T=h}}o.current=u,Vt=2}}function WT(){if(Vt===2){Vt=0;var o=Sl,u=tu,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=z.T,z.T=null;var m=G.p;G.p=2;var b=Ze;Ze|=4;try{bT(o,u.alternate,u)}finally{Ze=b,G.p=m,z.T=h}}Vt=3}}function VT(){if(Vt===4||Vt===3){Vt=0,z6();var o=Sl,u=tu,h=ka,m=_T;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Vt=5:(Vt=0,tu=Sl=null,KT(o,o.pendingLanes));var b=o.pendingLanes;if(b===0&&(xl=null),Hy(h),u=u.stateNode,pr&&typeof pr.onCommitFiberRoot=="function")try{pr.onCommitFiberRoot(kc,u,void 0,(u.current.flags&128)===128)}catch{}if(m!==null){u=z.T,b=G.p,G.p=2,z.T=null;try{for(var S=o.onRecoverableError,E=0;E<m.length;E++){var _=m[E];S(_.value,{componentStack:_.stack})}}finally{z.T=u,G.p=b}}(ka&3)!==0&&mp(),Di(o),b=o.pendingLanes,(h&261930)!==0&&(b&42)!==0?o===wb?of++:(of=0,wb=o):of=0,sf(0)}}function KT(o,u){(o.pooledCacheLanes&=u)===0&&(u=o.pooledCache,u!=null&&(o.pooledCache=null,Uc(u)))}function mp(){return qT(),WT(),VT(),XT()}function XT(){if(Vt!==5)return!1;var o=Sl,u=xb;xb=0;var h=Hy(ka),m=z.T,b=G.p;try{G.p=32>h?32:h,z.T=null,h=Sb,Sb=null;var S=Sl,E=ka;if(Vt=0,tu=Sl=null,ka=0,(Ze&6)!==0)throw Error(r(331));var _=Ze;if(Ze|=4,MT(S.current),CT(S,S.current,E,h),Ze=_,sf(0,!1),pr&&typeof pr.onPostCommitFiberRoot=="function")try{pr.onPostCommitFiberRoot(kc,S)}catch{}return!0}finally{G.p=b,z.T=m,KT(o,u)}}function QT(o,u,h){u=Lr(h,u),u=eb(o.stateNode,u,2),o=pl(o,u,2),o!==null&&(Ec(o,2),Di(o))}function tt(o,u,h){if(o.tag===3)QT(o,o,h);else for(;u!==null;){if(u.tag===3){QT(u,o,h);break}else if(u.tag===1){var m=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(xl===null||!xl.has(m))){o=Lr(h,o),h=YE(2),m=pl(u,h,2),m!==null&&(GE(h,m,u,o),Ec(m,2),Di(m));break}}u=u.return}}function kb(o,u,h){var m=o.pingCache;if(m===null){m=o.pingCache=new fH;var b=new Set;m.set(u,b)}else b=m.get(u),b===void 0&&(b=new Set,m.set(u,b));b.has(h)||(vb=!0,b.add(h),o=gH.bind(null,o,u,h),u.then(o,o))}function gH(o,u,h){var m=o.pingCache;m!==null&&m.delete(u),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,ut===o&&($e&h)===h&&(Tt===4||Tt===3&&($e&62914560)===$e&&300>dr()-up?(Ze&2)===0&&nu(o,0):yb|=h,eu===$e&&(eu=0)),Di(o)}function YT(o,u){u===0&&(u=qk()),o=po(o,u),o!==null&&(Ec(o,u),Di(o))}function vH(o){var u=o.memoizedState,h=0;u!==null&&(h=u.retryLane),YT(o,h)}function yH(o,u){var h=0;switch(o.tag){case 31:case 13:var m=o.stateNode,b=o.memoizedState;b!==null&&(h=b.retryLane);break;case 19:m=o.stateNode;break;case 22:m=o.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(u),YT(o,h)}function bH(o,u){return By(o,u)}var gp=null,iu=null,Cb=!1,vp=!1,Eb=!1,Ol=0;function Di(o){o!==iu&&o.next===null&&(iu===null?gp=iu=o:iu=iu.next=o),vp=!0,Cb||(Cb=!0,SH())}function sf(o,u){if(!Eb&&vp){Eb=!0;do for(var h=!1,m=gp;m!==null;){if(o!==0){var b=m.pendingLanes;if(b===0)var S=0;else{var E=m.suspendedLanes,_=m.pingedLanes;S=(1<<31-mr(42|o)+1)-1,S&=b&~(E&~_),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(h=!0,e2(m,S))}else S=$e,S=Sd(m,m===ut?S:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(S&3)===0||Cc(m,S)||(h=!0,e2(m,S));m=m.next}while(h);Eb=!1}}function xH(){GT()}function GT(){vp=Cb=!1;var o=0;Ol!==0&&PH()&&(o=Ol);for(var u=dr(),h=null,m=gp;m!==null;){var b=m.next,S=ZT(m,u);S===0?(m.next=null,h===null?gp=b:h.next=b,b===null&&(iu=h)):(h=m,(o!==0||(S&3)!==0)&&(vp=!0)),m=b}Vt!==0&&Vt!==5||sf(o),Ol!==0&&(Ol=0)}function ZT(o,u){for(var h=o.suspendedLanes,m=o.pingedLanes,b=o.expirationTimes,S=o.pendingLanes&-62914561;0<S;){var E=31-mr(S),_=1<<E,j=b[E];j===-1?((_&h)===0||(_&m)!==0)&&(b[E]=K6(_,u)):j<=u&&(o.expiredLanes|=_),S&=~_}if(u=ut,h=$e,h=Sd(o,o===u?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),m=o.callbackNode,h===0||o===u&&(et===2||et===9)||o.cancelPendingCommit!==null)return m!==null&&m!==null&&zy(m),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||Cc(o,h)){if(u=h&-h,u===o.callbackPriority)return u;switch(m!==null&&zy(m),Hy(h)){case 2:case 8:h=Hk;break;case 32:h=vd;break;case 268435456:h=Fk;break;default:h=vd}return m=JT.bind(null,o),h=By(h,m),o.callbackPriority=u,o.callbackNode=h,u}return m!==null&&m!==null&&zy(m),o.callbackPriority=2,o.callbackNode=null,2}function JT(o,u){if(Vt!==0&&Vt!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(mp()&&o.callbackNode!==h)return null;var m=$e;return m=Sd(o,o===ut?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),m===0?null:(RT(o,m,u),ZT(o,dr()),o.callbackNode!=null&&o.callbackNode===h?JT.bind(null,o):null)}function e2(o,u){if(mp())return null;RT(o,u,!0)}function SH(){NH(function(){(Ze&6)!==0?By(Uk,xH):GT()})}function Tb(){if(Ol===0){var o=Fs;o===0&&(o=yd,yd<<=1,(yd&261888)===0&&(yd=256)),Ol=o}return Ol}function t2(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:kd(""+o)}function n2(o,u){var h=u.ownerDocument.createElement("input");return h.name=u.name,h.value=u.value,o.id&&h.setAttribute("form",o.id),u.parentNode.insertBefore(h,u),o=new FormData(o),h.parentNode.removeChild(h),o}function wH(o,u,h,m,b){if(u==="submit"&&h&&h.stateNode===b){var S=t2((b[Xn]||null).action),E=m.submitter;E&&(u=(u=E[Xn]||null)?t2(u.formAction):E.getAttribute("formAction"),u!==null&&(S=u,E=null));var _=new Md("action","action",null,m,b);o.push({event:_,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Ol!==0){var j=E?n2(b,E):new FormData(b);X0(h,{pending:!0,data:j,method:b.method,action:S},null,j)}}else typeof S=="function"&&(_.preventDefault(),j=E?n2(b,E):new FormData(b),X0(h,{pending:!0,data:j,method:b.method,action:S},S,j))},currentTarget:b}]})}}for(var Mb=0;Mb<f0.length;Mb++){var Db=f0[Mb],OH=Db.toLowerCase(),AH=Db[0].toUpperCase()+Db.slice(1);li(OH,"on"+AH)}li(NC,"onAnimationEnd"),li(RC,"onAnimationIteration"),li(jC,"onAnimationStart"),li("dblclick","onDoubleClick"),li("focusin","onFocus"),li("focusout","onBlur"),li($U,"onTransitionRun"),li(UU,"onTransitionStart"),li(HU,"onTransitionCancel"),li(IC,"onTransitionEnd"),Ms("onMouseEnter",["mouseout","mouseover"]),Ms("onMouseLeave",["mouseout","mouseover"]),Ms("onPointerEnter",["pointerout","pointerover"]),Ms("onPointerLeave",["pointerout","pointerover"]),uo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),uo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),uo("onBeforeInput",["compositionend","keypress","textInput","paste"]),uo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),uo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),uo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uf="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(" "),kH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(uf));function r2(o,u){u=(u&4)!==0;for(var h=0;h<o.length;h++){var m=o[h],b=m.event;m=m.listeners;e:{var S=void 0;if(u)for(var E=m.length-1;0<=E;E--){var _=m[E],j=_.instance,F=_.currentTarget;if(_=_.listener,j!==S&&b.isPropagationStopped())break e;S=_,b.currentTarget=F;try{S(b)}catch(Z){_d(Z)}b.currentTarget=null,S=j}else for(E=0;E<m.length;E++){if(_=m[E],j=_.instance,F=_.currentTarget,_=_.listener,j!==S&&b.isPropagationStopped())break e;S=_,b.currentTarget=F;try{S(b)}catch(Z){_d(Z)}b.currentTarget=null,S=j}}}}function Be(o,u){var h=u[Fy];h===void 0&&(h=u[Fy]=new Set);var m=o+"__bubble";h.has(m)||(i2(u,o,2,!1),h.add(m))}function Pb(o,u,h){var m=0;u&&(m|=4),i2(h,o,m,u)}var yp="_reactListening"+Math.random().toString(36).slice(2);function _b(o){if(!o[yp]){o[yp]=!0,Gk.forEach(function(h){h!=="selectionchange"&&(kH.has(h)||Pb(h,!1,o),Pb(h,!0,o))});var u=o.nodeType===9?o:o.ownerDocument;u===null||u[yp]||(u[yp]=!0,Pb("selectionchange",!1,u))}}function i2(o,u,h,m){switch(N2(u)){case 2:var b=JH;break;case 8:b=e9;break;default:b=Kb}h=b.bind(null,u,h,o),b=void 0,!Zy||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(b=!0),m?b!==void 0?o.addEventListener(u,h,{capture:!0,passive:b}):o.addEventListener(u,h,!0):b!==void 0?o.addEventListener(u,h,{passive:b}):o.addEventListener(u,h,!1)}function Nb(o,u,h,m,b){var S=m;if((u&1)===0&&(u&2)===0&&m!==null)e:for(;;){if(m===null)return;var E=m.tag;if(E===3||E===4){var _=m.stateNode.containerInfo;if(_===b)break;if(E===4)for(E=m.return;E!==null;){var j=E.tag;if((j===3||j===4)&&E.stateNode.containerInfo===b)return;E=E.return}for(;_!==null;){if(E=Cs(_),E===null)return;if(j=E.tag,j===5||j===6||j===26||j===27){m=S=E;continue e}_=_.parentNode}}m=m.return}uC(function(){var F=S,Z=Yy(h),te=[];e:{var W=LC.get(o);if(W!==void 0){var Q=Md,ye=o;switch(o){case"keypress":if(Ed(h)===0)break e;case"keydown":case"keyup":Q=yU;break;case"focusin":ye="focus",Q=n0;break;case"focusout":ye="blur",Q=n0;break;case"beforeblur":case"afterblur":Q=n0;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=hC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=lU;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=SU;break;case NC:case RC:case jC:Q=uU;break;case IC:Q=OU;break;case"scroll":case"scrollend":Q=iU;break;case"wheel":Q=kU;break;case"copy":case"cut":case"paste":Q=fU;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=pC;break;case"toggle":case"beforetoggle":Q=EU}var Me=(u&4)!==0,at=!Me&&(o==="scroll"||o==="scrollend"),$=Me?W!==null?W+"Capture":null:W;Me=[];for(var L=F,H;L!==null;){var ee=L;if(H=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||H===null||$===null||(ee=Dc(L,$),ee!=null&&Me.push(cf(L,ee,H))),at)break;L=L.return}0<Me.length&&(W=new Q(W,ye,null,h,Z),te.push({event:W,listeners:Me}))}}if((u&7)===0){e:{if(W=o==="mouseover"||o==="pointerover",Q=o==="mouseout"||o==="pointerout",W&&h!==Qy&&(ye=h.relatedTarget||h.fromElement)&&(Cs(ye)||ye[ks]))break e;if((Q||W)&&(W=Z.window===Z?Z:(W=Z.ownerDocument)?W.defaultView||W.parentWindow:window,Q?(ye=h.relatedTarget||h.toElement,Q=F,ye=ye?Cs(ye):null,ye!==null&&(at=a(ye),Me=ye.tag,ye!==at||Me!==5&&Me!==27&&Me!==6)&&(ye=null)):(Q=null,ye=F),Q!==ye)){if(Me=hC,ee="onMouseLeave",$="onMouseEnter",L="mouse",(o==="pointerout"||o==="pointerover")&&(Me=pC,ee="onPointerLeave",$="onPointerEnter",L="pointer"),at=Q==null?W:Mc(Q),H=ye==null?W:Mc(ye),W=new Me(ee,L+"leave",Q,h,Z),W.target=at,W.relatedTarget=H,ee=null,Cs(Z)===F&&(Me=new Me($,L+"enter",ye,h,Z),Me.target=H,Me.relatedTarget=at,ee=Me),at=ee,Q&&ye)t:{for(Me=CH,$=Q,L=ye,H=0,ee=$;ee;ee=Me(ee))H++;ee=0;for(var Ae=L;Ae;Ae=Me(Ae))ee++;for(;0<H-ee;)$=Me($),H--;for(;0<ee-H;)L=Me(L),ee--;for(;H--;){if($===L||L!==null&&$===L.alternate){Me=$;break t}$=Me($),L=Me(L)}Me=null}else Me=null;Q!==null&&a2(te,W,Q,Me,!1),ye!==null&&at!==null&&a2(te,at,ye,Me,!0)}}e:{if(W=F?Mc(F):window,Q=W.nodeName&&W.nodeName.toLowerCase(),Q==="select"||Q==="input"&&W.type==="file")var Xe=wC;else if(xC(W))if(OC)Xe=LU;else{Xe=jU;var Se=RU}else Q=W.nodeName,!Q||Q.toLowerCase()!=="input"||W.type!=="checkbox"&&W.type!=="radio"?F&&Xy(F.elementType)&&(Xe=wC):Xe=IU;if(Xe&&(Xe=Xe(o,F))){SC(te,Xe,h,Z);break e}Se&&Se(o,W,F),o==="focusout"&&F&&W.type==="number"&&F.memoizedProps.value!=null&&Ky(W,"number",W.value)}switch(Se=F?Mc(F):window,o){case"focusin":(xC(Se)||Se.contentEditable==="true")&&(js=Se,s0=F,Bc=null);break;case"focusout":Bc=s0=js=null;break;case"mousedown":u0=!0;break;case"contextmenu":case"mouseup":case"dragend":u0=!1,PC(te,h,Z);break;case"selectionchange":if(zU)break;case"keydown":case"keyup":PC(te,h,Z)}var je;if(i0)e:{switch(o){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Rs?yC(o,h)&&(Ue="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(Ue="onCompositionStart");Ue&&(mC&&h.locale!=="ko"&&(Rs||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Rs&&(je=cC()):(ol=Z,Jy="value"in ol?ol.value:ol.textContent,Rs=!0)),Se=bp(F,Ue),0<Se.length&&(Ue=new dC(Ue,o,null,h,Z),te.push({event:Ue,listeners:Se}),je?Ue.data=je:(je=bC(h),je!==null&&(Ue.data=je)))),(je=MU?DU(o,h):PU(o,h))&&(Ue=bp(F,"onBeforeInput"),0<Ue.length&&(Se=new dC("onBeforeInput","beforeinput",null,h,Z),te.push({event:Se,listeners:Ue}),Se.data=je)),wH(te,o,F,h,Z)}r2(te,u)})}function cf(o,u,h){return{instance:o,listener:u,currentTarget:h}}function bp(o,u){for(var h=u+"Capture",m=[];o!==null;){var b=o,S=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||S===null||(b=Dc(o,h),b!=null&&m.unshift(cf(o,b,S)),b=Dc(o,u),b!=null&&m.push(cf(o,b,S))),o.tag===3)return m;o=o.return}return[]}function CH(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function a2(o,u,h,m,b){for(var S=u._reactName,E=[];h!==null&&h!==m;){var _=h,j=_.alternate,F=_.stateNode;if(_=_.tag,j!==null&&j===m)break;_!==5&&_!==26&&_!==27||F===null||(j=F,b?(F=Dc(h,S),F!=null&&E.unshift(cf(h,F,j))):b||(F=Dc(h,S),F!=null&&E.push(cf(h,F,j)))),h=h.return}E.length!==0&&o.push({event:u,listeners:E})}var EH=/\r\n?/g,TH=/\u0000|\uFFFD/g;function l2(o){return(typeof o=="string"?o:""+o).replace(EH,`
9
- `).replace(TH,"")}function o2(o,u){return u=l2(u),l2(o)===u}function it(o,u,h,m,b,S){switch(h){case"children":typeof m=="string"?u==="body"||u==="textarea"&&m===""||Ps(o,m):(typeof m=="number"||typeof m=="bigint")&&u!=="body"&&Ps(o,""+m);break;case"className":Od(o,"class",m);break;case"tabIndex":Od(o,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Od(o,h,m);break;case"style":oC(o,m,S);break;case"data":if(u!=="object"){Od(o,"data",m);break}case"src":case"href":if(m===""&&(u!=="a"||h!=="href")){o.removeAttribute(h);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){o.removeAttribute(h);break}m=kd(""+m),o.setAttribute(h,m);break;case"action":case"formAction":if(typeof m=="function"){o.setAttribute(h,"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 S=="function"&&(h==="formAction"?(u!=="input"&&it(o,u,"name",b.name,b,null),it(o,u,"formEncType",b.formEncType,b,null),it(o,u,"formMethod",b.formMethod,b,null),it(o,u,"formTarget",b.formTarget,b,null)):(it(o,u,"encType",b.encType,b,null),it(o,u,"method",b.method,b,null),it(o,u,"target",b.target,b,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){o.removeAttribute(h);break}m=kd(""+m),o.setAttribute(h,m);break;case"onClick":m!=null&&(o.onclick=ca);break;case"onScroll":m!=null&&Be("scroll",o);break;case"onScrollEnd":m!=null&&Be("scrollend",o);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(h=m.__html,h!=null){if(b.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"multiple":o.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":o.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){o.removeAttribute("xlink:href");break}h=kd(""+m),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(h,""+m):o.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":m===!0?o.setAttribute(h,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(h,m):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?o.setAttribute(h,m):o.removeAttribute(h);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?o.removeAttribute(h):o.setAttribute(h,m);break;case"popover":Be("beforetoggle",o),Be("toggle",o),wd(o,"popover",m);break;case"xlinkActuate":ua(o,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":ua(o,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":ua(o,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":ua(o,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":ua(o,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":ua(o,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":ua(o,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":ua(o,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":ua(o,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":wd(o,"is",m);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=nU.get(h)||h,wd(o,h,m))}}function Rb(o,u,h,m,b,S){switch(h){case"style":oC(o,m,S);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(h=m.__html,h!=null){if(b.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"children":typeof m=="string"?Ps(o,m):(typeof m=="number"||typeof m=="bigint")&&Ps(o,""+m);break;case"onScroll":m!=null&&Be("scroll",o);break;case"onScrollEnd":m!=null&&Be("scrollend",o);break;case"onClick":m!=null&&(o.onclick=ca);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Zk.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(b=h.endsWith("Capture"),u=h.slice(2,b?h.length-7:void 0),S=o[Xn]||null,S=S!=null?S[h]:null,typeof S=="function"&&o.removeEventListener(u,S,b),typeof m=="function")){typeof S!="function"&&S!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(u,m,b);break e}h in o?o[h]=m:m===!0?o.setAttribute(h,""):wd(o,h,m)}}}function yn(o,u,h){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",o),Be("load",o);var m=!1,b=!1,S;for(S in h)if(h.hasOwnProperty(S)){var E=h[S];if(E!=null)switch(S){case"src":m=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:it(o,u,S,E,h,null)}}b&&it(o,u,"srcSet",h.srcSet,h,null),m&&it(o,u,"src",h.src,h,null);return;case"input":Be("invalid",o);var _=S=E=b=null,j=null,F=null;for(m in h)if(h.hasOwnProperty(m)){var Z=h[m];if(Z!=null)switch(m){case"name":b=Z;break;case"type":E=Z;break;case"checked":j=Z;break;case"defaultChecked":F=Z;break;case"value":S=Z;break;case"defaultValue":_=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,u));break;default:it(o,u,m,Z,h,null)}}rC(o,S,_,j,F,E,b,!1);return;case"select":Be("invalid",o),m=E=S=null;for(b in h)if(h.hasOwnProperty(b)&&(_=h[b],_!=null))switch(b){case"value":S=_;break;case"defaultValue":E=_;break;case"multiple":m=_;default:it(o,u,b,_,h,null)}u=S,h=E,o.multiple=!!m,u!=null?Ds(o,!!m,u,!1):h!=null&&Ds(o,!!m,h,!0);return;case"textarea":Be("invalid",o),S=b=m=null;for(E in h)if(h.hasOwnProperty(E)&&(_=h[E],_!=null))switch(E){case"value":m=_;break;case"defaultValue":b=_;break;case"children":S=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:it(o,u,E,_,h,null)}aC(o,m,b,S);return;case"option":for(j in h)h.hasOwnProperty(j)&&(m=h[j],m!=null)&&(j==="selected"?o.selected=m&&typeof m!="function"&&typeof m!="symbol":it(o,u,j,m,h,null));return;case"dialog":Be("beforetoggle",o),Be("toggle",o),Be("cancel",o),Be("close",o);break;case"iframe":case"object":Be("load",o);break;case"video":case"audio":for(m=0;m<uf.length;m++)Be(uf[m],o);break;case"image":Be("error",o),Be("load",o);break;case"details":Be("toggle",o);break;case"embed":case"source":case"link":Be("error",o),Be("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in h)if(h.hasOwnProperty(F)&&(m=h[F],m!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:it(o,u,F,m,h,null)}return;default:if(Xy(u)){for(Z in h)h.hasOwnProperty(Z)&&(m=h[Z],m!==void 0&&Rb(o,u,Z,m,h,void 0));return}}for(_ in h)h.hasOwnProperty(_)&&(m=h[_],m!=null&&it(o,u,_,m,h,null))}function MH(o,u,h,m){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,S=null,E=null,_=null,j=null,F=null,Z=null;for(Q in h){var te=h[Q];if(h.hasOwnProperty(Q)&&te!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":j=te;default:m.hasOwnProperty(Q)||it(o,u,Q,null,m,te)}}for(var W in m){var Q=m[W];if(te=h[W],m.hasOwnProperty(W)&&(Q!=null||te!=null))switch(W){case"type":S=Q;break;case"name":b=Q;break;case"checked":F=Q;break;case"defaultChecked":Z=Q;break;case"value":E=Q;break;case"defaultValue":_=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,u));break;default:Q!==te&&it(o,u,W,Q,m,te)}}Vy(o,E,_,j,F,Z,S,b);return;case"select":Q=E=_=W=null;for(S in h)if(j=h[S],h.hasOwnProperty(S)&&j!=null)switch(S){case"value":break;case"multiple":Q=j;default:m.hasOwnProperty(S)||it(o,u,S,null,m,j)}for(b in m)if(S=m[b],j=h[b],m.hasOwnProperty(b)&&(S!=null||j!=null))switch(b){case"value":W=S;break;case"defaultValue":_=S;break;case"multiple":E=S;default:S!==j&&it(o,u,b,S,m,j)}u=_,h=E,m=Q,W!=null?Ds(o,!!h,W,!1):!!m!=!!h&&(u!=null?Ds(o,!!h,u,!0):Ds(o,!!h,h?[]:"",!1));return;case"textarea":Q=W=null;for(_ in h)if(b=h[_],h.hasOwnProperty(_)&&b!=null&&!m.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:it(o,u,_,null,m,b)}for(E in m)if(b=m[E],S=h[E],m.hasOwnProperty(E)&&(b!=null||S!=null))switch(E){case"value":W=b;break;case"defaultValue":Q=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==S&&it(o,u,E,b,m,S)}iC(o,W,Q);return;case"option":for(var ye in h)W=h[ye],h.hasOwnProperty(ye)&&W!=null&&!m.hasOwnProperty(ye)&&(ye==="selected"?o.selected=!1:it(o,u,ye,null,m,W));for(j in m)W=m[j],Q=h[j],m.hasOwnProperty(j)&&W!==Q&&(W!=null||Q!=null)&&(j==="selected"?o.selected=W&&typeof W!="function"&&typeof W!="symbol":it(o,u,j,W,m,Q));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 Me in h)W=h[Me],h.hasOwnProperty(Me)&&W!=null&&!m.hasOwnProperty(Me)&&it(o,u,Me,null,m,W);for(F in m)if(W=m[F],Q=h[F],m.hasOwnProperty(F)&&W!==Q&&(W!=null||Q!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,u));break;default:it(o,u,F,W,m,Q)}return;default:if(Xy(u)){for(var at in h)W=h[at],h.hasOwnProperty(at)&&W!==void 0&&!m.hasOwnProperty(at)&&Rb(o,u,at,void 0,m,W);for(Z in m)W=m[Z],Q=h[Z],!m.hasOwnProperty(Z)||W===Q||W===void 0&&Q===void 0||Rb(o,u,Z,W,m,Q);return}}for(var $ in h)W=h[$],h.hasOwnProperty($)&&W!=null&&!m.hasOwnProperty($)&&it(o,u,$,null,m,W);for(te in m)W=m[te],Q=h[te],!m.hasOwnProperty(te)||W===Q||W==null&&Q==null||it(o,u,te,W,m,Q)}function s2(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function DH(){if(typeof performance.getEntriesByType=="function"){for(var o=0,u=0,h=performance.getEntriesByType("resource"),m=0;m<h.length;m++){var b=h[m],S=b.transferSize,E=b.initiatorType,_=b.duration;if(S&&_&&s2(E)){for(E=0,_=b.responseEnd,m+=1;m<h.length;m++){var j=h[m],F=j.startTime;if(F>_)break;var Z=j.transferSize,te=j.initiatorType;Z&&s2(te)&&(j=j.responseEnd,E+=Z*(j<_?1:(_-F)/(j-F)))}if(--m,u+=8*(S+E)/(b.duration/1e3),o++,10<o)break}}if(0<o)return u/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var jb=null,Ib=null;function xp(o){return o.nodeType===9?o:o.ownerDocument}function u2(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function c2(o,u){if(o===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&u==="foreignObject"?0:o}function Lb(o,u){return o==="textarea"||o==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Bb=null;function PH(){var o=window.event;return o&&o.type==="popstate"?o===Bb?!1:(Bb=o,!0):(Bb=null,!1)}var f2=typeof setTimeout=="function"?setTimeout:void 0,_H=typeof clearTimeout=="function"?clearTimeout:void 0,h2=typeof Promise=="function"?Promise:void 0,NH=typeof queueMicrotask=="function"?queueMicrotask:typeof h2<"u"?function(o){return h2.resolve(null).then(o).catch(RH)}:f2;function RH(o){setTimeout(function(){throw o})}function Al(o){return o==="head"}function d2(o,u){var h=u,m=0;do{var b=h.nextSibling;if(o.removeChild(h),b&&b.nodeType===8)if(h=b.data,h==="/$"||h==="/&"){if(m===0){o.removeChild(b),su(u);return}m--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")m++;else if(h==="html")ff(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,ff(h);for(var S=h.firstChild;S;){var E=S.nextSibling,_=S.nodeName;S[Tc]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&S.rel.toLowerCase()==="stylesheet"||h.removeChild(S),S=E}}else h==="body"&&ff(o.ownerDocument.body);h=b}while(h);su(u)}function p2(o,u){var h=o;o=0;do{var m=h.nextSibling;if(h.nodeType===1?u?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(u?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),m&&m.nodeType===8)if(h=m.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=m}while(h)}function zb(o){var u=o.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var h=u;switch(u=u.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":zb(h),qy(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function jH(o,u,h,m){for(;o.nodeType===1;){var b=h;if(o.nodeName.toLowerCase()!==u.toLowerCase()){if(!m&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(m){if(!o[Tc])switch(u){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(S=o.getAttribute("rel"),S==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(S!==b.rel||o.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||o.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||o.getAttribute("title")!==(b.title==null?null:b.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(S=o.getAttribute("src"),(S!==(b.src==null?null:b.src)||o.getAttribute("type")!==(b.type==null?null:b.type)||o.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&S&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(u==="input"&&o.type==="hidden"){var S=b.name==null?null:""+b.name;if(b.type==="hidden"&&o.getAttribute("name")===S)return o}else return o;if(o=Hr(o.nextSibling),o===null)break}return null}function IH(o,u,h){if(u==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=Hr(o.nextSibling),o===null))return null;return o}function m2(o,u){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=Hr(o.nextSibling),o===null))return null;return o}function $b(o){return o.data==="$?"||o.data==="$~"}function Ub(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function LH(o,u){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=u;else if(o.data!=="$?"||h.readyState!=="loading")u();else{var m=function(){u(),h.removeEventListener("DOMContentLoaded",m)};h.addEventListener("DOMContentLoaded",m),o._reactRetry=m}}function Hr(o){for(;o!=null;o=o.nextSibling){var u=o.nodeType;if(u===1||u===3)break;if(u===8){if(u=o.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return o}var Hb=null;function g2(o){o=o.nextSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(u===0)return Hr(o.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}o=o.nextSibling}return null}function v2(o){o=o.previousSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(u===0)return o;u--}else h!=="/$"&&h!=="/&"||u++}o=o.previousSibling}return null}function y2(o,u,h){switch(u=xp(h),o){case"html":if(o=u.documentElement,!o)throw Error(r(452));return o;case"head":if(o=u.head,!o)throw Error(r(453));return o;case"body":if(o=u.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function ff(o){for(var u=o.attributes;u.length;)o.removeAttributeNode(u[0]);qy(o)}var Fr=new Map,b2=new Set;function Sp(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Ca=G.d;G.d={f:BH,r:zH,D:$H,C:UH,L:HH,m:FH,X:WH,S:qH,M:VH};function BH(){var o=Ca.f(),u=hp();return o||u}function zH(o){var u=Es(o);u!==null&&u.tag===5&&u.type==="form"?IE(u):Ca.r(o)}var au=typeof document>"u"?null:document;function x2(o,u,h){var m=au;if(m&&typeof u=="string"&&u){var b=jr(u);b='link[rel="'+o+'"][href="'+b+'"]',typeof h=="string"&&(b+='[crossorigin="'+h+'"]'),b2.has(b)||(b2.add(b),o={rel:o,crossOrigin:h,href:u},m.querySelector(b)===null&&(u=m.createElement("link"),yn(u,"link",o),tn(u),m.head.appendChild(u)))}}function $H(o){Ca.D(o),x2("dns-prefetch",o,null)}function UH(o,u){Ca.C(o,u),x2("preconnect",o,u)}function HH(o,u,h){Ca.L(o,u,h);var m=au;if(m&&o&&u){var b='link[rel="preload"][as="'+jr(u)+'"]';u==="image"&&h&&h.imageSrcSet?(b+='[imagesrcset="'+jr(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(b+='[imagesizes="'+jr(h.imageSizes)+'"]')):b+='[href="'+jr(o)+'"]';var S=b;switch(u){case"style":S=lu(o);break;case"script":S=ou(o)}Fr.has(S)||(o=p({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:o,as:u},h),Fr.set(S,o),m.querySelector(b)!==null||u==="style"&&m.querySelector(hf(S))||u==="script"&&m.querySelector(df(S))||(u=m.createElement("link"),yn(u,"link",o),tn(u),m.head.appendChild(u)))}}function FH(o,u){Ca.m(o,u);var h=au;if(h&&o){var m=u&&typeof u.as=="string"?u.as:"script",b='link[rel="modulepreload"][as="'+jr(m)+'"][href="'+jr(o)+'"]',S=b;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=ou(o)}if(!Fr.has(S)&&(o=p({rel:"modulepreload",href:o},u),Fr.set(S,o),h.querySelector(b)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(df(S)))return}m=h.createElement("link"),yn(m,"link",o),tn(m),h.head.appendChild(m)}}}function qH(o,u,h){Ca.S(o,u,h);var m=au;if(m&&o){var b=Ts(m).hoistableStyles,S=lu(o);u=u||"default";var E=b.get(S);if(!E){var _={loading:0,preload:null};if(E=m.querySelector(hf(S)))_.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":u},h),(h=Fr.get(S))&&Fb(o,h);var j=E=m.createElement("link");tn(j),yn(j,"link",o),j._p=new Promise(function(F,Z){j.onload=F,j.onerror=Z}),j.addEventListener("load",function(){_.loading|=1}),j.addEventListener("error",function(){_.loading|=2}),_.loading|=4,wp(E,u,m)}E={type:"stylesheet",instance:E,count:1,state:_},b.set(S,E)}}}function WH(o,u){Ca.X(o,u);var h=au;if(h&&o){var m=Ts(h).hoistableScripts,b=ou(o),S=m.get(b);S||(S=h.querySelector(df(b)),S||(o=p({src:o,async:!0},u),(u=Fr.get(b))&&qb(o,u),S=h.createElement("script"),tn(S),yn(S,"link",o),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(b,S))}}function VH(o,u){Ca.M(o,u);var h=au;if(h&&o){var m=Ts(h).hoistableScripts,b=ou(o),S=m.get(b);S||(S=h.querySelector(df(b)),S||(o=p({src:o,async:!0,type:"module"},u),(u=Fr.get(b))&&qb(o,u),S=h.createElement("script"),tn(S),yn(S,"link",o),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(b,S))}}function S2(o,u,h,m){var b=(b=Oe.current)?Sp(b):null;if(!b)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(u=lu(h.href),h=Ts(b).hoistableStyles,m=h.get(u),m||(m={type:"style",instance:null,count:0,state:null},h.set(u,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=lu(h.href);var S=Ts(b).hoistableStyles,E=S.get(o);if(E||(b=b.ownerDocument||b,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(o,E),(S=b.querySelector(hf(o)))&&!S._p&&(E.instance=S,E.state.loading=5),Fr.has(o)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Fr.set(o,h),S||KH(b,o,h,E.state))),u&&m===null)throw Error(r(528,""));return E}if(u&&m!==null)throw Error(r(529,""));return null;case"script":return u=h.async,h=h.src,typeof h=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=ou(h),h=Ts(b).hoistableScripts,m=h.get(u),m||(m={type:"script",instance:null,count:0,state:null},h.set(u,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function lu(o){return'href="'+jr(o)+'"'}function hf(o){return'link[rel="stylesheet"]['+o+"]"}function w2(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function KH(o,u,h,m){o.querySelector('link[rel="preload"][as="style"]['+u+"]")?m.loading=1:(u=o.createElement("link"),m.preload=u,u.addEventListener("load",function(){return m.loading|=1}),u.addEventListener("error",function(){return m.loading|=2}),yn(u,"link",h),tn(u),o.head.appendChild(u))}function ou(o){return'[src="'+jr(o)+'"]'}function df(o){return"script[async]"+o}function O2(o,u,h){if(u.count++,u.instance===null)switch(u.type){case"style":var m=o.querySelector('style[data-href~="'+jr(h.href)+'"]');if(m)return u.instance=m,tn(m),m;var b=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return m=(o.ownerDocument||o).createElement("style"),tn(m),yn(m,"style",b),wp(m,h.precedence,o),u.instance=m;case"stylesheet":b=lu(h.href);var S=o.querySelector(hf(b));if(S)return u.state.loading|=4,u.instance=S,tn(S),S;m=w2(h),(b=Fr.get(b))&&Fb(m,b),S=(o.ownerDocument||o).createElement("link"),tn(S);var E=S;return E._p=new Promise(function(_,j){E.onload=_,E.onerror=j}),yn(S,"link",m),u.state.loading|=4,wp(S,h.precedence,o),u.instance=S;case"script":return S=ou(h.src),(b=o.querySelector(df(S)))?(u.instance=b,tn(b),b):(m=h,(b=Fr.get(S))&&(m=p({},h),qb(m,b)),o=o.ownerDocument||o,b=o.createElement("script"),tn(b),yn(b,"link",m),o.head.appendChild(b),u.instance=b);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(m=u.instance,u.state.loading|=4,wp(m,h.precedence,o));return u.instance}function wp(o,u,h){for(var m=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=m.length?m[m.length-1]:null,S=b,E=0;E<m.length;E++){var _=m[E];if(_.dataset.precedence===u)S=_;else if(S!==b)break}S?S.parentNode.insertBefore(o,S.nextSibling):(u=h.nodeType===9?h.head:h,u.insertBefore(o,u.firstChild))}function Fb(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.title==null&&(o.title=u.title)}function qb(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.integrity==null&&(o.integrity=u.integrity)}var Op=null;function A2(o,u,h){if(Op===null){var m=new Map,b=Op=new Map;b.set(h,m)}else b=Op,m=b.get(h),m||(m=new Map,b.set(h,m));if(m.has(o))return m;for(m.set(o,null),h=h.getElementsByTagName(o),b=0;b<h.length;b++){var S=h[b];if(!(S[Tc]||S[pn]||o==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var E=S.getAttribute(u)||"";E=o+E;var _=m.get(E);_?_.push(S):m.set(E,[S])}}return m}function k2(o,u,h){o=o.ownerDocument||o,o.head.insertBefore(h,u==="title"?o.querySelector("head > title"):null)}function XH(o,u,h){if(h===1||u.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;return u.rel==="stylesheet"?(o=u.disabled,typeof u.precedence=="string"&&o==null):!0;case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function C2(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function QH(o,u,h,m){if(h.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var b=lu(m.href),S=u.querySelector(hf(b));if(S){u=S._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(o.count++,o=Ap.bind(o),u.then(o,o)),h.state.loading|=4,h.instance=S,tn(S);return}S=u.ownerDocument||u,m=w2(m),(b=Fr.get(b))&&Fb(m,b),S=S.createElement("link"),tn(S);var E=S;E._p=new Promise(function(_,j){E.onload=_,E.onerror=j}),yn(S,"link",m),h.instance=S}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,u),(u=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=Ap.bind(o),u.addEventListener("load",h),u.addEventListener("error",h))}}var Wb=0;function YH(o,u){return o.stylesheets&&o.count===0&&Cp(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var m=setTimeout(function(){if(o.stylesheets&&Cp(o,o.stylesheets),o.unsuspend){var S=o.unsuspend;o.unsuspend=null,S()}},6e4+u);0<o.imgBytes&&Wb===0&&(Wb=62500*DH());var b=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Cp(o,o.stylesheets),o.unsuspend)){var S=o.unsuspend;o.unsuspend=null,S()}},(o.imgBytes>Wb?50:800)+u);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function Ap(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cp(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var kp=null;function Cp(o,u){o.stylesheets=null,o.unsuspend!==null&&(o.count++,kp=new Map,u.forEach(GH,o),kp=null,Ap.call(o))}function GH(o,u){if(!(u.state.loading&4)){var h=kp.get(o);if(h)var m=h.get(null);else{h=new Map,kp.set(o,h);for(var b=o.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<b.length;S++){var E=b[S];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(h.set(E.dataset.precedence,E),m=E)}m&&h.set(null,m)}b=u.instance,E=b.getAttribute("data-precedence"),S=h.get(E)||m,S===m&&h.set(null,b),h.set(E,b),this.count++,m=Ap.bind(this),b.addEventListener("load",m),b.addEventListener("error",m),S?S.parentNode.insertBefore(b,S.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(b,o.firstChild)),u.state.loading|=4}}var pf={$$typeof:k,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function ZH(o,u,h,m,b,S,E,_,j){this.tag=1,this.containerInfo=o,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=$y(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$y(0),this.hiddenUpdates=$y(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=S,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function E2(o,u,h,m,b,S,E,_,j,F,Z,te){return o=new ZH(o,u,h,E,j,F,Z,te,_),u=1,S===!0&&(u|=24),S=vr(3,null,null,u),o.current=S,S.stateNode=o,u=A0(),u.refCount++,o.pooledCache=u,u.refCount++,S.memoizedState={element:m,isDehydrated:h,cache:u},T0(S),o}function T2(o){return o?(o=Bs,o):Bs}function M2(o,u,h,m,b,S){b=T2(b),m.context===null?m.context=b:m.pendingContext=b,m=dl(u),m.payload={element:h},S=S===void 0?null:S,S!==null&&(m.callback=S),h=pl(o,m,u),h!==null&&(er(h,o,u),Wc(h,o,u))}function D2(o,u){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<u?h:u}}function Vb(o,u){D2(o,u),(o=o.alternate)&&D2(o,u)}function P2(o){if(o.tag===13||o.tag===31){var u=po(o,67108864);u!==null&&er(u,o,67108864),Vb(o,67108864)}}function _2(o){if(o.tag===13||o.tag===31){var u=wr();u=Uy(u);var h=po(o,u);h!==null&&er(h,o,u),Vb(o,u)}}var Ep=!0;function JH(o,u,h,m){var b=z.T;z.T=null;var S=G.p;try{G.p=2,Kb(o,u,h,m)}finally{G.p=S,z.T=b}}function e9(o,u,h,m){var b=z.T;z.T=null;var S=G.p;try{G.p=8,Kb(o,u,h,m)}finally{G.p=S,z.T=b}}function Kb(o,u,h,m){if(Ep){var b=Xb(m);if(b===null)Nb(o,u,m,Tp,h),R2(o,m);else if(n9(b,o,u,h,m))m.stopPropagation();else if(R2(o,m),u&4&&-1<t9.indexOf(o)){for(;b!==null;){var S=Es(b);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var E=so(S.pendingLanes);if(E!==0){var _=S;for(_.pendingLanes|=2,_.entangledLanes|=2;E;){var j=1<<31-mr(E);_.entanglements[1]|=j,E&=~j}Di(S),(Ze&6)===0&&(cp=dr()+500,sf(0))}}break;case 31:case 13:_=po(S,2),_!==null&&er(_,S,2),hp(),Vb(S,2)}if(S=Xb(m),S===null&&Nb(o,u,m,Tp,h),S===b)break;b=S}b!==null&&m.stopPropagation()}else Nb(o,u,m,null,h)}}function Xb(o){return o=Yy(o),Qb(o)}var Tp=null;function Qb(o){if(Tp=null,o=Cs(o),o!==null){var u=a(o);if(u===null)o=null;else{var h=u.tag;if(h===13){if(o=l(u),o!==null)return o;o=null}else if(h===31){if(o=s(u),o!==null)return o;o=null}else if(h===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;o=null}else u!==o&&(o=null)}}return Tp=o,null}function N2(o){switch(o){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($6()){case Uk:return 2;case Hk:return 8;case vd:case U6:return 32;case Fk:return 268435456;default:return 32}default:return 32}}var Yb=!1,kl=null,Cl=null,El=null,mf=new Map,gf=new Map,Tl=[],t9="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 R2(o,u){switch(o){case"focusin":case"focusout":kl=null;break;case"dragenter":case"dragleave":Cl=null;break;case"mouseover":case"mouseout":El=null;break;case"pointerover":case"pointerout":mf.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":gf.delete(u.pointerId)}}function vf(o,u,h,m,b,S){return o===null||o.nativeEvent!==S?(o={blockedOn:u,domEventName:h,eventSystemFlags:m,nativeEvent:S,targetContainers:[b]},u!==null&&(u=Es(u),u!==null&&P2(u)),o):(o.eventSystemFlags|=m,u=o.targetContainers,b!==null&&u.indexOf(b)===-1&&u.push(b),o)}function n9(o,u,h,m,b){switch(u){case"focusin":return kl=vf(kl,o,u,h,m,b),!0;case"dragenter":return Cl=vf(Cl,o,u,h,m,b),!0;case"mouseover":return El=vf(El,o,u,h,m,b),!0;case"pointerover":var S=b.pointerId;return mf.set(S,vf(mf.get(S)||null,o,u,h,m,b)),!0;case"gotpointercapture":return S=b.pointerId,gf.set(S,vf(gf.get(S)||null,o,u,h,m,b)),!0}return!1}function j2(o){var u=Cs(o.target);if(u!==null){var h=a(u);if(h!==null){if(u=h.tag,u===13){if(u=l(h),u!==null){o.blockedOn=u,Qk(o.priority,function(){_2(h)});return}}else if(u===31){if(u=s(h),u!==null){o.blockedOn=u,Qk(o.priority,function(){_2(h)});return}}else if(u===3&&h.stateNode.current.memoizedState.isDehydrated){o.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Mp(o){if(o.blockedOn!==null)return!1;for(var u=o.targetContainers;0<u.length;){var h=Xb(o.nativeEvent);if(h===null){h=o.nativeEvent;var m=new h.constructor(h.type,h);Qy=m,h.target.dispatchEvent(m),Qy=null}else return u=Es(h),u!==null&&P2(u),o.blockedOn=h,!1;u.shift()}return!0}function I2(o,u,h){Mp(o)&&h.delete(u)}function r9(){Yb=!1,kl!==null&&Mp(kl)&&(kl=null),Cl!==null&&Mp(Cl)&&(Cl=null),El!==null&&Mp(El)&&(El=null),mf.forEach(I2),gf.forEach(I2)}function Dp(o,u){o.blockedOn===u&&(o.blockedOn=null,Yb||(Yb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,r9)))}var Pp=null;function L2(o){Pp!==o&&(Pp=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Pp===o&&(Pp=null);for(var u=0;u<o.length;u+=3){var h=o[u],m=o[u+1],b=o[u+2];if(typeof m!="function"){if(Qb(m||h)===null)continue;break}var S=Es(h);S!==null&&(o.splice(u,3),u-=3,X0(S,{pending:!0,data:b,method:h.method,action:m},m,b))}}))}function su(o){function u(j){return Dp(j,o)}kl!==null&&Dp(kl,o),Cl!==null&&Dp(Cl,o),El!==null&&Dp(El,o),mf.forEach(u),gf.forEach(u);for(var h=0;h<Tl.length;h++){var m=Tl[h];m.blockedOn===o&&(m.blockedOn=null)}for(;0<Tl.length&&(h=Tl[0],h.blockedOn===null);)j2(h),h.blockedOn===null&&Tl.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(m=0;m<h.length;m+=3){var b=h[m],S=h[m+1],E=b[Xn]||null;if(typeof S=="function")E||L2(h);else if(E){var _=null;if(S&&S.hasAttribute("formAction")){if(b=S,E=S[Xn]||null)_=E.formAction;else if(Qb(b)!==null)continue}else _=E.action;typeof _=="function"?h[m+1]=_:(h.splice(m,3),m-=3),L2(h)}}}function B2(){function o(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(E){return b=E})},focusReset:"manual",scroll:"manual"})}function u(){b!==null&&(b(),b=null),m||setTimeout(h,20)}function h(){if(!m&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,b=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(h,100),function(){m=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),b!==null&&(b(),b=null)}}}function Gb(o){this._internalRoot=o}_p.prototype.render=Gb.prototype.render=function(o){var u=this._internalRoot;if(u===null)throw Error(r(409));var h=u.current,m=wr();M2(h,m,o,u,null,null)},_p.prototype.unmount=Gb.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var u=o.containerInfo;M2(o.current,2,null,o,null,null),hp(),u[ks]=null}};function _p(o){this._internalRoot=o}_p.prototype.unstable_scheduleHydration=function(o){if(o){var u=Xk();o={blockedOn:null,target:o,priority:u};for(var h=0;h<Tl.length&&u!==0&&u<Tl[h].priority;h++);Tl.splice(h,0,o),h===0&&j2(o)}};var z2=t.version;if(z2!=="19.2.7")throw Error(r(527,z2,"19.2.7"));G.findDOMNode=function(o){var u=o._reactInternals;if(u===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=f(u),o=o!==null?d(o):null,o=o===null?null:o.stateNode,o};var i9={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Np=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Np.isDisabled&&Np.supportsFiber)try{kc=Np.inject(i9),pr=Np}catch{}}return bf.createRoot=function(o,u){if(!i(o))throw Error(r(299));var h=!1,m="",b=VE,S=KE,E=XE;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(m=u.identifierPrefix),u.onUncaughtError!==void 0&&(b=u.onUncaughtError),u.onCaughtError!==void 0&&(S=u.onCaughtError),u.onRecoverableError!==void 0&&(E=u.onRecoverableError)),u=E2(o,1,!1,null,null,h,m,null,b,S,E,B2),o[ks]=u.current,_b(o),new Gb(u)},bf.hydrateRoot=function(o,u,h){if(!i(o))throw Error(r(299));var m=!1,b="",S=VE,E=KE,_=XE,j=null;return h!=null&&(h.unstable_strictMode===!0&&(m=!0),h.identifierPrefix!==void 0&&(b=h.identifierPrefix),h.onUncaughtError!==void 0&&(S=h.onUncaughtError),h.onCaughtError!==void 0&&(E=h.onCaughtError),h.onRecoverableError!==void 0&&(_=h.onRecoverableError),h.formState!==void 0&&(j=h.formState)),u=E2(o,1,!0,u,h??null,m,b,j,S,E,_,B2),u.context=T2(null),h=u.current,m=wr(),m=Uy(m),b=dl(m),b.callback=null,pl(h,b,m),h=m,u.current.lanes=h,Ec(u,h),Di(u),o[ks]=u.current,_b(o),new _p(u)},bf.version="19.2.7",bf}var Q2;function m9(){if(Q2)return ex.exports;Q2=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(),ex.exports=p9(),ex.exports}var g9=m9();const v9=Ov(g9);var oc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},y9=class extends oc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Ww=new y9,b9={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},x9=class{#e=b9;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},$o=new x9;function S9(e){setTimeout(e,0)}var w9=typeof window>"u"||"Deno"in globalThis;function $n(){}function O9(e,t){return typeof e=="function"?e(t):e}function P1(e){return typeof e=="number"&&e>=0&&e!==1/0}function Gj(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Hl(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function Y2(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:s}=e;if(l){if(r){if(t.queryHash!==Vw(l,t.options))return!1}else if(!ih(t.queryKey,l))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function G2(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ns(t.options.mutationKey)!==ns(a))return!1}else if(!ih(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Vw(e,t){return(t?.queryKeyHashFn||ns)(e)}function ns(e){return JSON.stringify(e,(t,n)=>_1(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function ih(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ih(e[n],t[n])):!1}var A9=Object.prototype.hasOwnProperty;function Zj(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Z2(e)&&Z2(t);if(!r&&!(_1(e)&&_1(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),s=l.length,c=r?new Array(s):{};let f=0;for(let d=0;d<s;d++){const p=r?d:l[d],g=e[p],v=t[p];if(g===v){c[p]=g,(r?d<a:A9.call(e,p))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){c[p]=v;continue}const y=Zj(g,v,n+1);c[p]=y,y===g&&f++}return a===s&&f===a?e:c}function Xm(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Z2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _1(e){if(!J2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!J2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function J2(e){return Object.prototype.toString.call(e)==="[object Object]"}function k9(e){return new Promise(t=>{$o.setTimeout(t,e)})}function N1(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Zj(e,t):t}function C9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function E9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Kw=Symbol();function Jj(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Kw?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Xw(e,t){return typeof e=="function"?e(...t):!!e}function T9(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var ah=(()=>{let e=()=>w9;return{isServer(){return e()},setIsServer(t){e=t}}})();function R1(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var M9=S9;function D9(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=M9;const a=s=>{t?e.push(s):i(()=>{n(s)})},l=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(c=>{n(c)})})})};return{batch:s=>{let c;t++;try{c=s()}finally{t--,t||l()}return c},batchCalls:s=>(...c)=>{a(()=>{s(...c)})},schedule:a,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Gt=D9(),P9=class extends oc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Qm=new P9;function _9(e){return Math.min(1e3*2**e,3e4)}function eI(e){return(e??"online")==="online"?Qm.isOnline():!0}var j1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function tI(e){let t=!1,n=0,r;const i=R1(),a=()=>i.status!=="pending",l=x=>{if(!a()){const w=new j1(x);g(w),e.onCancel?.(w)}},s=()=>{t=!0},c=()=>{t=!1},f=()=>Ww.isFocused()&&(e.networkMode==="always"||Qm.isOnline())&&e.canRun(),d=()=>eI(e.networkMode)&&e.canRun(),p=x=>{a()||(r?.(),i.resolve(x))},g=x=>{a()||(r?.(),i.reject(x))},v=()=>new Promise(x=>{r=w=>{(a()||f())&&x(w)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),y=()=>{if(a())return;let x;const w=n===0?e.initialPromise:void 0;try{x=w??e.fn()}catch(A){x=Promise.reject(A)}Promise.resolve(x).then(p).catch(A=>{if(a())return;const C=e.retry??(ah.isServer()?0:3),k=e.retryDelay??_9,P=typeof k=="function"?k(n,A):k,T=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,A);if(t||!T){g(A);return}n++,e.onFail?.(n,A),k9(P).then(()=>f()?void 0:v()).then(()=>{t?g(A):y()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:d,start:()=>(d()?y():v().then(y),i)}}var nI=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),P1(this.gcTime)&&(this.#e=$o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ah.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&($o.clearTimeout(this.#e),this.#e=void 0)}};function N9(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},c=0;const f=async()=>{let d=!1;const p=y=>{T9(y,()=>t.signal,()=>d=!0)},g=Jj(t.options,t.fetchOptions),v=async(y,x,w)=>{if(d)return Promise.reject(t.signal.reason);if(x==null&&y.pages.length)return Promise.resolve(y);const C=(()=>{const D={client:t.client,queryKey:t.queryKey,pageParam:x,direction:w?"backward":"forward",meta:t.options.meta};return p(D),D})(),k=await g(C),{maxPages:P}=t.options,T=w?E9:C9;return{pages:T(y.pages,k,P),pageParams:T(y.pageParams,x,P)}};if(i&&a.length){const y=i==="backward",x=y?R9:eM,w={pages:a,pageParams:l},A=x(r,w);s=await v(w,A,y)}else{const y=e??a.length;do{const x=c===0?l[0]??r.initialPageParam:eM(r,s);if(c>0&&x==null)break;s=await v(s,x),c++}while(c<y)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function eM(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function R9(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var j9=class extends nI{#e;#t;#n;#r;#a;#i;#o;#l;constructor(e){super(),this.#l=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#r=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=nM(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=nM(this.options);t.data!==void 0&&(this.setState(tM(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=N1(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#s({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then($n).catch($n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Cr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kw||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Hl(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Gj(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#l||this.#c()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#l=!0,n.signal)})},i=()=>{const c=Jj(this.options,t),d=(()=>{const p={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#l=!1,this.options.persister?this.options.persister(c,d,this):c(d)},l=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:i};return r(c),c})();(this.#e==="infinite"?N9(this.options.pages):this.options.behavior)?.onFetch(l,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:"fetch",meta:l.fetchOptions?.meta}),this.#i=tI({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:c=>{c instanceof j1&&c.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(c,f)=>{this.#s({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const c=await this.#i.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#r.config.onSuccess?.(c,this),this.#r.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof j1){if(c.silent)return this.#i.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#r.config.onError?.(c,this),this.#r.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...rI(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...tM(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Gt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function rI(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:eI(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function tM(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function nM(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var I9=class extends oc{constructor(e,t){super(),this.options=t,this.#e=e,this.#l=null,this.#o=R1(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#a;#i;#o;#l;#c;#s;#p;#f;#h;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),rM(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return I1(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return I1(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!Xm(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&iM(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Cr(this.options.enabled,this.#t)!==Cr(t.enabled,this.#t)||Hl(this.options.staleTime,this.#t)!==Hl(t.staleTime,this.#t))&&this.#g();const i=this.#v();r&&(this.#t!==n||Cr(this.options.enabled,this.#t)!==Cr(t.enabled,this.#t)||i!==this.#u)&&this.#y(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return B9(this,n)&&(this.#r=n,this.#i=this.options,this.#a=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch($n)),t}#g(){this.#x();const e=Hl(this.options.staleTime,this.#t);if(ah.isServer()||this.#r.isStale||!P1(e))return;const n=Gj(this.#r.dataUpdatedAt,e)+1;this.#f=$o.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#S(),this.#u=e,!(ah.isServer()||Cr(this.options.enabled,this.#t)===!1||!P1(this.#u)||this.#u===0)&&(this.#h=$o.setInterval(()=>{(this.options.refetchIntervalInBackground||Ww.isFocused())&&this.#d()},this.#u))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#f!==void 0&&($o.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#h!==void 0&&($o.clearInterval(this.#h),this.#h=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#r,a=this.#a,l=this.#i,c=e!==n?e.state:this.#n,{state:f}=e;let d={...f},p=!1,g;if(t._optimisticResults){const I=this.hasListeners(),U=!I&&rM(e,t),K=I&&iM(e,n,t,r);(U||K)&&(d={...d,...rI(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:x}=d;g=d.data;let w=!1;if(t.placeholderData!==void 0&&g===void 0&&x==="pending"){let I;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(I=i.data,w=!0):I=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,I!==void 0&&(x="success",g=N1(i?.data,I,t),p=!0)}if(t.select&&g!==void 0&&!w)if(i&&g===a?.data&&t.select===this.#c)g=this.#s;else try{this.#c=t.select,g=t.select(g),g=N1(i?.data,g,t),this.#s=g,this.#l=null}catch(I){this.#l=I}this.#l&&(v=this.#l,g=this.#s,y=Date.now(),x="error");const A=d.fetchStatus==="fetching",C=x==="pending",k=x==="error",P=C&&A,T=g!==void 0,N={status:x,fetchStatus:d.fetchStatus,isPending:C,isSuccess:x==="success",isError:k,isInitialLoading:P,isLoading:P,data:g,dataUpdatedAt:d.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:A,isRefetching:A&&!C,isLoadingError:k&&!T,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:k&&T,isStale:Qw(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Cr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const I=N.data!==void 0,U=N.status==="error"&&!I,K=ae=>{U?ae.reject(N.error):I&&ae.resolve(N.data)},V=()=>{const ae=this.#o=N.promise=R1();K(ae)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&K(B);break;case"fulfilled":(U||N.data!==B.value)&&V();break;case"rejected":(!U||N.error!==B.reason)&&V();break}}return N}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#i=this.options,this.#a.data!==void 0&&(this.#p=this.#t),Xm(t,e))return;this.#r=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#m.size)return!0;const a=new Set(i??this.#m);return this.options.throwOnError&&a.add("error"),Object.keys(this.#r).some(l=>{const s=l;return this.#r[s]!==e[s]&&a.has(s)})};this.#O({listeners:n()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#O(e){Gt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function L9(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Cr(t.retryOnMount,e)===!1)}function rM(e,t){return L9(e,t)||e.state.data!==void 0&&I1(e,t,t.refetchOnMount)}function I1(e,t,n){if(Cr(t.enabled,e)!==!1&&Hl(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Qw(e,t)}return!1}function iM(e,t,n,r){return(e!==t||Cr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Qw(e,n)}function Qw(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(Hl(t.staleTime,e))}function B9(e,t){return!Xm(e.getCurrentResult(),t)}var z9=class extends nI{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||iI(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#a({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=tI({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#a({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#r.canStart();try{if(r)t();else{this.#a({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#a({type:"pending",context:l,variables:e,isPaused:i})}const a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#a({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#a({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#a(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Gt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function iI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $9=class extends oc{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new z9({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Rp(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Rp(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Rp(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Rp(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Gt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>G2(t,n))}findAll(e={}){return this.getAll().filter(t=>G2(e,t))}notify(e){Gt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Gt.batch(()=>Promise.all(e.map(t=>t.continue().catch($n))))}};function Rp(e){return e.options.scope?.id}var U9=class extends oc{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Xm(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ns(n.mutationKey)!==ns(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#a(){const t=this.#n?.state??iI();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){Gt.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,n,r,i)}catch(a){Promise.reject(a)}try{this.#r.onSettled?.(t.data,null,n,r,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,n,r,i)}catch(a){Promise.reject(a)}try{this.#r.onSettled?.(void 0,t.error,n,r,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#t)})})}},H9=class extends oc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Vw(r,t);let a=this.get(i);return a||(a=new j9({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Gt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Y2(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Y2(e,n)):t}notify(e){Gt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Gt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Gt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},F9=class{#e;#t;#n;#r;#a;#i;#o;#l;constructor(e={}){this.#e=e.queryCache||new H9,this.#t=e.mutationCache||new $9,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=Ww.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=Qm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Hl(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(r.queryHash)?.state.data,l=O9(t,a);if(l!==void 0)return this.#e.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Gt.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Gt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Gt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Gt.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then($n).catch($n)}invalidateQueries(e,t={}){return Gt.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Gt.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch($n)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then($n)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Hl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($n).catch($n)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($n).catch($n)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Qm.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ns(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{ih(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(ns(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{ih(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Vw(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Kw&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},aI=O.createContext(void 0),io=e=>{const t=O.useContext(aI);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},q9=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),M.jsx(aI.Provider,{value:e,children:t})),lI=O.createContext(!1),W9=()=>O.useContext(lI);lI.Provider;function V9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var K9=O.createContext(V9()),X9=()=>O.useContext(K9),Q9=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Xw(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Y9=e=>{O.useEffect(()=>{e.clearReset()},[e])},G9=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Xw(n,[e.error,r])),Z9=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},J9=(e,t)=>e.isLoading&&e.isFetching&&!t,eF=(e,t)=>e?.suspense&&t.isPending,aM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function tF(e,t,n){const r=W9(),i=X9(),a=io(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const s=a.getQueryCache().get(l.queryHash),c=e.subscribed!==!1;l._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Z9(l),Q9(l,i,s),Y9(i);const f=!a.getQueryCache().get(l.queryHash),[d]=O.useState(()=>new t(a,l)),p=d.getOptimisticResult(l),g=!r&&c;if(O.useSyncExternalStore(O.useCallback(v=>{const y=g?d.subscribe(Gt.batchCalls(v)):$n;return d.updateResult(),y},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),O.useEffect(()=>{d.setOptions(l)},[l,d]),eF(l,p))throw aM(l,d,i);if(G9({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:s,suspense:l.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!ah.isServer()&&J9(p,r)&&(f?aM(l,d,i):s?.promise)?.catch($n).finally(()=>{d.updateResult()}),l.notifyOnChangeProps?p:d.trackResult(p)}function Fi(e,t){return tF(e,I9)}function Uu(e,t){const n=io(),[r]=O.useState(()=>new U9(n,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);const i=O.useSyncExternalStore(O.useCallback(l=>r.subscribe(Gt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=O.useCallback((l,s)=>{r.mutate(l,s).catch($n)},[r]);if(i.error&&Xw(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Yw=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,oI=/^[\\/]{2}/;function nF(e,t){return t+e.replace(/\\/g,"/")}var lM="popstate";function oM(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function rF(e={}){function t(r,i){let a=i.state?.masked,{pathname:l,search:s,hash:c}=a||r.location;return L1("",{pathname:l,search:s,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default",a?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:lh(i)}return aF(t,n,null,e)}function Ct(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Zi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function iF(){return Math.random().toString(36).substring(2,10)}function sM(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function L1(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?sc(t):t,state:n,key:t&&t.key||r||iF(),mask:i}}function lh({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function sc(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function aF(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,l=i.history,s="POP",c=null,f=d();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function d(){return(l.state||{idx:null}).idx}function p(){s="POP";let w=d(),A=w==null?null:w-f;f=w,c&&c({action:s,location:x.location,delta:A})}function g(w,A){s="PUSH";let C=oM(w)?w:L1(x.location,w,A);f=d()+1;let k=sM(C,f),P=x.createHref(C.mask||C);try{l.pushState(k,"",P)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(P)}a&&c&&c({action:s,location:x.location,delta:1})}function v(w,A){s="REPLACE";let C=oM(w)?w:L1(x.location,w,A);f=d();let k=sM(C,f),P=x.createHref(C.mask||C);l.replaceState(k,"",P),a&&c&&c({action:s,location:x.location,delta:0})}function y(w){return lF(i,w)}let x={get action(){return s},get location(){return e(i,l)},listen(w){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(lM,p),c=w,()=>{i.removeEventListener(lM,p),c=null}},createHref(w){return t(i,w)},createURL:y,encodeLocation(w){let A=y(w);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:g,replace:v,go(w){return l.go(w)}};return x}function lF(e,t,n=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),Ct(r,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:lh(t);return i=i.replace(/ $/,"%20"),!n&&oI.test(i)&&(i=r+i),new URL(i,r)}function sI(e,t,n="/"){return oF(e,t,n,!1)}function oF(e,t,n,r,i){let a=typeof t=="string"?sc(t):t,l=$a(a.pathname||"/",n);if(l==null)return null;let s=sF(e),c=null,f=bF(l);for(let d=0;c==null&&d<s.length;++d)c=yF(s[d],f,r);return c}function sF(e){let t=uI(e);return uF(t),t}function uI(e,t=[],n=[],r="",i=!1){let a=(l,s,c=i,f)=>{let d={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:s,route:l};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(r)&&c)return;Ct(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length)}let p=mi([r,d.relativePath]),g=n.concat(d);l.children&&l.children.length>0&&(Ct(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),uI(l.children,t,g,p,c)),!(l.path==null&&!l.index)&&t.push({path:p,score:gF(p,l.index),routesMeta:g.map((v,y)=>{let[x,w]=hI(v.relativePath,v.caseSensitive,y===g.length-1);return{...v,matcher:x,compiledParams:w}})})};return e.forEach((l,s)=>{if(l.path===""||!l.path?.includes("?"))a(l,s);else for(let c of cI(l.path))a(l,s,!0,c)}),t}function cI(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let l=cI(r.join("/")),s=[];return s.push(...l.map(c=>c===""?a:[a,c].join("/"))),i&&s.push(...l),s.map(c=>e.startsWith("/")&&c===""?"/":c)}function uF(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:vF(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var cF=/^:[\w-]+$/,fF=3,hF=2,dF=1,pF=10,mF=-2,uM=e=>e==="*";function gF(e,t){let n=e.split("/"),r=n.length;return n.some(uM)&&(r+=mF),t&&(r+=hF),n.filter(i=>!uM(i)).reduce((i,a)=>i+(cF.test(a)?fF:a===""?dF:pF),r)}function vF(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function yF(e,t,n=!1){let{routesMeta:r}=e,i={},a="/",l=[];for(let s=0;s<r.length;++s){let c=r[s],f=s===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",p={path:c.relativePath,caseSensitive:c.caseSensitive,end:f},g=c.matcher&&c.compiledParams?fI(p,d,c.matcher,c.compiledParams):Ym(p,d),v=c.route;if(!g&&f&&n&&!r[r.length-1].route.index&&(g=Ym({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!g)return null;Object.assign(i,g.params),l.push({params:i,pathname:mi([a,g.pathname]),pathnameBase:wF(mi([a,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(a=mi([a,g.pathnameBase]))}return l}function Ym(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=hI(e.path,e.caseSensitive,e.end);return fI(e,t,n,r)}function fI(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],l=a.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((f,{paramName:d,isOptional:p},g)=>{if(d==="*"){let y=s[g]||"";l=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const v=s[g];return p&&!v?f[d]=void 0:f[d]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:l,pattern:e}}function hI(e,t=!1,n=!0){Zi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,c,f,d)=>{if(r.push({paramName:s,isOptional:c!=null}),c){let p=d.charAt(f+l.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function bF(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Zi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function $a(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function xF(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?sc(e):e,a;return n?(n=pI(n),n.startsWith("/")?a=cM(n.substring(1),"/"):a=cM(n,t)):a=t,{pathname:a,search:OF(r),hash:AF(i)}}function cM(e,t){let n=Gm(t).split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function ix(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function SF(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function dI(e){let t=SF(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Gw(e,t,n,r=!1){let i;typeof e=="string"?i=sc(e):(i={...e},Ct(!i.pathname||!i.pathname.includes("?"),ix("?","pathname","search",i)),Ct(!i.pathname||!i.pathname.includes("#"),ix("#","pathname","hash",i)),Ct(!i.search||!i.search.includes("#"),ix("#","search","hash",i)));let a=e===""||i.pathname==="",l=a?"/":i.pathname,s;if(l==null)s=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),p-=1;i.pathname=g.join("/")}s=p>=0?t[p]:"/"}let c=xF(i,s),f=l&&l!=="/"&&l.endsWith("/"),d=(a||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||d)&&(c.pathname+="/"),c}var pI=e=>e.replace(/[\\/]{2,}/g,"/"),mi=e=>pI(e.join("/")),Gm=e=>e.replace(/\/+$/,""),wF=e=>Gm(e).replace(/^\/*/,"/"),OF=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,AF=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,kF=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function CF(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function EF(e){let t=e.map(n=>n.route.path).filter(Boolean);return mi(t)||"/"}var mI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gI(e,t){let n=e;if(typeof n!="string"||!Yw.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(mI)try{let a=new URL(window.location.href),l=oI.test(n)?new URL(nF(n,a.protocol)):new URL(n),s=$a(l.pathname,t);l.origin===a.origin&&s!=null?n=s+l.search+l.hash:i=!0}catch{Zi(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var vI=["POST","PUT","PATCH","DELETE"];new Set(vI);var TF=["GET",...vI];new Set(TF);var MF=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function DF(e){try{return MF.includes(new URL(e).protocol)}catch{return!1}}var uc=O.createContext(null);uc.displayName="DataRouter";var Av=O.createContext(null);Av.displayName="DataRouterState";var yI=O.createContext(!1);function PF(){return O.useContext(yI)}var bI=O.createContext({isTransitioning:!1});bI.displayName="ViewTransition";var _F=O.createContext(new Map);_F.displayName="Fetchers";var NF=O.createContext(null);NF.displayName="Await";var ti=O.createContext(null);ti.displayName="Navigation";var Uh=O.createContext(null);Uh.displayName="Location";var ra=O.createContext({outlet:null,matches:[],isDataRoute:!1});ra.displayName="Route";var Zw=O.createContext(null);Zw.displayName="RouteError";var xI="REACT_ROUTER_ERROR",RF="REDIRECT",jF="ROUTE_ERROR_RESPONSE";function IF(e){if(e.startsWith(`${xI}:${RF}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function LF(e){if(e.startsWith(`${xI}:${jF}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new kF(t.status,t.statusText,t.data)}catch{}}function BF(e,{relative:t}={}){Ct(Hh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=O.useContext(ti),{hash:i,pathname:a,search:l}=Fh(e,{relative:t}),s=a;return n!=="/"&&(s=a==="/"?n:mi([n,a])),r.createHref({pathname:s,search:l,hash:i})}function Hh(){return O.useContext(Uh)!=null}function Ga(){return Ct(Hh(),"useLocation() may be used only in the context of a <Router> component."),O.useContext(Uh).location}var SI="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wI(e){O.useContext(ti).static||O.useLayoutEffect(e)}function kv(){let{isDataRoute:e}=O.useContext(ra);return e?GF():zF()}function zF(){Ct(Hh(),"useNavigate() may be used only in the context of a <Router> component.");let e=O.useContext(uc),{basename:t,navigator:n}=O.useContext(ti),{matches:r}=O.useContext(ra),{pathname:i}=Ga(),a=JSON.stringify(dI(r)),l=O.useRef(!1);return wI(()=>{l.current=!0}),O.useCallback((c,f={})=>{if(Zi(l.current,SI),!l.current)return;if(typeof c=="number"){n.go(c);return}let d=Gw(c,JSON.parse(a),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:mi([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,a,i,e])}O.createContext(null);function Jw(){let{matches:e}=O.useContext(ra);return e[e.length-1]?.params??{}}function Fh(e,{relative:t}={}){let{matches:n}=O.useContext(ra),{pathname:r}=Ga(),i=JSON.stringify(dI(n));return O.useMemo(()=>Gw(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function $F(e,t){return OI(e,t)}function OI(e,t,n){Ct(Hh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=O.useContext(ti),{matches:i}=O.useContext(ra),a=i[i.length-1],l=a?a.params:{},s=a?a.pathname:"/",c=a?a.pathnameBase:"/",f=a&&a.route;{let w=f&&f.path||"";kI(s,!f||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
-
11
- Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let d=Ga(),p;if(t){let w=typeof t=="string"?sc(t):t;Ct(c==="/"||w.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${w.pathname}" was given in the \`location\` prop.`),p=w}else p=d;let g=p.pathname||"/",v=g;if(c!=="/"){let w=c.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=n&&n.state.matches.length?n.state.matches.map(w=>Object.assign(w,{route:n.manifest[w.route.id]||w.route})):sI(e,{pathname:v});Zi(f||y!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Zi(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=WF(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:mi([c,r.encodeLocation?r.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:mi([c,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),i,n);return t&&x?O.createElement(Uh.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},x):x}function UF(){let e=YF(),t=CF(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=O.createElement(O.Fragment,null,O.createElement("p",null,"💿 Hey developer 👋"),O.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",O.createElement("code",{style:a},"ErrorBoundary")," or"," ",O.createElement("code",{style:a},"errorElement")," prop on your route.")),O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},t),n?O.createElement("pre",{style:i},n):null,l)}var HF=O.createElement(UF,null),AI=class extends O.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=LF(e.digest);n&&(e=n)}let t=e!==void 0?O.createElement(ra.Provider,{value:this.props.routeContext},O.createElement(Zw.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?O.createElement(FF,{error:e},t):t}};AI.contextType=yI;var ax=new WeakMap;function FF({children:e,error:t}){let{basename:n}=O.useContext(ti);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=IF(t.digest);if(r){let i=ax.get(t);if(i)throw i;let a=gI(r.location,n),l=a.absoluteURL||a.to;if(DF(l))throw new Error("Invalid redirect location");if(mI&&!ax.get(t))if(a.isExternal||r.reloadDocument)window.location.href=l;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw ax.set(t,s),s}return O.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function qF({routeContext:e,match:t,children:n}){let r=O.useContext(uc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),O.createElement(ra.Provider,{value:e},n)}function WF(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let d=i.findIndex(p=>p.route.id&&a?.[p.route.id]!==void 0);Ct(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,d+1))}let l=!1,s=-1;if(n&&r){l=r.renderFallback;for(let d=0;d<i.length;d++){let p=i[d];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(s=d),p.route.id){let{loaderData:g,errors:v}=r,y=p.route.loader&&!g.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||y){n.isStatic&&(l=!0),s>=0?i=i.slice(0,s+1):i=[i[0]];break}}}}let c=n?.onError,f=r&&c?(d,p)=>{c(d,{location:r.location,params:r.matches?.[0]?.params??{},pattern:EF(r.matches),errorInfo:p})}:void 0;return i.reduceRight((d,p,g)=>{let v,y=!1,x=null,w=null;r&&(v=a&&p.route.id?a[p.route.id]:void 0,x=p.route.errorElement||HF,l&&(s<0&&g===0?(kI("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,w=null):s===g&&(y=!0,w=p.route.hydrateFallbackElement||null)));let A=t.concat(i.slice(0,g+1)),C=()=>{let k;return v?k=x:y?k=w:p.route.Component?k=O.createElement(p.route.Component,null):p.route.element?k=p.route.element:k=d,O.createElement(qF,{match:p,routeContext:{outlet:d,matches:A,isDataRoute:r!=null},children:k})};return r&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?O.createElement(AI,{location:r.location,revalidation:r.revalidation,component:x,error:v,children:C(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:f}):C()},null)}function eO(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function VF(e){let t=O.useContext(uc);return Ct(t,eO(e)),t}function KF(e){let t=O.useContext(Av);return Ct(t,eO(e)),t}function XF(e){let t=O.useContext(ra);return Ct(t,eO(e)),t}function tO(e){let t=XF(e),n=t.matches[t.matches.length-1];return Ct(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function QF(){return tO("useRouteId")}function YF(){let e=O.useContext(Zw),t=KF("useRouteError"),n=tO("useRouteError");return e!==void 0?e:t.errors?.[n]}function GF(){let{router:e}=VF("useNavigate"),t=tO("useNavigate"),n=O.useRef(!1);return wI(()=>{n.current=!0}),O.useCallback(async(i,a={})=>{Zi(n.current,SI),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var fM={};function kI(e,t,n){!t&&!fM[e]&&(fM[e]=!0,Zi(!1,n))}O.memo(ZF);function ZF({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return OI(e,void 0,{manifest:t,state:r,isStatic:i,onError:a})}function If(e){Ct(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function JF({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,useTransitions:l}){Ct(!Hh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),c=O.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:l,future:{}}),[s,i,a,l]);typeof n=="string"&&(n=sc(n));let{pathname:f="/",search:d="",hash:p="",state:g=null,key:v="default",mask:y}=n,x=O.useMemo(()=>{let w=$a(f,s);return w==null?null:{location:{pathname:w,search:d,hash:p,state:g,key:v,mask:y},navigationType:r}},[s,f,d,p,g,v,r,y]);return Zi(x!=null,`<Router basename="${s}"> is not able to match the URL "${f}${d}${p}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:O.createElement(ti.Provider,{value:c},O.createElement(Uh.Provider,{children:t,value:x}))}function eq({children:e,location:t}){return $F(B1(e),t)}function B1(e,t=[]){let n=[];return O.Children.forEach(e,(r,i)=>{if(!O.isValidElement(r))return;let a=[...t,i];if(r.type===O.Fragment){n.push.apply(n,B1(r.props.children,a));return}Ct(r.type===If,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ct(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=B1(r.props.children,a)),n.push(l)}),n}var Mm="get",Dm="application/x-www-form-urlencoded";function Cv(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function tq(e){return Cv(e)&&e.tagName.toLowerCase()==="button"}function nq(e){return Cv(e)&&e.tagName.toLowerCase()==="form"}function rq(e){return Cv(e)&&e.tagName.toLowerCase()==="input"}function iq(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function aq(e,t){return e.button===0&&(!t||t==="_self")&&!iq(e)}var jp=null;function lq(){if(jp===null)try{new FormData(document.createElement("form"),0),jp=!1}catch{jp=!0}return jp}var oq=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function lx(e){return e!=null&&!oq.has(e)?(Zi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dm}"`),null):e}function sq(e,t){let n,r,i,a,l;if(nq(e)){let s=e.getAttribute("action");r=s?$a(s,t):null,n=e.getAttribute("method")||Mm,i=lx(e.getAttribute("enctype"))||Dm,a=new FormData(e)}else if(tq(e)||rq(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||s.getAttribute("action");if(r=c?$a(c,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||Mm,i=lx(e.getAttribute("formenctype"))||lx(s.getAttribute("enctype"))||Dm,a=new FormData(s,e),!lq()){let{name:f,type:d,value:p}=e;if(d==="image"){let g=f?`${f}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else f&&a.append(f,p)}}else{if(Cv(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Mm,r=null,i=Dm,l=e}return a&&i==="text/plain"&&(l=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function nO(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function CI(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&$a(i.pathname,t)==="/"?i.pathname=`${Gm(t)}/_root.${r}`:i.pathname=`${Gm(i.pathname)}.${r}`,i}async function uq(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function cq(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function fq(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let l=await uq(a,n);return l.links?l.links():[]}return[]}));return mq(r.flat(1).filter(cq).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function hM(e,t,n,r,i,a){let l=(c,f)=>n[f]?c.route.id!==n[f].route.id:!0,s=(c,f)=>n[f].pathname!==c.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==c.params["*"];return a==="assets"?t.filter((c,f)=>l(c,f)||s(c,f)):a==="data"?t.filter((c,f)=>{let d=r.routes[c.route.id];if(!d||!d.hasLoader)return!1;if(l(c,f)||s(c,f))return!0;if(c.route.shouldRevalidate){let p=c.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function hq(e,t,{includeHydrateFallback:n}={}){return dq(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function dq(e){return[...new Set(e)]}function pq(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function mq(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(pq(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function rO(){let e=O.useContext(uc);return nO(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function gq(){let e=O.useContext(Av);return nO(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var iO=O.createContext(void 0);iO.displayName="FrameworkContext";function Ev(){let e=O.useContext(iO);return nO(e,"You must render this element inside a <HydratedRouter> element"),e}function vq(e,t){let n=O.useContext(iO),[r,i]=O.useState(!1),[a,l]=O.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:f,onMouseLeave:d,onTouchStart:p}=t,g=O.useRef(null);O.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let x=A=>{A.forEach(C=>{l(C.isIntersecting)})},w=new IntersectionObserver(x,{threshold:.5});return g.current&&w.observe(g.current),()=>{w.disconnect()}}},[e]),O.useEffect(()=>{if(r){let x=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(x)}}},[r]);let v=()=>{i(!0)},y=()=>{i(!1),l(!1)};return n?e!=="intent"?[a,g,{}]:[a,g,{onFocus:xf(s,v),onBlur:xf(c,y),onMouseEnter:xf(f,v),onMouseLeave:xf(d,y),onTouchStart:xf(p,v)}]:[!1,g,{}]}function xf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function yq({page:e,...t}){let n=PF(),{nonce:r}=Ev(),{router:i}=rO(),a=O.useMemo(()=>sI(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?O.createElement(xq,{page:e,matches:a,...t}):O.createElement(Sq,{page:e,matches:a,...t})):null}function bq(e){let{manifest:t,routeModules:n}=Ev(),[r,i]=O.useState([]);return O.useEffect(()=>{let a=!1;return fq(e,t,n).then(l=>{a||i(l)}),()=>{a=!0}},[e,t,n]),r}function xq({page:e,matches:t,...n}){let r=Ga(),{future:i}=Ev(),{basename:a}=rO(),l=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let s=CI(e,a,i.v8_trailingSlashAwareDataRequests,"rsc"),c=!1,f=[];for(let d of t)typeof d.route.shouldRevalidate=="function"?c=!0:f.push(d.route.id);return c&&f.length>0&&s.searchParams.set("_routes",f.join(",")),[s.pathname+s.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return O.createElement(O.Fragment,null,l.map(s=>O.createElement("link",{key:s,rel:"prefetch",as:"fetch",href:s,...n})))}function Sq({page:e,matches:t,...n}){let r=Ga(),{future:i,manifest:a,routeModules:l}=Ev(),{basename:s}=rO(),{loaderData:c,matches:f}=gq(),d=O.useMemo(()=>hM(e,t,f,a,r,"data"),[e,t,f,a,r]),p=O.useMemo(()=>hM(e,t,f,a,r,"assets"),[e,t,f,a,r]),g=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let x=new Set,w=!1;if(t.forEach(C=>{let k=a.routes[C.route.id];!k||!k.hasLoader||(!d.some(P=>P.route.id===C.route.id)&&C.route.id in c&&l[C.route.id]?.shouldRevalidate||k.hasClientLoader?w=!0:x.add(C.route.id))}),x.size===0)return[];let A=CI(e,s,i.v8_trailingSlashAwareDataRequests,"data");return w&&x.size>0&&A.searchParams.set("_routes",t.filter(C=>x.has(C.route.id)).map(C=>C.route.id).join(",")),[A.pathname+A.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,d,t,e,l]),v=O.useMemo(()=>hq(p,a),[p,a]),y=bq(p);return O.createElement(O.Fragment,null,g.map(x=>O.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),v.map(x=>O.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),y.map(({key:x,link:w})=>O.createElement("link",{key:x,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function wq(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Oq=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Oq&&(window.__reactRouterVersion="7.18.1")}catch{}function Aq({basename:e,children:t,useTransitions:n,window:r}){let i=O.useRef();i.current==null&&(i.current=rF({window:r,v5Compat:!0}));let a=i.current,[l,s]=O.useState({action:a.action,location:a.location}),c=O.useCallback(f=>{n===!1?s(f):O.startTransition(()=>s(f))},[n]);return O.useLayoutEffect(()=>a.listen(c),[a,c]),O.createElement(JF,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:a,useTransitions:n})}var gi=O.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:a,replace:l,mask:s,state:c,target:f,to:d,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:v,...y},x){let{basename:w,navigator:A,useTransitions:C}=O.useContext(ti),k=typeof d=="string"&&Yw.test(d),P=gI(d,w);d=P.to;let T=BF(d,{relative:i}),D=Ga(),N=null;if(s){let oe=Gw(s,[],D.mask?D.mask.pathname:"/",!0);w!=="/"&&(oe.pathname=oe.pathname==="/"?w:mi([w,oe.pathname])),N=A.createHref(oe)}let[I,U,K]=vq(r,y),V=Tq(d,{replace:l,mask:s,state:c,target:f,preventScrollReset:p,relative:i,viewTransition:g,defaultShouldRevalidate:v,useTransitions:C});function B(oe){t&&t(oe),oe.defaultPrevented||V(oe)}let ae=!(P.isExternal||a),ie=O.createElement("a",{...y,...K,href:(ae?N:void 0)||P.absoluteURL||T,onClick:ae?B:t,ref:wq(x,U),target:f,"data-discover":!k&&n==="render"?"true":void 0});return I&&!k?O.createElement(O.Fragment,null,ie,O.createElement(yq,{page:T})):ie});gi.displayName="Link";var kq=O.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:a,to:l,viewTransition:s,children:c,...f},d){let p=Fh(l,{relative:f.relative}),g=Ga(),v=O.useContext(Av),{navigator:y,basename:x}=O.useContext(ti),w=v!=null&&Nq(p)&&s===!0,A=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,C=g.pathname,k=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(C=C.toLowerCase(),k=k?k.toLowerCase():null,A=A.toLowerCase()),k&&x&&(k=$a(k,x)||k);const P=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let T=C===A||!i&&C.startsWith(A)&&C.charAt(P)==="/",D=k!=null&&(k===A||!i&&k.startsWith(A)&&k.charAt(A.length)==="/"),N={isActive:T,isPending:D,isTransitioning:w},I=T?t:void 0,U;typeof r=="function"?U=r(N):U=[r,T?"active":null,D?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let K=typeof a=="function"?a(N):a;return O.createElement(gi,{...f,"aria-current":I,className:U,ref:d,style:K,to:l,viewTransition:s},typeof c=="function"?c(N):c)});kq.displayName="NavLink";var Cq=O.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:l=Mm,action:s,onSubmit:c,relative:f,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:g,...v},y)=>{let{useTransitions:x}=O.useContext(ti),w=Pq(),A=_q(s,{relative:f}),C=l.toLowerCase()==="get"?"get":"post",k=typeof s=="string"&&Yw.test(s),P=T=>{if(c&&c(T),T.defaultPrevented)return;T.preventDefault();let D=T.nativeEvent.submitter,N=D?.getAttribute("formmethod")||l,I=()=>w(D||T.currentTarget,{fetcherKey:t,method:N,navigate:n,replace:i,state:a,relative:f,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:g});x&&n!==!1?O.startTransition(()=>I()):I()};return O.createElement("form",{ref:y,method:C,action:A,onSubmit:r?c:P,...v,"data-discover":!k&&e==="render"?"true":void 0})});Cq.displayName="Form";function Eq(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function EI(e){let t=O.useContext(uc);return Ct(t,Eq(e)),t}function Tq(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:l,viewTransition:s,defaultShouldRevalidate:c,useTransitions:f}={}){let d=kv(),p=Ga(),g=Fh(e,{relative:l});return O.useCallback(v=>{if(aq(v,t)){v.preventDefault();let y=n!==void 0?n:lh(p)===lh(g),x=()=>d(e,{replace:y,mask:r,state:i,preventScrollReset:a,relative:l,viewTransition:s,defaultShouldRevalidate:c});f?O.startTransition(()=>x()):x()}},[p,d,g,n,r,i,t,e,a,l,s,c,f])}var Mq=0,Dq=()=>`__${String(++Mq)}__`;function Pq(){let{router:e}=EI("useSubmit"),{basename:t}=O.useContext(ti),n=QF(),r=e.fetch,i=e.navigate;return O.useCallback(async(a,l={})=>{let{action:s,method:c,encType:f,formData:d,body:p}=sq(a,t);if(l.navigate===!1){let g=l.fetcherKey||Dq();await r(g,n,l.action||s,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:p,formMethod:l.method||c,formEncType:l.encType||f,flushSync:l.flushSync})}else await i(l.action||s,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:p,formMethod:l.method||c,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,i,t,n])}function _q(e,{relative:t}={}){let{basename:n}=O.useContext(ti),r=O.useContext(ra);Ct(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...Fh(e||".",{relative:t})},l=Ga();if(e==null){a.search=l.search;let s=new URLSearchParams(a.search),c=s.getAll("index");if(c.some(d=>d==="")){s.delete("index"),c.filter(p=>p).forEach(p=>s.append("index",p));let d=s.toString();a.search=d?`?${d}`:""}}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:mi([n,a.pathname])),lh(a)}function Nq(e,{relative:t}={}){let n=O.useContext(bI);Ct(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=EI("useViewTransitionState"),i=Fh(e,{relative:t});if(!n.isTransitioning)return!1;let a=$a(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=$a(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ym(i.pathname,l)!=null||Ym(i.pathname,a)!=null}var aO=Yj();class oh extends Error{constructor(t,n){super(n),this.status=t}status}async function tr(e,t){const n=await fetch(e,{headers:{"Content-Type":"application/json"},...t});if(!n.ok){let r=n.statusText;try{const i=await n.json();i?.error&&(r=i.error)}catch{}throw new oh(n.status,r)}if(n.status!==204)return n.json()}const qt={health:()=>tr("/api/health"),configs:()=>tr("/api/configs"),config:e=>tr(`/api/configs/${e}`),createConfig:(e,t)=>tr("/api/configs",{method:"POST",body:JSON.stringify({filename:e,content:t})}),updateConfig:(e,t,n)=>tr(`/api/configs/${e}`,{method:"PUT",body:JSON.stringify({content:t,baseHash:n})}),deleteConfig:e=>tr(`/api/configs/${e}`,{method:"DELETE"}),validateConfig:e=>tr("/api/configs/validate",{method:"POST",body:JSON.stringify({content:e})}),triggerRun:e=>tr(`/api/configs/${e}/run`,{method:"POST"}),configStats:(e,t)=>tr(`/api/configs/${e}/stats?days=${t}`),chunksForUrl:(e,t)=>{const n=new URLSearchParams;return n.set("product_name",t.product_name),t.type&&n.set("type",t.type),t.version&&n.set("version",t.version),n.set("url",t.url),tr(`/api/configs/${e}/chunks?${n}`)},runs:(e={})=>{const t=new URLSearchParams;return e.configId!==void 0&&t.set("configId",String(e.configId)),e.status!==void 0&&t.set("status",e.status),e.limit!==void 0&&t.set("limit",String(e.limit)),e.before!==void 0&&t.set("before",String(e.before)),tr(`/api/runs?${t}`)},run:e=>tr(`/api/runs/${e}`),runLogs:(e,t=0,n=1e3)=>tr(`/api/runs/${e}/logs?afterSeq=${t}&limit=${n}`),cancelRun:e=>tr(`/api/runs/${e}/cancel`,{method:"POST"})};var ox={exports:{}},dM;function Rq(){return dM||(dM=1,(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var n={949(l,s,c){Object.defineProperty(s,"__esModule",{value:!0}),s.CronParser=void 0;var f=c(515),d=(function(){function p(g,v,y){v===void 0&&(v=!0),y===void 0&&(y=!1),this.expression=g,this.dayOfWeekStartIndexZero=v,this.monthStartIndexZero=y}return p.prototype.parse=function(){var g,v,y=(g=this.expression)!==null&&g!==void 0?g:"";if(y==="@reboot")return v=["@reboot","","","","","",""],v;if(y.startsWith("@")){var x=this.parseSpecial(this.expression);v=this.extractParts(x)}else v=this.extractParts(this.expression);return this.normalize(v),this.validate(v),v},p.prototype.parseSpecial=function(g){var v={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},y=v[g];if(!y)throw new Error("Unknown special expression.");return y},p.prototype.extractParts=function(g){if(!this.expression)throw new Error("cron expression is empty");for(var v=g.trim().split(/[ ]+/),y=0;y<v.length;y++)if(v[y].includes(",")){var x=v[y].split(",").map(function(A){return A.trim()}).filter(function(A){return A!==""}).map(function(A){return isNaN(Number(A))?A:Number(A)}).filter(function(A){return A!==null&&A!==""});x.length===0&&x.push("*"),x.sort(function(A,C){return A!==null&&C!==null?A-C:0}),v[y]=x.map(function(A){return A!==null?A.toString():""}).join(",")}if(v.length<5)throw new Error("Expression has only ".concat(v.length," part").concat(v.length==1?"":"s",". At least 5 parts are required."));if(v.length==5)v.unshift(""),v.push("");else if(v.length==6){var w=/\d{4}$/.test(v[5])||v[4]=="?"||v[2]=="?";w?v.unshift(""):v.push("")}else if(v.length>7)throw new Error("Expression has ".concat(v.length," parts; too many!"));return v},p.prototype.normalize=function(g){var v=this;if(g[3]=g[3].replace("?","*"),g[5]=g[5].replace("?","*"),g[2]=g[2].replace("?","*"),g[0].indexOf("0/")==0&&(g[0]=g[0].replace("0/","*/")),g[1].indexOf("0/")==0&&(g[1]=g[1].replace("0/","*/")),g[2].indexOf("0/")==0&&(g[2]=g[2].replace("0/","*/")),g[3].indexOf("1/")==0&&(g[3]=g[3].replace("1/","*/")),g[4].indexOf("1/")==0&&(g[4]=g[4].replace("1/","*/")),g[6].indexOf("1/")==0&&(g[6]=g[6].replace("1/","*/")),g[5]=g[5].replace(/(^\d)|([^#/\s]\d)/g,function(T){var D=T.replace(/\D/,""),N=D;return v.dayOfWeekStartIndexZero?D=="7"&&(N="0"):N=(parseInt(D)-1).toString(),T.replace(D,N)}),g[5]=="L"&&(g[5]="6"),g[3]=="?"&&(g[3]="*"),g[3].indexOf("W")>-1&&(g[3].indexOf(",")>-1||g[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var y={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var x in y)g[5]=g[5].replace(new RegExp(x,"gi"),y[x].toString());g[4]=g[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(T){var D=T.replace(/\D/,""),N=D;return v.monthStartIndexZero&&(N=(parseInt(D)+1).toString()),T.replace(D,N)});var w={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var A in w)g[4]=g[4].replace(new RegExp(A,"gi"),w[A].toString());g[0]=="0"&&(g[0]=""),!/\*|\-|\,|\//.test(g[2])&&(/\*|\//.test(g[1])||/\*|\//.test(g[0]))&&(g[2]+="-".concat(g[2]));for(var C=0;C<g.length;C++)if(g[C].indexOf(",")!=-1&&(g[C]=g[C].split(",").filter(function(T){return T!==""}).join(",")||"*"),g[C]=="*/1"&&(g[C]="*"),g[C].indexOf("/")>-1&&!/^\*|\-|\,/.test(g[C])){var k=null;switch(C){case 4:k="12";break;case 5:k="6";break;case 6:k="9999";break;default:k=null;break}if(k!==null){var P=g[C].split("/");g[C]="".concat(P[0],"-").concat(k,"/").concat(P[1])}}},p.prototype.validate=function(g){var v="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(g[0],v),this.validateOnlyExpectedCharactersFound(g[1],v),this.validateOnlyExpectedCharactersFound(g[2],v),this.validateOnlyExpectedCharactersFound(g[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(g[4],v),this.validateOnlyExpectedCharactersFound(g[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(g[6],v),this.validateAnyRanges(g)},p.prototype.validateAnyRanges=function(g){f.default.secondRange(g[0]),f.default.minuteRange(g[1]),f.default.hourRange(g[2]),f.default.dayOfMonthRange(g[3]),f.default.monthRange(g[4],this.monthStartIndexZero),f.default.dayOfWeekRange(g[5],this.dayOfWeekStartIndexZero)},p.prototype.validateOnlyExpectedCharactersFound=function(g,v){var y=g.match(new RegExp("[^".concat(v,"]+"),"gi"));if(y&&y.length)throw new Error("Expression contains invalid values: '".concat(y.toString(),"'"))},p})();s.CronParser=d},333(l,s,c){Object.defineProperty(s,"__esModule",{value:!0}),s.ExpressionDescriptor=void 0;var f=c(823),d=c(949),p=(function(){function g(v,y){if(this.expression=v,this.options=y,this.expressionParts=new Array(5),!this.options.locale&&g.defaultLocale&&(this.options.locale=g.defaultLocale),!g.locales[this.options.locale]){var x=Object.keys(g.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(x,"'.")),this.options.locale=x}this.i18n=g.locales[this.options.locale],y.use24HourTimeFormat===void 0&&(y.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return g.toString=function(v,y){var x=y===void 0?{}:y,w=x.throwExceptionOnParseError,A=w===void 0?!0:w,C=x.verbose,k=C===void 0?!1:C,P=x.dayOfWeekStartIndexZero,T=P===void 0?!0:P,D=x.monthStartIndexZero,N=D===void 0?!1:D,I=x.use24HourTimeFormat,U=x.trimHoursLeadingZero,K=U===void 0?!1:U,V=x.locale,B=V===void 0?null:V,ae=x.logicalAndDayFields,ie=ae===void 0?!1:ae,oe={throwExceptionOnParseError:A,verbose:k,dayOfWeekStartIndexZero:T,monthStartIndexZero:N,use24HourTimeFormat:I,trimHoursLeadingZero:K,locale:B,logicalAndDayFields:ie};oe.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var z=new g(v,oe);return z.getFullDescription()},g.initialize=function(v,y){y===void 0&&(y="en"),g.specialCharacters=["/","-",",","*"],g.defaultLocale=y,v.load(g.locales)},g.prototype.getFullDescription=function(){var v,y,x="";try{var w=new d.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=w.parse(),this.expressionParts[0]==="@reboot")return((y=(v=this.i18n).atReboot)===null||y===void 0?void 0:y.call(v))||"Run once, at startup";var A=this.getTimeOfDayDescription(),C=this.getDayOfMonthDescription(),k=this.getMonthDescription(),P=this.getDayOfWeekDescription(),T=this.getYearDescription();x+=A+C+P+k+T,x=this.transformVerbosity(x,!!this.options.verbose),x=x.charAt(0).toLocaleUpperCase()+x.substr(1)}catch(D){if(!this.options.throwExceptionOnParseError)x=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(D)}return x},g.prototype.getTimeOfDayDescription=function(){var v=this.expressionParts[0],y=this.expressionParts[1],x=this.expressionParts[2],w="";if(!f.StringUtilities.containsAny(y,g.specialCharacters)&&!f.StringUtilities.containsAny(x,g.specialCharacters)&&!f.StringUtilities.containsAny(v,g.specialCharacters))w+=this.i18n.atSpace()+this.formatTime(x,y,v);else if(!v&&y.indexOf("-")>-1&&!(y.indexOf(",")>-1)&&!(y.indexOf("/")>-1)&&!f.StringUtilities.containsAny(x,g.specialCharacters)){var A=y.split("-");w+=f.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(x,A[0],""),this.formatTime(x,A[1],""))}else if(!v&&x.indexOf(",")>-1&&x.indexOf("-")==-1&&x.indexOf("/")==-1&&!f.StringUtilities.containsAny(y,g.specialCharacters)){var C=x.split(",");w+=this.i18n.at();for(var k=0;k<C.length;k++)w&&(w+=" "),w+=this.formatTime(C[k],y,""),k<C.length-2&&(w+=","),k==C.length-2&&(w+=this.i18n.spaceAnd())}else{var P=this.getSecondsDescription(),T=this.getMinutesDescription(),D=this.getHoursDescription();if(w+=P,w&&T&&(w+=", "),w+=T,T===D)return w;w&&D&&(w+=", "),w+=D}return w},g.prototype.getSecondsDescription=function(){var v=this,y=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(x){return x},function(x){return f.StringUtilities.format(v.i18n.everyX0Seconds(x),x)},function(x){return v.i18n.secondsX0ThroughX1PastTheMinute()},function(x){return x=="0"?"":parseInt(x)<20?v.i18n.atX0SecondsPastTheMinute(x):v.i18n.atX0SecondsPastTheMinuteGt20()||v.i18n.atX0SecondsPastTheMinute(x)});return y},g.prototype.getMinutesDescription=function(){var v=this,y=this.expressionParts[0],x=this.expressionParts[2],w=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(A){return A},function(A){return f.StringUtilities.format(v.i18n.everyX0Minutes(A),A)},function(A){return v.i18n.minutesX0ThroughX1PastTheHour()},function(A){var C,k;try{return A=="0"&&x.indexOf("/")==-1&&y==""?v.i18n.everyHour():A=="0"?((k=(C=v.i18n).onTheHour)===null||k===void 0?void 0:k.call(C))||v.i18n.atX0MinutesPastTheHour(A):parseInt(A)<20?v.i18n.atX0MinutesPastTheHour(A):v.i18n.atX0MinutesPastTheHourGt20()||v.i18n.atX0MinutesPastTheHour(A)}catch{return v.i18n.atX0MinutesPastTheHour(A)}});return w},g.prototype.getHoursDescription=function(){var v=this,y=this.expressionParts[2],x=0,w=[];y.split("/")[0].split(",").forEach(function(k){var P=k.split("-");P.length===2&&w.push({value:P[1],index:x+1}),x+=P.length});var A=0,C=this.getSegmentDescription(y,this.i18n.everyHour(),function(k){var P=w.find(function(D){return D.value===k&&D.index===A}),T=P&&v.expressionParts[1]!=="0";return A++,T?v.formatTime(k,"59",""):v.formatTime(k,"0","")},function(k){return f.StringUtilities.format(v.i18n.everyX0Hours(k),k)},function(k){return v.i18n.betweenX0AndX1()},function(k){return v.i18n.atX0()});return C},g.prototype.getDayOfWeekDescription=function(){var v=this,y=this.i18n.daysOfTheWeek(),x=null;return this.expressionParts[5]=="*"?x="":x=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(w,A){var C=w;w.indexOf("#")>-1?C=w.substring(0,w.indexOf("#")):w.indexOf("L")>-1&&(C=C.replace("L",""));var k=parseInt(C),P=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(A)[k]:y[k];if(w.indexOf("#")>-1){var T=null,D=w.substring(w.indexOf("#")+1),N=w.substring(0,w.indexOf("#"));switch(D){case"1":T=v.i18n.first(N);break;case"2":T=v.i18n.second(N);break;case"3":T=v.i18n.third(N);break;case"4":T=v.i18n.fourth(N);break;case"5":T=v.i18n.fifth(N);break}P=T+" "+P}return P},function(w){return parseInt(w)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0DaysOfTheWeek(w),w)},function(w){var A=w.substring(0,w.indexOf("-")),C=v.expressionParts[3]!="*";return C?v.i18n.commaAndX0ThroughX1(A):v.i18n.commaX0ThroughX1(A)},function(w){var A=null;if(w.indexOf("#")>-1){var C=w.substring(w.indexOf("#")+1),k=w.substring(0,w.indexOf("#"));A=v.i18n.commaOnThe(C,k).trim()+v.i18n.spaceX0OfTheMonth()}else if(w.indexOf("L")>-1)A=v.i18n.commaOnTheLastX0OfTheMonth(w.replace("L",""));else{var P=v.expressionParts[3]!="*";P?v.options.logicalAndDayFields?A=v.i18n.commaOnlyOnX0(w):A=v.i18n.commaAndOnX0():A=v.i18n.commaOnlyOnX0(w)}return A}),x},g.prototype.getMonthDescription=function(){var v=this,y=this.i18n.monthsOfTheYear(),x=this.getSegmentDescription(this.expressionParts[4],"",function(w,A){return A&&v.i18n.monthsOfTheYearInCase?v.i18n.monthsOfTheYearInCase(A)[parseInt(w)-1]:y[parseInt(w)-1]},function(w){return parseInt(w)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0Months(w),w)},function(w){return v.i18n.commaMonthX0ThroughMonthX1()||v.i18n.commaX0ThroughX1()},function(w){return v.i18n.commaOnlyInMonthX0?v.i18n.commaOnlyInMonthX0():v.i18n.commaOnlyInX0()});return x},g.prototype.getDayOfMonthDescription=function(){var v=this,y=null,x=this.expressionParts[3];switch(x){case"L":y=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":y=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var w=x.match(/(\d{1,2}W)|(W\d{1,2})/);if(w){var A=parseInt(w[0].replace("W","")),C=A==1?this.i18n.firstWeekday():f.StringUtilities.format(this.i18n.weekdayNearestDayX0(),A.toString());y=f.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),C);break}else{var k=x.match(/L-(\d{1,2})/);if(k){var P=k[1];y=f.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(P),P);break}else{if(x=="*"&&this.expressionParts[5]!="*")return"";y=this.getSegmentDescription(x,this.i18n.commaEveryDay(),function(T){return T=="L"?v.i18n.lastDay():v.i18n.dayX0?f.StringUtilities.format(v.i18n.dayX0(),T):T},function(T){return T=="1"?v.i18n.commaEveryDay():v.i18n.commaEveryX0Days(T)},function(T){return v.i18n.commaBetweenDayX0AndX1OfTheMonth(T)},function(T){return v.i18n.commaOnDayX0OfTheMonth(T)})}break}}return y},g.prototype.getYearDescription=function(){var v=this,y=this.getSegmentDescription(this.expressionParts[6],"",function(x){return/^\d+$/.test(x)?new Date(parseInt(x),1).getFullYear().toString():x},function(x){return f.StringUtilities.format(v.i18n.commaEveryX0Years(x),x)},function(x){return v.i18n.commaYearX0ThroughYearX1()||v.i18n.commaX0ThroughX1()},function(x){return v.i18n.commaOnlyInYearX0?v.i18n.commaOnlyInYearX0():v.i18n.commaOnlyInX0()});return y},g.prototype.getSegmentDescription=function(v,y,x,w,A,C){var k=null,P=v.indexOf("/")>-1,T=v.indexOf("-")>-1,D=v.indexOf(",")>-1;if(!v)k="";else if(v==="*")k=y;else if(!P&&!T&&!D)k=f.StringUtilities.format(C(v),x(v));else if(D){for(var N=v.split(","),I="",U=this.i18n.spaceAnd(),K=0;K<N.length;K++)if(K>0&&N.length>2&&(I+=",",K<N.length-1&&(I+=" ")),K>0&&N.length>1&&(K==N.length-1||N.length==2)&&(I+=U==","&&N.length>2?" ":"".concat(U," ")),N[K].indexOf("/")>-1||N[K].indexOf("-")>-1){var V=N[K].indexOf("-")>-1&&N[K].indexOf("/")==-1,B=this.getSegmentDescription(N[K],y,x,w,V?this.i18n.commaX0ThroughX1:A,C);V&&(B=B.replace(", ","")),I+=B}else if(!P)I+=x(N[K]);else{var ae=this.getSegmentDescription(N[K],y,x,w,A,C);ae&&ae.startsWith(", ")&&(ae=ae.substring(2)),I+=ae}P?k=I:k=f.StringUtilities.format(C(v),I)}else if(P){var N=v.split("/");if(k=f.StringUtilities.format(w(N[1]),N[1]),N[0].indexOf("-")>-1){var ie=this.generateRangeSegmentDescription(N[0],A,x);ie.indexOf(", ")!=0&&(k+=", "),k+=ie}else if(N[0].indexOf("*")==-1){var oe=f.StringUtilities.format(C(N[0]),x(N[0]));oe=oe.replace(", ",""),k+=f.StringUtilities.format(this.i18n.commaStartingX0(),oe)}}else T&&(k=this.generateRangeSegmentDescription(v,A,x));return k},g.prototype.generateRangeSegmentDescription=function(v,y,x){var w="",A=v.split("-"),C=x(A[0],1),k=x(A[1],2),P=y(v);return w+=f.StringUtilities.format(P,C,k),w},g.prototype.formatTime=function(v,y,x){var w=0,A=0,C=parseInt(v)+w,k=parseInt(y)+A;k>=60?(k-=60,C+=1):k<0&&(k+=60,C-=1),C>=24?C=C-24:C<0&&(C=24+C);var P="",T=!1;this.options.use24HourTimeFormat||(T=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),P=T?"".concat(this.getPeriod(C)," "):" ".concat(this.getPeriod(C)),C>12&&(C-=12),C===0&&(C=12));var D="";x&&(D=":".concat(("00"+x).substring(x.length)));var N=C.toString(),I=("00"+N).substring(N.length),U=k.toString(),K=("00"+U).substring(U.length),V=this.options.trimHoursLeadingZero?N:I;return"".concat(T?P:"").concat(V,":").concat(K).concat(D).concat(T?"":P)},g.prototype.transformVerbosity=function(v,y){if(!y&&(v=v.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),v=v.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),v=v.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),v=v.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var x=0,w=Object.entries(this.i18n.conciseVerbosityReplacements());x<w.length;x++){var A=w[x],C=A[0],k=A[1];v=v.replace(new RegExp(C,"g"),k)}return v},g.prototype.getPeriod=function(v){return v>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},g.locales={},g})();s.ExpressionDescriptor=p},747(l,s,c){Object.defineProperty(s,"__esModule",{value:!0}),s.enLocaleLoader=void 0;var f=c(486),d=(function(){function p(){}return p.prototype.load=function(g){g.en=new f.en},p})();s.enLocaleLoader=d},486(l,s){Object.defineProperty(s,"__esModule",{value:!0}),s.en=void 0;var c=(function(){function f(){}return f.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},f.prototype.atX0MinutesPastTheHourGt20=function(){return null},f.prototype.commaMonthX0ThroughMonthX1=function(){return null},f.prototype.commaYearX0ThroughYearX1=function(){return null},f.prototype.use24HourTimeFormatByDefault=function(){return!1},f.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},f.prototype.everyMinute=function(){return"every minute"},f.prototype.everyHour=function(){return"every hour"},f.prototype.atSpace=function(){return"At "},f.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},f.prototype.at=function(){return"At"},f.prototype.spaceAnd=function(){return" and"},f.prototype.everySecond=function(){return"every second"},f.prototype.everyX0Seconds=function(){return"every %s seconds"},f.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},f.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},f.prototype.everyX0Minutes=function(){return"every %s minutes"},f.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},f.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},f.prototype.everyX0Hours=function(){return"every %s hours"},f.prototype.betweenX0AndX1=function(){return"between %s and %s"},f.prototype.atX0=function(){return"at %s"},f.prototype.commaEveryDay=function(){return", every day"},f.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},f.prototype.commaX0ThroughX1=function(){return", %s through %s"},f.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},f.prototype.first=function(){return"first"},f.prototype.second=function(){return"second"},f.prototype.third=function(){return"third"},f.prototype.fourth=function(){return"fourth"},f.prototype.fifth=function(){return"fifth"},f.prototype.commaOnThe=function(){return", on the "},f.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},f.prototype.lastDay=function(){return"the last day"},f.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},f.prototype.commaOnlyOnX0=function(){return", only on %s"},f.prototype.commaAndOnX0=function(){return", and on %s"},f.prototype.commaEveryX0Months=function(){return", every %s months"},f.prototype.commaOnlyInX0=function(){return", only in %s"},f.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},f.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},f.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},f.prototype.firstWeekday=function(){return"first weekday"},f.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},f.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},f.prototype.commaEveryX0Days=function(){return", every %s days in a month"},f.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},f.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},f.prototype.commaEveryHour=function(){return", every hour"},f.prototype.commaEveryX0Years=function(){return", every %s years"},f.prototype.commaStartingX0=function(){return", starting %s"},f.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},f.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},f.prototype.atReboot=function(){return"Run once, at startup"},f.prototype.onTheHour=function(){return"on the hour"},f})();s.en=c},515(l,s){Object.defineProperty(s,"__esModule",{value:!0});function c(d,p){if(!d)throw new Error(p)}var f=(function(){function d(){}return d.secondRange=function(p){for(var g=p.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var y=parseInt(g[v],10);c(y>=0&&y<=59,"seconds part must be >= 0 and <= 59")}},d.minuteRange=function(p){for(var g=p.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var y=parseInt(g[v],10);c(y>=0&&y<=59,"minutes part must be >= 0 and <= 59")}},d.hourRange=function(p){for(var g=p.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var y=parseInt(g[v],10);c(y>=0&&y<=23,"hours part must be >= 0 and <= 23")}},d.dayOfMonthRange=function(p){for(var g=p.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var y=parseInt(g[v],10);c(y>=1&&y<=31,"DOM part must be >= 1 and <= 31")}},d.monthRange=function(p,g){for(var v=p.split(","),y=0;y<v.length;y++)if(!isNaN(parseInt(v[y],10))){var x=parseInt(v[y],10);c(x>=1&&x<=12,g?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},d.dayOfWeekRange=function(p,g){for(var v=p.split(","),y=0;y<v.length;y++)if(!isNaN(parseInt(v[y],10))){var x=parseInt(v[y],10);c(x>=0&&x<=6,g?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},d})();s.default=f},823(l,s){Object.defineProperty(s,"__esModule",{value:!0}),s.StringUtilities=void 0;var c=(function(){function f(){}return f.format=function(d){for(var p=[],g=1;g<arguments.length;g++)p[g-1]=arguments[g];return d.replace(/%s/g,function(v){return p.shift()})},f.containsAny=function(d,p){return p.some(function(g){return d.indexOf(g)>-1})},f})();s.StringUtilities=c}},r={};function i(l){var s=r[l];if(s!==void 0)return s.exports;var c=r[l]={exports:{}};return n[l](c,c.exports,i),c.exports}var a={};return(()=>{var l=a;Object.defineProperty(l,"__esModule",{value:!0}),l.toString=void 0;var s=i(333),c=i(747);s.ExpressionDescriptor.initialize(new c.enLocaleLoader),l.default=s.ExpressionDescriptor;var f=s.ExpressionDescriptor.toString;l.toString=f})(),a})())})(ox)),ox.exports}var jq=Rq();const Iq=Ov(jq);function Hu(e){if(e==null||!isFinite(e))return"—";if(e<1)return"<1s";if(e<60)return`${Math.round(e)}s`;const t=Math.floor(e/60);return t<60?`${t}m ${Math.round(e%60)}s`:`${Math.floor(t/60)}h ${t%60}m`}function lO(e,t){if(!e)return"—";const n=t?new Date(t).getTime():Date.now();return Hu((n-new Date(e).getTime())/1e3)}function Ua(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function z1(e){if(!e)return"—";const t=new Date(e).getTime()-Date.now(),n=Math.abs(t),r=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});return n<6e4?r.format(Math.round(t/1e3),"second"):n<36e5?r.format(Math.round(t/6e4),"minute"):n<864e5?r.format(Math.round(t/36e5),"hour"):r.format(Math.round(t/864e5),"day")}function oO(e){if(!e)return"Manual only";try{return Iq.toString(e,{verbose:!1})}catch{return e}}const pM={succeeded:{label:"Succeeded",symbol:"✓",className:"text-good-text border-good/40"},failed:{label:"Failed",symbol:"✕",className:"text-critical border-critical/40"},running:{label:"Running",symbol:"●",className:"text-accent border-accent/40 animate-pulse"},queued:{label:"Queued",symbol:"…",className:"text-ink-secondary border-edge"},skipped:{label:"Skipped",symbol:"≫",className:"text-warning border-warning/40"},canceled:{label:"Canceled",symbol:"⊘",className:"text-ink-muted border-edge"}};function Tv({status:e}){const t=pM[e]??pM.queued;return M.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full border bg-surface px-2.5 py-0.5 text-xs font-medium ${t.className}`,children:[M.jsx("span",{"aria-hidden":!0,children:t.symbol}),t.label]})}var Ke=Symbol("NOT_RESOLVED"),sO=Symbol("MERGE_KEY");function Pn(e,t){return{tagName:e,nodeKind:"scalar",implicit:t.implicit??!1,matchByTagPrefix:t.matchByTagPrefix??!1,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify??null,represent:t.represent??(n=>String(n)),representTagName:t.representTagName??null}}function uO(e,t){const n=t.finalize===void 0;return{tagName:e,nodeKind:"sequence",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addItem:t.addItem,finalize:t.finalize??(r=>r),carrierIsResult:n,identify:t.identify??null,represent:t.represent??(r=>r),representTagName:t.representTagName??null}}function Mv(e,t){const n=t.finalize===void 0;return{tagName:e,nodeKind:"mapping",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??(r=>r),carrierIsResult:n,identify:t.identify??null,represent:t.represent??(r=>r),representTagName:t.representTagName??null}}var Lq=Pn("tag:yaml.org,2002:str",{resolve:e=>e,identify:e=>typeof e=="string"}),Bq=["","~","null","Null","NULL"],zq=Pn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>Bq.indexOf(e)!==-1?null:Ke,identify:e=>e===null,represent:()=>"null"}),$q=Pn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(e,t)=>e==="null"||t&&e===""?null:Ke,identify:e=>e===null,represent:()=>"null"}),Uq=["","~","null","Null","NULL"],Hq=Pn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>Uq.indexOf(e)!==-1?null:Ke,identify:e=>e===null,represent:()=>"null"}),Fq=["true","True","TRUE"],qq=["false","False","FALSE"],Wq=Pn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:e=>Fq.indexOf(e)!==-1?!0:qq.indexOf(e)!==-1?!1:Ke,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),Vq=["true"],Kq=["false"],Xq=Pn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:e=>Vq.indexOf(e)!==-1?!0:Kq.indexOf(e)!==-1?!1:Ke,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),Qq=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],Yq=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],Gq=Pn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:e=>Qq.indexOf(e)!==-1?!0:Yq.indexOf(e)!==-1?!1:Ke,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),Zq=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),Jq=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function eW(e){let t=e,n=1;return(t[0]==="-"||t[0]==="+")&&(t[0]==="-"&&(n=-1),t=t.slice(1)),t.startsWith("0b")?n*parseInt(t.slice(2),2):t.startsWith("0o")?n*parseInt(t.slice(2),8):t.startsWith("0x")?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function tW(e,t){if(t){if(!Jq.test(e))return Ke}else if(!Zq.test(e))return Ke;const n=eW(e);return Number.isFinite(n)?n:Ke}var TI=Pn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:tW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),nW=new RegExp("^-?(?:0|[1-9][0-9]*)$"),rW=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function iW(e){let t=e,n=1;return(t[0]==="-"||t[0]==="+")&&(t[0]==="-"&&(n=-1),t=t.slice(1)),t.startsWith("0b")?n*parseInt(t.slice(2),2):t.startsWith("0o")?n*parseInt(t.slice(2),8):t.startsWith("0x")?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function aW(e,t){if(t){if(!rW.test(e))return Ke}else if(!nW.test(e))return Ke;const n=iW(e);return Number.isFinite(n)?n:Ke}var lW=Pn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:aW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),oW=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");function sW(e){let t=e.replace(/_/g,""),n=1;if((t[0]==="-"||t[0]==="+")&&(t[0]==="-"&&(n=-1),t=t.slice(1)),t.startsWith("0b"))return n*parseInt(t.slice(2),2);if(t.startsWith("0x"))return n*parseInt(t.slice(2),16);if(t.includes(":")){let r=0;for(const i of t.split(":"))r=r*60+Number(i);return n*r}return t!=="0"&&t[0]==="0"?n*parseInt(t,8):n*parseInt(t,10)}function uW(e){if(!oW.test(e))return Ke;const t=sW(e);return Number.isFinite(t)?t:Ke}var $1=Pn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:uW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),cW=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),fW=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function hW(e){if(!cW.test(e))return Ke;let t=e.toLowerCase();const n=t[0]==="-"?-1:1;if("+-".includes(t[0])&&(t=t.slice(1)),t===".inf")return n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;const r=n*parseFloat(t);return Number.isFinite(r)||fW.test(e)?r:Ke}function dW(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var MI=Pn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:hW,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:dW}),pW=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),mW=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function gW(e,t){if(t){if(!mW.test(e))return Ke;let r=e.toLowerCase();const i=r[0]==="-"?-1:1;if("+-".includes(r[0])&&(r=r.slice(1)),r===".inf")return i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(r===".nan")return NaN;const a=i*parseFloat(r);return Number.isFinite(a)?a:Ke}if(!pW.test(e))return Ke;const n=Number(e);return Number.isFinite(n)?n:Ke}function vW(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var yW=Pn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:gW,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:vW}),bW=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),xW=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function SW(e){if(!bW.test(e))return Ke;let t=e.toLowerCase().replace(/_/g,"");const n=t[0]==="-"?-1:1;if("+-".includes(t[0])&&(t=t.slice(1)),t===".inf")return n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let r=0;if(t.includes(":")){for(const i of t.split(":"))r=r*60+Number(i);r*=n}else r=n*parseFloat(t);return Number.isFinite(r)||xW.test(e)?r:Ke}function wW(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var U1=Pn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:SW,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:wW}),OW=Pn("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(e,t)=>e==="<<"||t&&e===""?sO:Ke}),AW=/^[A-Za-z0-9+/]*={0,2}$/;function kW(e){const t=e.replace(/\s/g,"");if(t.length%4!==0||!AW.test(t))return Ke;const n=atob(t),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r}function CW(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}var EW=Pn("tag:yaml.org,2002:binary",{resolve:kW,identify:e=>Object.prototype.toString.call(e)==="[object Uint8Array]",represent:CW}),TW=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),MW=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function DW(e){let t=TW.exec(e);if(t===null&&(t=MW.exec(e)),t===null)return Ke;const n=+t[1],r=+t[2]-1,i=+t[3];if(!t[4]){const d=new Date(Date.UTC(n,r,i));return d.getUTCFullYear()!==n||d.getUTCMonth()!==r||d.getUTCDate()!==i?Ke:d}const a=+t[4],l=+t[5],s=+t[6];let c=0;if(a>23||l>59||s>59)return Ke;if(t[7]){let d=t[7].slice(0,3);for(;d.length<3;)d+="0";c=+d}const f=new Date(Date.UTC(n,r,i,a,l,s,c));if(f.getUTCFullYear()!==n||f.getUTCMonth()!==r||f.getUTCDate()!==i)return Ke;if(t[9]){const d=+t[10],p=+(t[11]||0);if(d>23||p>59)return Ke;const g=(d*60+p)*6e4;f.setTime(f.getTime()-(t[9]==="-"?-g:g))}return f}var PW=Pn("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:DW,identify:e=>e instanceof Date,represent:e=>e.toISOString()}),_W=uO("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});function Dv(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function H1(e,t){const n={};for(const r of t)e[r]!==void 0&&(n[r]=e[r]);return n}var NW=uO("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let n;if(t instanceof Map){if(t.size!==1)return"cannot resolve an ordered map item";n=t.keys().next().value}else if(Dv(t)){const r=Object.keys(t);if(r.length!==1)return"cannot resolve an ordered map item";n=r[0]}else return"cannot resolve an ordered map item";return e.seen.has(n)?"duplicate key in ordered map":(e.seen.add(n),e.list.push(t),"")},finalize:e=>e.list}),RW=uO("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(e,t)=>{if(t instanceof Map)return t.size!==1?"cannot resolve a pairs item":(e.push(t.entries().next().value),"");if(Object.prototype.toString.call(t)!=="[object Object]")return"cannot resolve a pairs item";const n=t,r=Object.keys(n);return r.length!==1?"cannot resolve a pairs item":(e.push([r[0],n[r[0]]]),"")}}),jW=Mv("tag:yaml.org,2002:map",{create:()=>({}),identify:Dv,represent:e=>{const t=new Map;for(const n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{if(t!==null&&typeof t=="object")return"object-based map does not support complex keys";const r=String(t);return r==="__proto__"?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,""},has:(e,t)=>t!==null&&typeof t=="object"?!1:Object.prototype.hasOwnProperty.call(e,String(t)),keys:e=>Object.keys(e),get:(e,t)=>e[String(t)]}),IW=Mv("tag:yaml.org,2002:set",{create:()=>new Set,identify:e=>e instanceof Set,represent:e=>{const t=new Map;for(const n of e)t.set(n,null);return t},addPair:(e,t,n)=>n!==null?"cannot resolve a set item":(e.add(t),""),has:(e,t)=>e.has(t),keys:e=>e.keys(),get:()=>null});function LW(){return{scalar:{},sequence:{},mapping:{}}}function BW(){return{scalar:[],sequence:[],mapping:[]}}function zW(e){const t=[];for(const n of e){let r=t.length;for(let i=0;i<t.length;i++){const a=t[i];if(a.nodeKind===n.nodeKind&&a.tagName===n.tagName&&a.matchByTagPrefix===n.matchByTagPrefix){r=i;break}}t[r]=n}return t}var Pv=class DI{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(t){const n=zW(t),r=[],i=LW(),a=BW();for(const d of n){if(d.nodeKind==="scalar"&&d.implicit){if(d.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");r.push(d)}switch(d.nodeKind){case"scalar":d.matchByTagPrefix?a.scalar.push(d):i.scalar[d.tagName]=d;break;case"sequence":d.matchByTagPrefix?a.sequence.push(d):i.sequence[d.tagName]=d;break;case"mapping":d.matchByTagPrefix?a.mapping.push(d):i.mapping[d.tagName]=d;break}}const l=r.filter(d=>d.implicitFirstChars===null),s=new Set;for(const d of r)if(d.implicitFirstChars!==null)for(const p of d.implicitFirstChars)s.add(p);const c=new Map;for(const d of s)c.set(d,r.filter(p=>p.implicitFirstChars===null||p.implicitFirstChars.indexOf(d)!==-1));const f=i.scalar["tag:yaml.org,2002:str"];if(!f)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=n,this.implicitScalarTags=r,this.implicitScalarByFirstChar=c,this.implicitScalarAnyFirstChar=l,this.defaultScalarTag=f,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=a}withTags(...t){let n=[];for(const r of t)n=n.concat(r);return new DI([...this.tags,...n])}},cO=new Pv([Lq,_W,jW]);new Pv([...cO.tags,$q,Xq,lW,yW]);var $W=new Pv([...cO.tags,zq,Wq,TI,MI]),UW=new Pv([...cO.tags,Hq,Gq,$1,U1,PW,OW,EW,NW,RW,IW]);Mv("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(e,t,n)=>(e.set(t,n),""),has:(e,t)=>e.has(t),keys:e=>e.keys(),get:(e,t)=>e.get(t),identify:e=>e instanceof Map||Dv(e),represent:e=>{if(e instanceof Map)return e;const t=new Map,n=e;for(const r of Object.keys(n))t.set(r,n[r]);return t}});function mM(e){if(Array.isArray(e)){const t=Array.prototype.slice.call(e);for(let n=0;n<t.length;n++){if(Array.isArray(t[n]))return null;typeof t[n]=="object"&&Object.prototype.toString.call(t[n])==="[object Object]"&&(t[n]="[object Object]")}return String(t)}return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"?"[object Object]":String(e)}Mv("tag:yaml.org,2002:map",{create:()=>({}),identify:Dv,represent:e=>{const t=new Map;for(const n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{const r=mM(t);return r===null?"nested arrays are not supported inside keys":(r==="__proto__"?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,"")},has:(e,t)=>{const n=mM(t);return n!==null&&Object.prototype.hasOwnProperty.call(e,n)},keys:e=>Object.keys(e),get:(e,t)=>e[String(t)]});var HW={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function sx(e,t,n,r,i){let a="",l="";const s=Math.floor(i/2)-1;return r-t>s&&(a=" ... ",t=r-s+a.length),n-r>s&&(l=" ...",n=r+s-l.length),{str:a+e.slice(t,n).replace(/\t/g,"→")+l,pos:r-t+a.length}}function ux(e,t){return" ".repeat(Math.max(t-e.length,0))+e}function FW(e,t){if(!e.buffer)return null;const n={...HW,...t},r=/\r?\n|\r|\0/g,i=[0],a=[];let l,s=-1;for(;l=r.exec(e.buffer);)a.push(l.index),i.push(l.index+l[0].length),e.position<=l.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);let c="";const f=Math.min(e.line+n.linesAfter,a.length).toString().length,d=n.maxLength-(n.indent+f+3);for(let g=1;g<=n.linesBefore&&!(s-g<0);g++){const v=sx(e.buffer,i[s-g],a[s-g],e.position-(i[s]-i[s-g]),d);c=`${" ".repeat(n.indent)}${ux((e.line-g+1).toString(),f)} | ${v.str}
12
- ${c}`}const p=sx(e.buffer,i[s],a[s],e.position,d);c+=`${" ".repeat(n.indent)}${ux((e.line+1).toString(),f)} | ${p.str}
13
- `,c+=`${"-".repeat(n.indent+f+3+p.pos)}^
14
- `;for(let g=1;g<=n.linesAfter&&!(s+g>=a.length);g++){const v=sx(e.buffer,i[s+g],a[s+g],e.position-(i[s]-i[s+g]),d);c+=`${" ".repeat(n.indent)}${ux((e.line+g+1).toString(),f)} | ${v.str}
15
- `}return c.replace(/\n$/,"")}function gM(e,t){let n="";return e.mark?(e.mark.name&&(n+=`in "${e.mark.name}" `),n+=`(${e.mark.line+1}:${e.mark.column+1})`,!t&&e.mark.snippet&&(n+=`
16
-
17
- ${e.mark.snippet}`),`${e.reason} ${n}`):e.reason}var sh=class extends Error{reason;mark;constructor(e,t){super(),this.name="YAMLException",this.reason=e,this.mark=t,this.message=gM(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${gM(this,e)}`}};function _v(e,t,n,r=""){let i=0,a=0;for(let s=0;s<t;s++){const c=e.charCodeAt(s);c===10?(i++,a=s+1):c===13&&(i++,e.charCodeAt(s+1)===10&&s++,a=s+1)}const l={name:r,buffer:e,position:t,line:i,column:t-a};throw l.snippet=FW(l),new sh(n,l)}var qW=-1;function vM(e){switch(e){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
18
- `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}var PI=new Array(256),_I=new Array(256);for(let e=0;e<256;e++)PI[e]=vM(e)?1:0,_I[e]=vM(e);function WW(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function VW(e){return e>=48&&e<=57?e-48:(e|32)-97+10}function KW(e){return e===120?2:e===117?4:8}function Zm(e,t,n){let r=0;for(;t<n;){const i=e.charCodeAt(t);if(i===10)r++,t++;else if(i===13)r++,t++,e.charCodeAt(t)===10&&t++;else if(i===32||i===9)t++;else break}return{position:t,breaks:r}}function fO(e){return e===1?" ":`
19
- `.repeat(e-1)}function XW(e,t,n){let r="",i=t,a=t,l=t;for(;i<n;){const s=e.charCodeAt(i);if(s===10||s===13){r+=e.slice(a,l);const c=Zm(e,i,n);r+=fO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,l)}function QW(e,t,n){let r="",i=t,a=t,l=t;for(;i<n;){const s=e.charCodeAt(i);if(s===39)r+=e.slice(a,i)+"'",i+=2,a=l=i;else if(s===10||s===13){r+=e.slice(a,l);const c=Zm(e,i,n);r+=fO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,n)}function YW(e,t,n){let r="",i=t,a=t,l=t;for(;i<n;){const s=e.charCodeAt(i);if(s===92){r+=e.slice(a,i),i++;const c=e.charCodeAt(i);if(c===10||c===13)i=Zm(e,i,n).position;else if(c<256&&PI[c])r+=_I[c],i++;else{let f=KW(c),d=0;for(;f>0;f--){i++;const p=VW(e.charCodeAt(i));d=(d<<4)+p}r+=WW(d),i++}a=l=i}else if(s===10||s===13){r+=e.slice(a,l);const c=Zm(e,i,n);r+=fO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,n)}function yM(e,t,n,r,i,a){const l=r<0?0:r,s=e.slice(t,n).replace(/\r\n?/g,`
20
- `),c=s===""?[]:(s.endsWith(`
21
- `)?s.slice(0,-1):s).split(`
22
- `);let f="",d=!1,p=0,g=!1;for(const v of c){let y=0;for(;y<l&&v.charCodeAt(y)===32;)y++;if(r<0||y>=v.length){p++;continue}const x=v.slice(l),w=x.charCodeAt(0);a?w===32||w===9?(g=!0,f+=`
23
- `.repeat(d?1+p:p)):g?(g=!1,f+=`
24
- `.repeat(p+1)):p===0?d&&(f+=" "):f+=`
25
- `.repeat(p):f+=`
26
- `.repeat(d?1+p:p),f+=x,d=!0,p=0}return i===3?f+=`
27
- `.repeat(d?1+p:p):i!==2&&d&&(f+=`
28
- `),f}function GW(e,t){if(t.valueStart===qW)return"";const{valueStart:n,valueEnd:r}=t;if(t.fast)return e.slice(n,r);switch(t.style){case 2:return QW(e,n,r);case 3:return YW(e,n,r);case 4:return yM(e,n,r,t.indent,t.chomping,!1);case 5:return yM(e,n,r,t.indent,t.chomping,!0);default:return XW(e,n,r)}}var ZW={"!":"!","!!":"tag:yaml.org,2002:"};function cx(e){return encodeURI(e).replace(/!/g,"%21")}function NI(e,t){if(e.startsWith("!<")&&e.endsWith(">"))return decodeURIComponent(e.slice(2,-1));const n=e.indexOf("!",1),r=n===-1?"!":e.slice(0,n+1),i=t?.[r]??ZW[r]??r;return decodeURIComponent(i)+decodeURIComponent(e.slice(r.length))}function RI(e){let t=e;return t.charCodeAt(0)===33?(t=t.slice(1),`!${cx(t)}`):t.slice(0,18)==="tag:yaml.org,2002:"?`!!${cx(t.slice(18))}`:`!<${cx(t)}>`}var Tu=-1,hO={filename:"",schema:$W,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function JW(e){return"tagStart"in e&&e.tagStart!==Tu?e.tagStart:"anchorStart"in e&&e.anchorStart!==Tu?e.anchorStart:"valueStart"in e&&e.valueStart!==Tu?e.valueStart:"start"in e?e.start:0}function fr(e,t){_v(e.source,e.position,t,e.filename)}function jI(e,t,n,r){try{return n.finalize(r)}catch(i){if(i instanceof sh)throw i;_v(e.source,t,i instanceof Error?i.message:String(i),e.filename)}}function Pm(e,t,n){const r=e[n];if(r)return r;for(const i of t)if(n.startsWith(i.tagName))return i}function eV(e,t,n,r,i){const a=Pm(t,n,r);if(a)return a;fr(e,`unknown ${i} tag !<${r}>`)}function tV(e,t){const n=GW(e.source,t),r=t.tagStart===Tu?"":e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(r!==""){if(r==="!")return{value:n,tag:i};const a=NI(r,e.tagHandlers),l=Pm(e.schema.exact.scalar,e.schema.prefix.scalar,a);if(l){const c=l.resolve(n,!0,a);return c===Ke&&fr(e,`cannot resolve a node with !<${a}> explicit tag`),{value:c,tag:l}}const s=Pm(e.schema.exact.mapping,e.schema.prefix.mapping,a)??Pm(e.schema.exact.sequence,e.schema.prefix.sequence,a);if(s){n!==""&&fr(e,`cannot resolve a node with !<${a}> explicit tag`);const c=s.create(a);return{value:s.carrierIsResult?c:jI(e,e.position,s,c),tag:s}}fr(e,`unknown scalar tag !<${a}>`)}if(t.style===1){const a=e.schema.implicitScalarByFirstChar.get(n.charAt(0))??e.schema.implicitScalarAnyFirstChar;for(const l of a){const s=l.resolve(n,!1,l.tagName);if(s!==Ke)return{value:s,tag:l}}}return{value:i.resolve(n,!1,i.tagName),tag:i}}function bM(e,t,n,r,i,a){const l=t.tagStart===Tu?"":e.source.slice(t.tagStart,t.tagEnd),s=l===""||l==="!"?i:NI(l,e.tagHandlers);return{tagName:s,tag:eV(e,n,r,s,a)}}function II(e){return e.nodeKind==="mapping"}function xM(e,t,n,r){for(const i of r.keys(n)){if(e.maxTotalMergeKeys!==-1&&++e.totalMergeKeys>e.maxTotalMergeKeys&&fr(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`),t.tag.has(t.value,i))continue;const a=t.tag.addPair(t.value,i,r.get(n,i));a&&fr(e,a),(t.overridable??=new Set).add(i)}}function nV(e,t,n,r){if(e.position=t.keyPosition,II(r))xM(e,t,n,r);else if(r.nodeKind==="sequence"&&Array.isArray(n))for(const i of n)xM(e,t,i,t.tag);else fr(e,"cannot merge mappings; the provided source object is unacceptable")}function rV(e,t,n,r,i){if(e.position=t.keyPosition,n===sO){nV(e,t,r,i);return}!e.json&&t.tag.has(t.value,n)&&!t.overridable?.has(n)&&fr(e,"duplicated mapping key");const a=t.tag.addPair(t.value,n,r);a&&fr(e,a),t.overridable?.delete(n)}function fx(e,t,n){const r=e.frames[e.frames.length-1];if(r.kind==="document")r.value=t,r.hasValue=!0;else if(r.kind==="sequence"){r.merge&&(II(n)||fr(e,"cannot merge mappings; the provided source object is unacceptable"));const i=r.tag.addItem(r.value,t,r.index++);i&&fr(e,i)}else if(r.hasKey){const i=r.key;r.key=void 0,r.hasKey=!1,rV(e,r,i,t,n)}else r.key=t,r.keyPosition=e.position,r.hasKey=!0}function hx(e,t,n,r,i){if(t.anchorStart!==Tu){const a={value:n,tag:r,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),a),a}return null}function iV(e,t){const n={...hO,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};for(;n.eventIndex<n.events.length;){const r=n.events[n.eventIndex++];switch(n.position=JW(r),r.type){case 1:n.anchors=new Map,n.aliasCount=0,n.tagHandlers=Object.create(null);for(const i of r.directives)i.kind==="tag"&&(n.tagHandlers[i.handle]=i.prefix);n.frames.push({kind:"document",position:n.position,value:void 0,hasValue:!1});break;case 4:{const{value:i,tag:a}=tV(n,r);hx(n,r,i,a,!0),fx(n,i,a);break}case 2:{const i=bM(n,r,n.schema.exact.sequence,n.schema.prefix.sequence,"tag:yaml.org,2002:seq","sequence"),a=i.tag.create(i.tagName),l=hx(n,r,a,i.tag,i.tag.carrierIsResult),s=n.frames[n.frames.length-1],c=s!==void 0&&s.kind==="mapping"&&s.hasKey&&s.key===sO;n.frames.push({kind:"sequence",position:n.position,value:a,tag:i.tag,anchor:l,index:0,merge:c});break}case 3:{const i=bM(n,r,n.schema.exact.mapping,n.schema.prefix.mapping,"tag:yaml.org,2002:map","mapping"),a=i.tag.create(i.tagName),l=hx(n,r,a,i.tag,i.tag.carrierIsResult);n.frames.push({kind:"mapping",position:n.position,value:a,tag:i.tag,anchor:l,key:void 0,keyPosition:n.position,hasKey:!1,overridable:null});break}case 5:{n.maxAliases!==-1&&++n.aliasCount>n.maxAliases&&fr(n,`aliases exceeded maxAliases (${n.maxAliases})`);const i=n.source.slice(r.anchorStart,r.anchorEnd),a=n.anchors.get(i);a||fr(n,`unidentified alias "${i}"`),a.isValueFinal||fr(n,`recursive alias "${i}" is not supported for tag ${a.tag.tagName} because it uses finalize()`),fx(n,a.value,a.tag);break}case 6:{const i=n.frames.pop();if(i.kind==="document")n.documents.push(i.value);else{const a=i.tag.carrierIsResult?i.value:jI(n,i.position,i.tag,i.value);i.anchor&&(i.anchor.value=a,i.anchor.isValueFinal=!0),fx(n,a,i.tag)}break}}}return n.documents}var He=-1,LI=Object.prototype.hasOwnProperty,Bl=1,F1=2,BI=3,Jm=4,aV=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,lV=/[,\[\]{}]/,zI=/^(?:!|!!|![0-9A-Za-z-]+!)$/,q1=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,$I=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,oV=new RegExp(`^(?:${q1})*$`),sV=new RegExp(`^(?:${$I})+$`),uV=new RegExp(`^(?:!(?:${q1})*|${$I}(?:${q1})*)$`),dO={filename:"",maxDepth:100};function cV(e,t,n){e.events.push({type:1,explicitStart:t,explicitEnd:n,directives:e.directives})}function UI(e,t,n,r,i,a,l){e.events.push({type:2,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:l})}function qf(e,t,n,r,i,a,l){e.events.push({type:3,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:l})}function cc(e,t,n,r,i,a,l,s,c=1,f=-1,d=!1){e.events.push({type:4,valueStart:t,valueEnd:n,anchorStart:r,anchorEnd:i,tagStart:a,tagEnd:l,style:s,chomping:c,indent:f,fast:d})}function fV(e,t,n){e.events.push({type:5,anchorStart:t,anchorEnd:n})}function Mu(e){e.events.push({type:6})}function nr(e){cc(e,He,He,He,He,He,He,1)}function SM(){return{anchorStart:He,anchorEnd:He,tagStart:He,tagEnd:He}}function Wf(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function Fl(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.events.length=t.eventsLength}function ke(e,t){_v(e.input.slice(0,e.length),e.position,t,e.filename)}function an(e){return e===10||e===13}function rs(e){return e===9||e===32}function vi(e){return rs(e)||an(e)}function Pa(e){return e===0||vi(e)}function is(e){return e===44||e===91||e===93||e===123||e===125}function hV(e){return e>=48&&e<=57?e-48:-1}function dV(e){if(e>=48&&e<=57)return e-48;const t=e|32;return t>=97&&t<=102?t-97+10:-1}function pV(e){return e===120?2:e===117?4:e===85?8:0}function mV(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function eg(e){e.input.charCodeAt(e.position)===10?e.position++:(e.position++,e.input.charCodeAt(e.position)===10&&e.position++),e.line++,e.lineStart=e.position,e.lineIndent=0,e.firstTabInLine=-1}function Hn(e,t){let n=0,r=e.input.charCodeAt(e.position),i=e.position===e.lineStart||vi(e.input.charCodeAt(e.position-1));for(;r!==0;){for(;rs(r);)i=!0,r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&i&&r===35)do r=e.input.charCodeAt(++e.position);while(!an(r)&&r!==0);if(!an(r))break;for(eg(e),n++,i=!0,r=e.input.charCodeAt(e.position);r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return n}function ql(e,t=e.position){const n=e.input.charCodeAt(t);if((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)){const r=e.input.charCodeAt(t+3);return r===0||vi(r)}return!1}function wM(e){let t=e.input.charCodeAt(e.position);for(;t!==0&&!an(t);)t=e.input.charCodeAt(++e.position)}function HI(e,t,n){aV.test(e.input.slice(t,n))&&ke(e,"the stream contains non-printable characters")}function gV(e,t,n){if(e.input.charCodeAt(e.position)!==33)return!1;t.tagStart!==He&&ke(e,"duplication of a tag property");const r=e.position;let i=!1,a=!1,l="!",s=e.input.charCodeAt(++e.position);s===60?(i=!0,s=e.input.charCodeAt(++e.position)):s===33&&(a=!0,l="!!",s=e.input.charCodeAt(++e.position));let c=e.position,f;if(i){for(;s!==0&&s!==62;)s=e.input.charCodeAt(++e.position);s!==62&&ke(e,"unexpected end of the stream within a verbatim tag"),f=e.input.slice(c,e.position),e.position++}else{for(;s!==0&&!vi(s)&&!(n&&is(s));)s===33&&(a?ke(e,"tag suffix cannot contain exclamation marks"):(l=e.input.slice(c-1,e.position+1),zI.test(l)||ke(e,"named tag handle cannot contain such characters"),a=!0,c=e.position+1)),s=e.input.charCodeAt(++e.position);f=e.input.slice(c,e.position),lV.test(f)&&ke(e,"tag suffix cannot contain flow indicator characters")}return f&&!(i?oV.test(f):sV.test(f))&&ke(e,`tag name cannot contain such characters: ${f}`),!i&&l!=="!"&&l!=="!!"&&!LI.call(e.tagHandlers,l)&&ke(e,`undeclared tag handle "${l}"`),t.tagStart=r,t.tagEnd=e.position,!0}function vV(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;t.anchorStart!==He&&ke(e,"duplication of an anchor property"),e.position++;const n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!vi(e.input.charCodeAt(e.position))&&!is(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&ke(e,"name of an anchor node must contain at least one character"),t.anchorStart=n,t.anchorEnd=e.position,!0}function yV(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;(t.anchorStart!==He||t.tagStart!==He)&&ke(e,"alias node should not have any properties"),e.position++;const n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!vi(e.input.charCodeAt(e.position))&&!is(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&ke(e,"name of an alias node must contain at least one character"),fV(e,n,e.position),!0}function W1(e,t){Hn(e,!1),e.lineIndent<t&&ke(e,"deficient indentation")}function bV(e,t,n){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;const r=e.position;let i=!0;for(;e.input.charCodeAt(e.position)!==0;){const a=e.input.charCodeAt(e.position);if(a===39){if(e.input.charCodeAt(e.position+1)===39){i=!1,e.position+=2;continue}const l=e.position;return e.position++,cc(e,r,l,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,2,1,-1,i),!0}an(a)?(i=!1,W1(e,t)):e.position===e.lineStart&&ql(e)?ke(e,"unexpected end of the document within a single quoted scalar"):a!==9&&a<32?ke(e,"expected valid JSON character"):e.position++}ke(e,"unexpected end of the stream within a single quoted scalar")}function xV(e,t,n){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;const r=e.position;let i=!0;for(;e.input.charCodeAt(e.position)!==0;){const a=e.input.charCodeAt(e.position);if(a===34){const l=e.position;return e.position++,cc(e,r,l,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,3,1,-1,i),!0}if(a===92){i=!1;const l=e.input.charCodeAt(++e.position);if(an(l))W1(e,t);else if(mV(l))e.position++;else{let s=pV(l);for(s===0&&ke(e,"unknown escape sequence");s-- >0;)e.position++,dV(e.input.charCodeAt(e.position))<0&&ke(e,"expected hexadecimal character");e.position++}}else an(a)?(i=!1,W1(e,t)):e.position===e.lineStart&&ql(e)?ke(e,"unexpected end of the document within a double quoted scalar"):a!==9&&a<32?ke(e,"expected valid JSON character"):e.position++}ke(e,"unexpected end of the stream within a double quoted scalar")}function SV(e,t,n){const r=e.input.charCodeAt(e.position);let i=1,a=-1,l=!1;if(r!==124&&r!==62)return!1;const s=r===124?4:5;for(e.position++;e.input.charCodeAt(e.position)!==0;){const v=e.input.charCodeAt(e.position),y=hV(v);if(v===43||v===45)i!==1&&ke(e,"repeat of a chomping mode identifier"),i=v===43?3:2,e.position++;else if(y>=0)y===0&&ke(e,"bad explicit indentation width of a block scalar; it cannot be less than one"),l&&ke(e,"repeat of an indentation width identifier"),a=t+y-1,l=!0,e.position++;else break}let c=!1;for(;rs(e.input.charCodeAt(e.position));)c=!0,e.position++;c&&e.input.charCodeAt(e.position)===35&&wM(e),an(e.input.charCodeAt(e.position))?eg(e):e.input.charCodeAt(e.position)!==0&&ke(e,"a line break is expected");let f=l?a:-1,d=0;const p=e.position;let g=e.position;for(;e.input.charCodeAt(e.position)!==0;){const v=e.position;let y=0;for(;e.input.charCodeAt(v+y)===32;)y++;const x=e.input.charCodeAt(v+y);if(x===0){f>=0?y>f&&(g=v+y):y>0&&(g=v+y);break}if(v===e.lineStart&&ql(e,v))break;if(!l&&f===-1&&an(x)&&(d=Math.max(d,y)),!l&&f===-1&&!an(x)&&(x===9&&y<t&&(e.position=v+y,ke(e,"tab characters must not be used in indentation")),y<d&&(e.position=v+y,ke(e,"bad indentation of a mapping entry"))),f===-1&&x!==0&&!an(x)&&y<t){e.lineIndent=y,e.position=v+y;break}!l&&x!==0&&!an(x)&&f===-1&&(f=y);const w=f===-1?t+1:f;if(x!==0&&!an(x)&&y<w){e.lineIndent=y,e.position=v+y;break}wM(e),g=e.position,an(e.input.charCodeAt(e.position))&&(eg(e),g=e.position)}return HI(e,p,g),cc(e,p,g,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,s,i,f),!0}function wV(e,t){const n=e.input.charCodeAt(e.position),r=t===Bl;if(n===0||vi(n)||n===35||n===38||n===42||n===33||n===124||n===62||n===39||n===34||n===37||n===64||n===96||r&&is(n))return!1;if(n===63||n===45){const i=e.input.charCodeAt(e.position+1);if(Pa(i)||r&&is(i))return!1}return!0}function OV(e,t,n,r){if(!wV(e,n))return!1;const i=e.position;let a=e.position,l=e.input.charCodeAt(e.position);const s=n===Bl;let c=!1;for(;l!==0&&!(e.position===e.lineStart&&ql(e));){if(l===58){const f=e.input.charCodeAt(e.position+1);if(Pa(f)||s&&is(f))break}else if(l===35){if(vi(e.input.charCodeAt(e.position-1)))break}else{if(s&&is(l))break;if(an(l)){const f=e.position,d=e.line,p=e.lineStart,g=e.lineIndent;if(Hn(e,!1),e.lineIndent>=t){c=!0,l=e.input.charCodeAt(e.position);continue}e.position=f,e.line=d,e.lineStart=p,e.lineIndent=g;break}}rs(l)||(a=e.position+1),l=e.input.charCodeAt(++e.position)}return a===i?!1:(HI(e,i,a),cc(e,i,a,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1,1,-1,!c),!0)}function Eo(e,t){const n=e.line;Hn(e,!0),(e.line>n&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)&&ke(e,"deficient indentation")}function AV(e,t,n){const r=e.input.charCodeAt(e.position),i=r===123,a=e.position;let l=!0;if(r!==91&&r!==123)return!1;const s=i?125:93;for(i?qf(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,2):UI(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,2),e.position++;e.input.charCodeAt(e.position)!==0;){Eo(e,t);let c=e.input.charCodeAt(e.position);if(c===s)return e.position++,Mu(e),!0;l?c===44&&ke(e,"expected the node content, but found ','"):ke(e,"missed comma between flow collection entries");let f=!1,d=!1;c===63&&vi(e.input.charCodeAt(e.position+1))&&(f=d=!0,e.position+=1,Eo(e,t));const p=e.line,g=Wf(e),v=_a(e,t,Bl,!1,!0);Eo(e,t),c=e.input.charCodeAt(e.position),(i||d||e.line===p)&&c===58?(f=!0,e.position++,Eo(e,t),i?v||nr(e):(Fl(e,g),qf(e,g.position,He,He,He,He,2),_a(e,t,Bl,!1,!0)||nr(e),Eo(e,t),e.position++,Eo(e,t)),_a(e,t,Bl,!1,!0)||nr(e),Eo(e,t),i||Mu(e)):i&&f?(v||nr(e),nr(e)):i?nr(e):f&&(Fl(e,g),qf(e,g.position,He,He,He,He,2),_a(e,t,Bl,!1,!0),nr(e),Mu(e)),c=e.input.charCodeAt(e.position),c===44?(l=!0,e.position++):l=!1}ke(e,"unexpected end of the stream within a flow collection")}function OM(e,t,n){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!Pa(e.input.charCodeAt(e.position+1)))return!1;for(UI(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,1);e.input.charCodeAt(e.position)===45&&Pa(e.input.charCodeAt(e.position+1));){e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,ke(e,"tab characters must not be used in indentation"));const r=e.line;e.position++;const i=Hn(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&Pa(e.input.charCodeAt(e.position+1))&&ke(e,"bad indentation of a sequence entry"),i&&e.lineIndent<=t?nr(e):_a(e,t,BI,!1,!0),Hn(e,!0),e.lineIndent<t||e.position>=e.length)break;e.lineIndent>t&&ke(e,"bad indentation of a sequence entry"),e.line===r&&e.input.charCodeAt(e.position)===45&&Pa(e.input.charCodeAt(e.position+1))&&ke(e,"bad indentation of a sequence entry")}return Mu(e),!0}function dx(e,t,n,r){let i=!1,a=!1,l=!1,s=!1;if(e.firstTabInLine!==-1)return!1;let c=e.input.charCodeAt(e.position);for(;c!==0;){!i&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,ke(e,"tab characters must not be used in indentation"));const f=e.input.charCodeAt(e.position+1),d=e.line;if((c===63||c===58)&&Pa(f))l||(qf(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1),l=!0),c===63?(i&&nr(e),a=!0,i=!0):(i||(nr(e),a=!0),i=!1),e.position+=1,s=!0;else{i&&(nr(e),i=!1);const p=Wf(e);if(!_a(e,n,F1,!1,!0))break;if(e.line===d){for(c=e.input.charCodeAt(e.position);rs(c);)c=e.input.charCodeAt(++e.position);if(c===58){if(c=e.input.charCodeAt(++e.position),Pa(c)||ke(e,"a whitespace character is expected after the key-value separator within a block mapping"),!l){for(Fl(e,p),qf(e,p.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1),l=!0,_a(e,n,F1,!1,!0),c=e.input.charCodeAt(e.position);rs(c);)c=e.input.charCodeAt(++e.position);e.position++}a=!0,i=!1,s=!1}else if(a)ke(e,"expected ':' after a mapping key");else return r.anchorStart!==He||r.tagStart!==He?(Fl(e,p),!1):!0}else if(a)ke(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return r.anchorStart!==He||r.tagStart!==He?(Fl(e,p),!1):!0}if(_a(e,t,Jm,!0,s)&&(s=!1),i||s&&(nr(e),s=!1),Hn(e,!0),c=e.input.charCodeAt(e.position),(e.line===d||e.lineIndent>t)&&c!==0)ke(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return a?(i&&nr(e),l&&Mu(e),!0):!1}function _a(e,t,n,r,i,a=!0){e.depth>=e.maxDepth&&ke(e,`nesting exceeded maxDepth (${e.maxDepth})`),e.depth++;let l=1,s=!1,c=!1,f=null;const d=SM();let p=n===Jm||n===BI,g=p;const v=p;if(r&&Hn(e,!0)&&(s=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:l=-1),e.position===e.lineStart&&ql(e))return e.depth--,!1;if(l===1)for(;;){const y=e.input.charCodeAt(e.position),x=Wf(e);if(s&&l!==1&&(y===33||y===38))break;if(s&&v&&(d.tagStart!==He||d.anchorStart!==He)&&(y===33||y===38)){const w=Wf(e),A=t+1;if(dx(e,e.position-e.lineStart,A,d)&&e.events[w.eventsLength]?.type===3)return e.depth--,!0;Fl(e,w)}if(s&&(y===33&&d.tagStart!==He||y===38&&d.anchorStart!==He)||!gV(e,d,n===Bl)&&!vV(e,d))break;f===null&&(f=x),Hn(e,!0)?(s=!0,g=v,e.lineIndent>t?l=1:e.lineIndent===t?l=0:l=-1):g=!1}if(g&&(g=s||i),l===1||n===Jm){const y=n===Bl||n===F1?t:t+1,x=e.position-e.lineStart;if(l===1)if(g&&(OM(e,x,d)||dx(e,x,y,d))||AV(e,y,d))c=!0;else{const w=e.input.charCodeAt(e.position);if(f!==null&&a&&v&&!g&&w!==124&&w!==62){const A=Wf(e),C=f.position-f.lineStart;Fl(e,f),dx(e,C,y,SM())&&e.events[A.eventsLength]?.type===3?c=!0:Fl(e,A)}!c&&(p&&SV(e,y,d)||bV(e,y,d)||xV(e,y,d)||yV(e,d)||OV(e,y,n,d))&&(c=!0)}else l===0&&(c=g&&OM(e,x,d))}return p=p&&!c,!c&&(d.anchorStart!==He||d.tagStart!==He||p)&&(cc(e,He,He,d.anchorStart,d.anchorEnd,d.tagStart,d.tagEnd,1),c=!0),e.depth--,c||d.anchorStart!==He||d.tagStart!==He}function kV(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;const t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!vi(e.input.charCodeAt(e.position));)e.position++;const n=e.input.slice(t,e.position),r=[];for(n.length===0&&ke(e,"directive name must not be less than one character in length");e.input.charCodeAt(e.position)!==0&&!an(e.input.charCodeAt(e.position));){for(;rs(e.input.charCodeAt(e.position));)e.position++;if(e.input.charCodeAt(e.position)===35||an(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;const i=e.position;for(;e.input.charCodeAt(e.position)!==0&&!vi(e.input.charCodeAt(e.position));)e.position++;r.push(e.input.slice(i,e.position))}if(an(e.input.charCodeAt(e.position))&&eg(e),n==="YAML"){e.directives.some(a=>a.kind==="yaml")&&ke(e,"duplication of %YAML directive"),r.length!==1&&ke(e,"YAML directive accepts exactly one argument");const i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]);i===null&&ke(e,"ill-formed argument of the YAML directive"),parseInt(i[1],10)!==1&&ke(e,"unacceptable YAML version of the document"),e.directives.push({kind:"yaml",version:r[0]})}else if(n==="TAG"){r.length!==2&&ke(e,"TAG directive accepts exactly two arguments");const[i,a]=r;zI.test(i)||ke(e,"ill-formed tag handle (first argument) of the TAG directive"),LI.call(e.tagHandlers,i)&&ke(e,`there is a previously declared suffix for "${i}" tag handle`),uV.test(a)||ke(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagHandlers[i]=a,e.directives.push({kind:"tag",handle:i,prefix:a})}return!0}function CV(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;for(Hn(e,!0);kV(e);)t=!0,Hn(e,!0);let n=!1,r=!1,i=!0;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&Pa(e.input.charCodeAt(e.position+3))){n=!0;const s=e.line;e.position+=3,Hn(e,!0),i=e.line>s}else t&&ke(e,"directives end mark is expected");const a=e.events.length;if(!n&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&ql(e)){e.position+=3,Hn(e,!0);return}if(cV(e,n,!1),_a(e,e.lineIndent-1,Jm,!1,i,i)||nr(e),Hn(e,!0),e.position===e.lineStart&&ql(e)&&(r=e.input.charCodeAt(e.position)===46,r)){const s=e.line;e.position+=3,Hn(e,!0),e.line===s&&e.position<e.length&&ke(e,"end of the stream or a document separator is expected")}const l=e.events[a];l?.type===1&&(l.explicitEnd=r),Mu(e),!r&&e.position<e.length&&!(e.position===e.lineStart&&ql(e))&&ke(e,"end of the stream or a document separator is expected")}function EV(e,t){const n=e.length,r={...dO,...t,input:`${e}\0`,length:n,position:0,line:0,lineStart:0,lineIndent:0,firstTabInLine:-1,depth:0,directives:[],tagHandlers:Object.create(null),events:[]},i=e.indexOf("\0");for(i!==-1&&_v(e,i,"null byte is not allowed in input",r.filename),r.input.charCodeAt(r.position)===65279&&r.position++;r.position<r.length&&(Hn(r,!0),!(r.position>=r.length));){const a=r.position;CV(r),r.position===a&&ke(r,"can not read a document")}return r.events}var TV={...dO,...hO};function MV(e,t={}){const n={...TV,...t},r=String(e),i=Object.keys(dO),a=Object.keys(hO);return iV(EV(r,H1(n,i)),{...H1(n,a),source:r})}function DV(e,t){const n=MV(e,t);if(n.length===0)throw new sh("expected a document, but the input is empty");if(n.length===1)return n[0];throw new sh("expected a single document in the stream, but found more")}var Ip=class{tagged=!1;flow=!1;singleQuoted=!1;doubleQuoted=!1;literal=!1;folded=!1},No=Symbol("INVALID");function PV(e){const t=new Set([e.defaultScalarTag,e.defaultSequenceTag,e.defaultMappingTag].filter(a=>a!==void 0)),n=e.implicitScalarTags,r=e.tags.filter(a=>!(a.nodeKind==="scalar"&&a.implicit)&&!t.has(a)),i=e.tags.filter(a=>t.has(a));return[...n.map(a=>({tag:a,implicitTag:!0})),...r.map(a=>({tag:a,implicitTag:!1})),...i.map(a=>({tag:a,implicitTag:!0}))]}function _V(e,t){for(let n=0,r=e.representTypes.length;n<r;n+=1){const{tag:i,implicitTag:a}=e.representTypes[n];if(i.identify&&i.identify(t)){let l;return i.matchByTagPrefix&&i.representTagName?l=i.representTagName(t):l=i.tagName,{tag:i,tagName:l,implicitTag:a}}}return null}function Lf(e,t){if(!e.noRefs&&t!==null&&typeof t=="object"){const d=e.refs.get(t);if(d)return d.anchor===void 0&&(d.anchor=`ref_${e.refCounter++}`),{kind:"alias",tag:"",style:new Ip,anchor:d.anchor}}const n=_V(e,t);if(!n){if(t===void 0||e.skipInvalid)return No;throw new sh(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`)}const{tag:r,tagName:i,implicitTag:a}=n,l=a?i:RI(i);if(r.nodeKind==="scalar"){const d=new Ip;return d.tagged=!a,{kind:"scalar",tag:l,style:d,value:r.represent(t)}}if(r.nodeKind==="sequence"){const d=r.represent(t),p=new Ip;p.tagged=!a;const g={kind:"sequence",tag:l,style:p,items:[]};e.noRefs||e.refs.set(t,g);for(let v=0,y=d.length;v<y;v+=1){let x=Lf(e,d[v]);x===No&&d[v]===void 0&&(x=Lf(e,null)),x!==No&&g.items.push(x)}return g}const s=r.represent(t),c=new Ip;c.tagged=!a;const f={kind:"mapping",tag:l,style:c,items:[]};e.noRefs||e.refs.set(t,f);for(const[d,p]of s){const g=Lf(e,d);if(g===No)continue;const v=Lf(e,p);v!==No&&f.items.push({key:g,value:v})}return f}function NV(e,t,n={}){const r=Lf({representTypes:PV(t),noRefs:n.noRefs??!1,skipInvalid:n.skipInvalid??!1,refs:new Map,refCounter:0},e);return[{contents:r===No?null:r,directives:[]}]}var RV=Symbol("visit:break"),FI=Symbol("visit:skip");function _m(e,t,n){const r=t(e,n);if(r===RV)return!0;if(r===FI)return!1;const i=n.depth+1;switch(e.kind){case"sequence":for(const a of e.items)if(_m(a,t,{depth:i,parent:e,isKey:!1}))return!0;break;case"mapping":for(const{key:a,value:l}of e.items)if(_m(a,t,{depth:i,parent:e,isKey:!0})||_m(l,t,{depth:i,parent:e,isKey:!1}))return!0;break}return!1}function jV(e,t){for(const n of e)if(n.contents&&_m(n.contents,t,{depth:0,parent:null,isKey:!1}))return}var pO=65279,IV=9,as=10,qI=13,LV=32,BV=33,WI=34,V1=35,zV=37,$V=38,VI=39,UV=42,KI=44,mO=45,uh=58,HV=61,FV=62,XI=63,qV=64,QI=91,YI=93,WV=96,GI=123,VV=124,ZI=125,_n={};_n[0]="\\0";_n[7]="\\a";_n[8]="\\b";_n[9]="\\t";_n[10]="\\n";_n[11]="\\v";_n[12]="\\f";_n[13]="\\r";_n[27]="\\e";_n[34]='\\"';_n[92]="\\\\";_n[133]="\\N";_n[160]="\\_";_n[8232]="\\L";_n[8233]="\\P";var gO={indent:2,seqNoIndent:!1,seqInlineFirst:!0,sortKeys:!1,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,tagBeforeAnchor:!1};function KV(e){return e.style.tagged?e.tag:RI(e.tag)}function XV(e){const t={...gO,...e};return{...t,defaultScalarTagName:t.schema.defaultScalarTag.tagName,implicitResolvers:t.schema.implicitScalarTags}}function QV(e){const t=e.toString(16).toUpperCase(),n=e<=255?"x":"u",r=e<=255?2:4;return`\\${n}${"0".repeat(r-t.length)}${t}`}function AM(e,t){const n=" ".repeat(t);let r=0,i="";const a=e.length;for(;r<a;){let l;const s=e.indexOf(`
29
- `,r);s===-1?(l=e.slice(r),r=a):(l=e.slice(r,s+1),r=s+1),l.length&&l!==`
30
- `&&(i+=n),i+=l}return i}function K1(e,t){return`
31
- ${" ".repeat(e.indent*t)}`}function YV(e,t){const n=e.indent*Math.max(1,t);return{indent:n,blockIndent:t===0?e.indent+1:e.indent,lineWidth:e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-n)}}function kM(e,t){for(let n=0,r=e.implicitResolvers.length;n<r;n+=1){const i=e.implicitResolvers[n];if(i.resolve(t,!1,i.tagName)!==Ke)return i.tagName}return e.defaultScalarTagName}function Fu(e){return e===LV||e===IV}function GV(e){const t=e.charCodeAt(0);if(t!==mO&&t!==46||e.charCodeAt(1)!==t||e.charCodeAt(2)!==t)return!1;if(e.length===3)return!0;const n=e.charCodeAt(3);return Fu(n)||n===qI||n===as}function ch(e){return e>=32&&e<=126||e>=161&&e<=55295&&e!==8232&&e!==8233||e>=57344&&e<=65533&&e!==pO||e>=65536&&e<=1114111}function CM(e){return ch(e)&&e!==pO&&e!==qI&&e!==as}function X1(e,t,n){const r=CM(e),i=r&&!Fu(e);return(n?r:r&&e!==KI&&e!==QI&&e!==YI&&e!==GI&&e!==ZI)&&e!==V1&&!(t===uh&&!i)||CM(t)&&!Fu(t)&&e===V1||t===uh&&i}function ZV(e){return ch(e)&&e!==pO&&!Fu(e)&&e!==mO&&e!==XI&&e!==uh&&e!==KI&&e!==QI&&e!==YI&&e!==GI&&e!==ZI&&e!==V1&&e!==$V&&e!==UV&&e!==BV&&e!==VV&&e!==HV&&e!==FV&&e!==VI&&e!==WI&&e!==zV&&e!==qV&&e!==WV}function JV(e,t){const n=Du(e,0);if(ZV(n))return!0;if(e.length>1&&(n===mO||n===XI||n===uh)){const r=Du(e,1);return!Fu(r)&&X1(r,n,t)}return!1}function e7(e){return!Fu(e)&&e!==uh}function Du(e,t){const n=e.charCodeAt(t);let r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function JI(e){return/^\n* /.test(e)}var fh=1,Vf=2,vO=3,yO=4,zl=5;function t7(e,t,n,r,i,a){const{blockIndent:l,lineWidth:s}=n;let c,f=0,d=-1,p=!1,g=!1;const v=s!==-1;let y=-1,x=!GV(t)&&JV(t,a)&&e7(Du(t,t.length-1));if(r||i)for(c=0;c<t.length;f>=65536?c+=2:c++){if(f=Du(t,c),!ch(f))return zl;x=x&&X1(f,d,a),d=f}else{for(c=0;c<t.length;f>=65536?c+=2:c++){if(f=Du(t,c),f===as)p=!0,v&&(g=g||c-y-1>s&&t[y+1]!==" ",y=c);else if(!ch(f))return zl;x=x&&X1(f,d,a),d=f}g=g||v&&c-y-1>s&&t[y+1]!==" "}return!p&&!g?x&&!i?fh:e.quoteStyle==="double"?zl:Vf:l>9&&JI(t)?zl:g?yO:vO}function n7(e,t,n){const{indent:r,blockIndent:i,lineWidth:a}=n;switch(t){case fh:return TM(e,r);case Vf:return`'${TM(e,r).replace(/'/g,"''")}'`;case vO:return"|"+EM(e,i)+MM(AM(e,r));case yO:return">"+EM(e,i)+MM(AM(i7(e,a),r));case zl:return`"${a7(e)}"`}}function r7(e,t,n,r,i){const a=r||!i;if(t.style.singleQuoted)return Vf;if(t.style.doubleQuoted)return zl;if(!a){if(t.style.literal)return vO;if(t.style.folded)return yO}const l=t.value;if(l.length===0)return t.style.tagged||kM(e,l)===t.tag?fh:e.quoteStyle==="double"?zl:Vf;const s=t7(e,l,n,a,e.forceQuotes&&!r,i);return s===fh&&!t.style.tagged&&kM(e,l)!==t.tag?e.quoteStyle==="double"?zl:Vf:s}function EM(e,t){const n=JI(e)?String(t):"",r=e[e.length-1]===`
32
- `;return`${n}${r&&(e[e.length-2]===`
33
- `||e===`
34
- `)?"+":r?"":"-"}
35
- `}function TM(e,t){let n=e.indexOf(`
36
- `);if(n===-1)return e;const r=" ".repeat(t);let i=e.slice(0,n);const a=/(\n+)([^\n]*)/g;a.lastIndex=n;let l;for(;l=a.exec(e);){const s=l[1].length,c=l[2];i+=`
37
- `.repeat(s+1)+r+c}return i}function MM(e){return e[e.length-1]===`
38
- `?e.slice(0,-1):e}function i7(e,t){const n=/(\n+)([^\n]*)/g;let r=e.indexOf(`
39
- `);r===-1&&(r=e.length),n.lastIndex=r;let i=DM(e.slice(0,r),t),a=e[0]===`
40
- `||e[0]===" ",l,s;for(;s=n.exec(e);){const c=s[1],f=s[2];l=f[0]===" ",i+=c+(!a&&!l&&f!==""?`
41
- `:"")+DM(f,t),a=l}return i}function DM(e,t){if(e===""||e[0]===" ")return e;const n=/ [^ ]/g;let r,i=0,a,l=0,s=0,c="";for(;r=n.exec(e);)s=r.index,s-i>t&&(a=l>i?l:s,c+=`
42
- ${e.slice(i,a)}`,i=a+1),l=s;return c+=`
43
- `,e.length-i>t&&l>i?c+=`${e.slice(i,l)}
44
- ${e.slice(l+1)}`:c+=e.slice(i),c.slice(1)}function a7(e){let t="",n=0;for(let r=0;r<e.length;n>=65536?r+=2:r++){n=Du(e,r);const i=_n[n];if(i){t+=i;continue}if(ch(n)){t+=e[r],n>=65536&&(t+=e[r+1]);continue}t+=QV(n)}return t}function l7(e,t,n){let r="";for(let a=0,l=n.items.length;a<l;a+=1){const s=Ia(e,t,n.items[a],{});r!==""&&(r+=`,${e.flowSkipCommaSpace?"":" "}`),r+=s}const i=e.flowBracketPadding&&r!==""?" ":"";return`[${i}${r}${i}]`}function PM(e,t,n,r){let i="";for(let a=0,l=n.items.length;a<l;a+=1){const s=Ia(e,t+1,n.items[a],{block:!0,compact:e.seqInlineFirst,isblockseq:!0});(!r||i!=="")&&(i+=K1(e,t)),s===""||as===s.charCodeAt(0)?i+="-":i+="- ",i+=s}return i}function o7(e,t,n){let r="";const i=eL(e,n.items);for(const{key:l,value:s}of i){let c="";r!==""&&(c+=`,${e.flowSkipCommaSpace?"":" "}`);const f=Ia(e,t,l,{iskey:!0}),d=f.length>1024;d?c+="? ":e.quoteFlowKeys&&(c+='"');const p=Ia(e,t,s,{}),g=e.flowSkipColonSpace||p===""?"":" ";c+=`${f}${e.quoteFlowKeys&&!d?'"':""}:${g}${p}`,r+=c}const a=e.flowBracketPadding&&r!==""?" ":"";return`{${a}${r}${a}}`}function Lp(e){return e.kind==="scalar"?e.value:e}function eL(e,t){if(!e.sortKeys)return t;const n=t.slice();if(e.sortKeys===!0)n.sort((r,i)=>{const a=Lp(r.key),l=Lp(i.key);return a<l?-1:a>l?1:0});else{const r=e.sortKeys;n.sort((i,a)=>r(Lp(i.key),Lp(a.key)))}return n}function s7(e,t,n,r){let i="";const a=eL(e,n.items);for(let l=0,s=a.length;l<s;l+=1){let c="";(!r||i!=="")&&(c+=K1(e,t));const{key:f,value:d}=a[l],p=(f.kind==="mapping"||f.kind==="sequence")&&!f.style.flow&&f.items.length!==0||f.kind==="scalar"&&(f.style.literal||f.style.folded),g=p?Ia(e,t+1,f,{block:!0,compact:!0,isblockseq:!Q1(e,f,t+1)}):Ia(e,t+1,f,{block:!0,compact:!0,iskey:!0}),v=f.kind==="scalar"&&f.value.indexOf(`
45
- `)!==-1,y=p||v||g.length>1024;y&&(g&&as===g.charCodeAt(0)?c+="?":c+="? "),c+=g,y&&(c+=K1(e,t));const x=Ia(e,t+1,d,{block:!0,compact:y,isblockseq:y&&!Q1(e,d,t+1)}),w=f.kind==="scalar"&&f.value===""&&g!==""&&g.charCodeAt(g.length-1)!==VI&&g.charCodeAt(g.length-1)!==WI,A=!y&&(f.kind==="alias"||w)?" ":"";x===""||as===x.charCodeAt(0)?c+=`${A}:`:c+=`${A}: `,c+=x,i+=c}return i}function Q1(e,t,n){return t.style.tagged||t.anchor!==void 0||e.indent<2&&n>0}function Ia(e,t,n,r){if(n.kind==="alias")return`*${n.anchor}`;const{block:i=!1,iskey:a=!1,isblockseq:l=!1}=r;let s=r.compact??!1;const c=n.anchor!==void 0;Q1(e,n,t)&&(s=!1);let f,d=n.style.tagged;const p=i&&(n.kind==="mapping"||n.kind==="sequence")&&!n.style.flow&&n.items.length!==0;if(n.kind==="mapping")p?f=s7(e,t,n,s):f=o7(e,t,n);else if(n.kind==="sequence")p?e.seqNoIndent&&!l&&t>0?f=PM(e,t-1,n,s):f=PM(e,t,n,s):f=l7(e,t,n);else{const g=YV(e,t),v=r7(e,n,g,a,i);f=n7(n.value,v,g),d=n.style.tagged||v!==fh&&n.tag!==e.defaultScalarTagName}if(p&&s&&t>0&&e.indent>2&&(f=`${" ".repeat(e.indent-2)}${f}`),d||c){const g=[],v=d?KV(n):null,y=c?`&${n.anchor}`:null;e.tagBeforeAnchor?(v!==null&&g.push(v),y!==null&&g.push(y)):(y!==null&&g.push(y),v!==null&&g.push(v));const x=f===""||f.charCodeAt(0)===as?"":" ";f=`${g.join(" ")}${x}${f}`}return f}function u7(e){return(e.kind==="sequence"||e.kind==="mapping")&&!e.style.flow&&e.items.length!==0&&!e.style.tagged&&e.anchor===void 0}function c7(e){let t=e;for(;(t.kind==="sequence"||t.kind==="mapping")&&!t.style.flow&&t.items.length!==0;)t=t.kind==="sequence"?t.items[t.items.length-1]:t.items[t.items.length-1].value;if(t.kind!=="scalar"||!(t.style.literal||t.style.folded))return!1;const{value:n}=t;return n.endsWith(`
46
-
47
- `)||n===`
48
- `}function f7(e){let t="";for(const n of e.directives){if(n.kind==="yaml"){t+=`%YAML ${n.version}
49
- `;continue}const{handle:r,prefix:i}=n;t+=`%TAG ${r} ${i}
50
- `}return t}function h7(e,t){const n=XV(t);let r="",i=!1;for(let a=0;a<e.length;a+=1){const l=e[a],s=f7(l),c=s!=="",f=l.explicitStart||c||a>0&&!i;if(r+=s,l.contents===null)f&&(r+=`---
51
- `);else if(f){const d=Ia(n,0,l.contents,{block:!0,compact:!0}),p=d===""?"":c||u7(l.contents)?`
52
- `:" ";r+=`---${p}${d}
53
- `}else r+=Ia(n,0,l.contents,{block:!0,compact:!0})+`
54
- `;i=l.explicitEnd||l.contents!==null&&c7(l.contents),i&&(r+=`...
55
- `)}return r}var d7=UW.withTags({...$1,resolve:(e,t,n)=>{const r=$1.resolve(e,t,n);return r===Ke?TI.resolve(e,t,n):r}},{...U1,resolve:(e,t,n)=>{const r=U1.resolve(e,t,n);return r===Ke?MI.resolve(e,t,n):r}}),p7={...gO,schema:d7,skipInvalid:!1,noRefs:!1,flowLevel:-1,transform:()=>{}};function m7(e,t={}){const n={...p7,...t},r=NV(e,n.schema,{noRefs:n.noRefs,skipInvalid:n.skipInvalid});return n.flowLevel>=0&&jV(r,(i,a)=>{if(!(a.depth<n.flowLevel))return i.style.flow=!0,FI}),n.transform(r),h7(r,{...H1(n,Object.keys(gO)),schema:n.schema})}const _M=[{key:"product_name",label:"Product name",type:"string",required:!0,placeholder:"istio",help:"Stored in chunk metadata; used to identify the source"},{key:"version",label:"Version",type:"string",required:!0,placeholder:"latest",help:"Required for all types except code (defaults to branch)"},{key:"max_size",label:"Max page size (bytes)",type:"number",placeholder:"1048576",help:"Pages/files larger than this are skipped"}],Bp={website:{label:"Website",fields:[{key:"url",label:"Base URL",type:"string",required:!0,placeholder:"https://docs.example.com/"},{key:"sitemap_url",label:"Sitemap URL",type:"string",placeholder:"https://docs.example.com/sitemap.xml",help:"Discovers pages not linked in navigation; lastmod dates enable cheap change detection"},{key:"markdown_store",label:"Store markdown in Postgres",type:"boolean",help:"Requires the top-level markdown store to be configured"}]},github:{label:"GitHub issues",fields:[{key:"repo",label:"Repository",type:"string",required:!0,placeholder:"owner/repo"},{key:"start_date",label:"Start date",type:"string",placeholder:"2025-01-01",help:"Only issues updated after this date (first run)"}]},local_directory:{label:"Local directory",fields:[{key:"path",label:"Directory path",type:"string",required:!0,placeholder:"/data/docs"},{key:"include_extensions",label:"Include extensions",type:"string_list",placeholder:".md, .txt, .pdf"},{key:"exclude_extensions",label:"Exclude extensions",type:"string_list",placeholder:".log, .tmp"},{key:"recursive",label:"Recurse into subdirectories",type:"boolean"},{key:"encoding",label:"File encoding",type:"string",placeholder:"utf8"},{key:"url_rewrite_prefix",label:"URL rewrite prefix",type:"string",placeholder:"https://mydomain.com",help:"Rewrites file:// URLs in chunk metadata"}]},zendesk:{label:"Zendesk",fields:[{key:"zendesk_subdomain",label:"Subdomain",type:"string",required:!0,placeholder:"mycompany",help:"mycompany.zendesk.com"},{key:"email",label:"User email",type:"string",required:!0,placeholder:"agent@company.com"},{key:"api_token",label:"API token",type:"string",required:!0,secret:!0,placeholder:"${ZENDESK_API_TOKEN}"},{key:"fetch_tickets",label:"Fetch tickets",type:"boolean"},{key:"fetch_articles",label:"Fetch help center articles",type:"boolean"},{key:"start_date",label:"Start date",type:"string",placeholder:"2025-01-01"},{key:"ticket_status",label:"Ticket statuses",type:"string_list",placeholder:"new, open, pending, hold, solved"},{key:"ticket_priority",label:"Ticket priorities",type:"string_list",placeholder:"urgent, high"},{key:"excluded_organizations",label:"Excluded organizations",type:"string_list"},{key:"include_internal_comments",label:"Include internal comments",type:"boolean"}]},code:{label:"Code",fields:[{key:"source",label:"Code source",type:"select",required:!0,options:["github","local_directory"]},{key:"repo",label:"Repository",type:"string",placeholder:"owner/repo",help:"When source is github"},{key:"branch",label:"Branch",type:"string",placeholder:"main",help:"When source is github"},{key:"path",label:"Directory path",type:"string",placeholder:"/data/src",help:"When source is local_directory"},{key:"include_extensions",label:"Include extensions",type:"string_list",placeholder:".ts, .go, .py"},{key:"exclude_extensions",label:"Exclude extensions",type:"string_list"},{key:"recursive",label:"Recurse into subdirectories",type:"boolean"},{key:"chunk_size",label:"Chunk size (tokens)",type:"number",placeholder:"1500"},{key:"url_rewrite_prefix",label:"URL rewrite prefix",type:"string"}]},s3:{label:"S3 bucket",fields:[{key:"bucket",label:"Bucket",type:"string",required:!0,placeholder:"my-docs-bucket"},{key:"prefix",label:"Key prefix",type:"string",placeholder:"docs/"},{key:"region",label:"Region",type:"string",placeholder:"us-east-1"},{key:"endpoint",label:"Custom endpoint",type:"string",placeholder:"https://minio.local:9000",help:"For S3-compatible services (MinIO, LocalStack)"},{key:"include_extensions",label:"Include extensions",type:"string_list",placeholder:".md, .txt, .pdf"},{key:"exclude_extensions",label:"Exclude extensions",type:"string_list"},{key:"encoding",label:"Text encoding",type:"string",placeholder:"utf8"},{key:"url_rewrite_prefix",label:"URL rewrite prefix",type:"string",help:"Rewrites s3:// URLs in chunk metadata"}]}},px={sqlite:{label:"SQLite (sqlite-vec)",fields:[{key:"db_path",label:"Database file",type:"string",placeholder:"./my-product.db"}]},qdrant:{label:"Qdrant",fields:[{key:"qdrant_url",label:"Qdrant URL",type:"string",placeholder:"http://localhost"},{key:"qdrant_port",label:"Port",type:"number",placeholder:"6333"},{key:"collection_name",label:"Collection",type:"string",placeholder:"my-product"}]}},NM={openai:{label:"OpenAI (or compatible)",fields:[{key:"api_key",label:"API key",type:"string",secret:!0,placeholder:"${OPENAI_API_KEY}",help:"Falls back to the OPENAI_API_KEY env var"},{key:"model",label:"Model",type:"string",placeholder:"text-embedding-3-large"},{key:"base_url",label:"Base URL",type:"string",placeholder:"http://localhost:11434/v1",help:"For Ollama or other OpenAI-compatible endpoints"}]},azure:{label:"Azure OpenAI",fields:[{key:"api_key",label:"API key",type:"string",secret:!0,placeholder:"${AZURE_OPENAI_KEY}"},{key:"endpoint",label:"Endpoint",type:"string",placeholder:"https://myresource.openai.azure.com"},{key:"deployment_name",label:"Deployment name",type:"string",placeholder:"text-embedding-3-large"},{key:"api_version",label:"API version",type:"string",placeholder:"2024-10-21"}]}},g7=[{key:"connection_string",label:"Connection string",type:"string",secret:!0,placeholder:"postgres://user:${PG_PASSWORD}@host:5432/db",help:"Either this, or the discrete fields below"},{key:"host",label:"Host",type:"string"},{key:"port",label:"Port",type:"number",placeholder:"5432"},{key:"database",label:"Database",type:"string"},{key:"user",label:"User",type:"string"},{key:"password",label:"Password",type:"string",secret:!0,placeholder:"${PG_PASSWORD}"},{key:"table_name",label:"Table name",type:"string",placeholder:"markdown_pages"}];function zp(e){const t={type:e,product_name:"",version:"latest",max_size:1048576};return e==="code"&&delete t.version,t.database_config={type:"sqlite",params:{db_path:""}},t}function v7(e,t){return t.reduce((n,r)=>n?.[r],e)}function tL(e,t,n){if(t.length===0)return n;const[r,...i]=t,a=Array.isArray(e)?[...e??[]]:{...e??{}};return i.length===0?n===void 0||n===""||Array.isArray(n)&&n.length===0?delete a[r]:a[r]=n:a[r]=tL(a[r],i,n),a}const Uo="w-full rounded-md border border-edge bg-page px-3 py-1.5 text-sm outline-none focus:border-accent placeholder:text-ink-muted/60";function gu({field:e,value:t,onChange:n}){const[r,i]=O.useState(null);return e.type==="boolean"?M.jsxs("label",{className:"flex items-center gap-2 py-1.5 text-sm text-ink-secondary",children:[M.jsx("input",{type:"checkbox",checked:!!t,onChange:a=>n(a.target.checked||void 0),className:"h-4 w-4 accent-(--accent)"}),e.label,e.help&&M.jsxs("span",{className:"text-xs text-ink-muted",children:["— ",e.help]})]}):M.jsxs("label",{className:"block",children:[M.jsxs("span",{className:"mb-1 flex items-baseline gap-2 text-xs font-medium text-ink-secondary",children:[e.label,e.required&&M.jsx("span",{className:"text-critical",children:"*"}),e.secret&&M.jsxs("span",{className:"text-ink-muted",children:["use a ",M.jsx("code",{children:"${ENV_VAR}"})," placeholder"]})]}),e.type==="select"?M.jsxs("select",{value:t??"",onChange:a=>n(a.target.value||void 0),className:Uo,children:[M.jsx("option",{value:"",children:"—"}),e.options.map(a=>M.jsx("option",{value:a,children:a},a))]}):e.type==="string_list"?M.jsx("input",{value:r??(Array.isArray(t)?t.join(", "):""),placeholder:e.placeholder,onChange:a=>i(a.target.value),onBlur:()=>{r!==null&&(n(r.split(",").map(a=>a.trim()).filter(Boolean)),i(null))},className:Uo}):M.jsx("input",{type:"text",inputMode:e.type==="number"?"numeric":void 0,value:t??"",placeholder:e.placeholder,onChange:a=>{const l=a.target.value;e.type==="number"?n(l===""?void 0:Number(l)):n(l)},className:Uo}),e.help&&M.jsx("span",{className:"mt-1 block text-xs text-ink-muted",children:e.help})]})}function mx({fields:e,doc:t,basePath:n,onSet:r}){return M.jsx("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:e.map(i=>M.jsx("div",{className:i.type==="boolean"?"sm:col-span-2":"",children:M.jsx(gu,{field:i,value:v7(t,[...n,i.key]),onChange:a=>r([...n,i.key],a)})},i.key))})}function $p({title:e,subtitle:t,action:n,children:r}){return M.jsxs("section",{className:"rounded-lg border border-edge bg-surface p-4",children:[M.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[M.jsx("h3",{className:"text-sm font-semibold",children:e}),t&&M.jsx("span",{className:"text-xs text-ink-muted",children:t}),M.jsx("div",{className:"ml-auto",children:n})]}),r]})}function nL(e){const t=io(),n=O.useMemo(()=>{if(e.mode==="edit"&&e.config)try{const A=DV(e.config.content);return A&&typeof A=="object"?{doc:A,parseError:null}:{doc:null,parseError:"config is not a YAML mapping"}}catch(A){return{doc:null,parseError:A instanceof Error?A.message:String(A)}}return{doc:{name:"",schedule:"",sources:[zp("website")]},parseError:null}},[e.mode,e.config]),[r,i]=O.useState(n.doc),[a,l]=O.useState(""),[s,c]=O.useState(null),f=Uu({mutationFn:async()=>{const A=m7(r,{lineWidth:120,noRefs:!0}),C=await qt.validateConfig(A);if(!C.valid)throw new oh(400,C.error??"invalid config");if(e.mode==="create"){const k=a.trim()||`${(r.name||"config").toString().replace(/[^A-Za-z0-9._-]+/g,"-")}.yaml`;return qt.createConfig(k,A)}return qt.updateConfig(e.config.id,A,e.config.content_hash)},onSuccess:A=>{c(null),t.invalidateQueries({queryKey:["configs"]}),e.onSaved?.(A)},onError:A=>c(A.message)});if(n.parseError||!r)return M.jsxs("p",{className:"rounded-md border border-warning/50 bg-surface px-3 py-2 text-sm text-ink-secondary",children:["⚠ This config can't be edited as a form (",n.parseError,") — use the YAML view."]});const d=(A,C)=>i(k=>tL(k,A,C)),p=Array.isArray(r.sources)?r.sources:[],g=[];p.forEach((A,C)=>{const k=Bp[A?.type];for(const P of[..._M,...k?.fields??[]]){if(!P.required||A?.type==="code"&&P.key==="version")continue;const T=A?.[P.key];(T===void 0||T==="")&&g.push(`source ${C+1}: ${P.label}`)}});const v=r.embedding!==void 0,y=r.markdown_store!==void 0,x=f.error instanceof oh&&f.error.status===409,w=r.schedule??"";return M.jsxs("div",{className:"space-y-4",children:[x&&M.jsx("div",{className:"rounded-md border border-warning/50 bg-surface px-3 py-2 text-sm text-ink-secondary",children:"⚠ The file changed on disk since you loaded it. Reload the page and reapply your edits."}),s&&!x&&M.jsx("div",{className:"rounded-md border border-critical/50 bg-surface px-3 py-2 text-sm text-critical",children:s}),M.jsx($p,{title:"General",children:M.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[e.mode==="create"&&M.jsxs("label",{className:"block",children:[M.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Filename"}),M.jsx("input",{value:a,onChange:A=>l(A.target.value),placeholder:`${(r.name||"my-config").toString().replace(/[^A-Za-z0-9._-]+/g,"-")}.yaml`,className:`${Uo} font-mono`})]}),M.jsx(gu,{field:{key:"name",label:"Display name",type:"string",placeholder:"product-docs"},value:r.name,onChange:A=>d(["name"],A)}),M.jsxs("div",{children:[M.jsx(gu,{field:{key:"schedule",label:"Schedule (cron)",type:"string",placeholder:"0 2 * * *",help:"Leave empty for manual runs only"},value:w,onChange:A=>d(["schedule"],A)}),w&&M.jsx("p",{className:"mt-1 text-xs text-accent",children:oO(w)})]})]})}),p.map((A,C)=>{const k=Bp[A?.type]??Bp.website,P=A?.database_config?.type??"sqlite",T=px[P]??px.sqlite;return M.jsx($p,{title:`Source ${C+1}`,subtitle:A?.product_name||void 0,action:M.jsx("button",{onClick:()=>d(["sources"],p.filter((D,N)=>N!==C)),className:"text-xs text-ink-muted transition hover:text-critical",children:"Remove"}),children:M.jsxs("div",{className:"space-y-4",children:[M.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[M.jsxs("label",{className:"block",children:[M.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Type"}),M.jsx("select",{value:A?.type??"website",onChange:D=>{const N={...zp(D.target.value),product_name:A?.product_name??"",...A?.version!==void 0&&D.target.value!=="code"&&{version:A.version},...A?.max_size!==void 0&&{max_size:A.max_size},database_config:A?.database_config??zp(D.target.value).database_config};d(["sources",C],N)},className:Uo,children:Object.entries(Bp).map(([D,N])=>M.jsx("option",{value:D,children:N.label},D))})]}),_M.map(D=>M.jsx(gu,{field:A?.type==="code"&&D.key==="version"?{...D,required:!1,help:"Defaults to the branch name"}:D,value:A?.[D.key],onChange:N=>d(["sources",C,D.key],N)},D.key))]}),M.jsxs("div",{children:[M.jsxs("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-ink-muted",children:[k.label," options"]}),M.jsx(mx,{fields:k.fields,doc:r,basePath:["sources",C],onSet:d})]}),M.jsxs("div",{children:[M.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-ink-muted",children:"Vector database"}),M.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[M.jsxs("label",{className:"block",children:[M.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Type"}),M.jsx("select",{value:P,onChange:D=>d(["sources",C,"database_config"],{type:D.target.value,params:{}}),className:Uo,children:Object.entries(px).map(([D,N])=>M.jsx("option",{value:D,children:N.label},D))})]}),T.fields.map(D=>M.jsx(gu,{field:D,value:A?.database_config?.params?.[D.key],onChange:N=>d(["sources",C,"database_config","params",D.key],N)},D.key))]})]})]})},C)}),M.jsx("button",{onClick:()=>d(["sources"],[...p,zp("website")]),className:"w-full rounded-lg border border-dashed border-edge py-2.5 text-sm font-medium text-ink-muted transition hover:border-accent hover:text-accent",children:"+ Add source"}),M.jsx($p,{title:"Embedding",subtitle:"optional — defaults to OpenAI text-embedding-3-large",action:M.jsxs("label",{className:"flex items-center gap-2 text-xs text-ink-secondary",children:[M.jsx("input",{type:"checkbox",checked:v,onChange:A=>d(["embedding"],A.target.checked?{provider:"openai"}:void 0),className:"h-4 w-4 accent-(--accent)"}),"customize"]}),children:v?M.jsxs("div",{className:"space-y-3",children:[M.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[M.jsxs("label",{className:"block",children:[M.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Provider"}),M.jsx("select",{value:r.embedding?.provider??"openai",onChange:A=>d(["embedding"],{provider:A.target.value}),className:Uo,children:Object.entries(NM).map(([A,C])=>M.jsx("option",{value:A,children:C.label},A))})]}),M.jsx(gu,{field:{key:"dimension",label:"Dimension",type:"number",placeholder:"3072"},value:r.embedding?.dimension,onChange:A=>d(["embedding","dimension"],A)})]}),M.jsx(mx,{fields:NM[r.embedding?.provider??"openai"].fields,doc:r,basePath:["embedding",r.embedding?.provider??"openai"],onSet:d})]}):M.jsx("p",{className:"text-xs text-ink-muted",children:"Using defaults (OPENAI_API_KEY env var, text-embedding-3-large, 3072 dimensions)."})}),M.jsx($p,{title:"Markdown store",subtitle:"optional — store crawled markdown in Postgres",action:M.jsxs("label",{className:"flex items-center gap-2 text-xs text-ink-secondary",children:[M.jsx("input",{type:"checkbox",checked:y,onChange:A=>d(["markdown_store"],A.target.checked?{}:void 0),className:"h-4 w-4 accent-(--accent)"}),"enable"]}),children:y?M.jsx(mx,{fields:g7,doc:r,basePath:["markdown_store"],onSet:d}):M.jsx("p",{className:"text-xs text-ink-muted",children:"Disabled."})}),M.jsxs("div",{className:"flex items-center gap-3",children:[M.jsx("button",{onClick:()=>f.mutate(),disabled:f.isPending||p.length===0||g.length>0,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:f.isPending?"Saving…":e.mode==="create"?"Create config":"Save changes"}),e.onCancel&&M.jsx("button",{onClick:e.onCancel,className:"text-sm text-ink-muted hover:text-ink-secondary",children:"Cancel"}),g.length>0&&M.jsxs("span",{className:"text-xs text-warning",children:["missing: ",g.slice(0,3).join(", "),g.length>3?"…":""]}),p.length===0&&M.jsx("span",{className:"text-xs text-warning",children:"add at least one source"}),e.mode==="edit"&&M.jsx("span",{className:"ml-auto text-xs text-ink-muted",children:"Saving rewrites the YAML file (comments are not preserved)."})]})]})}const y7={website:"🌐",github:"🐙",zendesk:"🎫",local_directory:"📁",code:"⌨️",s3:"🪣"};function rL({sources:e,max:t}){const[n,r]=O.useState(!1);if(e.length===0)return M.jsx("span",{className:"text-xs text-ink-muted",children:"no sources"});const i=n||t===void 0?e.length:t,a=e.slice(0,i),l=e.length-a.length;return M.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.map((s,c)=>M.jsxs("span",{title:`${s.type}${s.version?` · ${s.version}`:""}`,className:"inline-flex items-center gap-1 rounded-full border border-edge bg-page px-2 py-0.5 text-xs text-ink-secondary",children:[M.jsx("span",{"aria-hidden":!0,className:"text-[10px]",children:y7[s.type]??"•"}),s.product_name,M.jsx("span",{className:"text-ink-muted",children:s.type})]},`${s.product_name}-${s.type}-${c}`)),l>0&&M.jsxs("button",{onClick:s=>{s.preventDefault(),r(!0)},className:"rounded-full border border-edge px-2 py-0.5 text-xs text-ink-muted transition hover:border-accent hover:text-accent",children:["+",l," more"]})]})}function b7({config:e}){const t=io(),n=Uu({mutationFn:()=>qt.triggerRun(e.id),onSettled:()=>t.invalidateQueries({queryKey:["configs"]})}),r=e.busy||!!e.parse_error||n.isPending;return M.jsxs("div",{className:"flex items-center gap-2",children:[M.jsx("button",{onClick:i=>{i.preventDefault(),n.mutate()},disabled:r,className:"rounded-md border border-edge bg-surface px-3 py-1 text-xs font-medium text-ink-secondary transition hover:border-accent hover:text-accent disabled:cursor-not-allowed disabled:opacity-40",children:e.busy?"Running…":"Run now"}),n.error&&M.jsx("span",{className:"text-xs text-critical",children:n.error.message})]})}function x7(){const e=kv(),{data:t,isLoading:n,error:r}=Fi({queryKey:["configs"],queryFn:qt.configs}),{data:i}=Fi({queryKey:["health"],queryFn:qt.health}),[a,l]=O.useState(!1),s=t?.filter(c=>c.last_run?.status==="running"||c.last_run?.status==="queued")??[];return n?M.jsx("p",{className:"text-ink-muted",children:"Loading…"}):r?M.jsxs("p",{className:"text-critical",children:["Failed to load configs: ",String(r.message)]}):M.jsxs("div",{className:"space-y-6",children:[s.length>0&&M.jsx("div",{className:"rounded-lg border border-accent/30 bg-surface px-4 py-3",children:M.jsxs("p",{className:"text-sm text-ink-secondary",children:[M.jsxs("span",{className:"font-medium text-accent",children:["● ",s.length," config",s.length>1?"s":""," syncing now"]})," — ",s.map((c,f)=>M.jsxs("span",{children:[f>0&&", ",M.jsx(gi,{to:`/runs/${c.last_run.id}`,className:"text-accent hover:underline",children:c.name})]},c.id))]})}),M.jsxs("div",{className:"flex items-center justify-between",children:[M.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Configurations"}),i?.mode==="rw"&&M.jsx("button",{onClick:()=>l(!0),className:"rounded-md bg-accent px-3.5 py-1.5 text-sm font-medium text-white transition hover:opacity-90",children:"New config"})]}),a&&M.jsxs("div",{className:"rounded-lg border border-edge bg-page p-4",children:[M.jsx("h2",{className:"mb-4 text-sm font-semibold",children:"Create a new config"}),M.jsx(nL,{mode:"create",onSaved:c=>{l(!1),e(`/configs/${c.id}`)},onCancel:()=>l(!1)})]}),t&&t.length===0&&M.jsxs("p",{className:"rounded-lg border border-edge bg-surface px-4 py-8 text-center text-sm text-ink-muted",children:["No configs loaded. Pass config files to ",M.jsx("code",{className:"text-ink-secondary",children:"doc2vec controller"}),i?.mode==="rw"&&" or create one with the button above","."]}),M.jsx("div",{className:"grid gap-4",children:t?.map(c=>M.jsx(gi,{to:`/configs/${c.id}`,className:"block rounded-lg border border-edge bg-surface p-4 transition hover:border-accent/50",children:M.jsxs("div",{className:"flex flex-wrap items-start gap-x-6 gap-y-3",children:[M.jsxs("div",{className:"min-w-48 flex-1",children:[M.jsxs("div",{className:"flex items-center gap-2",children:[M.jsx("h2",{className:"font-semibold",children:c.name}),c.parse_error&&M.jsx("span",{className:"rounded-full border border-critical/40 px-2 py-0.5 text-xs text-critical",title:c.parse_error,children:"invalid"})]}),M.jsx("div",{className:"mt-1.5",children:M.jsx(rL,{sources:c.source_summary,max:4})})]}),M.jsxs("div",{className:"text-sm",children:[M.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Schedule"}),M.jsx("p",{className:"mt-0.5 text-ink-secondary",title:c.schedule??void 0,children:oO(c.schedule)})]}),M.jsxs("div",{className:"text-sm",children:[M.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Last run"}),M.jsx("div",{className:"mt-0.5 flex items-center gap-2",children:c.last_run?M.jsxs(M.Fragment,{children:[M.jsx(Tv,{status:c.last_run.status}),M.jsxs("span",{className:"text-xs text-ink-muted",title:Ua(c.last_run.queued_at),children:[z1(c.last_run.finished_at??c.last_run.queued_at),c.last_run.finished_at&&c.last_run.started_at&&` · ${lO(c.last_run.started_at,c.last_run.finished_at)}`]})]}):M.jsx("span",{className:"text-xs text-ink-muted",children:"never"})})]}),M.jsxs("div",{className:"text-sm",children:[M.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Next run"}),M.jsx("p",{className:"mt-0.5 text-ink-secondary",title:c.next_run?Ua(c.next_run):void 0,children:c.next_run?z1(c.next_run):"—"})]}),M.jsx("div",{className:"ml-auto self-center",children:M.jsx(b7,{config:c})})]})},c.id))})]})}function Y1(){return Y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y1.apply(null,arguments)}function S7(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}let G1=[],iL=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?iL:G1).push(n=n+e[t])})();function w7(e){if(e<768)return!1;for(let t=0,n=G1.length;;){let r=t+n>>1;if(e<G1[r])n=r;else if(e>=iL[r])t=r+1;else return!0;if(t==n)return!1}}function RM(e){return e>=127462&&e<=127487}const jM=8205;function O7(e,t,n=!0,r=!0){return(n?aL:A7)(e,t,r)}function aL(e,t,n){if(t==e.length)return t;t&&lL(e.charCodeAt(t))&&oL(e.charCodeAt(t-1))&&t--;let r=gx(e,t);for(t+=IM(r);t<e.length;){let i=gx(e,t);if(r==jM||i==jM||n&&w7(i))t+=IM(i),r=i;else if(RM(i)){let a=0,l=t-2;for(;l>=0&&RM(gx(e,l));)a++,l-=2;if(a%2==0)break;t+=2}else break}return t}function A7(e,t,n){for(;t>1;){let r=aL(e,t-2,n);if(r<t)return r;t--}return 0}function gx(e,t){let n=e.charCodeAt(t);if(!oL(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return lL(r)?(n-55296<<10)+(r-56320)+65536:n}function lL(e){return e>=56320&&e<57344}function oL(e){return e>=55296&&e<56320}function IM(e){return e<65536?1:2}let Je=class sL{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,r){[t,n]=qu(this,t,n);let i=[];return this.decompose(0,t,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),$i.from(i,this.length-(n-t)+r.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=qu(this,t,n);let r=[];return this.decompose(t,n,r,0),$i.from(r,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),r=this.length-this.scanIdentical(t,-1),i=new Kf(this),a=new Kf(t);for(let l=n,s=n;;){if(i.next(l),a.next(l),l=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(s+=i.value.length,i.done||s>=r)return!0}}iter(t=1){return new Kf(this,t)}iterRange(t,n=this.length){return new uL(this,t,n)}iterLines(t,n){let r;if(t==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(t).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new cL(r)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?sL.empty:t.length<=32?new It(t):$i.from(It.split(t,[]))}};class It extends Je{constructor(t,n=k7(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,r,i){for(let a=0;;a++){let l=this.text[a],s=i+l.length;if((n?r:s)>=t)return new C7(i,s,r,l);i=s+1,r++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new It(LM(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let l=r.pop(),s=Nm(a.text,l.text.slice(),0,a.length);if(s.length<=32)r.push(new It(s,l.length+a.length));else{let c=s.length>>1;r.push(new It(s.slice(0,c)),new It(s.slice(c)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof It))return super.replace(t,n,r);[t,n]=qu(this,t,n);let i=Nm(this.text,Nm(r.text,LM(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new It(i,a):$i.from(It.split(i,[]),a)}sliceString(t,n=this.length,r=`
56
- `){[t,n]=qu(this,t,n);let i="";for(let a=0,l=0;a<=n&&l<this.text.length;l++){let s=this.text[l],c=a+s.length;a>t&&l&&(i+=r),t<c&&n>a&&(i+=s.slice(Math.max(0,t-a),n-a)),a=c+1}return i}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new It(r,i)),r=[],i=-1);return i>-1&&n.push(new It(r,i)),n}}class $i extends Je{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let r of t)this.lines+=r.lines}lineInner(t,n,r,i){for(let a=0;;a++){let l=this.children[a],s=i+l.length,c=r+l.lines-1;if((n?c:s)>=t)return l.lineInner(t,n,r,i);i=s+1,r=c+1}}decompose(t,n,r,i){for(let a=0,l=0;l<=n&&a<this.children.length;a++){let s=this.children[a],c=l+s.length;if(t<=c&&n>=l){let f=i&((l<=t?1:0)|(c>=n?2:0));l>=t&&c<=n&&!f?r.push(s):s.decompose(t-l,n-l,r,f)}l=c+1}}replace(t,n,r){if([t,n]=qu(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let l=this.children[i],s=a+l.length;if(t>=a&&n<=s){let c=l.replace(t-a,n-a,r),f=this.lines-l.lines+c.lines;if(c.lines<f>>4&&c.lines>f>>6){let d=this.children.slice();return d[i]=c,new $i(d,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(t,n=this.length,r=`
57
- `){[t,n]=qu(this,t,n);let i="";for(let a=0,l=0;a<this.children.length&&l<=n;a++){let s=this.children[a],c=l+s.length;l>t&&a&&(i+=r),t<c&&n>l&&(i+=s.sliceString(t-l,n-l,r)),l=c+1}return i}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof $i))return 0;let r=0,[i,a,l,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==l||a==s)return r;let c=this.children[i],f=t.children[a];if(c!=f)return r+c.scanIdentical(f,n);r+=c.length+1}}static from(t,n=t.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let v of t)r+=v.lines;if(r<32){let v=[];for(let y of t)y.flatten(v);return new It(v,n)}let i=Math.max(32,r>>5),a=i<<1,l=i>>1,s=[],c=0,f=-1,d=[];function p(v){let y;if(v.lines>a&&v instanceof $i)for(let x of v.children)p(x);else v.lines>l&&(c>l||!c)?(g(),s.push(v)):v instanceof It&&c&&(y=d[d.length-1])instanceof It&&v.lines+y.lines<=32?(c+=v.lines,f+=v.length+1,d[d.length-1]=new It(y.text.concat(v.text),y.length+1+v.length)):(c+v.lines>i&&g(),c+=v.lines,f+=v.length+1,d.push(v))}function g(){c!=0&&(s.push(d.length==1?d[0]:$i.from(d,f)),f=-1,c=d.length=0)}for(let v of t)p(v);return g(),s.length==1?s[0]:new $i(s,n)}}Je.empty=new It([""],0);function k7(e){let t=-1;for(let n of e)t+=n.length+1;return t}function Nm(e,t,n=0,r=1e9){for(let i=0,a=0,l=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),l?(t[t.length-1]+=s,l=!1):t.push(s)),i=c+1}return t}function LM(e,t,n){return Nm(e,[""],t,n)}class Kf{constructor(t,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof It?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],a=this.offsets[r],l=a>>1,s=i instanceof It?i.text.length:i.children.length;if(l==(n>0?s:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(n>0?0:1)){if(this.offsets[r]+=n,t==0)return this.lineBreak=!0,this.value=`
58
- `,this;t--}else if(i instanceof It){let c=i.text[l+(n<0?-1:0)];if(this.offsets[r]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=i.children[l+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof It?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class uL{constructor(t,n,r){this.value="",this.done=!1,this.cursor=new Kf(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;t>r&&(t=r),r-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class cL{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:r,value:i}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Je.prototype[Symbol.iterator]=function(){return this.iter()},Kf.prototype[Symbol.iterator]=uL.prototype[Symbol.iterator]=cL.prototype[Symbol.iterator]=function(){return this});let C7=class{constructor(t,n,r,i){this.from=t,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function qu(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function on(e,t,n=!0,r=!0){return O7(e,t,n,r)}function E7(e){return e>=56320&&e<57344}function T7(e){return e>=55296&&e<56320}function rr(e,t){let n=e.charCodeAt(t);if(!T7(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return E7(r)?(n-55296<<10)+(r-56320)+65536:n}function bO(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Ui(e){return e<65536?1:2}const Z1=/\r\n?|\n/;var Fn=(function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e})(Fn||(Fn={}));class Qi{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;n<this.sections.length;n+=2)t+=this.sections[n];return t}get newLength(){let t=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];t+=r<0?this.sections[n]:r}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let n=0,r=0,i=0;n<this.sections.length;){let a=this.sections[n++],l=this.sections[n++];l<0?(t(r,i,a),i+=a):i+=l,r+=a}}iterChangedRanges(t,n=!1){J1(this,t,n)}get invertedDesc(){let t=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?t.push(r,i):t.push(i,r)}return new Qi(t)}composeDesc(t){return this.empty?t:t.empty?this:fL(this,t)}mapDesc(t,n=!1){return t.empty?this:eS(this,t,n)}mapPos(t,n=-1,r=Fn.Simple){let i=0,a=0;for(let l=0;l<this.sections.length;){let s=this.sections[l++],c=this.sections[l++],f=i+s;if(c<0){if(f>t)return a+(t-i);a+=s}else{if(r!=Fn.Simple&&f>=t&&(r==Fn.TrackDel&&i<t&&f>t||r==Fn.TrackBefore&&i<t||r==Fn.TrackAfter&&f>t))return null;if(f>t||f==t&&n<0&&!s)return t==i||n<0?a:a+c;a+=c}i=f}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return a}touchesRange(t,n=t){for(let r=0,i=0;r<this.sections.length&&i<=n;){let a=this.sections[r++],l=this.sections[r++],s=i+a;if(l>=0&&i<=n&&s>=t)return i<t&&s>n?"cover":!0;i=s}return!1}toString(){let t="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];t+=(t?" ":"")+r+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qi(t)}static create(t){return new Qi(t)}}class Yt extends Qi{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return J1(this,(n,r,i,a,l)=>t=t.replace(i,i+(r-n),l),!1),t}mapDesc(t,n=!1){return eS(this,t,n,!0)}invert(t){let n=this.sections.slice(),r=[];for(let i=0,a=0;i<n.length;i+=2){let l=n[i],s=n[i+1];if(s>=0){n[i]=s,n[i+1]=l;let c=i>>1;for(;r.length<c;)r.push(Je.empty);r.push(l?t.slice(a,a+l):Je.empty)}a+=l}return new Yt(n,r)}compose(t){return this.empty?t:t.empty?this:fL(this,t,!0)}map(t,n=!1){return t.empty?this:eS(this,t,n,!0)}iterChanges(t,n=!1){J1(this,t,n)}get desc(){return Qi.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new hh(this);e:for(let l=0,s=0;;){let c=l==t.length?1e9:t[l++];for(;s<c||s==c&&a.len==0;){if(a.done)break e;let d=Math.min(a.len,c-s);Tn(i,d,-1);let p=a.ins==-1?-1:a.off==0?a.ins:0;Tn(n,d,p),p>0&&$l(r,n,a.text),a.forward(d),s+=d}let f=t[l++];for(;s<f;){if(a.done)break e;let d=Math.min(a.len,f-s);Tn(n,d,-1),Tn(i,d,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(d),s+=d}}return{changes:new Yt(n,r),filtered:Qi.create(i)}}toJSON(){let t=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?t.push(r):i==0?t.push([r]):t.push([r].concat(this.inserted[n>>1].toJSON()))}return t}static of(t,n,r){let i=[],a=[],l=0,s=null;function c(d=!1){if(!d&&!i.length)return;l<n&&Tn(i,n-l,-1);let p=new Yt(i,a);s=s?s.compose(p.map(s)):p,i=[],a=[],l=0}function f(d){if(Array.isArray(d))for(let p of d)f(p);else if(d instanceof Yt){if(d.length!=n)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${n})`);c(),s=s?s.compose(d.map(s)):d}else{let{from:p,to:g=p,insert:v}=d;if(p>g||p<0||g>n)throw new RangeError(`Invalid change range ${p} to ${g} (in doc of length ${n})`);let y=v?typeof v=="string"?Je.of(v.split(r||Z1)):v:Je.empty,x=y.length;if(p==g&&x==0)return;p<l&&c(),p>l&&Tn(i,p-l,-1),Tn(i,g-p,x),$l(a,i,y),l=g}}return f(t),c(!s),s}static empty(t){return new Yt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<t.length;i++){let a=t[i];if(typeof a=="number")n.push(a,-1);else{if(!Array.isArray(a)||typeof a[0]!="number"||a.some((l,s)=>s&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)n.push(a[0],0);else{for(;r.length<i;)r.push(Je.empty);r[i]=Je.of(a.slice(1)),n.push(a[0],r[i].length)}}}return new Yt(n,r)}static createSet(t,n){return new Yt(t,n)}}function Tn(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function $l(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(Je.empty);e.push(n)}}function J1(e,t,n){let r=e.inserted;for(let i=0,a=0,l=0;l<e.sections.length;){let s=e.sections[l++],c=e.sections[l++];if(c<0)i+=s,a+=s;else{let f=i,d=a,p=Je.empty;for(;f+=s,d+=c,c&&r&&(p=p.append(r[l-2>>1])),!(n||l==e.sections.length||e.sections[l+1]<0);)s=e.sections[l++],c=e.sections[l++];t(i,f,a,d,p),i=f,a=d}}}function eS(e,t,n,r=!1){let i=[],a=r?[]:null,l=new hh(e),s=new hh(t);for(let c=-1;;){if(l.done&&s.len||s.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&s.ins==-1){let f=Math.min(l.len,s.len);Tn(i,f,-1),l.forward(f),s.forward(f)}else if(s.ins>=0&&(l.ins<0||c==l.i||l.off==0&&(s.len<l.len||s.len==l.len&&!n))){let f=s.len;for(Tn(i,s.ins,-1);f;){let d=Math.min(l.len,f);l.ins>=0&&c<l.i&&l.len<=d&&(Tn(i,0,l.ins),a&&$l(a,i,l.text),c=l.i),l.forward(d),f-=d}s.next()}else if(l.ins>=0){let f=0,d=l.len;for(;d;)if(s.ins==-1){let p=Math.min(d,s.len);f+=p,d-=p,s.forward(p)}else if(s.ins==0&&s.len<d)d-=s.len,s.next();else break;Tn(i,f,c<l.i?l.ins:0),a&&c<l.i&&$l(a,i,l.text),c=l.i,l.forward(l.len-d)}else{if(l.done&&s.done)return a?Yt.createSet(i,a):Qi.create(i);throw new Error("Mismatched change set lengths")}}}function fL(e,t,n=!1){let r=[],i=n?[]:null,a=new hh(e),l=new hh(t);for(let s=!1;;){if(a.done&&l.done)return i?Yt.createSet(r,i):Qi.create(r);if(a.ins==0)Tn(r,a.len,0,s),a.next();else if(l.len==0&&!l.done)Tn(r,0,l.ins,s),i&&$l(i,r,l.text),l.next();else{if(a.done||l.done)throw new Error("Mismatched change set lengths");{let c=Math.min(a.len2,l.len),f=r.length;if(a.ins==-1){let d=l.ins==-1?-1:l.off?0:l.ins;Tn(r,c,d,s),i&&d&&$l(i,r,l.text)}else l.ins==-1?(Tn(r,a.off?0:a.len,c,s),i&&$l(i,r,a.textBit(c))):(Tn(r,a.off?0:a.len,l.off?0:l.ins,s),i&&!l.off&&$l(i,r,l.text));s=(a.ins>c||l.ins>=0&&l.len>c)&&(s||r.length>f),a.forward2(c),l.forward(c)}}}}class hh{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length?Je.empty:t[n]}textBit(t){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!t?Je.empty:n[r].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class jl{constructor(t,n,r,i){this.from=t,this.to=n,this.flags=r,this.goalColumn=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new jl(r,i,this.flags,this.goalColumn)}extend(t,n=t,r=0){if(t<=this.anchor&&n>=this.anchor)return J.range(t,n,void 0,void 0,r);let i=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return J.range(this.anchor,i,void 0,void 0,r)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return J.range(t.anchor,t.head)}static create(t,n,r,i){return new jl(t,n,r,i)}}class J{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:J.create(this.ranges.map(r=>r.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(t.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new J([this.main],0)}addRange(t,n=!0){return J.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,J.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new J(t.ranges.map(n=>jl.fromJSON(n)),t.main)}static single(t,n=t){return new J([J.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return J.normalized(t.slice(),n);r=a.to}return new J(t,n)}static cursor(t,n=0,r,i){return jl.create(t,t,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r)),i)}static range(t,n,r,i,a){let l=i==null?7:Math.min(6,i);return!a&&t!=n&&(a=n<t?1:-1),a&&(l|=a<0?8:16),n<t?jl.create(n,t,l|32,r):jl.create(t,n,l,r)}static undirectionalRange(t,n){return jl.create(t,n,64,void 0)}static normalized(t,n=0){let r=t[n];t.sort((i,a)=>i.from-a.from),n=t.indexOf(r);for(let i=1;i<t.length;i++){let a=t[i],l=t[i-1];if(a.empty?a.from<=l.to:a.from<l.to){let s=l.from,c=Math.max(a.to,l.to);i<=n&&n--,t.splice(--i,2,a.anchor>a.head?J.range(c,s):J.range(s,c))}}return new J(t,n)}}function hL(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let xO=0;class me{constructor(t,n,r,i,a){this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=xO++,this.default=t([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(t={}){return new me(t.combine||(n=>n),t.compareInput||((n,r)=>n===r),t.compare||(t.combine?(n,r)=>n===r:SO),!!t.static,t.enables)}of(t){return new Rm([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Rm(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Rm(t,this,2,n)}from(t,n){return n||(n=r=>r),this.compute([t],r=>n(r.field(t)))}}function SO(e,t){return e==t||e.length==t.length&&e.every((n,r)=>n===t[r])}class Rm{constructor(t,n,r,i){this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=xO++}dynamicSlot(t){var n;let r=this.value,i=this.facet.compareInput,a=this.id,l=t[a]>>1,s=this.type==2,c=!1,f=!1,d=[];for(let p of this.dependencies)p=="doc"?c=!0:p=="selection"?f=!0:(((n=t[p.id])!==null&&n!==void 0?n:1)&1)==0&&d.push(t[p.id]);return{create(p){return p.values[l]=r(p),1},update(p,g){if(c&&g.docChanged||f&&(g.docChanged||g.selection)||tS(p,d)){let v=r(p);if(s?!BM(v,p.values[l],i):!i(v,p.values[l]))return p.values[l]=v,1}return 0},reconfigure:(p,g)=>{let v,y=g.config.address[a];if(y!=null){let x=ng(g,y);if(this.dependencies.every(w=>w instanceof me?g.facet(w)===p.facet(w):w instanceof Nn?g.field(w,!1)==p.field(w,!1):!0)||(s?BM(v=r(p),x,i):i(v=r(p),x)))return p.values[l]=x,0}else v=r(p);return p.values[l]=v,1}}}get extension(){return this}}function BM(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function tS(e,t){let n=!1;for(let r of t)Xf(e,r)&1&&(n=!0);return n}function M7(e,t,n){let r=n.map(c=>e[c.id]),i=n.map(c=>c.type),a=r.filter(c=>!(c&1)),l=e[t.id]>>1;function s(c){let f=[];for(let d=0;d<r.length;d++){let p=ng(c,r[d]);if(i[d]==2)for(let g of p)f.push(g);else f.push(p)}return t.combine(f)}return{create(c){for(let f of r)Xf(c,f);return c.values[l]=s(c),1},update(c,f){if(!tS(c,a))return 0;let d=s(c);return t.compare(d,c.values[l])?0:(c.values[l]=d,1)},reconfigure(c,f){let d=tS(c,r),p=f.config.facets[t.id],g=f.facet(t);if(p&&!d&&SO(n,p))return c.values[l]=g,0;let v=s(c);return t.compare(v,g)?(c.values[l]=g,0):(c.values[l]=v,1)}}}const Up=me.define({static:!0});class Nn{constructor(t,n,r,i,a){this.id=t,this.createF=n,this.updateF=r,this.compareF=i,this.spec=a,this.provides=void 0}static define(t){let n=new Nn(xO++,t.create,t.update,t.compare||((r,i)=>r===i),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(Up).find(r=>r.field==this);return(n?.create||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let a=r.values[n],l=this.updateF(a,i);return this.compareF(a,l)?0:(r.values[n]=l,1)},reconfigure:(r,i)=>{let a=r.facet(Up),l=i.facet(Up),s;return(s=a.find(c=>c.field==this))&&s!=l.find(c=>c.field==this)?(r.values[n]=s.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(t){return[this,Up.of({field:this,create:t})]}get extension(){return this}}const Lo={lowest:4,low:3,default:2,high:1,highest:0};function Sf(e){return t=>new dL(t,e)}const vs={highest:Sf(Lo.highest),high:Sf(Lo.high),default:Sf(Lo.default),low:Sf(Lo.low),lowest:Sf(Lo.lowest)};class dL{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class Nv{of(t){return new nS(this,t)}reconfigure(t){return Nv.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class nS{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class tg{constructor(t,n,r,i,a,l){for(this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=a,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(t){let n=this.address[t.id];return n==null?t.default:this.staticValues[n>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),l=new Map;for(let g of D7(t,n,l))g instanceof Nn?i.push(g):(a[g.facet.id]||(a[g.facet.id]=[])).push(g);let s=Object.create(null),c=[],f=[];for(let g of i)s[g.id]=f.length<<1,f.push(v=>g.slot(v));let d=r?.config.facets;for(let g in a){let v=a[g],y=v[0].facet,x=d&&d[g]||[];if(v.every(w=>w.type==0))if(s[y.id]=c.length<<1|1,SO(x,v))c.push(r.facet(y));else{let w=y.combine(v.map(A=>A.value));c.push(r&&y.compare(w,r.facet(y))?r.facet(y):w)}else{for(let w of v)w.type==0?(s[w.id]=c.length<<1|1,c.push(w.value)):(s[w.id]=f.length<<1,f.push(A=>w.dynamicSlot(A)));s[y.id]=f.length<<1,f.push(w=>M7(w,y,v))}}let p=f.map(g=>g(s));return new tg(t,l,p,s,c,a)}}function D7(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(l,s){let c=i.get(l);if(c!=null){if(c<=s)return;let f=r[c].indexOf(l);f>-1&&r[c].splice(f,1),l instanceof nS&&n.delete(l.compartment)}if(i.set(l,s),Array.isArray(l))for(let f of l)a(f,s);else if(l instanceof nS){if(n.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let f=t.get(l.compartment)||l.inner;n.set(l.compartment,f),a(f,s)}else if(l instanceof dL)a(l.inner,l.prec);else if(l instanceof Nn)r[s].push(l),l.provides&&a(l.provides,s);else if(l instanceof Rm)r[s].push(l),l.facet.extensions&&a(l.facet.extensions,Lo.default);else{let f=l.extension;if(!f)throw new Error(`Unrecognized extension value in extension set (${l}).`);if(f==l)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(f,s)}}return a(e,Lo.default),r.reduce((l,s)=>l.concat(s))}function Xf(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function ng(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const pL=me.define(),rS=me.define({combine:e=>e.some(t=>t),static:!0}),mL=me.define({combine:e=>e.length?e[0]:void 0,static:!0}),gL=me.define(),vL=me.define(),yL=me.define(),bL=me.define({combine:e=>e.length?e[0]:!1});class ia{constructor(t,n){this.type=t,this.value=n}static define(){return new P7}}class P7{of(t){return new ia(this,t)}}class _7{constructor(t){this.map=t}of(t){return new _e(this,t)}}class _e{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new _e(this.type,n)}is(t){return this.type==t}static define(t={}){return new _7(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let r=[];for(let i of t){let a=i.map(n);a&&r.push(a)}return r}}_e.reconfigure=_e.define();_e.appendConfig=_e.define();class Zt{constructor(t,n,r,i,a,l){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=l,this._doc=null,this._state=null,r&&hL(r,n.newLength),a.some(s=>s.type==Zt.time)||(this.annotations=a.concat(Zt.time.of(Date.now())))}static create(t,n,r,i,a,l){return new Zt(t,n,r,i,a,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Zt.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Zt.time=ia.define();Zt.userEvent=ia.define();Zt.addToHistory=ia.define();Zt.remote=ia.define();function N7(e,t){let n=[];for(let r=0,i=0;;){let a,l;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],l=e[r++];else if(i<t.length)a=t[i++],l=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,l):n[n.length-1]<l&&(n[n.length-1]=l)}}function xL(e,t,n){var r;let i,a,l;return n?(i=t.changes,a=Yt.empty(t.changes.length),l=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),a=e.changes.mapDesc(t.changes,!0),l=e.changes.compose(i)),{changes:l,selection:t.selection?t.selection.map(a):(r=e.selection)===null||r===void 0?void 0:r.map(i),effects:_e.mapEffects(e.effects,i).concat(_e.mapEffects(t.effects,a)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function iS(e,t,n){let r=t.selection,i=Pu(t.annotations);return t.userEvent&&(i=i.concat(Zt.userEvent.of(t.userEvent))),{changes:t.changes instanceof Yt?t.changes:Yt.of(t.changes||[],n,e.facet(mL)),selection:r&&(r instanceof J?r:J.single(r.anchor,r.head)),effects:Pu(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function SL(e,t,n){let r=iS(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let a=1;a<t.length;a++){t[a].filter===!1&&(n=!1);let l=!!t[a].sequential;r=xL(r,iS(e,t[a],l?r.changes.newLength:e.doc.length),l)}let i=Zt.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return j7(n?R7(i):i)}function R7(e){let t=e.startState,n=!0;for(let i of t.facet(gL)){let a=i(e);if(a===!1){n=!1;break}Array.isArray(a)&&(n=n===!0?a:N7(n,a))}if(n!==!0){let i,a;if(n===!1)a=e.changes.invertedDesc,i=Yt.empty(t.doc.length);else{let l=e.changes.filter(n);i=l.changes,a=l.filtered.mapDesc(l.changes).invertedDesc}e=Zt.create(t,i,e.selection&&e.selection.map(a),_e.mapEffects(e.effects,a),e.annotations,e.scrollIntoView)}let r=t.facet(vL);for(let i=r.length-1;i>=0;i--){let a=r[i](e);a instanceof Zt?e=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Zt?e=a[0]:e=SL(t,Pu(a),!1)}return e}function j7(e){let t=e.startState,n=t.facet(yL),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=xL(r,iS(t,a,e.changes.newLength),!0))}return r==e?e:Zt.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}const I7=[];function Pu(e){return e==null?I7:Array.isArray(e)?e:[e]}var Ot=(function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e})(Ot||(Ot={}));const L7=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let aS;try{aS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function B7(e){if(aS)return aS.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||L7.test(n)))return!0}return!1}function z7(e){return t=>{if(!/\S/.test(t))return Ot.Space;if(B7(t))return Ot.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return Ot.Word;return Ot.Other}}class qe{constructor(t,n,r,i,a,l){this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=a,l&&(l._state=this);for(let s=0;s<this.config.dynamicSlots.length;s++)Xf(this,s<<1);this.computeSlot=null}field(t,n=!0){let r=this.config.address[t.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return Xf(this,r),ng(this,r)}update(...t){return SL(this,t,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let s of t.effects)s.is(Nv.reconfigure)?(n&&(i=new Map,n.compartments.forEach((c,f)=>i.set(f,c)),n=null),i.set(s.value.compartment,s.value.extension)):s.is(_e.reconfigure)?(n=null,r=s.value):s.is(_e.appendConfig)&&(n=null,r=Pu(r).concat(s.value));let a;n?a=t.startState.values.slice():(n=tg.resolve(r,i,this),a=new qe(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,f)=>f.reconfigure(c,this),null).values);let l=t.startState.facet(rS)?t.newSelection:t.newSelection.asSingle();new qe(n,t.newDoc,l,a,(s,c)=>c.update(s,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:J.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,r=t(n.ranges[0]),i=this.changes(r.changes),a=[r.range],l=Pu(r.effects);for(let s=1;s<n.ranges.length;s++){let c=t(n.ranges[s]),f=this.changes(c.changes),d=f.map(i);for(let g=0;g<s;g++)a[g]=a[g].map(d);let p=i.mapDesc(f,!0);a.push(c.range.map(p)),i=i.compose(d),l=_e.mapEffects(l,d).concat(_e.mapEffects(Pu(c.effects),p))}return{changes:i,selection:J.create(a,n.mainIndex),effects:l}}changes(t=[]){return t instanceof Yt?t:Yt.of(t,this.doc.length,this.facet(qe.lineSeparator))}toText(t){return Je.of(t.split(this.facet(qe.lineSeparator)||Z1))}sliceDoc(t=0,n=this.doc.length){return this.doc.sliceString(t,n,this.lineBreak)}facet(t){let n=this.config.address[t.id];return n==null?t.default:(Xf(this,n),ng(this,n))}toJSON(t){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let r in t){let i=t[r];i instanceof Nn&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(t[r]),this))}return n}static fromJSON(t,n={},r){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let a in r)if(Object.prototype.hasOwnProperty.call(t,a)){let l=r[a],s=t[a];i.push(l.init(c=>l.spec.fromJSON(s,c)))}}return qe.create({doc:t.doc,selection:J.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=tg.resolve(t.extensions||[],new Map),r=t.doc instanceof Je?t.doc:Je.of((t.doc||"").split(n.staticFacet(qe.lineSeparator)||Z1)),i=t.selection?t.selection instanceof J?t.selection:J.single(t.selection.anchor,t.selection.head):J.single(0);return hL(i,r.length),n.staticFacet(rS)||(i=i.asSingle()),new qe(n,r,i,n.dynamicSlots.map(()=>null),(a,l)=>l.create(a),null)}get tabSize(){return this.facet(qe.tabSize)}get lineBreak(){return this.facet(qe.lineSeparator)||`
59
- `}get readOnly(){return this.facet(bL)}phrase(t,...n){for(let r of this.facet(qe.phrases))if(Object.prototype.hasOwnProperty.call(r,t)){t=r[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let a=+(i||1);return!a||a>n.length?r:n[a-1]})),t}languageDataAt(t,n,r=-1){let i=[];for(let a of this.facet(pL))for(let l of a(this,n,r))Object.prototype.hasOwnProperty.call(l,t)&&i.push(l[t]);return i}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return z7(n.length?n[0]:"")}wordAt(t){let{text:n,from:r,length:i}=this.doc.lineAt(t),a=this.charCategorizer(t),l=t-r,s=t-r;for(;l>0;){let c=on(n,l,!1);if(a(n.slice(c,l))!=Ot.Word)break;l=c}for(;s<i;){let c=on(n,s);if(a(n.slice(s,c))!=Ot.Word)break;s=c}return l==s?null:J.range(l+r,s+r)}}qe.allowMultipleSelections=rS;qe.tabSize=me.define({combine:e=>e.length?e[0]:4});qe.lineSeparator=mL;qe.readOnly=bL;qe.phrases=me.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(i=>e[i]==t[i])}});qe.languageData=pL;qe.changeFilter=gL;qe.transactionFilter=vL;qe.transactionExtender=yL;Nv.reconfigure=_e.define();function aa(e,t,n={}){let r={};for(let i of e)for(let a of Object.keys(i)){let l=i[a],s=r[a];if(s===void 0)r[a]=l;else if(!(s===l||l===void 0))if(Object.hasOwnProperty.call(n,a))r[a]=n[a](s,l);else throw new Error("Config merge conflict for field "+a)}for(let i in t)r[i]===void 0&&(r[i]=t[i]);return r}class Xl{eq(t){return this==t}range(t,n=t){return lS.create(t,n,this)}}Xl.prototype.startSide=Xl.prototype.endSide=0;Xl.prototype.point=!1;Xl.prototype.mapMode=Fn.TrackDel;function wO(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}let lS=class wL{constructor(t,n,r){this.from=t,this.to=n,this.value=r}static create(t,n,r){return new wL(t,n,r)}};function oS(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class OO{constructor(t,n,r,i){this.from=t,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,n,r,i=0){let a=r?this.to:this.from;for(let l=i,s=a.length;;){if(l==s)return l;let c=l+s>>1,f=a[c]-t||(r?this.value[c].endSide:this.value[c].startSide)-n;if(c==l)return f>=0?l:s;f>=0?s=c:l=c+1}}between(t,n,r,i){for(let a=this.findIndex(n,-1e9,!0),l=this.findIndex(r,1e9,!1,a);a<l;a++)if(i(this.from[a]+t,this.to[a]+t,this.value[a])===!1)return!1}map(t,n){let r=[],i=[],a=[],l=-1,s=-1;for(let c=0;c<this.value.length;c++){let f=this.value[c],d=this.from[c]+t,p=this.to[c]+t,g,v;if(d==p){let y=n.mapPos(d,f.startSide,f.mapMode);if(y==null||(g=v=y,f.startSide!=f.endSide&&(v=n.mapPos(d,f.endSide),v<g)))continue}else if(g=n.mapPos(d,f.startSide),v=n.mapPos(p,f.endSide),g>v||g==v&&f.startSide>0&&f.endSide<=0)continue;(v-g||f.endSide-f.startSide)<0||(l<0&&(l=g),f.point&&(s=Math.max(s,v-g)),r.push(f),i.push(g-l),a.push(v-l))}return{mapped:r.length?new OO(i,a,r,s):null,pos:l}}}class ze{constructor(t,n,r,i){this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(t,n,r,i){return new ze(t,n,r,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,l=t.filter;if(n.length==0&&!l)return this;if(r&&(n=n.slice().sort(oS)),this.isEmpty)return n.length?ze.of(n):this;let s=new OL(this,null,-1).goto(0),c=0,f=[],d=new Ha;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let p=n[c++];d.addInner(p.from,p.to,p.value)||f.push(p)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!l||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&d.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!l||i>s.to||a<s.from||l(s.from,s.to,s.value))&&(d.addInner(s.from,s.to,s.value)||f.push(lS.create(s.from,s.to,s.value))),s.next());return d.finishInner(this.nextLayer.isEmpty&&!f.length?ze.empty:this.nextLayer.update({add:f,filter:l,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let l=0;l<this.chunk.length;l++){let s=this.chunkPos[l],c=this.chunk[l],f=t.touchesRange(s,s+c.length);if(f===!1)i=Math.max(i,c.maxPoint),n.push(c),r.push(t.mapPos(s));else if(f===!0){let{mapped:d,pos:p}=c.map(s,t);d&&(i=Math.max(i,d.maxPoint),n.push(d),r.push(p))}}let a=this.nextLayer.map(t);return n.length==0?a:new ze(r,n,a||ze.empty,i)}between(t,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let a=this.chunkPos[i],l=this.chunk[i];if(n>=a&&t<=a+l.length&&l.between(a,t-a,n-a,r)===!1)return}this.nextLayer.between(t,n,r)}}iter(t=0){return dh.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return dh.from(t).goto(n)}static compare(t,n,r,i,a=-1){let l=t.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=a),s=n.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=a),c=zM(l,s,r),f=new wf(l,c,a),d=new wf(s,c,a);r.iterGaps((p,g,v)=>$M(f,p,d,g,v,i)),r.empty&&r.length==0&&$M(f,0,d,0,0,i)}static eq(t,n,r=0,i){i==null&&(i=999999999);let a=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),l=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(a.length!=l.length)return!1;if(!a.length)return!0;let s=zM(a,l),c=new wf(a,s,0).goto(r),f=new wf(l,s,0).goto(r);for(;;){if(c.to!=f.to||!sS(c.active,f.active)||c.point&&(!f.point||!wO(c.point,f.point)))return!1;if(c.to>i)return!0;c.next(),f.next()}}static spans(t,n,r,i,a=-1){let l=new wf(t,null,a).goto(n),s=n,c=l.openStart;for(;;){let f=Math.min(l.to,r);if(l.point){let d=l.activeForPoint(l.to),p=l.pointFrom<n?d.length+1:l.point.startSide<0?d.length:Math.min(d.length,c);i.point(s,f,l.point,d,p,l.pointRank),c=Math.min(l.openEnd(f),d.length)}else f>s&&(i.span(s,f,l.active,c),c=l.openEnd(f));if(l.to>r)return c+(l.point&&l.to>r?1:0);s=l.to,l.next()}}static of(t,n=!1){let r=new Ha;for(let i of t instanceof lS?[t]:n?$7(t):t)r.add(i.from,i.to,i.value);return r.finish()}static join(t){if(!t.length)return ze.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=ze.empty;i=i.nextLayer)n=new ze(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}ze.empty=new ze([],[],null,-1);function $7(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(oS(t,r)>0)return e.slice().sort(oS);t=r}return e}ze.empty.nextLayer=ze.empty;class Ha{finishChunk(t){this.chunks.push(new OO(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new Ha)).add(t,n,r)}addInner(t,n,r){let i=t-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=t,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+t,this.lastTo=n.to[r]+t,!0}finish(){return this.finishInner(ze.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=ze.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function zM(e,t,n){let r=new Map;for(let a of e)for(let l=0;l<a.chunk.length;l++)a.chunk[l].maxPoint<=0&&r.set(a.chunk[l],a.chunkPos[l]);let i=new Set;for(let a of t)for(let l=0;l<a.chunk.length;l++){let s=r.get(a.chunk[l]);s!=null&&(n?n.mapPos(s):s)==a.chunkPos[l]&&!n?.touchesRange(s,s+a.chunk[l].length)&&i.add(a.chunk[l])}return i}class OL{constructor(t,n,r,i=0){this.layer=t,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,n,!1),this}gotoInner(t,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<t||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,n){(this.to-t||this.endSide-n)<0&&this.gotoInner(t,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let t=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=t+n.from[this.rangeIndex];if(this.from=r,this.to=t+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class dh{constructor(t){this.heap=t}static from(t,n=null,r=-1){let i=[];for(let a=0;a<t.length;a++)for(let l=t[a];!l.isEmpty;l=l.nextLayer)l.maxPoint>=r&&i.push(new OL(l,n,r,a));return i.length==1?i[0]:new dh(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let r of this.heap)r.goto(t,n);for(let r=this.heap.length>>1;r>=0;r--)vx(this.heap,r);return this.next(),this}forward(t,n){for(let r of this.heap)r.forward(t,n);for(let r=this.heap.length>>1;r>=0;r--)vx(this.heap,r);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),vx(this.heap,0)}}}function vx(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}class wf{constructor(t,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=dh.from(t,n,r)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){Hp(this.active,t),Hp(this.activeTo,t),Hp(this.activeRank,t),this.minActive=UM(this.active,this.activeTo)}addActive(t){let n=0,{value:r,to:i,rank:a}=this.cursor;for(;n<this.activeRank.length&&(a-this.activeRank[n]||i-this.activeTo[n])>0;)n++;Fp(this.active,n,r),Fp(this.activeTo,n,i),Fp(this.activeRank,n,a),t&&Fp(t,n,this.cursor.from),this.minActive=UM(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Hp(r,i)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let a=this.cursor.value;if(!a.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=a,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=a.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<t;i--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>t||this.activeTo[r]==t&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(t){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>t;r--)n++;return n}}function $M(e,t,n,r,i,a){e.goto(t),n.goto(r);let l=r+i,s=r,c=r-t,f=!!a.boundChange;for(let d=!1;;){let p=e.to+c-n.to,g=p||e.endSide-n.endSide,v=g<0?e.to+c:n.to,y=Math.min(v,l);if(e.point||n.point?(e.point&&n.point&&wO(e.point,n.point)&&sS(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,y,e.point,n.point),d=!1):(d&&a.boundChange(s),y>s&&!sS(e.active,n.active)&&a.compareRange(s,y,e.active,n.active),f&&y<l&&(p||e.openEnd(v)!=n.openEnd(v))&&(d=!0)),v>l)break;s=v,g<=0&&e.next(),g>=0&&n.next()}}function sS(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!wO(e[n],t[n]))return!1;return!0}function Hp(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function Fp(e,t,n){for(let r=e.length-1;r>=t;r--)e[r+1]=e[r];e[t]=n}function UM(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function fc(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=on(e,i));return r}function uS(e,t,n,r){for(let i=0,a=0;;){if(a>=t)return i;if(i==e.length)break;a+=e.charCodeAt(i)==9?n-a%n:1,i=on(e,i)}return r===!0?-1:e.length}const cS="ͼ",HM=typeof Symbol>"u"?"__"+cS:Symbol.for(cS),fS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),FM=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Ql{constructor(t,n){this.rules=[];let{finish:r}=n||{};function i(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function a(l,s,c,f){let d=[],p=/^@(\w+)\b/.exec(l[0]),g=p&&p[1]=="keyframes";if(p&&s==null)return c.push(l[0]+";");for(let v in s){let y=s[v];if(/&/.test(v))a(v.split(/,\s*/).map(x=>l.map(w=>x.replace(/&/,w))).reduce((x,w)=>x.concat(w)),y,c);else if(y&&typeof y=="object"){if(!p)throw new RangeError("The value of a property ("+v+") should be a primitive value.");a(i(v),y,d,g)}else y!=null&&d.push(v.replace(/_.*/,"").replace(/[A-Z]/g,x=>"-"+x.toLowerCase())+": "+y+";")}(d.length||g)&&c.push((r&&!p&&!f?l.map(r):l).join(", ")+" {"+d.join(" ")+"}")}for(let l in t)a(i(l),t[l],this.rules)}getRules(){return this.rules.join(`
60
- `)}static newName(){let t=FM[HM]||1;return FM[HM]=t+1,cS+t.toString(36)}static mount(t,n,r){let i=t[fS],a=r&&r.nonce;i?a&&i.setNonce(a):i=new U7(t,a),i.mount(Array.isArray(n)?n:[n],t)}}let qM=new Map;class U7{constructor(t,n){let r=t.ownerDocument||t,i=r.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let a=qM.get(r);if(a)return t[fS]=a;this.sheet=new i.CSSStyleSheet,qM.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[fS]=this}mount(t,n){let r=this.sheet,i=0,a=0;for(let l=0;l<t.length;l++){let s=t[l],c=this.modules.indexOf(s);if(c<a&&c>-1&&(this.modules.splice(c,1),a--,c=-1),c==-1){if(this.modules.splice(a++,0,s),r)for(let f=0;f<s.rules.length;f++)r.insertRule(s.rules[f],i++)}else{for(;a<c;)i+=this.modules[a++].rules.length;i+=s.rules.length,a++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let l="";for(let c=0;c<this.modules.length;c++)l+=this.modules[c].getRules()+`
61
- `;this.styleTag.textContent=l;let s=n.head||n;this.styleTag.parentNode!=s&&s.insertBefore(this.styleTag,s.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var Yl={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ph={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},H7=typeof navigator<"u"&&/Mac/.test(navigator.platform),F7=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var On=0;On<10;On++)Yl[48+On]=Yl[96+On]=String(On);for(var On=1;On<=24;On++)Yl[On+111]="F"+On;for(var On=65;On<=90;On++)Yl[On]=String.fromCharCode(On+32),ph[On]=String.fromCharCode(On);for(var yx in Yl)ph.hasOwnProperty(yx)||(ph[yx]=Yl[yx]);function q7(e){var t=H7&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||F7&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?ph:Yl)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function ot(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)AL(e,arguments[t]);return e}function AL(e,t){if(typeof t=="string")e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)AL(e,t[n]);else throw new RangeError("Unsupported child node: "+t)}let Un=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},hS=typeof document<"u"?document:{documentElement:{style:{}}};const dS=/Edge\/(\d+)/.exec(Un.userAgent),kL=/MSIE \d/.test(Un.userAgent),pS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Un.userAgent),Rv=!!(kL||pS||dS),WM=!Rv&&/gecko\/(\d+)/i.test(Un.userAgent),bx=!Rv&&/Chrome\/(\d+)/.exec(Un.userAgent),VM="webkitFontSmoothing"in hS.documentElement.style,mS=!Rv&&/Apple Computer/.test(Un.vendor),KM=mS&&(/Mobile\/\w+/.test(Un.userAgent)||Un.maxTouchPoints>2);var pe={mac:KM||/Mac/.test(Un.platform),windows:/Win/.test(Un.platform),linux:/Linux|X11/.test(Un.platform),ie:Rv,ie_version:kL?hS.documentMode||6:pS?+pS[1]:dS?+dS[1]:0,gecko:WM,gecko_version:WM?+(/Firefox\/(\d+)/.exec(Un.userAgent)||[0,0])[1]:0,chrome:!!bx,chrome_version:bx?+bx[1]:0,ios:KM,android:/Android\b/.test(Un.userAgent),webkit:VM,webkit_version:VM?+(/\bAppleWebKit\/(\d+)/.exec(Un.userAgent)||[0,0])[1]:0,safari:mS,safari_version:mS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Un.userAgent)||[0,0])[1]:0,tabSize:hS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function AO(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const rg=Object.create(null);function kO(e,t,n){if(e==t)return!0;e||(e=rg),t||(t=rg);let r=Object.keys(e),i=Object.keys(t);if(r.length-0!=i.length-0)return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function W7(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]==null&&e.removeAttribute(r)}for(let n in t){let r=t[n];n=="style"?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function XM(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i=="style"?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i=="style"?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function V7(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}class la{eq(t){return!1}updateDOM(t,n,r){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var kn=(function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e})(kn||(kn={}));class Ce extends Xl{constructor(t,n,r,i){super(),this.startSide=t,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(t){return new qh(t)}static widget(t){let n=Math.max(-1e4,Math.min(1e4,t.side||0)),r=!!t.block;return n+=r&&!t.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new ls(t,n,n,r,t.widget||null,!1)}static replace(t){let n=!!t.block,r,i;if(t.isBlockGap)r=-5e8,i=4e8;else{let{start:a,end:l}=CL(t,n);r=(a?n?-3e8:-1:5e8)-1,i=(l?n?2e8:1:-6e8)+1}return new ls(t,r,i,n,t.widget||null,!0)}static line(t){return new Wh(t)}static set(t,n=!1){return ze.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ce.none=ze.empty;class qh extends Ce{constructor(t){let{start:n,end:r}=CL(t);super(n?-1:5e8,r?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?AO(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||rg}eq(t){return this==t||t instanceof qh&&this.tagName==t.tagName&&kO(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}qh.prototype.point=!1;class Wh extends Ce{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Wh&&this.spec.class==t.spec.class&&kO(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}Wh.prototype.mapMode=Fn.TrackBefore;Wh.prototype.point=!0;class ls extends Ce{constructor(t,n,r,i,a,l){super(n,r,a,t),this.block=i,this.isReplace=l,this.mapMode=i?n<=0?Fn.TrackBefore:Fn.TrackAfter:Fn.TrackDel}get type(){return this.startSide!=this.endSide?kn.WidgetRange:this.startSide<=0?kn.WidgetBefore:kn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof ls&&K7(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}ls.prototype.point=!0;function CL(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n==null&&(n=e.inclusive),r==null&&(r=e.inclusive),{start:n??t,end:r??t}}function K7(e,t){return e==t||!!(e&&t&&e.compare(t))}function _u(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}class mh extends Xl{constructor(t,n,r){super(),this.tagName=t,this.attributes=n,this.rank=r}eq(t){return t==this||t instanceof mh&&this.tagName==t.tagName&&kO(this.attributes,t.attributes)}static create(t){return new mh(t.tagName,t.attributes||rg,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return ze.of(t,n)}}mh.prototype.startSide=mh.prototype.endSide=-1;function gh(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function gS(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function Qf(e,t){if(!t.anchorNode)return!1;try{return gS(e,t.anchorNode)}catch{return!1}}function Yf(e){return e.nodeType==3?yh(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function Gf(e,t,n,r){return n?QM(e,t,n,r,-1)||QM(e,t,n,r,1):!1}function Gl(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function ig(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function QM(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Fa(e))){if(e.nodeName=="DIV")return!1;let a=e.parentNode;if(!a||a.nodeType!=1)return!1;t=Gl(e)+(i<0?0:1),e=a}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=i<0?Fa(e):0}else return!1}}function Fa(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function vh(e,t){let{left:n,right:r}=e;if(n==r)return e;let i=t?n:r;return{left:i,right:i,top:e.top,bottom:e.bottom}}function X7(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function EL(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function Q7(e,t,n,r,i,a,l,s){let c=e.ownerDocument,f=c.defaultView||window;for(let d=e,p=!1;d&&!p;)if(d.nodeType==1){let g,v=d==c.body,y=1,x=1;if(v)g=X7(f);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(p=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let C=d.getBoundingClientRect();({scaleX:y,scaleY:x}=EL(d,C)),g={left:C.left,right:C.left+d.clientWidth*y,top:C.top,bottom:C.top+d.clientHeight*x}}let w=0,A=0;if(i=="nearest")t.top<g.top+l?(A=t.top-(g.top+l),n>0&&t.bottom>g.bottom+A&&(A=t.bottom-g.bottom+l)):t.bottom>g.bottom-l&&(A=t.bottom-g.bottom+l,n<0&&t.top-A<g.top&&(A=t.top-(g.top+l)));else{let C=t.bottom-t.top,k=g.bottom-g.top;A=(i=="center"&&C<=k?t.top+C/2-k/2:i=="start"||i=="center"&&n<0?t.top-l:t.bottom-k+l)-g.top}if(r=="nearest"?t.left<g.left+a?(w=t.left-(g.left+a),n>0&&t.right>g.right+w&&(w=t.right-g.right+a)):t.right>g.right-a&&(w=t.right-g.right+a,n<0&&t.left<g.left+w&&(w=t.left-(g.left+a))):w=(r=="center"?t.left+(t.right-t.left)/2-(g.right-g.left)/2:r=="start"==s?t.left-a:t.right-(g.right-g.left)+a)-g.left,w||A)if(v)f.scrollBy(w,A);else{let C=0,k=0;if(A){let P=d.scrollTop;d.scrollTop+=A/x,k=(d.scrollTop-P)*x}if(w){let P=d.scrollLeft;d.scrollLeft+=w/y,C=(d.scrollLeft-P)*y}t={left:t.left-C,top:t.top-k,right:t.right-C,bottom:t.bottom-k},C&&Math.abs(C-w)<1&&(r="nearest"),k&&Math.abs(k-A)<1&&(i="nearest")}if(v)break;(t.top<g.top||t.bottom>g.bottom||t.left<g.left||t.right>g.right)&&(t={left:Math.max(t.left,g.left),right:Math.min(t.right,g.right),top:Math.max(t.top,g.top),bottom:Math.min(t.bottom,g.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function TL(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}class Y7{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:r}=t;this.set(n,Math.min(t.anchorOffset,n?Fa(n):0),r,Math.min(t.focusOffset,r?Fa(r):0))}set(t,n,r,i){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Ro=null;pe.safari&&pe.safari_version>=26&&(Ro=!1);function ML(e){if(e.setActive)return e.setActive();if(Ro)return e.focus(Ro);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(Ro==null?{get preventScroll(){return Ro={preventScroll:!0},!0}}:void 0),!Ro){Ro=!1;for(let n=0;n<t.length;){let r=t[n++],i=t[n++],a=t[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=a&&(r.scrollLeft=a)}}}let YM;function yh(e,t,n=t){let r=YM||(YM=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function Nu(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent("keydown",i);a.synthetic=!0,e.dispatchEvent(a);let l=new KeyboardEvent("keyup",i);return l.synthetic=!0,e.dispatchEvent(l),a.defaultPrevented||l.defaultPrevented}function G7(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function Z7(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,Fa(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Fa(n))}else{if(n==e)return!0;r=Gl(n),n=n.parentNode}}function DL(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function PL(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Fa(n)}else if(n.parentNode&&!ig(n))r=Gl(n),n=n.parentNode;else return null}}function _L(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!ig(n))r=Gl(n)+1,n=n.parentNode;else return null}}class di{constructor(t,n,r=!0){this.node=t,this.offset=n,this.precise=r}static before(t,n){return new di(t.parentNode,Gl(t),n)}static after(t,n){return new di(t.parentNode,Gl(t)+1,n)}}var ft=(function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e})(ft||(ft={}));const os=ft.LTR,CO=ft.RTL;function NL(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const J7=NL("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),eK=NL("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),vS=Object.create(null),Pi=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);vS[t]=n,vS[n]=-t}function RL(e){return e<=247?J7[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?eK[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const tK=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class qi{get dir(){return this.level%2?CO:os}constructor(t,n,r){this.from=t,this.to=n,this.level=r}side(t,n){return this.dir==n==t?this.to:this.from}forward(t,n){return t==(this.dir==n)}static find(t,n,r,i){let a=-1;for(let l=0;l<t.length;l++){let s=t[l];if(s.from<=n&&s.to>=n){if(s.level==r)return l;(a<0||(i!=0?i<0?s.from<n:s.to>n:t[a].level>s.level))&&(a=l)}}if(a<0)throw new RangeError("Index out of range");return a}}function jL(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!jL(r.inner,i.inner))return!1}return!0}const ct=[];function nK(e,t,n,r,i){for(let a=0;a<=r.length;a++){let l=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let f=l,d=c,p=c;f<s;f++){let g=RL(e.charCodeAt(f));g==512?g=d:g==8&&p==4&&(g=16),ct[f]=g==4?2:g,g&7&&(p=g),d=g}for(let f=l,d=c,p=c;f<s;f++){let g=ct[f];if(g==128)f<s-1&&d==ct[f+1]&&d&24?g=ct[f]=d:ct[f]=256;else if(g==64){let v=f+1;for(;v<s&&ct[v]==64;)v++;let y=f&&d==8||v<n&&ct[v]==8?p==1?1:8:256;for(let x=f;x<v;x++)ct[x]=y;f=v-1}else g==8&&p==1&&(ct[f]=1);d=g,g&7&&(p=g)}}}function rK(e,t,n,r,i){let a=i==1?2:1;for(let l=0,s=0,c=0;l<=r.length;l++){let f=l?r[l-1].to:t,d=l<r.length?r[l].from:n;for(let p=f,g,v,y;p<d;p++)if(v=vS[g=e.charCodeAt(p)])if(v<0){for(let x=s-3;x>=0;x-=3)if(Pi[x+1]==-v){let w=Pi[x+2],A=w&2?i:w&4?w&1?a:i:0;A&&(ct[p]=ct[Pi[x]]=A),s=x;break}}else{if(Pi.length==189)break;Pi[s++]=p,Pi[s++]=g,Pi[s++]=c}else if((y=ct[p])==2||y==1){let x=y==i;c=x?0:1;for(let w=s-3;w>=0;w-=3){let A=Pi[w+2];if(A&2)break;if(x)Pi[w+2]|=2;else{if(A&4)break;Pi[w+2]|=4}}}}}function iK(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let l=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=l;c<s;){let f=ct[c];if(f==256){let d=c+1;for(;;)if(d==s){if(i==n.length)break;d=n[i++].to,s=i<n.length?n[i].from:t}else if(ct[d]==256)d++;else break;let p=a==1,g=(d<t?ct[d]:r)==1,v=p==g?p?1:2:r;for(let y=d,x=i,w=x?n[x-1].to:e;y>c;)y==w&&(y=n[--x].from,w=x?n[x-1].to:e),ct[--y]=v;c=d}else a=f,c++}}}function yS(e,t,n,r,i,a,l){let s=r%2?2:1;if(r%2==i%2)for(let c=t,f=0;c<n;){let d=!0,p=!1;if(f==a.length||c<a[f].from){let x=ct[c];x!=s&&(d=!1,p=x==16)}let g=!d&&s==1?[]:null,v=d?r:r+1,y=c;e:for(;;)if(f<a.length&&y==a[f].from){if(p)break e;let x=a[f];if(!d)for(let w=x.to,A=f+1;;){if(w==n)break e;if(A<a.length&&a[A].from==w)w=a[A++].to;else{if(ct[w]==s)break e;break}}if(f++,g)g.push(x);else{x.from>c&&l.push(new qi(c,x.from,v));let w=x.direction==os!=!(v%2);bS(e,w?r+1:r,i,x.inner,x.from,x.to,l),c=x.to}y=x.to}else{if(y==n||(d?ct[y]!=s:ct[y]==s))break;y++}g?yS(e,c,y,r+1,i,g,l):c<y&&l.push(new qi(c,y,v)),c=y}else for(let c=n,f=a.length;c>t;){let d=!0,p=!1;if(!f||c>a[f-1].to){let x=ct[c-1];x!=s&&(d=!1,p=x==16)}let g=!d&&s==1?[]:null,v=d?r:r+1,y=c;e:for(;;)if(f&&y==a[f-1].to){if(p)break e;let x=a[--f];if(!d)for(let w=x.from,A=f;;){if(w==t)break e;if(A&&a[A-1].to==w)w=a[--A].from;else{if(ct[w-1]==s)break e;break}}if(g)g.push(x);else{x.to<c&&l.push(new qi(x.to,c,v));let w=x.direction==os!=!(v%2);bS(e,w?r+1:r,i,x.inner,x.from,x.to,l),c=x.from}y=x.from}else{if(y==t||(d?ct[y-1]!=s:ct[y-1]==s))break;y--}g?yS(e,y,c,r+1,i,g,l):y<c&&l.push(new qi(y,c,v)),c=y}}function bS(e,t,n,r,i,a,l){let s=t%2?2:1;nK(e,i,a,r,s),rK(e,i,a,r,s),iK(i,a,r,s),yS(e,i,a,t,n,r,l)}function aK(e,t,n){if(!e)return[new qi(0,0,t==CO?1:0)];if(t==os&&!n.length&&!tK.test(e))return IL(e.length);if(n.length)for(;e.length>ct.length;)ct[ct.length]=256;let r=[],i=t==os?0:1;return bS(e,i,i,n,0,e.length,r),r}function IL(e){return[new qi(0,e,0)]}let LL="";function lK(e,t,n,r,i){var a;let l=r.head-e.from,s=qi.find(t,l,(a=r.bidiLevel)!==null&&a!==void 0?a:-1,r.assoc),c=t[s],f=c.side(i,n);if(l==f){let g=s+=i?1:-1;if(g<0||g>=t.length)return null;c=t[s=g],l=c.side(!i,n),f=c.side(i,n)}let d=on(e.text,l,c.forward(i,n));(d<c.from||d>c.to)&&(d=f),LL=e.text.slice(Math.min(l,d),Math.max(l,d));let p=s==(i?t.length-1:0)?null:t[s+(i?1:-1)];return p&&d==f&&p.level+(i?0:1)<c.level?J.cursor(p.side(!i,n)+e.from,p.forward(i,n)?1:-1,p.level):J.cursor(d+e.from,c.forward(i,n)?-1:1,c.level)}function oK(e,t,n){for(let r=t;r<n;r++){let i=RL(e.charCodeAt(r));if(i==1)return os;if(i==2||i==4)return CO}return os}const BL=me.define(),zL=me.define(),$L=me.define(),UL=me.define(),xS=me.define(),HL=me.define(),FL=me.define(),EO=me.define(),TO=me.define(),qL=me.define({combine:e=>e.some(t=>t)}),WL=me.define({combine:e=>e.some(t=>t)}),VL=me.define();class Ru{constructor(t,n,r,i,a,l=!1){this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=a,this.isSnapshot=l}map(t){return t.empty?this:new Ru(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new Ru(J.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const qp=_e.define({map:(e,t)=>e.map(t)}),KL=_e.define();function lr(e,t,n){let r=e.facet(UL);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const Ma=me.define({combine:e=>e.length?e[0]:!0});let sK=0;const wu=me.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}});class _t{constructor(t,n,r,i,a){this.id=t,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=a(this),this.extension=this.baseExtensions.concat(wu.of({plugin:this,arg:void 0}))}of(t){return this.baseExtensions.concat(wu.of({plugin:this,arg:t}))}static define(t,n){const{eventHandlers:r,eventObservers:i,provide:a,decorations:l}=n||{};return new _t(sK++,t,r,i,s=>{let c=[];return l&&c.push(jv.of(f=>{let d=f.plugin(s);return d?l(d):Ce.none})),a&&c.push(a(s)),c})}static fromClass(t,n){return _t.define((r,i)=>new t(r,i),n)}}class xx{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(lr(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){lr(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){lr(t.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const XL=me.define(),MO=me.define(),jv=me.define(),QL=me.define(),DO=me.define(),Vh=me.define(),YL=me.define();function GM(e,t){let n=e.state.facet(YL);if(!n.length)return n;let r=n.map(a=>a instanceof Function?a(e):a),i=[];return ze.spans(r,t.from,t.to,{point(){},span(a,l,s,c){let f=a-t.from,d=l-t.from,p=i;for(let g=s.length-1;g>=0;g--,c--){let v=s[g].spec.bidiIsolate,y;if(v==null&&(v=oK(t.text,f,d)),c>0&&p.length&&(y=p[p.length-1]).to==f&&y.direction==v)y.to=d,p=y.inner;else{let x={from:f,to:d,direction:v,inner:[]};p.push(x),p=x.inner}}}}),i}const GL=me.define();function PO(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(GL)){let l=a(e);l&&(l.left!=null&&(t=Math.max(t,l.left)),l.right!=null&&(n=Math.max(n,l.right)),l.top!=null&&(r=Math.max(r,l.top)),l.bottom!=null&&(i=Math.max(i,l.bottom)))}return{left:t,right:n,top:r,bottom:i}}const Bf=me.define();class Xr{constructor(t,n,r,i){this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}join(t){return new Xr(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,r=this;for(;n>0;n--){let i=t[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),t.splice(n-1,1)}}return t.splice(n,0,r),t}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,l=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,f=Math.min(s,c);if(f==1e9)break;let d=f+l,p=f,g=d;for(;;)if(a<n.length&&n[a]<=p){let v=n[a+1];a+=2,p=Math.max(p,v);for(let y=i;y<t.length&&t[y].fromB<=p;y++)l=t[y].toA-t[y].toB;g=Math.max(g,v+l)}else if(i<t.length&&t[i].fromB<=p){let v=t[i++];p=Math.max(p,v.toB),g=Math.max(g,v.toA),l=v.toA-v.toB}else break;r.push(new Xr(d,g,f,p))}return r}}class ag{constructor(t,n,r){this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=Yt.empty(this.startState.doc.length);for(let a of r)this.changes=this.changes.compose(a.changes);let i=[];this.changes.iterChangedRanges((a,l,s,c)=>i.push(new Xr(a,l,s,c))),this.changedRanges=i}static create(t,n,r){return new ag(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const uK=[];class Pt{constructor(t,n,r=0){this.dom=t,this.length=n,this.flags=r,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return uK}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&W7(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let r=n;for(let i of this.children){if(i==t)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,r){return null}domPosFor(t,n){let r=Gl(this.dom),i=this.length?t>0:n>0;return new di(this.parent.dom,r+(i?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof Lv)return t;return null}static get(t){return t.cmTile}}class Iv extends Pt{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,r=null,i,a=t?.node==n?t:null,l=0;for(let s of this.children){if(s.sync(t),l+=s.length+s.breakAfter,i=r?r.nextSibling:n.firstChild,a&&i!=s.dom&&(a.written=!0),s.dom.parentNode==n)for(;i&&i!=s.dom;)i=ZM(i);else n.insertBefore(s.dom,i);r=s.dom}for(i=r?r.nextSibling:n.firstChild,a&&i&&(a.written=!0);i;)i=ZM(i);this.length=l}}function ZM(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Lv extends Iv{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=Pt.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],r=this,i=0,a=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&a++,i=n.pop()}else{let l=r.children[i++];if(l instanceof La)n.push(i),r=l,i=0;else{let s=a+l.length,c=t(l,a);if(c!==void 0)return c;a=s+l.breakAfter}}}resolveBlock(t,n){let r,i=-1,a,l=-1;if(this.blockTiles((s,c)=>{let f=c+s.length;if(t>=c&&t<=f){if(s.isWidget()&&n>=-1&&n<=1){if(s.flags&32)return!0;s.flags&16&&(r=void 0)}(c<t||t==f&&(n<-1?s.length:s.covers(1)))&&(!r||!s.isWidget()&&r.isWidget())&&(r=s,i=t-c),(f>t||t==c&&(n>1?s.length:s.covers(-1)))&&(!a||!s.isWidget()&&a.isWidget())&&(a=s,l=t-c)}}),!r&&!a)throw new Error("No tile at position "+t);return r&&n<0||!a?{tile:r,offset:i}:{tile:a,offset:l}}}class La extends Iv{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new La(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class Wu extends Iv{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,r){let i=new Wu(n||document.createElement("div"),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(t,n,r){let i=null,a=-1,l=null,s=-1;function c(d,p){for(let g=0,v=0;g<d.children.length&&v<=p;g++){let y=d.children[g],x=v+y.length;x>=p&&(y.isComposite()?c(y,p-v):(!l||l.isHidden&&(n>0&&!(l.flags&32)||r&&fK(l,y)))&&(x>p||y.flags&32)?(l=y,s=p-v):(v<p||y.flags&16&&!y.isHidden)&&(i=y,a=p-v)),v=x}}c(this,t);let f=(n<0?i:l)||i||l;return f?{tile:f,offset:f==i?a:s}:null}coordsIn(t,n,r){let i=this.resolveInline(t,n,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),n,r):cK(this)}domIn(t,n){let r=this.resolveInline(t,n);if(r){let{tile:i,offset:a}=r;if(this.dom.contains(i.dom))return i.isText()?new di(i.dom,Math.min(i.dom.nodeValue.length,a)):i.domPosFor(a,i.flags&16?1:i.flags&32?-1:n);let l=r.tile.parent,s=!1;for(let c of l.children){if(s)return new di(c.dom,0);c==r.tile&&(s=!0)}}return new di(this.dom,0)}}function cK(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=Yf(t);return n[n.length-1]||null}function fK(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}class ar extends Iv{constructor(t,n){super(t),this.mark=n}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new ar(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class Ho extends Pt{constructor(t,n){super(t,n.length),this.text=n}sync(t){this.flags&2||(super.sync(t),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(t,n,r){let i=this.dom.nodeValue.length;t>i&&(t=i);let a=t,l=t,s=0;t==0&&n<0||t==i&&n>=0?pe.chrome||pe.gecko||(t?(a--,s=1):l<i&&(l++,s=-1)):n<0?a--:l<i&&l++;let c=yh(this.dom,a,l).getClientRects();if(!c.length)return null;let f=c[(s?s<0:n>=0)?0:c.length-1];return pe.safari&&!s&&f.width==0&&(f=Array.prototype.find.call(c,d=>d.width)||f),r==null?f:vh(f,(s?s>0:n<0)==r)}static of(t,n){let r=new Ho(n||document.createTextNode(t),t);return n||(r.flags|=2),r}}class ss extends Pt{constructor(t,n,r,i){super(t,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,r){let i=this.widget.coordsAt(this.dom,t,n);if(i)return i;if(r)return vh(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let a=this.dom.getClientRects(),l=null;if(!a.length)return null;let s=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=s?a.length-1:0;l=a[c],!(t>0?c==0:c==a.length-1||l.top<l.bottom);c+=s?-1:1);return vh(l,!s)}}get overrideDOMText(){if(!this.length)return Je.empty;let{root:t}=this;if(!t)return Je.empty;let n=this.posAtStart;return t.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable="false")),new ss(a,r,t,i)}}class lg extends Pt{constructor(t){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,t)}get isHidden(){return!0}get overrideDOMText(){return Je.empty}coordsIn(t,n,r){let i=this.dom.getBoundingClientRect();return r==null?i:vh(i,n>0==r)}}class hK{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,r){let{tile:i,index:a,beforeBreak:l,parents:s}=this;for(;t||n>0;)if(i.isComposite())if(l){if(!t)break;r&&r.break(),t--,l=!1}else if(a==i.children.length){if(!t&&!s.length)break;r&&r.leave(i),l=!!i.breakAfter,{tile:i,index:a}=s.pop(),a++}else{let c=i.children[a],f=c.breakAfter;(n>0?c.length<=t:c.length<t)&&(!r||r.skip(c,0,c.length)!==!1||!c.isComposite)?(l=!!f,a++,t-=c.length):(s.push({tile:i,index:a}),i=c,a=0,r&&c.isComposite()&&r.enter(c))}else if(a==i.length)l=!!i.breakAfter,{tile:i,index:a}=s.pop(),a++;else if(t){let c=Math.min(t,i.length-a);r&&r.skip(i,a,a+c),t-=c,a+=c}else break;return this.tile=i,this.index=a,this.beforeBreak=l,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class dK{constructor(t,n,r,i){this.from=t,this.to=n,this.wrapper=r,this.rank=i}}class pK{constructor(t,n,r){this.cache=t,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(t,n,r,i){var a;this.flushBuffer();let l=this.ensureMarks(n,r),s=l.lastChild;if(s&&s.isText()&&!(s.flags&8)&&s.length+t.length<512){this.cache.reused.set(s,2);let c=l.children[l.children.length-1]=new Ho(s.dom,s.text+t);c.parent=l}else l.append(i||Ho.of(t,(a=this.cache.find(Ho))===null||a===void 0?void 0:a.dom));this.pos+=t.length,this.afterWidget=null}addComposition(t,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?Sx(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let s=n.marks.length-1;s>=0;s--){let c=n.marks[s],f=i.lastChild;if(f instanceof ar&&f.mark.eq(c.mark))f.dom!=c.dom&&f.setDOM(Sx(c.dom)),i=f;else{if(this.cache.reused.get(c)){let p=Pt.get(c.dom);p&&p.setDOM(Sx(c.dom))}let d=ar.of(c.mark,c.dom);i.append(d),i=d}this.cache.reused.set(c,2)}let a=Pt.get(t.text);a&&this.cache.reused.set(a,2);let l=new Ho(t.text,t.text.nodeValue);l.flags|=8,this.pos=t.range.toB,i.append(l)}addInlineWidget(t,n,r){let i=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);i||this.flushBuffer();let a=this.ensureMarks(n,r);!i&&!(t.flags&16)&&a.append(this.getBuffer(1)),a.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var r;t||(t=ZL);let i=Wu.start(t,n||((r=this.cache.find(Wu))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var r;let i=this.curLine;for(let a=t.length-1;a>=0;a--){let l=t[a],s;if(n>0&&(s=i.lastChild)&&s instanceof ar&&s.mark.eq(l))i=s,n--;else{let c=ar.of(l,(r=this.cache.find(ar,f=>f.mark.eq(l)))===null||r===void 0?void 0:r.dom);i.append(c),i=c,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!JM(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(pe.ios&&JM(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(wx,0,32)||new ss(wx.toDOM(),0,wx,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to<this.pos&&this.wrappers.splice(t,1);for(let t=this.blockWrappers;t.value&&t.from<=this.pos;t.next())if(t.to>=this.pos){let n=t.rank*102+t.value.rank,r=new dK(t.from,t.to,t.value,n),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-r.rank||this.wrappers[i-1].to-r.to)<0;)i--;this.wrappers.splice(i,0,r)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof La&&i.wrapper.eq(r.wrapper))n=i;else{let a=La.of(r.wrapper,(t=this.cache.find(La,l=>l.wrapper.eq(r.wrapper)))===null||t===void 0?void 0:t.dom);n.append(a),n=a}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),r=this.cache.find(lg,void 0,1);return r&&(r.flags=n),r||new lg(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class mK{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:i,lineBreak:a,done:l}=this.cursor.next(this.skipCount);if(this.skipCount=0,l)throw new Error("Ran out of text content when drawing inline views");this.text=i;let s=this.textOff=Math.min(t,i.length);return a?null:i.slice(0,s)}let n=Math.min(this.text.length,this.textOff+t),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const og=[ss,Wu,Ho,ar,lg,La,Lv];for(let e=0;e<og.length;e++)og[e].bucket=e;class gK{constructor(t){this.view=t,this.buckets=og.map(()=>[]),this.index=og.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,r=this.buckets[n];r.length<6?r.push(t):r[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,r=2){let i=t.bucket,a=this.buckets[i],l=this.index[i];for(let s=0;s<a.length;s++){let c=(s+l)%a.length,f=a[c];if((!n||n(f))&&!this.reused.has(f))return a.splice(c,1),c<l&&this.index[i]--,this.reused.set(f,r),f}return null}findWidget(t,n,r){let i=this.buckets[0];if(i.length)for(let a=0,l=0;;a++){if(a==i.length){if(l)return null;l=1,a=0}let s=i[a];if(!this.reused.has(s)&&(l==0?s.widget.compare(t):s.widget.constructor==t.constructor&&t.updateDOM(s.dom,this.view,s.widget)))return i.splice(a,1),a<this.index[0]&&this.index[0]--,s.widget==t&&s.length==n&&(s.flags&497)==r?(this.reused.set(s,1),s):(this.reused.set(s,2),new ss(s.dom,n,t,s.flags&-498|r))}}reuse(t){return this.reused.set(t,1),t}maybeReuse(t,n=2){if(!this.reused.has(t))return this.reused.set(t,n),t.dom}clear(){for(let t=0;t<this.buckets.length;t++)this.buckets[t].length=this.index[t]=0}}class vK{constructor(t,n,r,i,a){this.view=t,this.decorations=i,this.disallowBlockEffectsFor=a,this.openWidget=!1,this.openMarks=0,this.cache=new gK(t),this.text=new mK(t.state.doc),this.builder=new pK(this.cache,new Lv(t,t.contentDOM),ze.iter(r)),this.cache.reused.set(n,2),this.old=new hK(n),this.reuseWalker={skip:(l,s,c)=>{if(this.cache.add(l),l.isComposite())return!1},enter:l=>this.cache.add(l),leave:()=>{},break:()=>{}}}run(t,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,a=0,l=0;;){let s=l<t.length?t[l++]:null,c=s?s.fromA:this.old.root.length;if(c>i){let f=c-i;this.preserve(f,!l,!s),i=c,a+=f}if(!s)break;n&&s.fromA<=n.range.fromA&&s.toA>=n.range.toA?(this.forward(s.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(a,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,s.toA),this.emit(n.range.toB,s.toB)):(this.forward(s.fromA,s.toA),this.emit(a,s.toB)),a=s.toB,i=s.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(t,n,r){let i=xK(this.old),a=this.openMarks;this.old.advance(t,r?1:-1,{skip:(l,s,c)=>{if(l.isWidget())if(this.openWidget)this.builder.continueWidget(c-s);else{let f=c>0||s<l.length?ss.of(l.widget,this.view,c-s,l.flags&496,this.cache.maybeReuse(l)):this.cache.reuse(l);f.flags&256?(f.flags&=-2,this.builder.addBlockWidget(f)):(this.builder.ensureLine(null),this.builder.addInlineWidget(f,i,a),a=i.length)}else if(l.isText())this.builder.ensureLine(null),!s&&c==l.length&&!this.cache.reused.has(l)?this.builder.addText(l.text,i,a,this.cache.reuse(l)):(this.cache.add(l),this.builder.addText(l.text.slice(s,c),i,a)),a=i.length;else if(l.isLine())l.flags&=-2,this.cache.reused.set(l,1),this.builder.addLine(l);else if(l instanceof lg)this.cache.add(l);else if(l instanceof ar)this.builder.ensureLine(null),this.builder.addMark(l,i,a),this.cache.reused.set(l,1),a=i.length;else return!1;this.openWidget=!1},enter:l=>{l.isLine()?this.builder.addLineStart(l.attrs,this.cache.maybeReuse(l)):(this.cache.add(l),l instanceof ar&&i.unshift(l.mark)),this.openWidget=!1},leave:l=>{l.isLine()?i.length&&(i.length=a=0):l instanceof ar&&(i.shift(),a=Math.min(a,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let r=null,i=this.builder,a=-1,l=ze.spans(this.decorations,t,n,{point:(s,c,f,d,p,g)=>{if(f instanceof ls){if(this.disallowBlockEffectsFor[g]){if(f.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(s).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(a=d.length,p>d.length)i.continueWidget(c-s);else{let v=f.widget||(f.block?Vu.block:Vu.inline),y=yK(f),x=this.cache.findWidget(v,c-s,y)||ss.of(v,this.view,c-s,y);f.block?(f.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(x)):(i.ensureLine(r),i.addInlineWidget(x,d,p))}r=null}else r=bK(r,f);c>s&&this.text.skip(c-s)},span:(s,c,f,d)=>{for(let p=s;p<c;){let g=this.text.next(Math.min(512,c-p));g==null?(i.addLineStartIfNotCovered(r),i.addBreak(),p++):(i.ensureLine(r),i.addText(g,f,p==s?d:f.length),p+=g.length),r=null}a=f.length}});a>-1&&(this.openWidget=l>a),this.openWidget||i.addLineStartIfNotCovered(r),this.openMarks=l}forward(t,n,r=1){n-t<=10?this.old.advance(n-t,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(t){let n=[],r=null;for(let i=t.parentNode;;i=i.parentNode){let a=Pt.get(i);if(i==this.view.contentDOM)break;a instanceof ar?n.push(a):a?.isLine()?r=a:a instanceof La||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new Wu(i,ZL):r||n.push(ar.of(new qh({tagName:i.nodeName.toLowerCase(),attributes:V7(i)}),i)))}return{line:r,marks:n}}}function JM(e,t){let n=r=>{for(let i of r.children)if((t?i.isText():i.length)||n(i))return!0;return!1};return n(e)}function yK(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const ZL={class:"cm-line"};function bK(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r||(e||(e={class:"cm-line"}),n&&AO(n,e),r&&(e.class+=" "+r)),e}function xK(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof ar&&t.push(r.mark)}return t}function Sx(e){let t=Pt.get(e);return t&&t.setDOM(e.cloneNode()),e}class Vu extends la{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Vu.inline=new Vu("span");Vu.block=new Vu("div");const wx=new class extends la{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class eD{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Ce.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Lv(t,t.contentDOM),this.updateInner([new Xr(0,0,0,t.state.doc.length)],null)}update(t){var n;let r=t.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:d,toA:p})=>p<this.minWidthFrom||d>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!MK(t.changes,this.hasComposition)&&!t.selectionSet&&(i=t.state.selection.main.head));let a=i>-1?wK(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:p}=this.hasComposition;r=new Xr(d,p,t.changes.mapPos(d,-1),t.changes.mapPos(p,1)).addToSet(r.slice())}this.hasComposition=a?{from:a.range.fromB,to:a.range.toB}:null,(pe.ie||pe.chrome)&&!a&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,s=this.blockWrappers;this.updateDeco();let c=kK(l,this.decorations,t.changes);c.length&&(r=Xr.extendWithRanges(r,c));let f=EK(s,this.blockWrappers,t.changes);return f.length&&(r=Xr.extendWithRanges(r,f)),a&&!r.some(d=>d.fromA<=a.range.fromA&&d.toA>=a.range.toA)&&(r=a.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,a),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||t.length){let l=this.tile,s=new vK(this.view,l,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Pt.get(n.text)&&s.cache.reused.set(Pt.get(n.text),2),this.tile=s.run(t,n),SS(l,s.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=pe.chrome||pe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(a),a&&(a.written||r.selectionRange.focusNode!=a.node||!this.tile.dom.contains(a.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let a of this.tile.children)a.isWidget()&&a.widget instanceof Ox&&i.push(a.dom);r.updateGaps(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let n of t.transactions)for(let r of n.effects)r.is(KL)&&(this.editContextFormatting=r.value)}updateSelection(t=!1,n=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,a=i==r,l=!a&&!(this.view.state.facet(Ma)||r.tabIndex>-1)&&Qf(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(a||n||l))return;let s=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,f,d;if(c.empty?d=f=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),f=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),pe.gecko&&c.empty&&!this.hasComposition&&SK(f)){let g=document.createTextNode("");this.view.observer.ignore(()=>f.node.insertBefore(g,f.node.childNodes[f.offset]||null)),f=d=new di(g,0),s=!0}let p=this.view.observer.selectionRange;(s||!p.focusNode||(!Gf(f.node,f.offset,p.anchorNode,p.anchorOffset)||!Gf(d.node,d.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,c))&&(this.view.observer.ignore(()=>{pe.android&&pe.chrome&&r.contains(p.focusNode)&&TK(p.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let g=gh(this.view.root);if(g)if(c.empty){if(pe.gecko){let v=OK(f.node,f.offset);if(v&&v!=3){let y=(v==1?PL:_L)(f.node,f.offset);y&&(f=new di(y.node,y.offset))}}g.collapse(f.node,f.offset),c.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=c.bidiLevel)}else if(g.extend){g.collapse(f.node,f.offset);try{g.extend(d.node,d.offset)}catch{}}else{let v=document.createRange();c.anchor>c.head&&([f,d]=[d,f]),v.setEnd(d.node,d.offset),v.setStart(f.node,f.offset),g.removeAllRanges(),g.addRange(v)}l&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(f,d)),this.impreciseAnchor=f.precise?null:new di(p.anchorNode,p.anchorOffset),this.impreciseHead=d.precise?null:new di(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&Gf(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,r=gh(t.root),{anchorNode:i,anchorOffset:a}=t.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let l=this.lineAt(n.head,n.assoc);if(!l)return;let s=l.posAtStart;if(n.head==s||n.head==s+l.length)return;let c=this.coordsAt(n.head,-1),f=this.coordsAt(n.head,1);if(!c||!f||c.bottom>f.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(d.node,d.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let p=t.observer.selectionRange;t.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=n.from&&r.collapse(i,a)}posFromDOM(t,n){let r=this.tile.nearest(t);if(!r)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let a;if(t==r.dom)a=r.dom.childNodes[n];else{let l=Fa(t)==0?0:n==0?-1:1;for(;;){let s=t.parentNode;if(s==r.dom)break;l==0&&s.firstChild!=s.lastChild&&(t==s.firstChild?l=-1:l=1),t=s}l<0?a=t:a=t.nextSibling}if(a==r.dom.firstChild)return i;for(;a&&!Pt.get(a);)a=a.nextSibling;if(!a)return i+r.length;for(let l=0,s=i;;l++){let c=r.children[l];if(c.dom==a)return s;s+=c.length+c.breakAfter}}else return r.isText()?t==r.dom?i+n:i+(n?r.length:0):i}domAtPos(t,n){let{tile:r,offset:i}=this.tile.resolveBlock(t,n);return r.isWidget()?r.domPosFor(i,n):r.domIn(i,n)}inlineDOMNearPos(t,n){let r,i=-1,a=!1,l,s=-1,c=!1;return this.tile.blockTiles((f,d)=>{if(f.isWidget()){if(f.flags&32&&d>=t)return!0;f.flags&16&&(a=!0)}else{let p=d+f.length;if(d<=t&&(r=f,i=t-d,a=p<t),p>=t&&!l&&(l=f,s=t-d,c=d>t),d>t&&l)return!0}}),!r&&!l?this.domAtPos(t,n):(a&&l?r=null:c&&r&&(l=null),r&&n<0||!l?r.domIn(i,n):l.domIn(s,n))}coordsAt(t,n,r){let{tile:i,offset:a}=this.tile.resolveBlock(t,n);return i.isWidget()?i.widget instanceof Ox?null:i.coordsInWidget(a,n,!0):i.coordsIn(a,n,r)}lineAt(t,n){let{tile:r}=this.tile.resolveBlock(t,n);return r.isLine()?r:null}coordsForChar(t){let{tile:n,offset:r}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function i(a,l){if(a.isComposite())for(let s of a.children){if(s.length>=l){let c=i(s,l);if(c)return c}if(l-=s.length,l<0)break}else if(a.isText()&&l<a.length){let s=on(a.text,l);if(s==l)return null;let c=yh(a.dom,l,s).getClientRects();for(let f=0;f<c.length;f++){let d=c[f];if(f==c.length-1||d.top<d.bottom&&d.left<d.right)return d}}return null}return i(n,r)}measureVisibleLineHeights(t){let n=[],{from:r,to:i}=t,a=this.view.contentDOM.clientWidth,l=a>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,c=this.view.textDirection==ft.LTR,f=0,d=(p,g,v)=>{for(let y=0;y<p.children.length&&!(g>i);y++){let x=p.children[y],w=g+x.length,A=x.dom.getBoundingClientRect(),{height:C}=A;if(v&&!y&&(f+=A.top-v.top),x instanceof La)w>r&&d(x,g,A);else if(g>=r&&(f>0&&n.push(-f),n.push(C+f),f=0,l)){let k=x.dom.lastChild,P=k?Yf(k):[];if(P.length){let T=P[P.length-1],D=c?T.right-A.left:A.right-T.left;D>s&&(s=D,this.minWidth=a,this.minWidthFrom=g,this.minWidthTo=w)}}v&&y==p.children.length-1&&(f+=v.bottom-A.bottom),g=w+x.breakAfter}};return d(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?ft.RTL:ft.LTR}measureTextSize(){let t=this.tile.blockTiles(l=>{if(l.isLine()&&l.children.length&&l.length<=20){let s=0,c;for(let f of l.children){if(!f.isText()||/[^ -~]/.test(f.text))return;let d=Yf(f.dom);if(d.length!=1)return;s+=d[0].width,c=d[0].height}if(s)return{lineHeight:l.dom.getBoundingClientRect().height,charWidth:s/l.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),r,i,a;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let l=Yf(n.firstChild)[0];r=n.getBoundingClientRect().height,i=l&&l.width?l.width/27:7,a=l&&l.height?l.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:a}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let r=0,i=0;;i++){let a=i==n.viewports.length?null:n.viewports[i],l=a?a.from-1:this.view.state.doc.length;if(l>r){let s=(n.lineBlockAt(l).bottom-n.lineBlockAt(r).top)/this.view.scaleY;t.push(Ce.replace({widget:new Ox(s),block:!0,inclusive:!0,isBlockGap:!0}).range(r,l))}if(!a)break;r=a.to+1}return Ce.set(t)}updateDeco(){let t=1,n=this.view.state.facet(jv).map(a=>(this.dynamicDecorationMap[t++]=typeof a=="function")?a(this.view):a),r=!1,i=this.view.state.facet(DO).map((a,l)=>{let s=typeof a=="function";return s&&(r=!0),s?a(this.view):a});for(i.length&&(this.dynamicDecorationMap[t++]=r,n.push(ze.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;this.blockWrappers=this.view.state.facet(QL).map(a=>typeof a=="function"?a(this.view):a)}scrollIntoView(t){if(t.isSnapshot){let f=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=f.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let f of this.view.state.facet(VL))try{if(f(this.view,t.range,t))return!0}catch(d){lr(this.view.state,d,"scroll handler")}let{range:n}=t,r=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let a=PO(this.view),l={left:r.left-a.left,top:r.top-a.top,right:r.right+a.right,bottom:r.bottom+a.bottom},{offsetWidth:s,offsetHeight:c}=this.view.scrollDOM;if(Q7(this.view.scrollDOM,l,n.head<n.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,s),-s),Math.max(Math.min(t.yMargin,c),-c),this.view.textDirection==ft.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let f=this.view.docView.lineAt(n.head,1);f&&f.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(t){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){SS(this.tile)}}function SS(e,t){let n=t?.get(e);if(n!=1){n==null&&e.destroy();for(let r of e.children)SS(r,t)}}function SK(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function JL(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=PL(n.focusNode,n.focusOffset),i=_L(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let s=Pt.get(i.node);if(!s||s.isText()&&s.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let c=Pt.get(r.node);!c||c.isText()&&c.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let l=t-a.offset;return{from:l,to:l+a.node.nodeValue.length,node:a.node}}function wK(e,t,n){let r=JL(e,n);if(!r)return null;let{node:i,from:a,to:l}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new Xr(c.mapPos(a),c.mapPos(l),a,l),text:i}}function OK(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable=="false"?2:0)}let AK=class{constructor(){this.changes=[]}compareRange(t,n){_u(t,n,this.changes)}comparePoint(t,n){_u(t,n,this.changes)}boundChange(t){_u(t,t,this.changes)}};function kK(e,t,n){let r=new AK;return ze.compare(e,t,n,r),r.changes}class CK{constructor(){this.changes=[]}compareRange(t,n){_u(t,n,this.changes)}comparePoint(){}boundChange(t){_u(t,t,this.changes)}}function EK(e,t,n){let r=new CK;return ze.compare(e,t,n,r),r.changes}function TK(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function MK(e,t){let n=!1;return t&&e.iterChangedRanges((r,i)=>{r<t.to&&i>t.from&&(n=!0)}),n}class Ox extends la{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function DK(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return J.cursor(t);a==0?n=1:a==i.length&&(n=-1);let l=a,s=a;n<0?l=on(i.text,a,!1):s=on(i.text,a);let c=r(i.text.slice(l,s));for(;l>0;){let f=on(i.text,l,!1);if(r(i.text.slice(f,l))!=c)break;l=f}for(;s<i.length;){let f=on(i.text,s);if(r(i.text.slice(s,f))!=c)break;s=f}return J.undirectionalRange(l+i.from,s+i.from)}function PK(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let s=e.viewState.heightOracle.textHeight,c=Math.floor((i-n.top-(e.defaultLineHeight-s)*.5)/s);a+=c*e.viewState.heightOracle.lineLength}let l=e.state.sliceDoc(n.from,n.to);return n.from+uS(l,a,e.state.tabSize)}function wS(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let i;for(let a of r.type){if(a.from>t)break;if(!(a.to<t)){if(a.from<t&&a.to>t)return a;(!i||a.type==kn.Text&&(i.type!=a.type||(n<0?a.from<t:a.to>t)))&&(i=a)}}return i||r}return r}function _K(e,t,n,r){let i=wS(e,t.head,t.assoc||-1),a=!r||i.type!=kn.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let l=e.dom.getBoundingClientRect(),s=e.textDirectionAt(i.from),c=e.posAtCoords({x:n==(s==ft.LTR)?l.right-1:l.left+1,y:(a.top+a.bottom)/2});if(c!=null)return J.cursor(c,n?-1:1)}return J.cursor(n?i.to:i.from,n?-1:1)}function tD(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),l=e.textDirectionAt(i.from);for(let s=t,c=null;;){let f=lK(i,a,l,s,n),d=LL;if(!f){if(i.number==(n?e.state.doc.lines:1))return s;d=`
62
- `,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),f=e.visualLineSide(i,!n)}if(c){if(!c(d))return s}else{if(!r)return f;c=r(d)}s=f}}function NK(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return a=>{let l=r(a);return i==Ot.Space&&(i=l),i==l}}function RK(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return J.cursor(i,t.assoc);let l=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),f=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(f)l==null&&(l=f.left-c.left),s=a<0?f.top:f.bottom;else{let y=e.viewState.lineBlockAt(i);l==null&&(l=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-y.from))),s=(a<0?y.top:y.bottom)+d}let p=c.left+l,g=e.viewState.heightOracle.textHeight>>1,v=r??g;for(let y=0;;y+=g){let x=s+(v+y)*a,w=OS(e,{x:p,y:x},!1,a);if(n?x>c.bottom:x<c.top)return J.cursor(w.pos,w.assoc);let A=e.coordsAtPos(w.pos,w.assoc),C=A?(A.top+A.bottom)/2:0;if(!A||(n?C>s:C<s))return J.cursor(w.pos,w.assoc,void 0,l)}}function Zf(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(a,l,s)=>{if(t>a&&t<l){let c=r||n||(t-a<l-t?-1:1);t=c<0?a:l,r=c}});if(!r)return t}}function e3(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let l=Zf(e,i.from,0);l!=i.from&&(a=J.cursor(l,-1))}else{let l=Zf(e,i.from,-1),s=Zf(e,i.to,1);(l!=i.from||s!=i.to)&&(i.undirectional?a=J.undirectionalRange(i.from,i.to):a=J.range(i.from==i.anchor?l:s,i.from==i.head?l:s))}a&&(n||(n=t.ranges.slice()),n[r]=a)}return n?J.create(n,t.mainIndex):t}function Ax(e,t,n){let r=Zf(e.state.facet(Vh).map(i=>i(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:J.cursor(r,r<n.from?1:-1)}class Hi{constructor(t,n){this.pos=t,this.assoc=n}}function OS(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:l,y:s}=t,c=s-a,f;for(;;){if(c<0)return new Hi(0,1);if(c>e.viewState.docHeight)return new Hi(e.state.doc.length,-1);if(f=e.elementAtHeight(c),r==null)break;if(f.type==kn.Text){if(r<0?f.to<e.viewport.from:f.from>e.viewport.to)break;let g=e.docView.coordsAt(r<0?f.from:f.to,r>0?-1:1);if(g&&(r<0?g.top<=c+a:g.bottom>=c+a))break}let p=e.viewState.heightOracle.textHeight/2;c=r>0?f.bottom+p:f.top-p}if(e.viewport.from>=f.to||e.viewport.to<=f.from){if(n)return null;if(f.type==kn.Text){let p=PK(e,i,f,l,s);return new Hi(p,p==f.from?1:-1)}}if(f.type!=kn.Text)return c<(f.top+f.bottom)/2?new Hi(f.from,1):new Hi(f.to,-1);let d=e.docView.lineAt(f.from,2);return(!d||d.length!=f.length)&&(d=e.docView.lineAt(f.from,-2)),new jK(e,l,s,e.textDirectionAt(f.from)).scanTile(d,f.from)}class jK{constructor(t,n,r,i){this.view=t,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to<t)&&(this.line=this.view.state.doc.lineAt(t),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(t,n){let{line:r,spans:i}=this.bidiSpansAt(t);return i[qi.find(i,t-r.from,-1,n)].level==this.baseDir}dirAt(t,n){let{line:r,spans:i}=this.bidiSpansAt(t);return i[qi.find(i,t-r.from,-1,n)].dir}bidiIn(t,n){let{spans:r,line:i}=this.bidiSpansAt(t);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(t,n,r=!1){let i=0,a=t.length-1,l=new Set,s=this.bidiIn(t[0],t[a]),c,f,d=-1,p=1e9,g;e:for(;i<a;){let y=a-i,x=i+a>>1;t:if(l.has(x)){let A=i+Math.floor(Math.random()*y);for(let C=0;C<y;C++){if(!l.has(A)){x=A;break t}A++,A==a&&(A=i)}break e}l.add(x);let w=n(x);if(w)for(let A=0;A<w.length;A++){let C=w[A],k=0;if(!(C.width==0&&w.length>1)){if(C.bottom<this.y)(!c||c.bottom<C.bottom)&&(c=C),k=1;else if(C.top>this.y)(!f||f.top>C.top)&&(f=C),k=-1;else{let P=C.left>this.x?this.x-C.left:C.right<this.x?this.x-C.right:0,T=Math.abs(P);T<p&&(d=x,p=T,g=C),P&&(k=P<0==(this.baseDir==ft.LTR)?-1:1)}k==-1&&(!s||this.baseDirAt(t[x],1))?a=x:k==1&&(!s||this.baseDirAt(t[x+1],-1))&&(i=x+1)}}}if(!g){if(!f&&!c)return{i:t[0],after:!1};let y=c&&(!f||this.y-c.bottom<f.top-this.y)?c:f;return this.y=(y.top+y.bottom)/2,this.scan(t,n,!0)}if(p&&!r){let{top:y,bottom:x}=g;if(c&&c.bottom>(y+y+x)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(f&&f.top<(y+x+x)/3)return this.y=f.top+1,this.scan(t,n,!0)}let v=(s?this.dirAt(t[d],1):this.baseDir)==ft.LTR;return{i:d,after:this.x>(g.left+g.right)/2==v}}scanText(t,n){let r=[];for(let a=0;a<t.length;a=on(t.text,a))r.push(n+a);r.push(n+t.length);let i=this.scan(r,a=>{let l=r[a]-n,s=r[a+1]-n;return yh(t.dom,l,s).getClientRects()});return i.after?new Hi(r[i.i+1],-1):new Hi(r[i.i],1)}scanTile(t,n){if(!t.length)return new Hi(n,1);if(t.children.length==1){let s=t.children[0];if(s.isText())return this.scanText(s,n);if(s.isComposite())return this.scanTile(s,n)}let r=[n];for(let s=0,c=n;s<t.children.length;s++)r.push(c+=t.children[s].length);let i=this.scan(r,s=>{let c=t.children[s];return c.flags&48?null:(c.dom.nodeType==1?c.dom:yh(c.dom,0,c.length)).getClientRects()}),a=t.children[i.i],l=r[i.i];return a.isText()?this.scanText(a,l):a.isComposite()?this.scanTile(a,l):i.after?new Hi(r[i.i+1],-1):new Hi(l,1)}}const vu="￿";class IK{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(qe.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=vu}readRange(t,n){if(!t)return this;let r=t.parentNode;for(let i=t;;){this.findPointBefore(r,i);let a=this.text.length;this.readNode(i);let l=Pt.get(i),s=i.nextSibling;if(s==n){l?.breakAfter&&!s&&r!=this.view.contentDOM&&this.lineBreak();break}let c=Pt.get(s);(l&&c?l.breakAfter:(l?l.breakAfter:ig(i))||ig(s)&&(i.nodeName!="BR"||l?.isWidget())&&this.text.length>a)&&!BK(s,n)&&this.lineBreak(),i=s}return this.findPointBefore(r,n),this}readTextNode(t){let n=t.nodeValue;for(let r of this.points)r.node==t&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let a=-1,l=1,s;if(this.lineSeparator?(a=n.indexOf(this.lineSeparator,r),l=this.lineSeparator.length):(s=i.exec(n))&&(a=s.index,l=s[0].length),this.append(n.slice(r,a<0?n.length:a)),a<0)break;if(this.lineBreak(),l>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=l-1);r=a+l}}readNode(t){let n=Pt.get(t),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(t,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let r of this.points)r.node==t&&t.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(t,n){for(let r of this.points)(t.nodeType==3?r.node==t:t.contains(r.node))&&(r.pos=this.text.length+(LK(t,r.node,r.offset)?n:0))}}function LK(e,t,n){for(;;){if(!t||n<Fa(t))return!1;if(t==e)return!0;n=Gl(t)+1,t=t.parentNode}}function BK(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let r=Pt.get(e);if(!r?.isWidget())return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i?.length)return!1}return!0}class nD{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class zK{constructor(t,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:a,impreciseAnchor:l}=t.docView,s=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=t3(t.docView.tile,n,r,0))){let c=a||l?[]:UK(t),f=new IK(c,t);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=HK(c,this.bounds.from)}else{let c=t.observer.selectionRange,f=a&&a.node==c.focusNode&&a.offset==c.focusOffset||!gS(t.contentDOM,c.focusNode)?s.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=l&&l.node==c.anchorNode&&l.offset==c.anchorOffset||!gS(t.contentDOM,c.anchorNode)?s.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),p=t.viewport;if((pe.ios||pe.chrome)&&f!=d&&Math.min(f,d)<=s.main.from&&Math.max(f,d)>=s.main.to&&(p.from>0||p.to<t.state.doc.length)){let g=Math.min(f,d),v=Math.max(f,d),y=p.from-g,x=p.to-v;(y==0||y==1||g==0)&&(x==0||x==-1||v==t.state.doc.length)&&(f=0,d=t.state.doc.length)}if(t.inputState.composing>-1&&s.ranges.length>1)this.newSel=s.replaceRange(J.range(d,f));else if(t.lineWrapping&&d==f&&!(s.main.empty&&s.main.head==f)&&t.inputState.lastTouchTime>Date.now()-100){let g=t.coordsAtPos(f,-1),v=0;g&&(v=t.inputState.lastTouchY<=g.bottom?-1:1),this.newSel=J.create([J.cursor(f,v)])}else this.newSel=J.single(d,f)}}}function t3(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,l=-1,s=-1;for(let c=0,f=r,d=r;c<e.children.length;c++){let p=e.children[c],g=f+p.length;if(f<t&&g>n)return t3(p,t,n,f);if(g>=t&&i==-1&&(i=c,a=f),f>n&&p.dom.parentNode==e.dom){l=c,s=d;break}d=g,f=g+p.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:l<e.children.length&&l>=0?e.children[l].dom:null}}else return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function n3(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,l=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:s,to:c}=t.bounds,f=a.from,d=null;(l===8||pe.android&&t.text.length<c-s)&&(f=a.to,d="end");let p=i.doc.sliceString(s,c,vu),g,v;!a.empty&&a.from>=s&&a.to<=c&&(t.typeOver||p!=t.text)&&p.slice(0,a.from-s)==t.text.slice(0,a.from-s)&&p.slice(a.to-s)==t.text.slice(g=t.text.length-(p.length-(a.to-s)))?n={from:a.from,to:a.to,insert:Je.of(t.text.slice(a.from-s,g).split(vu))}:(v=r3(p,t.text,f-s,d))&&(pe.chrome&&l==13&&v.toB==v.from+2&&t.text.slice(v.from,v.toB)==vu+vu&&v.toB--,n={from:s+v.from,to:s+v.toA,insert:Je.of(t.text.slice(v.from,v.toB).split(vu))})}else r&&(!e.hasFocus&&i.facet(Ma)||sg(r,a))&&(r=null);if(!n&&!r)return!1;if((pe.mac||pe.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=J.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Je.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:pe.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
63
- `&&e.lineWrapping&&(r&&(r=J.single(r.main.anchor-1,r.main.head-1)),n={from:a.from,to:a.to,insert:Je.of([" "])}),n)return _O(e,n,r,l);if(r&&!sg(r,a)){let s=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(s=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(r=e3(i.facet(Vh).map(f=>f(e)),r))),e.dispatch({selection:r,scrollIntoView:s,userEvent:c}),!0}else return!1}function _O(e,t,n,r=-1){if(pe.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(pe.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&Nu(e.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&Nu(e.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&Nu(e.contentDOM,"Delete",46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let l,s=()=>l||(l=$K(e,t,n));return e.state.facet(HL).some(c=>c(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function $K(e,t,n){let r,i=e.state,a=i.selection.main,l=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let c=t.from<a.from?-1:1,f=c<0?a.from:a.to,d=Zf(i.facet(Vh).map(p=>p(e)),f,c);t.from==d&&(l=d)}if(l>-1)r={changes:t,selection:J.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let c=a.from<t.from?i.sliceDoc(a.from,t.from):"",f=a.to>t.to?i.sliceDoc(t.to,a.to):"";r=i.replaceSelection(e.state.toText(c+t.insert.sliceString(0,void 0,e.state.lineBreak)+f))}else{let c=i.changes(t),f=n&&n.main.to<=c.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let d=e.state.sliceDoc(t.from,t.to),p,g=n&&JL(e,n.main.head);if(g){let y=t.insert.length-(t.to-t.from);p={from:g.from,to:g.to-y}}else p=e.state.doc.lineAt(a.head);let v=a.to-t.to;r=i.changeByRange(y=>{if(y.from==a.from&&y.to==a.to)return{changes:c,range:f||y.map(c)};let x=y.to-v,w=x-d.length;if(e.state.sliceDoc(w,x)!=d||x>=p.from&&w<=p.to)return{range:y};let A=i.changes({from:w,to:x,insert:t.insert}),C=y.to-a.to;return{changes:A,range:f?J.range(Math.max(0,f.anchor+C),Math.max(0,f.head+C)):y.map(A)}})}else r={changes:c,selection:f&&i.selection.replaceRange(f)}}let s="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=".compose",e.inputState.compositionFirstChange&&(s+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function r3(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let l=e.length,s=t.length;for(;l>0&&s>0&&e.charCodeAt(l-1)==t.charCodeAt(s-1);)l--,s--;if(r=="end"){let c=Math.max(0,a-Math.min(l,s));n-=l+c-a}if(l<a&&e.length<t.length){let c=n<=a&&n>=l?a-n:0;a-=c,s=a+(s-l),l=a}else if(s<a){let c=n<=a&&n>=s?a-n:0;a-=c,l=a+(l-s),s=a}return{from:a,toA:l,toB:s}}function UK(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new nD(n,r)),(i!=n||a!=r)&&t.push(new nD(i,a))),t}function HK(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?J.single(n+t,r+t):null}function sg(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class FK{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,pe.safari&&t.contentDOM.addEventListener("input",()=>null),pe.gecko&&aX(t.contentDOM.ownerDocument)}handleEvent(t){!ZK(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let r=this.handlers[t];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=WK(t),r=this.handlers,i=this.view.contentDOM;for(let a in n)if(a!="scroll"){let l=!n[a].handlers.length,s=r[a];s&&l!=!s.handlers.length&&(i.removeEventListener(a,this.handleEvent),s=null),s||i.addEventListener(a,this.handleEvent,{passive:l})}for(let a in r)a!="scroll"&&!n[a]&&i.removeEventListener(a,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&a3.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),pe.android&&pe.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(pe.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(i3.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||VK.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&pe.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&qK(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString())?!1:(this.pendingIOSKey=void 0,Nu(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(t){return!/^key/.test(t.type)||t.synthetic?!1:this.composing>0?!0:pe.safari&&!pe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function qK(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function rD(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(i){lr(n.state,i)}}}function WK(e){let t=Object.create(null);function n(r){return t[r]||(t[r]={observers:[],handlers:[]})}for(let r of e){let i=r.spec,a=i&&i.plugin.domEventHandlers,l=i&&i.plugin.domEventObservers;if(a)for(let s in a){let c=a[s];c&&n(s).handlers.push(rD(r.value,c))}if(l)for(let s in l){let c=l[s];c&&n(s).observers.push(rD(r.value,c))}}for(let r in yi)n(r).handlers.push(yi[r]);for(let r in Vn)n(r).observers.push(Vn[r]);return t}const i3=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],VK="dthko",a3=[16,17,18,20,91,92,224,225],Wp=6;function Vp(e){return Math.max(0,e)*.7+8}function KK(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class XK{constructor(t,n,r,i){this.view=t,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=TL(t.contentDOM),this.atoms=t.state.facet(Vh).map(l=>l(t));let a=t.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(qe.allowMultipleSelections)&&QK(t,n),this.dragging=GK(t,n)&&s3(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&KK(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,r=0,i=0,a=0,l=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:s}=this.scrollParents.y.getBoundingClientRect());let c=PO(this.view);t.clientX-c.left<=i+Wp?n=-Vp(i-t.clientX):t.clientX+c.right>=l-Wp&&(n=Vp(t.clientX-l)),t.clientY-c.top<=a+Wp?r=-Vp(a-t.clientY):t.clientY+c.bottom>=s-Wp&&(r=Vp(t.clientY-s)),this.setScrollSpeed(n,r)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,r=e3(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function QK(e,t){let n=e.state.facet(BL);return n.length?n[0](t):pe.mac?t.metaKey:t.ctrlKey}function YK(e,t){let n=e.state.facet(zL);return n.length?n[0](t):pe.mac?!t.altKey:!t.ctrlKey}function GK(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=gh(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let a=0;a<i.length;a++){let l=i[a];if(l.left<=t.clientX&&l.right>=t.clientX&&l.top<=t.clientY&&l.bottom>=t.clientY)return!0}return!1}function ZK(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Pt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}const yi=Object.create(null),Vn=Object.create(null),l3=pe.ie&&pe.ie_version<15||pe.ios&&pe.webkit_version<604;function JK(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),o3(e,n.value)},50)}function Bv(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function o3(e,t){t=Bv(e.state,EO,t);let{state:n}=e,r,i=1,a=n.toText(t),l=a.lines==n.selection.ranges.length;if(AS!=null&&n.selection.ranges.every(c=>c.empty)&&AS==a.toString()){let c=-1;r=n.changeByRange(f=>{let d=n.doc.lineAt(f.from);if(d.from==c)return{range:f};c=d.from;let p=n.toText((l?a.line(i++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:p},range:J.cursor(f.from+p.length)}})}else l?r=n.changeByRange(c=>{let f=a.line(i++);return{changes:{from:c.from,to:c.to,insert:f.text},range:J.cursor(c.from+f.length)}}):r=n.replaceSelection(a);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Vn.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,pe.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};Vn.wheel=Vn.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};yi.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Vn.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};Vn.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Vn.touchend=(e,t)=>{e.inputState.touchActive=!1};yi.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet($L))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=tX(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new XK(e,t,n,r)),r&&e.observer.ignore(()=>{ML(e.contentDOM);let a=e.root.activeElement;a&&!a.contains(e.contentDOM)&&a.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function iD(e,t,n,r){if(r==1)return J.cursor(t,n);if(r==2)return DK(e.state,t,n);{let i=e.docView.lineAt(t,n),a=e.state.doc.lineAt(i?i.posAtEnd:t),l=i?i.posAtStart:a.from,s=i?i.posAtEnd:a.to;return s<e.state.doc.length&&s==a.to&&s++,J.undirectionalRange(l,s)}}const eX=pe.ie&&pe.ie_version<=11;let aD=null,lD=0,oD=0;function s3(e){if(!eX)return e.detail;let t=aD,n=oD;return aD=e,oD=Date.now(),lD=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(lD+1)%3:1}function tX(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=s3(t),i=e.state.selection;return{update(a){a.docChanged&&(n.pos=a.changes.mapPos(n.pos),i=i.map(a.changes))},get(a,l,s){let c=e.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),f,d=iD(e,c.pos,c.assoc,r);if(n.pos!=c.pos&&!l){let p=iD(e,n.pos,n.assoc,r),g=Math.min(p.from,d.from),v=Math.max(p.to,d.to);d=g<d.from?J.range(g,v,d.assoc):J.range(v,g,d.assoc)}return l?i.replaceRange(i.main.extend(d.from,d.to,d.assoc)):s&&r==1&&i.ranges.length>1&&(f=nX(i,c.pos))?f:s?i.addRange(d):J.create([d])}}}function nX(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return J.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}yi.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.tile.nearest(t.target);if(i&&i.isWidget()){let a=i.posAtStart,l=a+i.length;(a>=n.to||l<=n.from)&&(n=J.undirectionalRange(a,l))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",Bv(e.state,TO,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};yi.dragend=e=>(e.inputState.draggedContent=null,!1);function sD(e,t,n,r){if(n=Bv(e.state,EO,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,l=r&&a&&YK(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(l?[l,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:l?"move.drop":"input.drop"}),e.inputState.draggedContent=null}yi.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&sD(e,t,r.filter(l=>l!=null).join(e.state.lineBreak),!1)};for(let l=0;l<n.length;l++){let s=new FileReader;s.onerror=a,s.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(s.result)||(r[l]=s.result),a()},s.readAsText(n[l])}return!0}else{let r=t.dataTransfer.getData("Text");if(r)return sD(e,t,r,!0),!0}return!1};yi.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=l3?null:t.clipboardData;return n?(o3(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(JK(e),!1)};function rX(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function iX(e){let t=[],n=[],r=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let i=-1;for(let{from:a}of e.selection.ranges){let l=e.doc.lineAt(a);l.number>i&&(t.push(l.text),n.push({from:l.from,to:Math.min(e.doc.length,l.to+1)})),i=l.number}r=!0}return{text:Bv(e,TO,t.join(e.lineBreak)),ranges:n,linewise:r}}let AS=null;yi.copy=yi.cut=(e,t)=>{if(!Qf(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=iX(e.state);if(!n&&!i)return!1;AS=i?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let a=l3?null:t.clipboardData;return a?(a.clearData(),a.setData("text/plain",n),!0):(rX(e,n),!1)};const u3=ia.define();function c3(e,t){let n=[];for(let r of e.facet(FL)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:u3.of(!0)}):null}function f3(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=c3(e.state,t);n?e.dispatch(n):e.update([])}},10)}Vn.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),f3(e)};Vn.blur=e=>{e.observer.clearSelectionRange(),f3(e)};Vn.compositionstart=Vn.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Vn.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,pe.chrome&&pe.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};Vn.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};yi.beforeinput=(e,t)=>{var n,r;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let a=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),l=t.getTargetRanges();if(a&&l.length){let s=l[0],c=e.posAtDOM(s.startContainer,s.startOffset),f=e.posAtDOM(s.endContainer,s.endOffset);return _O(e,{from:c,to:f,insert:e.state.toText(a)},null),!0}}let i;if(pe.chrome&&pe.android&&(i=i3.find(a=>a.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let a=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>a+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return pe.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),pe.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>Vn.compositionend(e,t),20),!1};const uD=new Set;function aX(e){uD.has(e)||(uD.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const cD=["pre-wrap","normal","pre-line","break-spaces"];let Ku=!1;function fD(){Ku=!1}class lX{constructor(t){this.lineWrapping=t,this.doc=Je.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-t-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return cD.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let r=0;r<t.length;r++){let i=t[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(t,n,r,i,a,l){let s=cD.indexOf(t)>-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=a,c){this.heightSamples={};for(let f=0;f<l.length;f++){let d=l[f];d<0?f++:this.heightSamples[Math.floor(d*10)]=!0}}return c}}class oX{constructor(t,n){this.from=t,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class ci{constructor(t,n,r,i,a){this.from=t,this.length=n,this.top=r,this.height=i,this._content=a}get type(){return typeof this._content=="number"?kn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof ls?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new ci(this.from,this.length+t.length,this.top,this.height+t.height,n)}}var pt=(function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e})(pt||(pt={}));const jm=.001;class Wn{constructor(t,n,r=2){this.length=t,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>jm&&(Ku=!0),this.height=t)}replace(t,n,r){return Wn.of(r)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,r,i){let a=this,l=r.doc;for(let s=i.length-1;s>=0;s--){let{fromA:c,toA:f,fromB:d,toB:p}=i[s],g=a.lineAt(c,pt.ByPosNoHeight,r.setDoc(n),0,0),v=g.to>=f?g:a.lineAt(f,pt.ByPosNoHeight,r,0,0);for(p+=v.to-f,f=v.to;s>0&&g.from<=i[s-1].toA;)c=i[s-1].fromA,d=i[s-1].fromB,s--,c<g.from&&(g=a.lineAt(c,pt.ByPosNoHeight,r,0,0));d+=g.from-c,c=g.from;let y=NO.build(r.setDoc(l),t,d,p);a=ug(a,a.replace(c,f,y))}return a.updateHeight(r,0)}static empty(){return new kr(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let s=t[n-1];s.break?t.splice(--n,1,s.left,null,s.right):t.splice(--n,1,s.left,s.right),r+=1+s.break,i-=s.size}else if(a>i*2){let s=t[r];s.break?t.splice(r,1,s.left,null,s.right):t.splice(r,1,s.left,s.right),r+=2+s.break,a-=s.size}else break;else if(i<a){let s=t[n++];s&&(i+=s.size)}else{let s=t[--r];s&&(a+=s.size)}let l=0;return t[n-1]==null?(l=1,n--):t[n]==null&&(l=1,r++),new uX(Wn.of(t.slice(0,n)),l,Wn.of(t.slice(r)))}}function ug(e,t){return e==t?e:(e.constructor!=t.constructor&&(Ku=!0),t)}Wn.prototype.size=1;const sX=Ce.replace({});class h3 extends Wn{constructor(t,n,r){super(t,n),this.deco=r,this.spaceAbove=0}mainBlock(t,n){return new ci(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(t,n,r,i){return this.spaceAbove&&t<r+this.spaceAbove?new ci(i,0,r,this.spaceAbove,sX):this.mainBlock(r,i)}lineAt(t,n,r,i,a){let l=this.mainBlock(i,a);return this.spaceAbove?this.blockAt(0,r,i,a).join(l):l}forEachLine(t,n,r,i,a,l){t<=a+this.length&&n>=a&&l(this.lineAt(0,pt.ByPos,r,i,a))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class kr extends h3{constructor(t,n,r){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(t,n){return new ci(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof kr||i instanceof xn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof xn?i=new kr(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Wn.of(r)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class xn extends Wn{constructor(t){super(t,0)}heightMetrics(t,n){let r=t.doc.lineAt(n).number,i=t.doc.lineAt(n+this.length).number,a=i-r+1,l,s=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*a);l=c/a,this.length>a+1&&(s=(this.height-c)/(this.length-a-1))}else l=this.height/a;return{firstLine:r,lastLine:i,perLine:l,perChar:s}}blockAt(t,n,r,i){let{firstLine:a,lastLine:l,perLine:s,perChar:c}=this.heightMetrics(n,i);if(n.lineWrapping){let f=i+(t<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-r)/this.height))*this.length)),d=n.doc.lineAt(f),p=s+d.length*c,g=Math.max(r,t-p/2);return new ci(d.from,d.length,g,p,0)}else{let f=Math.max(0,Math.min(l-a,Math.floor((t-r)/s))),{from:d,length:p}=n.doc.line(a+f);return new ci(d,p,r+s*f,s,0)}}lineAt(t,n,r,i,a){if(n==pt.ByHeight)return this.blockAt(t,r,i,a);if(n==pt.ByPosNoHeight){let{from:v,to:y}=r.doc.lineAt(t);return new ci(v,y-v,0,0,0)}let{firstLine:l,perLine:s,perChar:c}=this.heightMetrics(r,a),f=r.doc.lineAt(t),d=s+f.length*c,p=f.number-l,g=i+s*p+c*(f.from-a-p);return new ci(f.from,f.length,Math.max(i,Math.min(g,i+this.height-d)),d,0)}forEachLine(t,n,r,i,a,l){t=Math.max(t,a),n=Math.min(n,a+this.length);let{firstLine:s,perLine:c,perChar:f}=this.heightMetrics(r,a);for(let d=t,p=i;d<=n;){let g=r.doc.lineAt(d);if(d==t){let y=g.number-s;p+=c*y+f*(t-a-y)}let v=c+f*g.length;l(new ci(g.from,g.length,p,v,0)),p+=v,d=g.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let a=r[r.length-1];a instanceof xn?r[r.length-1]=new xn(a.length+i):r.push(null,new xn(i-1))}if(t>0){let a=r[0];a instanceof xn?r[0]=new xn(t+a.length):r.unshift(new xn(t-1),null)}return Wn.of(r)}decomposeLeft(t,n){n.push(new xn(t-1),null)}decomposeRight(t,n){n.push(null,new xn(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let l=[],s=Math.max(n,i.from),c=-1;for(i.from>n&&l.push(new xn(i.from-n-1).updateHeight(t,n));s<=a&&i.more;){let d=t.doc.lineAt(s).length;l.length&&l.push(null);let p=i.heights[i.index++],g=0;p<0&&(g=-p,p=i.heights[i.index++]),c==-1?c=p:Math.abs(p-c)>=jm&&(c=-2);let v=new kr(d,p,g);v.outdated=!1,l.push(v),s+=d+1}s<=a&&l.push(null,new xn(a-s).updateHeight(t,s));let f=Wn.of(l);return(c<0||Math.abs(f.height-this.height)>=jm||Math.abs(c-this.heightMetrics(t,n).perLine)>=jm)&&(Ku=!0),ug(this,f)}else(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class uX extends Wn{constructor(t,n,r){super(t.length+n+r.length,t.height+r.height,n|(t.outdated||r.outdated?2:0)),this.left=t,this.right=r,this.size=t.size+r.size}get break(){return this.flags&1}blockAt(t,n,r,i){let a=r+this.left.height;return t<a?this.left.blockAt(t,n,r,i):this.right.blockAt(t,n,a,i+this.left.length+this.break)}lineAt(t,n,r,i,a){let l=i+this.left.height,s=a+this.left.length+this.break,c=n==pt.ByHeight?t<l:t<s,f=c?this.left.lineAt(t,n,r,i,a):this.right.lineAt(t,n,r,l,s);if(this.break||(c?f.to<s:f.from>s))return f;let d=n==pt.ByPosNoHeight?pt.ByPosNoHeight:pt.ByPos;return c?f.join(this.right.lineAt(s,d,r,l,s)):this.left.lineAt(s,d,r,i,a).join(f)}forEachLine(t,n,r,i,a,l){let s=i+this.left.height,c=a+this.left.length+this.break;if(this.break)t<c&&this.left.forEachLine(t,n,r,i,a,l),n>=c&&this.right.forEachLine(t,n,r,s,c,l);else{let f=this.lineAt(c,pt.ByPos,r,i,a);t<f.from&&this.left.forEachLine(t,f.from-1,r,i,a,l),f.to>=t&&f.from<=n&&l(f),n>f.to&&this.right.forEachLine(f.to+1,n,r,s,c,l)}}replace(t,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(t,n,r),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-i,n-i,r));let a=[];t>0&&this.decomposeLeft(t,a);let l=a.length;for(let s of r)a.push(s);if(t>0&&hD(a,l-1),n<this.length){let s=a.length;this.decomposeRight(n,a),hD(a,s)}return Wn.of(a)}decomposeLeft(t,n){let r=this.left.length;if(t<=r)return this.left.decomposeLeft(t,n);n.push(this.left),this.break&&(r++,t>=r&&n.push(null)),t>r&&this.right.decomposeLeft(t-r,n)}decomposeRight(t,n){let r=this.left.length,i=r+this.break;if(t>=i)return this.right.decomposeRight(t-i,n);t<r&&this.left.decomposeRight(t,n),this.break&&t<i&&n.push(null),n.push(this.right)}balanced(t,n){return t.size>2*n.size||n.size>2*t.size?Wn.of(this.break?[t,null,n]:[t,n]):(this.left=ug(this.left,t),this.right=ug(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,r=!1,i){let{left:a,right:l}=this,s=n+a.length+this.break,c=null;return i&&i.from<=n+a.length&&i.more?c=a=a.updateHeight(t,n,r,i):a.updateHeight(t,n,r),i&&i.from<=s+l.length&&i.more?c=l=l.updateHeight(t,s,r,i):l.updateHeight(t,s,r),c?this.balanced(a,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function hD(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof xn&&(r=e[t+1])instanceof xn&&e.splice(t-1,3,new xn(n.length+1+r.length))}const cX=5;class NO{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof kr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new kr(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,r){if(t<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,a=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let l=n-t;r.block?this.addBlock(new h3(l,i,r)):(l||a||i>=cX)&&this.addLineDeco(i,a,l)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTo<t&&((this.writtenTo<t-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new kr(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let r=new xn(n-t);return this.oracle.doc.lineAt(t).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof kr)return t;let n=new kr(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof kr)&&!this.isCovered?this.nodes.push(new kr(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=t;for(let i of this.nodes)i instanceof kr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(t,n,r,i){let a=new NO(r,t);return ze.spans(n,r,i,a,0),a.finish(r)}}function fX(e,t,n){let r=new hX;return ze.compare(e,t,n,r,0),r.changes}class hX{constructor(){this.changes=[]}compareRange(){}comparePoint(t,n,r,i){(t<n||r&&r.heightRelevant||i&&i.heightRelevant)&&_u(t,n,this.changes,5)}}function dX(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),l=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let f=e.parentNode;f&&f!=r.body;)if(f.nodeType==1){let d=f,p=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&p.overflow!="visible"){let g=d.getBoundingClientRect();a=Math.max(a,g.left),l=Math.min(l,g.right),s=Math.max(s,g.top),c=Math.min(f==e.parentNode?i.innerHeight:c,g.bottom)}f=p.position=="absolute"||p.position=="fixed"?d.offsetParent:d.parentNode}else if(f.nodeType==11)f=f.host;else break;return{left:a-n.left,right:Math.max(a,l)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function pX(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function mX(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class kx{constructor(t,n,r,i){this.from=t,this.to=n,this.size=r,this.displaySize=i}static same(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],a=n[r];if(i.from!=a.from||i.to!=a.to||i.size!=a.size)return!1}return!0}draw(t,n){return Ce.replace({widget:new gX(this.displaySize*(n?t.scaleY:t.scaleX),n)}).range(this.from,this.to)}}class gX extends la{constructor(t,n){super(),this.size=t,this.vertical=n}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class dD{constructor(t,n){this.view=t,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=pD,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ft.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(MO).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new lX(r),this.stateDeco=mD(n),this.heightMap=Wn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle.setDoc(n.doc),[new Xr(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ce.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!t.some(({from:a,to:l})=>i>=a&&i<=l)){let{from:a,to:l}=this.lineBlockAt(i);t.push(new Kp(a,l))}}return this.viewports=t.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?pD:new RO(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(zf(t,this.scaler))})}update(t,n=null){this.state=t.state;let r=this.stateDeco;this.stateDeco=mD(this.state);let i=t.changedRanges,a=Xr.extendWithRanges(i,fX(r,this.stateDeco,t?t.changes:Yt.empty(this.state.doc.length))),l=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);fD(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=l||Ku)&&(t.flags|=2),s?(this.scrollAnchorPos=t.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let c=a.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.head<c.from||n.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let f=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(f||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(WL)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,a=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?ft.RTL:ft.LTR;let l=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",s=n.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let f=0,d=0;if(s.width&&s.height){let{scaleX:T,scaleY:D}=EL(n,s);(T>.005&&Math.abs(this.scaleX-T)>.005||D>.005&&Math.abs(this.scaleY-D)>.005)&&(this.scaleX=T,this.scaleY=D,f|=16,l=c=!0)}let p=(parseInt(r.paddingTop)||0)*this.scaleY,g=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=g)&&(this.paddingTop=p,this.paddingBottom=g,f|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,f|=16);let v=TL(this.view.contentDOM,!1).y;v!=this.scrollParent&&(this.scrollParent=v,this.scrollAnchorHeight=-1,this.scrollOffset=0);let y=this.getScrollOffset();this.scrollOffset!=y&&(this.scrollAnchorHeight=-1,this.scrollOffset=y),this.scrolledToBottom=DL(this.scrollParent||t.win);let x=(this.printing?mX:dX)(n,this.paddingTop),w=x.top-this.pixelViewport.top,A=x.bottom-this.pixelViewport.bottom;this.pixelViewport=x;let C=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(C!=this.inView&&(this.inView=C,C&&(c=!0)),!this.inView&&!this.scrollTarget&&!pX(t.dom))return 0;let k=s.width;if((this.contentDOMWidth!=k||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=s.width,this.editorHeight=t.scrollDOM.clientHeight,f|=16),c){let T=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(T)&&(l=!0),l||i.lineWrapping&&Math.abs(k-this.contentDOMWidth)>i.charWidth){let{lineHeight:D,charWidth:N,textHeight:I}=t.docView.measureTextSize();l=D>0&&i.refresh(a,D,N,I,Math.max(5,k/N),T),l&&(t.docView.minWidth=0,f|=16)}w>0&&A>0?d=Math.max(w,A):w<0&&A<0&&(d=Math.min(w,A)),fD();for(let D of this.viewports){let N=D.from==this.viewport.from?T:t.docView.measureVisibleLineHeights(D);this.heightMap=(l?Wn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle,[new Xr(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,l,new oX(D.from,N))}Ku&&(f|=2)}let P=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return P&&(f&2&&(f|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),f|=this.updateForViewport()),(f&2||P)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,t)),f|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),f}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let r=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,a=this.heightOracle,{visibleTop:l,visibleBottom:s}=this,c=new Kp(i.lineAt(l-r*1e3,pt.ByHeight,a,0,0).from,i.lineAt(s+(1-r)*1e3,pt.ByHeight,a,0,0).to);if(n){let{head:f}=n.range;if(f<c.from||f>c.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=i.lineAt(f,pt.ByPos,a,0,0),g;n.y=="center"?g=(p.top+p.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&f<c.from?g=p.top:g=p.bottom-d,c=new Kp(i.lineAt(g-1e3/2,pt.ByHeight,a,0,0).from,i.lineAt(g+d+1e3/2,pt.ByHeight,a,0,0).to)}}return c}mapViewport(t,n){let r=n.mapPos(t.from,-1),i=n.mapPos(t.to,1);return new Kp(this.heightMap.lineAt(r,pt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,pt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(t,pt.ByPos,this.heightOracle,0,0),{bottom:a}=this.heightMap.lineAt(n,pt.ByPos,this.heightOracle,0,0),{visibleTop:l,visibleBottom:s}=this;return(t==0||i<=l-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||a>=s+Math.max(10,Math.min(r,250)))&&i>l-2*1e3&&a<s+2*1e3}mapLineGaps(t,n){if(!t.length||n.empty)return t;let r=[];for(let i of t)n.touchesRange(i.from,i.to)||r.push(new kx(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(t,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,a=i>>1,l=i<<1;if(this.defaultTextDirection!=ft.LTR&&!r)return[];let s=[],c=(d,p,g,v)=>{if(p-d<a)return;let y=this.state.selection.main,x=[y.from];y.empty||x.push(y.to);for(let A of x)if(A>d&&A<p){c(d,A-10,g,v),c(A+10,p,g,v);return}let w=yX(t,A=>A.from>=g.from&&A.to<=g.to&&Math.abs(A.from-d)<a&&Math.abs(A.to-p)<a&&!x.some(C=>A.from<C&&A.to>C));if(!w){if(p<g.to&&n&&r&&n.visibleRanges.some(k=>k.from<=p&&k.to>=p)){let k=n.moveToLineBoundary(J.cursor(p),!1,!0).head;k>d&&(p=k)}let A=this.gapSize(g,d,p,v),C=r||A<2e6?A:2e6;w=new kx(d,p,A,C)}s.push(w)},f=d=>{if(d.length<l||d.type!=kn.Text)return;let p=vX(d.from,d.to,this.stateDeco);if(p.total<l)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,v,y;if(r){let x=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,A;if(g!=null){let C=Qp(p,g),k=((this.visibleBottom-this.visibleTop)/2+x)/d.height;w=C-k,A=C+k}else w=(this.visibleTop-d.top-x)/d.height,A=(this.visibleBottom-d.top+x)/d.height;v=Xp(p,w),y=Xp(p,A)}else{let x=p.total*this.heightOracle.charWidth,w=i*this.heightOracle.charWidth,A=0;if(x>2e6)for(let D of t)D.from>=d.from&&D.from<d.to&&D.size!=D.displaySize&&D.from*this.heightOracle.charWidth+A<this.pixelViewport.left&&(A=D.size-D.displaySize);let C=this.pixelViewport.left+A,k=this.pixelViewport.right+A,P,T;if(g!=null){let D=Qp(p,g),N=((k-C)/2+w)/x;P=D-N,T=D+N}else P=(C-w)/x,T=(k+w)/x;v=Xp(p,P),y=Xp(p,T)}v>d.from&&c(d.from,v,d,p),y<d.to&&c(y,d.to,d,p)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(f):f(d);return s}gapSize(t,n,r,i){let a=Qp(i,r)-Qp(i,n);return this.heightOracle.lineWrapping?t.height*a:i.total*this.heightOracle.charWidth*a}updateLineGaps(t){kx.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=Ce.set(t.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];ze.spans(n,this.viewport.from,this.viewport.to,{span(a,l){r.push({from:a,to:l})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let a=0;a<r.length&&!(i&8);a++){let l=this.visibleRanges[a],s=r[a];(l.from!=s.from||l.to!=s.to)&&(i|=4,t&&t.mapPos(l.from,-1)==s.from&&t.mapPos(l.to,1)==s.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||zf(this.heightMap.lineAt(t,pt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||zf(this.heightMap.lineAt(this.scaler.fromDOM(t),pt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return zf(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Kp{constructor(t,n){this.from=t,this.to=n}}function vX(e,t,n){let r=[],i=e,a=0;return ze.spans(n,e,t,{span(){},point(l,s){l>i&&(r.push({from:i,to:l}),a+=l-i),i=s}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function Xp({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let i=0;;i++){let{from:a,to:l}=t[i],s=l-a;if(r<=s)return a+r;r-=s}}function Qp(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function yX(e,t){for(let n of e)if(t(n))return n}const pD={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function mD(e){let t=e.facet(jv).filter(r=>typeof r!="function"),n=e.facet(DO).filter(r=>typeof r!="function");return n.length&&t.push(ze.join(n)),t}class RO{constructor(t,n,r){let i=0,a=0,l=0;this.viewports=r.map(({from:s,to:c})=>{let f=n.lineAt(s,pt.ByPos,t,0,0).top,d=n.lineAt(c,pt.ByPos,t,0,0).bottom;return i+=d-f,{from:s,to:c,top:f,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let s of this.viewports)s.domTop=l+(s.top-a)*this.scale,l=s.domBottom=s.domTop+(s.bottom-s.top),a=s.bottom}toDOM(t){for(let n=0,r=0,i=0;;n++){let a=n<this.viewports.length?this.viewports[n]:null;if(!a||t<a.top)return i+(t-r)*this.scale;if(t<=a.bottom)return a.domTop+(t-a.top);r=a.bottom,i=a.domBottom}}fromDOM(t){for(let n=0,r=0,i=0;;n++){let a=n<this.viewports.length?this.viewports[n]:null;if(!a||t<a.domTop)return r+(t-i)/this.scale;if(t<=a.domBottom)return a.top+(t-a.domTop);r=a.bottom,i=a.domBottom}}eq(t){return t instanceof RO?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((n,r)=>n.from==t.viewports[r].from&&n.to==t.viewports[r].to):!1}}function zf(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new ci(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(i=>zf(i,t)):e._content)}const Yp=me.define({combine:e=>e.join(" ")}),kS=me.define({combine:e=>e.indexOf(!0)>-1}),CS=Ql.newName(),d3=Ql.newName(),p3=Ql.newName(),m3={"&light":"."+d3,"&dark":"."+p3};function ES(e,t,n){return new Ql(t,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return e;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):e+" "+r}})}const bX=ES("."+CS,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},m3),xX={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Cx=pe.ie&&pe.ie_version<=11;class SX{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new Y7,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(pe.ie&&pe.ie_version<=11||pe.ios&&t.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&pe.android&&t.constructor.EDIT_CONTEXT!==!1&&!(pe.chrome&&pe.chrome_version<126)&&(this.editContext=new OX(t),t.state.facet(Ma)&&(t.contentDOM.editContext=this.editContext.editContext)),Cx&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,r)=>n!=t[r]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Ma)?r.root.activeElement!=this.dom:!Qf(this.dom,i))return;let a=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(a&&a.isWidget()&&a.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(pe.ie&&pe.ie_version<=11||pe.android&&pe.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Gf(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=gh(t.root);if(!n)return!1;let r=pe.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&wX(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=Qf(this.dom,r);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&Z7(this.dom,r)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(t,n){this.selectionRange.set(t.node,t.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&t<this.scrollTargets.length&&this.scrollTargets[t]==r?t++:n||(n=this.scrollTargets.slice(0,t)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(t<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,t)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,xX),Cx&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Cx&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,n){var r;if(!this.delayedAndroidKey){let i=()=>{let a=this.delayedAndroidKey;a&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=a.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&a.force&&Nu(this.dom,a.key,a.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let a of t){let l=this.readMutation(a);l&&(l.typeOver&&(i=!0),n==-1?{from:n,to:r}=l:(n=Math.min(l.from,n),r=Math.max(l.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:t,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Qf(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let a=new zK(this.view,t,n,r);return this.view.docView.domChanged={newSel:a.newSel?a.newSel.main:null},a}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=n3(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!sg(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let r=gD(n,t.previousSibling||t.target.previousSibling,-1),i=gD(n,t.nextSibling||t.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(Ma)!=t.state.facet(Ma)&&(t.view.contentDOM.editContext=t.state.facet(Ma)?this.editContext.editContext:null))}destroy(){var t,n,r;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function gD(e,t,n){for(;t;){let r=Pt.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function vD(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,l=e.docView.domAtPos(e.state.selection.main.anchor,1);return Gf(l.node,l.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function wX(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return vD(e,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?vD(e,n):null}class OX{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=r=>{let i=t.state.selection.main,{anchor:a,head:l}=i,s=this.toEditorPos(r.updateRangeStart),c=this.toEditorPos(r.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:s,drifted:!1});let f=c-s>r.text.length;s==this.from&&a<this.from?s=a:c==this.to&&a>this.to&&(c=a);let d=r3(t.state.sliceDoc(s,c),r.text,(f?i.from:i.to)-s,f?"end":null);if(!d){let g=J.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));sg(g,i)||t.dispatch({selection:g,userEvent:"select"});return}let p={from:d.from+s,to:d.toA+s,insert:Je.of(r.text.slice(d.from,d.toB).split(`
64
- `))};if((pe.mac||pe.android)&&p.from==l-1&&/^\. ?$/.test(r.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:s,to:c,insert:Je.of([r.text.replace("."," ")])}),this.pendingContextChange=p,!t.state.readOnly){let g=this.to-this.from+(p.to-p.from+p.insert.length);_O(t,p,J.single(this.toEditorPos(r.selectionStart,g),this.toEditorPos(r.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),p.from<p.to&&!p.insert.length&&t.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],a=null;for(let l=this.toEditorPos(r.rangeStart),s=this.toEditorPos(r.rangeEnd);l<s;l++){let c=t.coordsForChar(l);a=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||a||new DOMRect,i.push(a)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let a of r.getTextFormats()){let l=a.underlineStyle,s=a.underlineThickness;if(!/none/i.test(l)&&!/none/i.test(s)){let c=this.toEditorPos(a.rangeStart),f=this.toEditorPos(a.rangeEnd);if(c<f){let d=`text-decoration: underline ${/^[a-z]/.test(l)?l+" ":l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${/thin/i.test(s)?1:2}px`;i.push(Ce.mark({attributes:{style:d}}).range(c,f))}}}t.dispatch({effects:KL.of(Ce.set(i))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(t.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{let i=gh(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,r=!1,i=this.pendingContextChange;return t.changes.iterChanges((a,l,s,c,f)=>{if(r)return;let d=f.length-(l-a);if(i&&l>=i.to)if(i.from==a&&i.to==l&&i.insert.eq(f)){i=this.pendingContextChange=null,n+=d,this.to+=d;return}else i=null,this.revertPending(t.state);if(a+=n,l+=n,l<=this.from)this.from+=d,this.to+=d;else if(a<this.to){if(a<this.from||l>this.to||this.to-this.from+f.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(a),this.toContextPos(l),f.toString()),this.to+=d}n+=d}),i&&!r&&this.revertPending(t.state),!r}update(t){let n=this.pendingContextChange,r=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(r.from,r.to)&&t.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to<t.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let r=this.composing;return r&&r.drifted?r.editorBase+(t-r.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class de{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:r}=t;this.dispatchTransactions=t.dispatchTransactions||r&&(i=>i.forEach(a=>r(a,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=t.root||G7(t.parent)||document,this.viewState=new dD(this,t.state||qe.create(t)),t.scrollTo&&t.scrollTo.is(qp)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(wu).map(i=>new xx(i));for(let i of this.plugins)i.update(this);this.observer=new SX(this),this.inputState=new FK(this),this.inputState.ensureHandlers(this.plugins),this.docView=new eD(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Zt?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,a=this.state;for(let g of t){if(g.startState!=a)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");a=g.state}if(this.destroyed){this.viewState.state=a;return}let l=this.hasFocus,s=0,c=null;t.some(g=>g.annotation(u3))?(this.inputState.notifiedFocused=l,s=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,c=c3(a,l),c||(s=1));let f=this.observer.delayedAndroidKey,d=null;if(f?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(d=null)):this.observer.clear(),a.facet(qe.phrases)!=this.state.facet(qe.phrases))return this.setState(a);i=ag.create(this,a,t),i.flags|=s;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let g of t){if(p&&(p=p.map(g.changes)),g.scrollIntoView){let{main:v}=g.state.selection,{x:y,y:x}=this.state.facet(de.cursorScrollMargin);p=new Ru(v.empty?v:J.cursor(v.head,v.head>v.anchor?-1:1),"nearest","nearest",x,y)}for(let v of g.effects)v.is(qp)&&(p=v.value.clip(this.state))}this.viewState.update(i,p),this.bidiCache=cg.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Bf)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Yp)!=i.state.facet(Yp)&&(this.viewState.mustMeasureContent=!0),(n||r||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let g of this.state.facet(xS))try{g(i)}catch(v){lr(this.state,v,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!n3(this,d)&&f.force&&Nu(this.contentDOM,f.key,f.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new dD(this,t),this.plugins=t.facet(wu).map(r=>new xx(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new eD(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(wu),r=t.state.facet(wu);if(n!=r){let i=[];for(let a of r){let l=n.indexOf(a);if(l<0)i.push(new xx(a));else{let s=this.plugins[l];s.mustUpdate=t,i.push(s)}}for(let a of this.plugins)a.mustUpdate!=t&&a.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=t;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let n=t.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){lr(this.state,r,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:a,scrollAnchorHeight:l}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let s=0;;s++){if(l<0)if(DL(r||this.win))a=-1,l=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(i);a=v.from,l=v.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(s>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];c&4||([this.measureRequests,f]=[f,this.measureRequests]);let d=f.map(v=>{try{return v.read(this)}catch(y){return lr(this.state,y),yD}}),p=ag.create(this,this.state,[]),g=!1;p.flags|=c,n?n.flags|=c:n=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),g=this.docView.update(p),g&&this.docViewUpdate());for(let v=0;v<f.length;v++)if(d[v]!=yD)try{let y=f[v];y.write&&y.write(d[v],this)}catch(y){lr(this.state,y)}if(g&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,l=-1;continue}else{let y=((a<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(a).top)-l)/this.scaleY;if((y>1||y<-1)&&!(pe.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+y,r?r.scrollTop+=y:this.win.scrollBy(0,y),l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let s of this.state.facet(xS))s(n)}get themeClasses(){return CS+" "+(this.state.facet(kS)?p3:d3)+" "+this.state.facet(Yp)}updateAttrs(){let t=bD(this,XL,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ma)?"true":"false",class:"cm-content",style:`${pe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),bD(this,MO,n);let r=this.observer.ignore(()=>{let i=XM(this.contentDOM,this.contentAttrs,n),a=XM(this.dom,this.editorAttrs,t);return i||a});return this.editorAttrs=t,this.contentAttrs=n,r}showAnnouncements(t){let n=!0;for(let r of t)for(let i of r.effects)if(i.is(de.announce)){n&&(this.announceDOM.textContent=""),n=!1;let a=this.announceDOM.appendChild(document.createElement("div"));a.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Bf);let t=this.state.facet(de.cspNonce);Ql.mount(this.root,this.styleModules.concat(bX).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===t.key){this.measureRequests[n]=t;return}}this.measureRequests.push(t)}}plugin(t){let n=this.pluginMap.get(t);return(n===void 0||n&&n.plugin!=t)&&this.pluginMap.set(t,n=this.plugins.find(r=>r.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,r){return Ax(this,t,tD(this,t,n,r))}moveByGroup(t,n){return Ax(this,t,tD(this,t,n,r=>NK(this,t.head,r)))}visualLineSide(t,n){let r=this.bidiSpans(t),i=this.textDirectionAt(t.from),a=r[n?r.length-1:0];return J.cursor(a.side(n,i)+t.from,a.forward(!n,i)?1:-1)}moveToLineBoundary(t,n,r=!0){return _K(this,t,n,r)}moveVertically(t,n,r){return Ax(this,t,RK(this,t,n,r))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let r=OS(this,t,n);return r&&r.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),OS(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let r=this.state.doc.lineAt(t),i=this.bidiSpans(r),a=i[qi.find(i,t-r.from,-1,n)];return this.docView.coordsAt(t,n,a.dir==ft.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(qL)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>AX)return IL(t.length);let n=this.textDirectionAt(t.from),r;for(let a of this.bidiCache)if(a.from==t.from&&a.dir==n&&(a.fresh||jL(a.isolates,r=GM(this,t))))return a.order;r||(r=GM(this,t));let i=aK(t.text,n,r);return this.bidiCache.push(new cg(t.from,t.to,n,r,!0,i)),i}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||pe.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ML(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var r,i,a,l;return qp.of(new Ru(typeof t=="number"?J.cursor(t):t,(r=n.y)!==null&&r!==void 0?r:"nearest",(i=n.x)!==null&&i!==void 0?i:"nearest",(a=n.yMargin)!==null&&a!==void 0?a:5,(l=n.xMargin)!==null&&l!==void 0?l:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(t);return qp.of(new Ru(J.cursor(r.from),"start","start",r.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return _t.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return _t.define(()=>({}),{eventObservers:t})}static theme(t,n){let r=Ql.newName(),i=[Yp.of(r),Bf.of(ES(`.${r}`,t))];return n&&n.dark&&i.push(kS.of(!0)),i}static baseTheme(t){return vs.lowest(Bf.of(ES("."+CS,t,m3)))}static findFromDOM(t){var n;let r=t.querySelector(".cm-content"),i=r&&Pt.get(r)||Pt.get(t);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}de.styleModule=Bf;de.inputHandler=HL;de.clipboardInputFilter=EO;de.clipboardOutputFilter=TO;de.scrollHandler=VL;de.focusChangeEffect=FL;de.perLineTextDirection=qL;de.exceptionSink=UL;de.updateListener=xS;de.editable=Ma;de.mouseSelectionStyle=$L;de.dragMovesSelection=zL;de.clickAddsSelectionRange=BL;de.decorations=jv;de.blockWrappers=QL;de.outerDecorations=DO;de.atomicRanges=Vh;de.bidiIsolatedRanges=YL;de.cursorScrollMargin=me.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r=="number"?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}});de.scrollMargins=GL;de.darkTheme=kS;de.cspNonce=me.define({combine:e=>e.length?e[0]:""});de.contentAttributes=MO;de.editorAttributes=XL;de.lineWrapping=de.contentAttributes.of({class:"cm-lineWrapping"});de.announce=_e.define();const AX=4096,yD={};class cg{constructor(t,n,r,i,a,l){this.from=t,this.to=n,this.dir=r,this.isolates=i,this.fresh=a,this.order=l}static update(t,n){if(n.empty&&!t.some(a=>a.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:ft.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let l=t[a];l.dir==i&&!n.touchesRange(l.from,l.to)&&r.push(new cg(n.mapPos(l.from,1),n.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return r}}function bD(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let a=r[i],l=typeof a=="function"?a(e):a;l&&AO(l,n)}return n}const kX=pe.mac?"mac":pe.windows?"win":pe.linux?"linux":"key";function CX(e,t){const n=e.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,a,l,s;for(let c=0;c<n.length-1;++c){const f=n[c];if(/^(cmd|meta|m)$/i.test(f))s=!0;else if(/^a(lt)?$/i.test(f))i=!0;else if(/^(c|ctrl|control)$/i.test(f))a=!0;else if(/^s(hift)?$/i.test(f))l=!0;else if(/^mod$/i.test(f))t=="mac"?s=!0:a=!0;else throw new Error("Unrecognized modifier name: "+f)}return i&&(r="Alt-"+r),a&&(r="Ctrl-"+r),s&&(r="Meta-"+r),l&&(r="Shift-"+r),r}function Gp(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n!==!1&&t.shiftKey&&(e="Shift-"+e),e}const EX=vs.default(de.domEventHandlers({keydown(e,t){return v3(g3(t.state),e,t,"editor")}})),zv=me.define({enables:EX}),xD=new WeakMap;function g3(e){let t=e.facet(zv),n=xD.get(t);return n||xD.set(t,n=DX(t.reduce((r,i)=>r.concat(i),[]))),n}function TX(e,t,n){return v3(g3(e.state),t,e,n)}let Il=null;const MX=4e3;function DX(e,t=kX){let n=Object.create(null),r=Object.create(null),i=(l,s)=>{let c=r[l];if(c==null)r[l]=s;else if(c!=s)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},a=(l,s,c,f,d)=>{var p,g;let v=n[l]||(n[l]=Object.create(null)),y=s.split(/ (?!$)/).map(A=>CX(A,t));for(let A=1;A<y.length;A++){let C=y.slice(0,A).join(" ");i(C,!0),v[C]||(v[C]={preventDefault:!0,stopPropagation:!1,run:[k=>{let P=Il={view:k,prefix:C,scope:l};return setTimeout(()=>{Il==P&&(Il=null)},MX),!0}]})}let x=y.join(" ");i(x,!1);let w=v[x]||(v[x]={preventDefault:!1,stopPropagation:!1,run:((g=(p=v._any)===null||p===void 0?void 0:p.run)===null||g===void 0?void 0:g.slice())||[]});c&&w.run.push(c),f&&(w.preventDefault=!0),d&&(w.stopPropagation=!0)};for(let l of e){let s=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let f of s){let d=n[f]||(n[f]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=l;for(let g in d)d[g].run.push(v=>p(v,TS))}let c=l[t]||l.key;if(c)for(let f of s)a(f,c,l.run,l.preventDefault,l.stopPropagation),l.shift&&a(f,"Shift-"+c,l.shift,l.preventDefault,l.stopPropagation)}return n}let TS=null;function v3(e,t,n,r){TS=t;let i=q7(t),a=rr(i,0),l=Ui(a)==i.length&&i!=" ",s="",c=!1,f=!1,d=!1;Il&&Il.view==n&&Il.scope==r&&(s=Il.prefix+" ",a3.indexOf(t.keyCode)<0&&(f=!0,Il=null));let p=new Set,g=w=>{if(w){for(let A of w.run)if(!p.has(A)&&(p.add(A),A(n)))return w.stopPropagation&&(d=!0),!0;w.preventDefault&&(w.stopPropagation&&(d=!0),f=!0)}return!1},v=e[r],y,x;return v&&(g(v[s+Gp(i,t,!l)])?c=!0:l&&(t.altKey||t.metaKey||t.ctrlKey)&&!(pe.windows&&t.ctrlKey&&t.altKey)&&!(pe.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(y=Yl[t.keyCode])&&y!=i?(g(v[s+Gp(y,t,!0)])||t.shiftKey&&(x=ph[t.keyCode])!=i&&x!=y&&g(v[s+Gp(x,t,!1)]))&&(c=!0):l&&t.shiftKey&&g(v[s+Gp(i,t,!0)])&&(c=!0),!c&&g(v._any)&&(c=!0)),f&&(c=!0),c&&d&&t.stopPropagation(),TS=null,c}class Yo{constructor(t,n,r,i,a){this.className=t,this.left=n,this.top=r,this.width=i,this.height=a}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=y3(t);return[new Yo(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return PX(t,n,r)}}function y3(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==ft.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function SD(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),l=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:l}),c=e.posAtCoords({x:a.right-1,y:l});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function PX(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==ft.LTR,l=e.contentDOM,s=l.getBoundingClientRect(),c=y3(e),f=l.querySelector(".cm-line"),d=f&&window.getComputedStyle(f),p=s.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),g=s.right-(d?parseInt(d.paddingRight):0),v=wS(e,r,1),y=wS(e,i,-1),x=v.type==kn.Text?v:null,w=y.type==kn.Text?y:null;if(x&&(e.lineWrapping||v.widgetLineBreaks)&&(x=SD(e,r,1,x)),w&&(e.lineWrapping||y.widgetLineBreaks)&&(w=SD(e,i,-1,w)),x&&w&&x.from==w.from&&x.to==w.to)return C(k(n.from,n.to,x));{let T=x?k(n.from,null,x):P(v,!1),D=w?k(null,n.to,w):P(y,!0),N=[];return(x||v).to<(w||y).from-(x&&w?1:0)||v.widgetLineBreaks>1&&T.bottom+e.defaultLineHeight/2<D.top?N.push(A(p,T.bottom,g,D.top)):T.bottom<D.top&&e.elementAtHeight((T.bottom+D.top)/2).type==kn.Text&&(T.bottom=D.top=(T.bottom+D.top)/2),C(T).concat(N).concat(C(D))}function A(T,D,N,I){return new Yo(t,T-c.left,D-c.top,Math.max(0,N-T),I-D)}function C({top:T,bottom:D,horizontal:N}){let I=[];for(let U=0;U<N.length;U+=2)I.push(A(N[U],T,N[U+1],D));return I}function k(T,D,N){let I=1e9,U=-1e9,K=[];function V(ie,oe,z,G,ne){let ce=e.coordsAtPos(ie,ie==N.to?-2:2),fe=e.coordsAtPos(z,z==N.from?2:-2);!ce||!fe||(I=Math.min(ce.top,fe.top,I),U=Math.max(ce.bottom,fe.bottom,U),ne==ft.LTR?K.push(a&&oe?p:ce.left,a&&G?g:fe.right):K.push(!a&&G?p:fe.left,!a&&oe?g:ce.right))}let B=T??N.from,ae=D??N.to;for(let ie of e.visibleRanges)if(ie.to>B&&ie.from<ae)for(let oe=Math.max(ie.from,B),z=Math.min(ie.to,ae);;){let G=e.state.doc.lineAt(oe);for(let ne of e.bidiSpans(G)){let ce=ne.from+G.from,fe=ne.to+G.from;if(ce>=z)break;fe>oe&&V(Math.max(ce,oe),T==null&&ce<=B,Math.min(fe,z),D==null&&fe>=ae,ne.dir)}if(oe=G.to+1,oe>=z)break}return K.length==0&&V(B,T==null,ae,D==null,e.textDirection),{top:I,bottom:U,horizontal:K}}function P(T,D){let N=s.top+(D?T.top:T.bottom);return{top:N,bottom:N,horizontal:[]}}}function _X(e,t){return e.constructor==t.constructor&&e.eq(t)}class NX{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(Im)!=t.state.facet(Im)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,r=t.facet(Im);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:n}=this.view;(t!=this.scaleX||n!=this.scaleY)&&(this.scaleX=t,this.scaleY=n,this.dom.style.transform=`scale(${1/t}, ${1/n})`)}draw(t){if(t.length!=this.drawn.length||t.some((n,r)=>!_X(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of t)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=t,pe.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Im=me.define();function b3(e){return[_t.define(t=>new NX(t,e)),Im.of(e)]}const Xu=me.define({combine(e){return aa(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function RX(e={}){return[Xu.of(e),jX,IX,LX,WL.of(!0)]}function x3(e){return e.startState.facet(Xu)!=e.state.facet(Xu)}const jX=b3({above:!0,markers(e){let{state:t}=e,n=t.facet(Xu),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(a&&pe.ios&&n.iosSelectionHandles)){let l=a?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",s=i.empty?i:J.cursor(i.head,i.assoc);for(let c of Yo.forRange(e,l,s))r.push(c)}}return r},update(e,t){e.transactions.some(r=>r.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=x3(e);return n&&wD(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){wD(t.state,e)},class:"cm-cursorLayer"});function wD(e,t){t.style.animationDuration=e.facet(Xu).cursorBlinkRate+"ms"}const IX=b3({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let i of r)if(!i.empty)for(let a of Yo.forRange(e,"cm-selectionBackground",i))t.push(a);if(pe.ios&&!n.empty&&e.state.facet(Xu).iosSelectionHandles){for(let i of Yo.forRange(e,"cm-selectionHandle cm-selectionHandle-start",J.cursor(n.from,1)))t.push(i);for(let i of Yo.forRange(e,"cm-selectionHandle cm-selectionHandle-end",J.cursor(n.to,1)))t.push(i)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||x3(e)},class:"cm-selectionLayer"}),LX=vs.highest(de.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),S3=_e.define({map(e,t){return e==null?null:t.mapPos(e)}}),$f=Nn.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,r)=>r.is(S3)?r.value:n,e)}}),BX=_t.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field($f);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field($f)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field($f),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field($f)!=e&&this.view.dispatch({effects:S3.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function zX(){return[$f,BX]}function OD(e,t,n,r,i){t.lastIndex=0;for(let a=e.iterRange(n,r),l=n,s;!a.next().done;l+=a.value.length)if(!a.lineBreak)for(;s=t.exec(a.value);)i(l+s.index,s)}function $X(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:a}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),a=Math.min(e.state.doc.lineAt(a).to,a+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=a:r.push({from:i,to:a});return r}class UX{constructor(t){const{regexp:n,decoration:r,decorate:i,boundary:a,maxLength:l=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(s,c,f,d)=>i(d,f,f+s[0].length,s,c);else if(typeof r=="function")this.addMatch=(s,c,f,d)=>{let p=r(s,c,f);p&&d(f,f+s[0].length,p)};else if(r)this.addMatch=(s,c,f,d)=>d(f,f+s[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=a,this.maxLength=l}createDeco(t){let n=new Ha,r=n.add.bind(n);for(let{from:i,to:a}of $X(t,this.maxLength))OD(t.state.doc,this.regexp,i,a,(l,s)=>this.addMatch(s,t,l,r));return n.finish()}updateDeco(t,n){let r=1e9,i=-1;return t.docChanged&&t.changes.iterChanges((a,l,s,c)=>{c>=t.view.viewport.from&&s<=t.view.viewport.to&&(r=Math.min(s,r),i=Math.max(c,i))}),t.viewportMoved||i-r>1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,n.map(t.changes),r,i):n}updateRange(t,n,r,i){for(let a of t.visibleRanges){let l=Math.max(a.from,r),s=Math.min(a.to,i);if(s>=l){let c=t.state.doc.lineAt(l),f=c.to<s?t.state.doc.lineAt(s):c,d=Math.max(a.from,c.from),p=Math.min(a.to,f.to);if(this.boundary){for(;l>c.from;l--)if(this.boundary.test(c.text[l-1-c.from])){d=l;break}for(;s<f.to;s++)if(this.boundary.test(f.text[s-f.from])){p=s;break}}let g=[],v,y=(x,w,A)=>g.push(A.range(x,w));if(c==f)for(this.regexp.lastIndex=d-c.from;(v=this.regexp.exec(c.text))&&v.index<p-c.from;)this.addMatch(v,t,v.index+c.from,y);else OD(t.state.doc,this.regexp,d,p,(x,w)=>this.addMatch(w,t,x,y));n=n.update({filterFrom:d,filterTo:p,filter:(x,w)=>x<d||w>p,add:g})}}return n}}const MS=/x/.unicode!=null?"gu":"g",HX=new RegExp(`[\0-\b
65
- --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,MS),FX={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Ex=null;function qX(){var e;if(Ex==null&&typeof document<"u"&&document.body){let t=document.body.style;Ex=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return Ex||!1}const Lm=me.define({combine(e){let t=aa(e,{render:null,specialChars:HX,addSpecialChars:null});return(t.replaceTabs=!qX())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,MS)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,MS)),t}});function WX(e={}){return[Lm.of(e),VX()]}let AD=null;function VX(){return AD||(AD=_t.fromClass(class{constructor(e){this.view=e,this.decorations=Ce.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Lm)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new UX({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=rr(t[0],0);if(a==9){let l=i.lineAt(r),s=n.state.tabSize,c=fc(l.text,s,r-l.from);return Ce.replace({widget:new YX((s-c%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Ce.replace({widget:new QX(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Lm);e.startState.facet(Lm)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const KX="•";function XX(e){return e>=32?KX:e==10?"␤":String.fromCharCode(9216+e)}class QX extends la{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=XX(this.code),r=t.state.phrase("Control character")+" "+(FX[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let a=document.createElement("span");return a.textContent=n,a.title=r,a.setAttribute("aria-label",r),a.className="cm-specialChar",a}ignoreEvent(){return!1}}class YX extends la{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function GX(){return JX}const ZX=Ce.line({class:"cm-activeLine"}),JX=_t.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(ZX.range(i.from)),t=i.from)}return Ce.set(n)}},{decorations:e=>e.decorations});class eQ extends la{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?Yf(t.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(t.parentNode),i=vh(n[0],r.direction!="rtl"),a=parseInt(r.lineHeight);return i.bottom-i.top>a*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+a}:i}ignoreEvent(){return!1}}function tQ(e){let t=_t.fromClass(class{constructor(n){this.view=n,this.placeholder=e?Ce.set([Ce.widget({widget:new eQ(e),side:1}).range(0)]):Ce.none}get decorations(){return this.view.state.doc.length?Ce.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,de.contentAttributes.of({"aria-placeholder":e})]:t}const DS=2e3;function nQ(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>DS||n.off>DS||t.col<0||n.col<0){let l=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let c=r;c<=i;c++){let f=e.doc.line(c);f.length<=s&&a.push(J.range(f.from+l,f.to+s))}}else{let l=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let c=r;c<=i;c++){let f=e.doc.line(c),d=uS(f.text,l,e.tabSize,!0);if(d<0)a.push(J.cursor(f.to));else{let p=uS(f.text,s,e.tabSize);a.push(J.range(f.from+d,f.from+p))}}}return a}function rQ(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function kD(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>DS?-1:i==r.length?rQ(e,t.clientX):fc(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function iQ(e,t){let n=kD(e,t),r=e.state.selection;return n?{update(i){if(i.docChanged){let a=i.changes.mapPos(i.startState.doc.line(n.line).from),l=i.state.doc.lineAt(a);n={line:l.number,col:n.col,off:Math.min(n.off,l.length)},r=r.map(i.changes)}},get(i,a,l){let s=kD(e,i);if(!s)return r;let c=nQ(e.state,n,s);return c.length?l?J.create(c.concat(r.ranges)):J.create(c):r}}:null}function aQ(e){let t=(n=>n.altKey&&n.button==0);return de.mouseSelectionStyle.of((n,r)=>t(r)?iQ(n,r):null)}const lQ={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},oQ={style:"cursor: crosshair"};function sQ(e={}){let[t,n]=lQ[e.key||"Alt"],r=_t.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==t||n(i))},keyup(i){(i.keyCode==t||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,de.contentAttributes.of(i=>{var a;return!((a=i.plugin(r))===null||a===void 0)&&a.isDown?oQ:null})]}const Zp="-10000px";class w3{constructor(t,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=t.state.facet(n),this.tooltips=this.input.filter(l=>l);let a=null;this.tooltipViews=this.tooltips.map(l=>a=r(l,a))}update(t,n){var r;let i=t.state.facet(this.facet),a=i.filter(c=>c);if(i===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let l=[],s=n?[]:null;for(let c=0;c<a.length;c++){let f=a[c],d=-1;if(f){for(let p=0;p<this.tooltips.length;p++){let g=this.tooltips[p];g&&g.create==f.create&&(d=p)}if(d<0)l[c]=this.createTooltipView(f,c?l[c-1]:null),s&&(s[c]=!!f.above);else{let p=l[c]=this.tooltipViews[d];s&&(s[c]=n[d]),p.update&&p.update(t)}}}for(let c of this.tooltipViews)l.indexOf(c)<0&&(this.removeTooltipView(c),(r=c.destroy)===null||r===void 0||r.call(c));return n&&(s.forEach((c,f)=>n[f]=c),n.length=s.length),this.input=i,this.tooltips=a,this.tooltipViews=l,!0}}function uQ(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const Tx=me.define({combine:e=>{var t,n,r;return{position:pe.ios?"absolute":((t=e.find(i=>i.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=e.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||uQ}}}),CD=new WeakMap,jO=_t.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(Tx);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new w3(e,IO,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(Tx);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=Zp,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(e=r.destroy)===null||e===void 0||e.call(r);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:a}=this.manager.tooltipViews[0];if(pe.safari){let l=a.getBoundingClientRect();n=Math.abs(l.top+1e4)>1||Math.abs(l.left)>1}else n=!!a.offsetParent&&a.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let a=this.parent.getBoundingClientRect();a.width&&a.height&&(e=a.width/this.parent.offsetWidth,t=a.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=PO(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((a,l)=>{let s=this.manager.tooltipViews[l];return s.getCoords?s.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(Tx).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let s of this.manager.tooltipViews)s.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:a}=e,l=[];for(let s=0;s<this.manager.tooltips.length;s++){let c=this.manager.tooltips[s],f=this.manager.tooltipViews[s],{dom:d}=f,p=e.pos[s],g=e.size[s];if(!p||c.clip!==!1&&(p.bottom<=Math.max(n.top,r.top)||p.top>=Math.min(n.bottom,r.bottom)||p.right<Math.max(n.left,r.left)-.1||p.left>Math.min(n.right,r.right)+.1)){d.style.top=Zp;continue}let v=c.arrow?f.dom.querySelector(".cm-tooltip-arrow"):null,y=v?7:0,x=g.right-g.left,w=(t=CD.get(f))!==null&&t!==void 0?t:g.bottom-g.top,A=f.offset||fQ,C=this.view.textDirection==ft.LTR,k=g.width>r.right-r.left?C?r.left:r.right-g.width:C?Math.max(r.left,Math.min(p.left-(v?14:0)+A.x,r.right-x)):Math.min(Math.max(r.left,p.left-x+(v?14:0)-A.x),r.right-x),P=this.above[s];!c.strictSide&&(P?p.top-w-y-A.y<r.top:p.bottom+w+y+A.y>r.bottom)&&P==r.bottom-p.bottom>p.top-r.top&&(P=this.above[s]=!P);let T=(P?p.top-r.top:r.bottom-p.bottom)-y;if(T<w&&f.resize!==!1){if(T<this.view.defaultLineHeight){d.style.top=Zp;continue}CD.set(f,w),d.style.height=(w=T)/a+"px"}else d.style.height&&(d.style.height="");let D=P?p.top-w-y-A.y:p.bottom+y+A.y,N=k+x;if(f.overlap!==!0)for(let I of l)I.left<N&&I.right>k&&I.top<D+w&&I.bottom>D&&(D=P?I.top-w-2-y:I.bottom+y+2);if(this.position=="absolute"?(d.style.top=(D-e.parent.top)/a+"px",ED(d,(k-e.parent.left)/i)):(d.style.top=D/a+"px",ED(d,k/i)),v){let I=p.left+(C?A.x:-A.x)-(k+14-7);v.style.left=I/i+"px"}f.overlap!==!0&&l.push({left:k,top:D,right:N,bottom:D+w}),d.classList.toggle("cm-tooltip-above",P),d.classList.toggle("cm-tooltip-below",!P),f.positioned&&f.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Zp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function ED(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const cQ=de.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),fQ={x:0,y:0},IO=me.define({enables:[jO,cQ]}),fg=me.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class $v{static create(t){return new $v(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new w3(t,fg,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(t,n){let r=t.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let r of this.manager.tooltipViews){let i=r[t];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const hQ=IO.compute([fg],e=>{let t=e.facet(fg);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:$v.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),O3=me.define();class dQ{constructor(t,n,r,i,a,l){this.view=t,this.source=n,this.field=r,this.locked=i,this.setHover=a,this.hoverTime=l,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:t,lastMove:n}=this,r=t.docView.tile.nearest(n.target);if(!r)return;let i,a=1;if(r.isWidget())i=r.posAtStart;else{if(i=t.posAtCoords(n),i==null)return;let l=t.coordsAtPos(i);if(!l||n.y<l.top||n.y>l.bottom||n.x<l.left-t.defaultCharacterWidth||n.x>l.right+t.defaultCharacterWidth)return;let s=t.bidiSpans(t.state.doc.lineAt(i)).find(f=>f.from<=i&&f.to>=i),c=s&&s.dir==ft.RTL?-1:1;a=n.x<l.left?-c:c}this.activateHover(t,i,a)}activateHover(t,n,r,i){let a=this.source(t,n,r),l=s=>{if(s&&!(Array.isArray(s)&&!s.length)){let c=Array.isArray(s)?s:[s];i&&this.locked.set(c,i),t.dispatch({effects:this.setHover.of(c)})}};if(a&&"then"in a){let s=this.pending={pos:n};a.then(c=>{this.pending==s&&(this.pending=null,l(c))},c=>lr(t.state,c,"hover tooltip"))}else l(a)}get tooltip(){let t=this.view.plugin(jO),n=t?t.manager.tooltips.findIndex(r=>r.create==$v.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,r;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:a}=this;if(i.length&&!this.locked.has(i)&&a&&!pQ(a.dom,t)||this.pending){let{pos:l}=i[0]||this.pending,s=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:l;(l==s?this.view.posAtCoords(this.lastMove)!=l:!mQ(this.view,l,s,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:r}=this;r&&r.dom.contains(t.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=r=>{t.removeEventListener("mouseleave",n);let{active:i}=this;i.length&&!this.locked.has(i)&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Jp=4;function pQ(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),l;if(l=e.querySelector(".cm-tooltip-arrow")){let s=l.getBoundingClientRect();i=Math.min(s.top,i),a=Math.max(s.bottom,a)}return t.clientX>=n-Jp&&t.clientX<=r+Jp&&t.clientY>=i-Jp&&t.clientY<=a+Jp}function mQ(e,t,n,r,i,a){let l=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(l.left>r||l.right<r||l.top>i||Math.min(l.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function gQ(e,t={}){let n=_e.define(),r=new WeakMap,i=Nn.define({create(){return[]},update(l,s){let c=r.get(l);if(l.length&&(t.hideOnChange&&(s.docChanged||s.selection)?l=[]:c&&c(s)?l=[]:t.hideOn&&(l=l.filter(f=>!t.hideOn(s,f)))),s.docChanged&&l.length){let f=[];for(let d of l){let p=s.changes.mapPos(d.pos,-1,Fn.TrackDel);if(p!=null){let g=Object.assign(Object.create(null),d);g.pos=p,g.end!=null&&(g.end=s.changes.mapPos(g.end)),f.push(g)}}l=f}for(let f of s.effects)f.is(n)&&(l=f.value,c=void 0),(f.is(yQ)&&!f.value||f.value==i)&&(l=[]);return l.length&&c&&r.set(l,c),l},provide:l=>fg.from(l)});const a=_t.define(l=>new dQ(l,e,i,r,n,t.hoverTime||300));return{active:i,extension:[i,a,O3.of(a),hQ]}}function vQ(e,t,n,r={}){var i;let a=e.state.facet(O3).map(l=>e.plugin(l)).filter(l=>!!l);if(r.tooltip&&r.tooltip.active){let l=a.find(s=>s.field==r.tooltip.active);l&&(a=[l])}for(let l of a)l.activateHover(e,t,n,(i=r.until)!==null&&i!==void 0?i:(()=>!1))}function A3(e,t){let n=e.plugin(jO);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const yQ=_e.define(),TD=me.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function LO(e,t){let n=e.plugin(k3),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const k3=_t.fromClass(class{constructor(e){this.input=e.state.facet(bh),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(TD);this.top=new em(e,!0,t.topContainer),this.bottom=new em(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(TD);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new em(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new em(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(bh);if(n!=this.input){let r=n.filter(c=>c),i=[],a=[],l=[],s=[];for(let c of r){let f=this.specs.indexOf(c),d;f<0?(d=c(e.view),s.push(d)):(d=this.panels[f],d.update&&d.update(e)),i.push(d),(d.top?a:l).push(d)}this.specs=r,this.panels=i,this.top.sync(a),this.bottom.sync(l);for(let c of s)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let r of this.panels)r.update&&r.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>de.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class em{constructor(t,n,r){this.view=t,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=MD(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=MD(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function MD(e){let t=e.nextSibling;return e.remove(),t}const bh=me.define({enables:k3});function bQ(e,t){let n,r=new Promise(l=>n=l),i=l=>xQ(l,t,n);e.state.field(Mx,!1)?e.dispatch({effects:C3.of(i)}):e.dispatch({effects:_e.appendConfig.of(Mx.init(()=>[i]))});let a=E3.of(i);return{close:a,result:r.then(l=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(Mx).indexOf(i)>-1&&e.dispatch({effects:a})}),l))}}const Mx=Nn.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(C3)?e=[n.value].concat(e):n.is(E3)&&(e=e.filter(r=>r!=n.value));return e},provide:e=>bh.computeN([e],t=>t.field(e))}),C3=_e.define(),E3=_e.define();function xQ(e,t,n){let r=t.content?t.content(e,()=>l(null)):null;if(!r){if(r=ot("form"),t.input){let s=ot("input",t.input);/^(text|password|number|email|tel|url)$/.test(s.type)&&s.classList.add("cm-textfield"),s.name||(s.name="input"),r.appendChild(ot("label",(t.label||"")+": ",s))}else r.appendChild(document.createTextNode(t.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(ot("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let s=0;s<i.length;s++){let c=i[s];c.addEventListener("keydown",f=>{f.keyCode==27?(f.preventDefault(),l(null)):f.keyCode==13&&(f.preventDefault(),l(c))}),c.addEventListener("submit",f=>{f.preventDefault(),l(c)})}let a=ot("div",r,ot("button",{onclick:()=>l(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(a.className=t.class),a.classList.add("cm-dialog");function l(s){a.contains(a.ownerDocument.activeElement)&&e.focus(),n(s)}return{dom:a,top:t.top,mount:()=>{if(t.focus){let s;typeof t.focus=="string"?s=r.querySelector(t.focus):s=r.querySelector("input")||r.querySelector("button"),s&&"select"in s?s.select():s&&"focus"in s&&s.focus()}}}}class qa extends Xl{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}qa.prototype.elementClass="";qa.prototype.toDOM=void 0;qa.prototype.mapMode=Fn.TrackBefore;qa.prototype.startSide=qa.prototype.endSide=-1;qa.prototype.point=!0;const Bm=me.define(),SQ=me.define(),wQ={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ze.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Jf=me.define();function OQ(e){return[T3(),Jf.of({...wQ,...e})]}const DD=me.define({combine:e=>e.some(t=>t)});function T3(e){return[AQ]}const AQ=_t.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(Jf).map(t=>new _D(e,t)),this.fixed=!e.state.facet(DD);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(DD)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=ze.iter(this.view.state.facet(Bm),this.view.viewport.from),r=[],i=this.gutters.map(a=>new kQ(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(a.type)){let l=!0;for(let s of a.type)if(s.type==kn.Text&&l){PS(n,r,s.from);for(let c of i)c.line(this.view,s,r);l=!1}else if(s.widget)for(let c of i)c.widget(this.view,s)}else if(a.type==kn.Text){PS(n,r,a.from);for(let l of i)l.line(this.view,a,r)}else if(a.widget)for(let l of i)l.widget(this.view,a);for(let a of i)a.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(Jf),n=e.state.facet(Jf),r=e.docChanged||e.heightChanged||e.viewportChanged||!ze.eq(e.startState.facet(Bm),e.state.facet(Bm),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let i of this.gutters)i.update(e)&&(r=!0);else{r=!0;let i=[];for(let a of n){let l=t.indexOf(a);l<0?i.push(new _D(this.view,a)):(this.gutters[l].update(e),i.push(this.gutters[l]))}for(let a of this.gutters)a.dom.remove(),i.indexOf(a)<0&&a.destroy();for(let a of i)a.config.side=="after"?this.getDOMAfter().appendChild(a.dom):this.dom.appendChild(a.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>de.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==ft.LTR?{left:r,right:i}:{right:r,left:i}})});function PD(e){return Array.isArray(e)?e:[e]}function PS(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class kQ{constructor(t,n,r){this.gutter=t,this.height=r,this.i=0,this.cursor=ze.iter(t.markers,n.from)}addElement(t,n,r){let{gutter:i}=this,a=(n.top-this.height)/t.scaleY,l=n.height/t.scaleY;if(this.i==i.elements.length){let s=new M3(t,l,a,r);i.elements.push(s),i.dom.appendChild(s.dom)}else i.elements[this.i].update(t,l,a,r);this.height=n.bottom,this.i++}line(t,n,r){let i=[];PS(this.cursor,i,n.from),r.length&&(i=i.concat(r));let a=this.gutter.config.lineMarker(t,n,i);a&&i.unshift(a);let l=this.gutter;i.length==0&&!l.config.renderEmptyElements||this.addElement(t,n,i)}widget(t,n){let r=this.gutter.config.widgetMarker(t,n.widget,n),i=r?[r]:null;for(let a of t.state.facet(SQ)){let l=a(t,n.widget,n);l&&(i||(i=[])).push(l)}i&&this.addElement(t,n,i)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class _D{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let a=i.target,l;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let c=a.getBoundingClientRect();l=(c.top+c.bottom)/2}else l=i.clientY;let s=t.lineBlockAtHeight(l-t.documentTop);n.domEventHandlers[r](t,s,i)&&i.preventDefault()});this.markers=PD(n.markers(t)),n.initialSpacer&&(this.spacer=new M3(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=PD(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],t);i!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[i])}let r=t.view.viewport;return!ze.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class M3{constructor(t,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,r,i)}update(t,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),CQ(this.markers,i)||this.setMarkers(t,i)}setMarkers(t,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let a=0,l=0;;){let s=l,c=a<n.length?n[a++]:null,f=!1;if(c){let d=c.elementClass;d&&(r+=" "+d);for(let p=l;p<this.markers.length;p++)if(this.markers[p].compare(c)){s=p,f=!0;break}}else s=this.markers.length;for(;l<s;){let d=this.markers[l++];if(d.toDOM){d.destroy(i);let p=i.nextSibling;i.remove(),i=p}}if(!c)break;c.toDOM&&(f?i=i.nextSibling:this.dom.insertBefore(c.toDOM(t),i)),f&&l++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function CQ(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}const EQ=me.define(),TQ=me.define(),Ou=me.define({combine(e){return aa(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,n){let r=Object.assign({},t);for(let i in n){let a=r[i],l=n[i];r[i]=a?(s,c,f)=>a(s,c,f)||l(s,c,f):l}return r}})}});class Dx extends qa{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function Px(e,t){return e.state.facet(Ou).formatNumber(t,e.state)}const MQ=Jf.compute([Ou],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(EQ)},lineMarker(t,n,r){return r.some(i=>i.toDOM)?null:new Dx(Px(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,r)=>{for(let i of t.state.facet(TQ)){let a=i(t,n,r);if(a)return a}return null},lineMarkerChange:t=>t.startState.facet(Ou)!=t.state.facet(Ou),initialSpacer(t){return new Dx(Px(t,ND(t.state.doc.lines)))},updateSpacer(t,n){let r=Px(n.view,ND(n.view.state.doc.lines));return r==t.number?t:new Dx(r)},domEventHandlers:e.facet(Ou).domEventHandlers,side:"before"}));function DQ(e={}){return[Ou.of(e),T3(),MQ]}function ND(e){let t=9;for(;t<e;)t=t*10+9;return t}const PQ=new class extends qa{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},_Q=Bm.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(PQ.range(i)))}return ze.of(t)});function NQ(){return _Q}const D3=1024;let RQ=0;class _x{constructor(t,n){this.from=t,this.to=n}}class Ie{constructor(t={}){this.id=RQ++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=hr.match(t)),n=>{let r=t(n);return r===void 0?null:[this,r]}}}Ie.closedBy=new Ie({deserialize:e=>e.split(" ")});Ie.openedBy=new Ie({deserialize:e=>e.split(" ")});Ie.group=new Ie({deserialize:e=>e.split(" ")});Ie.isolate=new Ie({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});Ie.contextHash=new Ie({perNode:!0});Ie.lookAhead=new Ie({perNode:!0});Ie.mounted=new Ie({perNode:!0});class eh{constructor(t,n,r,i=!1){this.tree=t,this.overlay=n,this.parser=r,this.bracketed=i}static get(t){return t&&t.props&&t.props[Ie.mounted.id]}}const jQ=Object.create(null);class hr{constructor(t,n,r,i=0){this.name=t,this.props=n,this.id=r,this.flags=i}static define(t){let n=t.props&&t.props.length?Object.create(null):jQ,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new hr(t.name||"",n,t.id,r);if(t.props){for(let a of t.props)if(Array.isArray(a)||(a=a(i)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[a[0].id]=a[1]}}return i}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(Ie.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let r in t)for(let i of r.split(" "))n[i]=t[r];return r=>{for(let i=r.prop(Ie.group),a=-1;a<(i?i.length:0);a++){let l=n[a<0?r.name:i[a]];if(l)return l}}}}hr.none=new hr("",Object.create(null),0,8);class BO{constructor(t){this.types=t;for(let n=0;n<t.length;n++)if(t[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let n=[];for(let r of this.types){let i=null;for(let a of t){let l=a(r);if(l){i||(i=Object.assign({},r.props));let s=l[1],c=l[0];c.combine&&c.id in i&&(s=c.combine(i[c.id],s)),i[c.id]=s}}n.push(i?new hr(r.name,i,r.id,r.flags):r)}return new BO(n)}}const tm=new WeakMap,RD=new WeakMap;var Dt;(function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"})(Dt||(Dt={}));class Lt{constructor(t,n,r,i,a){if(this.type=t,this.children=n,this.positions=r,this.length=i,this.props=null,a&&a.length){this.props=Object.create(null);for(let[l,s]of a)this.props[typeof l=="number"?l:l.id]=s}}toString(){let t=eh.get(this);if(t&&!t.overlay)return t.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(t=0){return new NS(this.topNode,t)}cursorAt(t,n=0,r=0){let i=tm.get(this)||this.topNode,a=new NS(i);return a.moveTo(t,n),tm.set(this,a._tree),a}get topNode(){return new Jr(this,0,0,null)}resolve(t,n=0){let r=xh(tm.get(this)||this.topNode,t,n,!1);return tm.set(this,r),r}resolveInner(t,n=0){let r=xh(RD.get(this)||this.topNode,t,n,!0);return RD.set(this,r),r}resolveStack(t,n=0){return BQ(this,t,n)}iterate(t){let{enter:n,leave:r,from:i=0,to:a=this.length}=t,l=t.mode||0,s=(l&Dt.IncludeAnonymous)>0;for(let c=this.cursor(l|Dt.IncludeAnonymous);;){let f=!1;if(c.from<=a&&c.to>=i&&(!s&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;f=!0}for(;f&&r&&(s||!c.type.isAnonymous)&&r(c),!c.nextSibling();){if(!c.parent())return;f=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:UO(hr.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Lt(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new Lt(hr.none,n,r,i)))}static build(t){return zQ(t)}}Lt.empty=new Lt(hr.none,[],[],0);class zO{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new zO(this.buffer,this.index)}}class Zl{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return hr.none}toString(){let t=[];for(let n=0;n<this.buffer.length;)t.push(this.childString(n)),n=this.buffer[n+3];return t.join(",")}childString(t){let n=this.buffer[t],r=this.buffer[t+3],i=this.set.types[n],a=i.name;if(/\W/.test(a)&&!i.isError&&(a=JSON.stringify(a)),t+=4,r==t)return a;let l=[];for(;t<r;)l.push(this.childString(t)),t=this.buffer[t+3];return a+"("+l.join(",")+")"}findChild(t,n,r,i,a){let{buffer:l}=this,s=-1;for(let c=t;c!=n&&!(P3(a,i,l[c+1],l[c+2])&&(s=c,r>0));c=l[c+3]);return s}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),l=0;for(let s=t,c=0;s<n;){a[c++]=i[s++],a[c++]=i[s++]-r;let f=a[c++]=i[s++]-r;a[c++]=i[s++]-t,l=Math.max(l,f)}return new Zl(a,l,this.set)}}function P3(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function xh(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let l=!r&&e instanceof Jr&&e.index<0?null:e.parent;if(!l)return e;e=l}let a=r?0:Dt.IgnoreOverlays;if(r)for(let l=e,s=l.parent;s;l=s,s=l.parent)l instanceof Jr&&l.index<0&&((i=s.enter(t,n,a))===null||i===void 0?void 0:i.from)!=l.from&&(e=s);for(;;){let l=e.enter(t,n,a);if(!l)return e;e=l}}class _3{cursor(t=0){return new NS(this,t)}getChild(t,n=null,r=null){let i=jD(this,t,n,r);return i.length?i[0]:null}getChildren(t,n=null,r=null){return jD(this,t,n,r)}resolve(t,n=0){return xh(this,t,n,!1)}resolveInner(t,n=0){return xh(this,t,n,!0)}matchContext(t){return _S(this.parent,t)}enterUnfinishedNodesBefore(t){let n=this.childBefore(t),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Jr extends _3{constructor(t,n,r,i){super(),this._tree=t,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let l=this;;){for(let{children:s,positions:c}=l._tree,f=n>0?s.length:-1;t!=f;t+=n){let d=s[t],p=c[t]+l.from,g;if(!(!(a&Dt.EnterBracketed&&d instanceof Lt&&(g=eh.get(d))&&!g.overlay&&g.bracketed&&r>=p&&r<=p+d.length)&&!P3(i,r,p,p+d.length))){if(d instanceof Zl){if(a&Dt.ExcludeBuffers)continue;let v=d.findChild(0,d.buffer.length,n,r-p,i);if(v>-1)return new Ul(new IQ(l,d,t,p),null,v)}else if(a&Dt.IncludeAnonymous||!d.type.isAnonymous||$O(d)){let v;if(!(a&Dt.IgnoreMounts)&&(v=eh.get(d))&&!v.overlay)return new Jr(v.tree,p,t,l);let y=new Jr(d,p,t,l);return a&Dt.IncludeAnonymous||!y.type.isAnonymous?y:y.nextChild(n<0?d.children.length-1:0,n,r,i,a)}}}if(a&Dt.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?t=l.index+n:t=n<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,r=0){let i;if(!(r&Dt.IgnoreOverlays)&&(i=eh.get(this._tree))&&i.overlay){let a=t-this.from,l=r&Dt.EnterBracketed&&i.bracketed;for(let{from:s,to:c}of i.overlay)if((n>0||l?s<=a:s<a)&&(n<0||l?c>=a:c>a))return new Jr(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function jD(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let l=!1;!l;)if(l=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function _S(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class IQ{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class Ul extends _3{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,r){super(),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new Ul(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,r=0){if(r&Dt.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new Ul(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Ul(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Ul(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:r}=this.context,i=this.index+4,a=r.buffer[this.index+3];if(a>i){let l=r.buffer[this.index+1];t.push(r.slice(i,a,l)),n.push(0)}return new Lt(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function N3(e){if(!e.length)return null;let t=0,n=e[0];for(let a=1;a<e.length;a++){let l=e[a];(l.from>n.from||l.to<n.to)&&(n=l,t=a)}let r=n instanceof Jr&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new LQ(i,n)}class LQ{constructor(t,n){this.heads=t,this.node=n}get next(){return N3(this.heads)}}function BQ(e,t,n){let r=e.resolveInner(t,n),i=null;for(let a=r instanceof Jr?r:r.context.parent;a;a=a.parent)if(a.index<0){let l=a.parent;(i||(i=[r])).push(l.resolve(t,n)),a=l}else{let l=eh.get(a.tree);if(l&&l.overlay&&l.overlay[0].from<=t&&l.overlay[l.overlay.length-1].to>=t){let s=new Jr(l.tree,l.overlay[0].from+a.from,-1,a);(i||(i=[r])).push(xh(s,t,n,!1))}}return i?N3(i):r}class NS{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Dt.EnterBracketed,t instanceof Jr)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}yield(t){return t?t instanceof Jr?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,r,this.mode));let{buffer:i}=this.buffer,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.buffer.start,r);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,r=this.mode){return this.buffer?r&Dt.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Dt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Dt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(t<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,r,{buffer:i}=this;if(i){if(t>0){if(this.index<i.buffer.buffer.length)return!1}else for(let a=0;a<this.index;a++)if(i.buffer.buffer[a+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let a=n+t,l=t<0?-1:r._tree.children.length;a!=l;a+=t){let s=r._tree.children[a];if(this.mode&Dt.IncludeAnonymous||s instanceof Zl||!s.type.isAnonymous||$O(s))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,n););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,n=null,r=0;if(t&&t.context==this.buffer)e:for(let i=this.index,a=this.stack.length;a>=0;){for(let l=t;l;l=l._parent)if(l.index==i){if(i==this.index)return l;n=l,r=a+1;break e}i=this.stack[--a]}for(let i=r;i<this.stack.length;i++)n=new Ul(this.buffer,n,this.stack[i]);return this.bufferNode=new Ul(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(t){if(!this.buffer)return _S(this.node.parent,t);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=t.length-1,a=this.stack.length-1;i>=0;a--){if(a<0)return _S(this._tree,t,i);let l=r[n.buffer[this.stack[a]]];if(!l.isAnonymous){if(t[i]&&t[i]!=l.name)return!1;i--}}return!0}}function $O(e){return e.children.some(t=>t instanceof Zl||!t.type.isAnonymous||$O(t))}function zQ(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=D3,reused:a=[],minRepeatType:l=r.types.length}=e,s=Array.isArray(n)?new zO(n,n.length):n,c=r.types,f=0,d=0;function p(T,D,N,I,U,K){let{id:V,start:B,end:ae,size:ie}=s,oe=d,z=f;if(ie<0)if(s.next(),ie==-1){let R=a[V];N.push(R),I.push(B-T);return}else if(ie==-3){f=V;return}else if(ie==-4){d=V;return}else throw new RangeError(`Unrecognized record size: ${ie}`);let G=c[V],ne,ce,fe=B-T;if(ae-B<=i&&(ce=w(s.pos-D,U))){let R=new Uint16Array(ce.size-ce.skip),X=s.pos-ce.size,re=R.length;for(;s.pos>X;)re=A(ce.start,R,re);ne=new Zl(R,ae-ce.start,r),fe=ce.start-T}else{let R=s.pos-ie;s.next();let X=[],re=[],le=V>=l?V:-1,ge=0,Oe=ae;for(;s.pos>R;)le>=0&&s.id==le&&s.size>=0?(s.end<=Oe-i&&(y(X,re,B,ge,s.end,Oe,le,oe,z),ge=X.length,Oe=s.end),s.next()):K>2500?g(B,R,X,re):p(B,R,X,re,le,K+1);if(le>=0&&ge>0&&ge<X.length&&y(X,re,B,ge,B,Oe,le,oe,z),X.reverse(),re.reverse(),le>-1&&ge>0){let De=v(G,z);ne=UO(G,X,re,0,X.length,0,ae-B,De,De)}else ne=x(G,X,re,ae-B,oe-ae,z)}N.push(ne),I.push(fe)}function g(T,D,N,I){let U=[],K=0,V=-1;for(;s.pos>D;){let{id:B,start:ae,end:ie,size:oe}=s;if(oe>4)s.next();else{if(V>-1&&ae<V)break;V<0&&(V=ie-i),U.push(B,ae,ie),K++,s.next()}}if(K){let B=new Uint16Array(K*4),ae=U[U.length-2];for(let ie=U.length-3,oe=0;ie>=0;ie-=3)B[oe++]=U[ie],B[oe++]=U[ie+1]-ae,B[oe++]=U[ie+2]-ae,B[oe++]=oe;N.push(new Zl(B,U[2]-ae,r)),I.push(ae-T)}}function v(T,D){return(N,I,U)=>{let K=0,V=N.length-1,B,ae;if(V>=0&&(B=N[V])instanceof Lt){if(!V&&B.type==T&&B.length==U)return B;(ae=B.prop(Ie.lookAhead))&&(K=I[V]+B.length+ae)}return x(T,N,I,U,K,D)}}function y(T,D,N,I,U,K,V,B,ae){let ie=[],oe=[];for(;T.length>I;)ie.push(T.pop()),oe.push(D.pop()+N-U);T.push(x(r.types[V],ie,oe,K-U,B-K,ae)),D.push(U-N)}function x(T,D,N,I,U,K,V){if(K){let B=[Ie.contextHash,K];V=V?[B].concat(V):[B]}if(U>25){let B=[Ie.lookAhead,U];V=V?[B].concat(V):[B]}return new Lt(T,D,N,I,V)}function w(T,D){let N=s.fork(),I=0,U=0,K=0,V=N.end-i,B={size:0,start:0,skip:0};e:for(let ae=N.pos-T;N.pos>ae;){let ie=N.size;if(N.id==D&&ie>=0){B.size=I,B.start=U,B.skip=K,K+=4,I+=4,N.next();continue}let oe=N.pos-ie;if(ie<0||oe<ae||N.start<V)break;let z=N.id>=l?4:0,G=N.start;for(N.next();N.pos>oe;){if(N.size<0)if(N.size==-3||N.size==-4)z+=4;else break e;else N.id>=l&&(z+=4);N.next()}U=G,I+=ie,K+=z}return(D<0||I==T)&&(B.size=I,B.start=U,B.skip=K),B.size>4?B:void 0}function A(T,D,N){let{id:I,start:U,end:K,size:V}=s;if(s.next(),V>=0&&I<l){let B=N;if(V>4){let ae=s.pos-(V-4);for(;s.pos>ae;)N=A(T,D,N)}D[--N]=B,D[--N]=K-T,D[--N]=U-T,D[--N]=I}else V==-3?f=I:V==-4&&(d=I);return N}let C=[],k=[];for(;s.pos>0;)p(e.start||0,e.bufferStart||0,C,k,-1,0);let P=(t=e.length)!==null&&t!==void 0?t:C.length?k[0]+C[0].length:0;return new Lt(c[e.topID],C.reverse(),k.reverse(),P)}const ID=new WeakMap;function zm(e,t){if(!e.isAnonymous||t instanceof Zl||t.type!=e)return 1;let n=ID.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Lt)){n=1;break}n+=zm(e,r)}ID.set(t,n)}return n}function UO(e,t,n,r,i,a,l,s,c){let f=0;for(let y=r;y<i;y++)f+=zm(e,t[y]);let d=Math.ceil(f*1.5/8),p=[],g=[];function v(y,x,w,A,C){for(let k=w;k<A;){let P=k,T=x[k],D=zm(e,y[k]);for(k++;k<A;k++){let N=zm(e,y[k]);if(D+N>=d)break;D+=N}if(k==P+1){if(D>d){let N=y[P];v(N.children,N.positions,0,N.children.length,x[P]+C);continue}p.push(y[P])}else{let N=x[k-1]+y[k-1].length-T;p.push(UO(e,y,x,P,k,T,N,null,c))}g.push(T+C-a)}}return v(t,n,r,i,0),(s||c)(p,g,l)}class Go{constructor(t,n,r,i,a=!1,l=!1){this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(a?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new Go(0,t.length,t,0,!1,r)];for(let a of n)a.to>t.length&&i.push(a);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,l=t.length?t[0]:null;for(let s=0,c=0,f=0;;s++){let d=s<n.length?n[s]:null,p=d?d.fromA:1e9;if(p-c>=r)for(;l&&l.from<p;){let g=l;if(c>=g.from||p<=g.to||f){let v=Math.max(g.from,c)-f,y=Math.min(g.to,p)-f;g=v>=y?null:new Go(v,y,g.tree,g.offset+f,s>0,!!d)}if(g&&i.push(g),l.to>p)break;l=a<t.length?t[a++]:null}if(!d)break;c=d.toA,f=d.toA-d.toB}return i}}class R3{startParse(t,n,r){return typeof t=="string"&&(t=new $Q(t)),r=r?r.length?r.map(i=>new _x(i.from,i.to)):[new _x(0,0)]:[new _x(0,t.length)],this.createParse(t,n||[],r)}parse(t,n,r){let i=this.startParse(t,n,r);for(;;){let a=i.advance();if(a)return a}}}class $Q{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}new Ie({perNode:!0});let UQ=0,Ea=class RS{constructor(t,n,r,i){this.name=t,this.set=n,this.base=r,this.modified=i,this.id=UQ++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let r=typeof t=="string"?t:"?";if(t instanceof RS&&(n=t),n?.base)throw new Error("Can not derive from a modified tag");let i=new RS(r,[],null,[]);if(i.set.push(i),n)for(let a of n.set)i.set.push(a);return i}static defineModifier(t){let n=new hg(t);return r=>r.modified.indexOf(n)>-1?r:hg.get(r.base||r,r.modified.concat(n).sort((i,a)=>i.id-a.id))}},HQ=0;class hg{constructor(t){this.name=t,this.instances=[],this.id=HQ++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(s=>s.base==t&&FQ(n,s.modified));if(r)return r;let i=[],a=new Ea(t.name,i,t,n);for(let s of n)s.instances.push(a);let l=qQ(n);for(let s of t.set)if(!s.modified.length)for(let c of l)i.push(hg.get(s,c));return a}}function FQ(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function qQ(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((n,r)=>r.length-n.length)}function j3(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let a=[],l=2,s=i;for(let p=0;;){if(s=="..."&&p>0&&p+3==i.length){l=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!g)throw new RangeError("Invalid path: "+i);if(a.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),p+=g[0].length,p==i.length)break;let v=i[p++];if(p==i.length&&v=="!"){l=0;break}if(v!="/")throw new RangeError("Invalid path: "+i);s=i.slice(p)}let c=a.length-1,f=a[c];if(!f)throw new RangeError("Invalid path: "+i);let d=new Sh(r,l,c>0?a.slice(0,c):null);t[f]=d.sort(t[f])}}return I3.add(t)}const I3=new Ie({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new Sh(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}});class Sh{constructor(t,n,r,i){this.tags=t,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}Sh.empty=new Sh([],2,null);function L3(e,t){let n=Object.create(null);for(let a of e)if(!Array.isArray(a.tag))n[a.tag.id]=a.class;else for(let l of a.tag)n[l.id]=a.class;let{scope:r,all:i=null}=t||{};return{style:a=>{let l=i;for(let s of a)for(let c of s.set){let f=n[c.id];if(f){l=l?l+" "+f:f;break}}return l},scope:r}}function WQ(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function VQ(e,t,n,r=0,i=e.length){let a=new KQ(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,"",a.highlighters),a.flush(i)}class KQ{constructor(t,n,r){this.at=t,this.highlighters=n,this.span=r,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,r,i,a){let{type:l,from:s,to:c}=t;if(s>=r||c<=n)return;l.isTop&&(a=this.highlighters.filter(v=>!v.scope||v.scope(l)));let f=i,d=XQ(t)||Sh.empty,p=WQ(a,d.tags);if(p&&(f&&(f+=" "),f+=p,d.mode==1&&(i+=(i?" ":"")+p)),this.startSpan(Math.max(n,s),f),d.opaque)return;let g=t.tree&&t.tree.prop(Ie.mounted);if(g&&g.overlay){let v=t.node.enter(g.overlay[0].from+s,1),y=this.highlighters.filter(w=>!w.scope||w.scope(g.tree.type)),x=t.firstChild();for(let w=0,A=s;;w++){let C=w<g.overlay.length?g.overlay[w]:null,k=C?C.from+s:c,P=Math.max(n,A),T=Math.min(r,k);if(P<T&&x)for(;t.from<T&&(this.highlightRange(t,P,T,i,a),this.startSpan(Math.min(T,t.to),f),!(t.to>=k||!t.nextSibling())););if(!C||k>r)break;A=C.to+s,A>n&&(this.highlightRange(v.cursor(),Math.max(n,C.from+s),Math.min(r,A),"",y),this.startSpan(Math.min(r,A),f))}x&&t.parent()}else if(t.firstChild()){g&&(i="");do if(!(t.to<=n)){if(t.from>=r)break;this.highlightRange(t,n,r,i,a),this.startSpan(Math.min(r,t.to),f)}while(t.nextSibling());t.parent()}}}function XQ(e){let t=e.type.prop(I3);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const he=Ea.define,nm=he(),Pl=he(),LD=he(Pl),BD=he(Pl),_l=he(),rm=he(_l),Nx=he(_l),Li=he(),To=he(Li),_i=he(),Ni=he(),jS=he(),Of=he(jS),im=he(),Y={comment:nm,lineComment:he(nm),blockComment:he(nm),docComment:he(nm),name:Pl,variableName:he(Pl),typeName:LD,tagName:he(LD),propertyName:BD,attributeName:he(BD),className:he(Pl),labelName:he(Pl),namespace:he(Pl),macroName:he(Pl),literal:_l,string:rm,docString:he(rm),character:he(rm),attributeValue:he(rm),number:Nx,integer:he(Nx),float:he(Nx),bool:he(_l),regexp:he(_l),escape:he(_l),color:he(_l),url:he(_l),keyword:_i,self:he(_i),null:he(_i),atom:he(_i),unit:he(_i),modifier:he(_i),operatorKeyword:he(_i),controlKeyword:he(_i),definitionKeyword:he(_i),moduleKeyword:he(_i),operator:Ni,derefOperator:he(Ni),arithmeticOperator:he(Ni),logicOperator:he(Ni),bitwiseOperator:he(Ni),compareOperator:he(Ni),updateOperator:he(Ni),definitionOperator:he(Ni),typeOperator:he(Ni),controlOperator:he(Ni),punctuation:jS,separator:he(jS),bracket:Of,angleBracket:he(Of),squareBracket:he(Of),paren:he(Of),brace:he(Of),content:Li,heading:To,heading1:he(To),heading2:he(To),heading3:he(To),heading4:he(To),heading5:he(To),heading6:he(To),contentSeparator:he(Li),list:he(Li),quote:he(Li),emphasis:he(Li),strong:he(Li),link:he(Li),monospace:he(Li),strikethrough:he(Li),inserted:he(),deleted:he(),changed:he(),invalid:he(),meta:im,documentMeta:he(im),annotation:he(im),processingInstruction:he(im),definition:Ea.defineModifier("definition"),constant:Ea.defineModifier("constant"),function:Ea.defineModifier("function"),standard:Ea.defineModifier("standard"),local:Ea.defineModifier("local"),special:Ea.defineModifier("special")};for(let e in Y){let t=Y[e];t instanceof Ea&&(t.name=e)}L3([{tag:Y.link,class:"tok-link"},{tag:Y.heading,class:"tok-heading"},{tag:Y.emphasis,class:"tok-emphasis"},{tag:Y.strong,class:"tok-strong"},{tag:Y.keyword,class:"tok-keyword"},{tag:Y.atom,class:"tok-atom"},{tag:Y.bool,class:"tok-bool"},{tag:Y.url,class:"tok-url"},{tag:Y.labelName,class:"tok-labelName"},{tag:Y.inserted,class:"tok-inserted"},{tag:Y.deleted,class:"tok-deleted"},{tag:Y.literal,class:"tok-literal"},{tag:Y.string,class:"tok-string"},{tag:Y.number,class:"tok-number"},{tag:[Y.regexp,Y.escape,Y.special(Y.string)],class:"tok-string2"},{tag:Y.variableName,class:"tok-variableName"},{tag:Y.local(Y.variableName),class:"tok-variableName tok-local"},{tag:Y.definition(Y.variableName),class:"tok-variableName tok-definition"},{tag:Y.special(Y.variableName),class:"tok-variableName2"},{tag:Y.definition(Y.propertyName),class:"tok-propertyName tok-definition"},{tag:Y.typeName,class:"tok-typeName"},{tag:Y.namespace,class:"tok-namespace"},{tag:Y.className,class:"tok-className"},{tag:Y.macroName,class:"tok-macroName"},{tag:Y.propertyName,class:"tok-propertyName"},{tag:Y.operator,class:"tok-operator"},{tag:Y.comment,class:"tok-comment"},{tag:Y.meta,class:"tok-meta"},{tag:Y.invalid,class:"tok-invalid"},{tag:Y.punctuation,class:"tok-punctuation"}]);var Rx;const Au=new Ie;function QQ(e){return me.define({combine:e?t=>t.concat(e):void 0})}const YQ=new Ie;class pi{constructor(t,n,r=[],i=""){this.data=t,this.name=i,qe.prototype.hasOwnProperty("tree")||Object.defineProperty(qe.prototype,"tree",{get(){return Dn(this)}}),this.parser=n,this.extension=[Jl.of(this),qe.languageData.of((a,l,s)=>{let c=zD(a,l,s),f=c.type.prop(Au);if(!f)return[];let d=a.facet(f),p=c.type.prop(YQ);if(p){let g=c.resolve(l-c.from,s);for(let v of p)if(v.test(g,a)){let y=a.facet(v.facet);return v.type=="replace"?y:y.concat(d)}}return d})].concat(r)}isActiveAt(t,n,r=-1){return zD(t,n,r).type.prop(Au)==this.data}findRegions(t){let n=t.facet(Jl);if(n?.data==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(a,l)=>{if(a.prop(Au)==this.data){r.push({from:l,to:l+a.length});return}let s=a.prop(Ie.mounted);if(s){if(s.tree.prop(Au)==this.data){if(s.overlay)for(let c of s.overlay)r.push({from:c.from+l,to:c.to+l});else r.push({from:l,to:l+a.length});return}else if(s.overlay){let c=r.length;if(i(s.tree,s.overlay[0].from+l),r.length>c)return}}for(let c=0;c<a.children.length;c++){let f=a.children[c];f instanceof Lt&&i(f,a.positions[c]+l)}};return i(Dn(t),0),r}get allowsNesting(){return!0}}pi.setState=_e.define();function zD(e,t,n){let r=e.facet(Jl),i=Dn(e).topNode;if(!r||r.allowsNesting)for(let a=i;a;a=a.enter(t,n,Dt.ExcludeBuffers|Dt.EnterBracketed))a.type.isTop&&(i=a);return i}class dg extends pi{constructor(t,n,r){super(t,n,[],r),this.parser=n}static define(t){let n=QQ(t.languageData);return new dg(n,t.parser.configure({props:[Au.add(r=>r.isTop?n:void 0)]}),t.name)}configure(t,n){return new dg(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Dn(e){let t=e.field(pi.state,!1);return t?t.tree:Lt.empty}class GQ{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let r=this.cursorPos-this.string.length;return t<r||n>=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-r,n-r)}}let Af=null;class pg{constructor(t,n,r=[],i,a,l,s,c){this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=a,this.viewport=l,this.skipped=s,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new pg(t,n,[],Lt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new GQ(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Lt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof t=="number"){let i=Date.now()+t;t=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Go.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,n;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Go.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=Af;Af=this;try{return t()}finally{Af=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=$D(t,n.from,n.to);return t}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:l,skipped:s}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((f,d,p,g)=>c.push({fromA:f,toA:d,fromB:p,toB:g})),r=Go.applyChanges(r,c),i=Lt.empty,a=0,l={from:t.mapPos(l.from,-1),to:t.mapPos(l.to,1)},this.skipped.length){s=[];for(let f of this.skipped){let d=t.mapPos(f.from,1),p=t.mapPos(f.to,-1);d<p&&s.push({from:d,to:p})}}}return new pg(this.parser,n,r,i,a,l,s,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:a}=this.skipped[r];i<t.to&&a>t.from&&(this.fragments=$D(this.fragments,i,a),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends R3{createParse(n,r,i){let a=i[0].from,l=i[i.length-1].to;return{parsedPos:a,advance(){let c=Af;if(c){for(let f of i)c.tempSkipped.push(f);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=l,new Lt(hr.none,[],[],l-a)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return Af}}function $D(e,t,n){return Go.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class Qu{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Qu(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=pg.create(t.facet(Jl).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Qu(r)}}pi.state=Nn.define({create:Qu.init,update(e,t){for(let n of t.effects)if(n.is(pi.setState))return n.value;return t.startState.facet(Jl)!=t.state.facet(Jl)?Qu.init(t.state):e.apply(t)}});let B3=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(B3=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const jx=typeof navigator<"u"&&(!((Rx=navigator.scheduling)===null||Rx===void 0)&&Rx.isInputPending)?()=>navigator.scheduling.isInputPending():null,ZQ=_t.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(pi.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(pi.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=B3(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,a=r.field(pi.state);if(a.tree==a.context.tree&&a.context.isDone(i+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,t&&!jx?Math.max(25,t.timeRemaining()-5):1e9),s=a.context.treeLen<i&&r.doc.length>i+1e3,c=a.context.work(()=>jx&&jx()||Date.now()>l,i+(s?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:pi.setState.of(new Qu(a.context))})),this.chunkBudget>0&&!(c&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>lr(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Jl=me.define({combine(e){return e.length?e[0]:null},enables:e=>[pi.state,ZQ,de.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class JQ{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}const eY=me.define(),Uv=me.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function mg(e){let t=e.facet(Uv);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function wh(e,t){let n="",r=e.tabSize,i=e.facet(Uv)[0];if(i==" "){for(;t>=r;)n+=" ",t-=r;i=" "}for(let a=0;a<t;a++)n+=i;return n}function HO(e,t){e instanceof qe&&(e=new Hv(e));for(let r of e.state.facet(eY)){let i=r(e,t);if(i!==void 0)return i}let n=Dn(e.state);return n.length>=t?tY(e,n,t):null}class Hv{constructor(t,n={}){this.state=t,this.options=n,this.unit=mg(t)}lineAt(t,n=1){let r=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:a}=this.options;return i!=null&&i>=r.from&&i<=r.to?a&&i==t?{text:"",from:t}:(n<0?i<t:i<=t)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(t,n=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(t,n);return r.slice(t-i,Math.min(r.length,t+100-i))}column(t,n=1){let{text:r,from:i}=this.lineAt(t,n),a=this.countColumn(r,t-i),l=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return l>-1&&(a+=l-this.countColumn(r,r.search(/\S|$/))),a}countColumn(t,n=t.length){return fc(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:r,from:i}=this.lineAt(t,n),a=this.options.overrideIndentation;if(a){let l=a(i);if(l>-1)return l}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const z3=new Ie;function tY(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let a=[];for(let l=i;l&&!(l.from<r.node.from||l.to>r.node.to||l.from==r.node.from&&l.type==r.node.type);l=l.parent)a.push(l);for(let l=a.length-1;l>=0;l--)r={node:a[l],next:r}}return $3(r,e,n)}function $3(e,t,n){for(let r=e;r;r=r.next){let i=rY(r.node);if(i)return i(FO.create(t,n,r))}return 0}function nY(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function rY(e){let t=e.type.prop(z3);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Ie.closedBy))){let i=e.lastChild,a=i&&r.indexOf(i.name)>-1;return l=>U3(l,!0,1,void 0,a&&!nY(l)?i.from:void 0)}return e.parent==null?iY:null}function iY(){return 0}class FO extends Hv{constructor(t,n,r){super(t.state,t.options),this.base=t,this.pos=n,this.context=r}get node(){return this.context.node}static create(t,n,r){return new FO(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let r=t.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(aY(r,t))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return $3(this.context.next,this.base,this.pos)}}function aY(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function lY(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),l=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let s=n.to;;){let c=t.childAfter(s);if(!c||c==r)return null;if(!c.type.isSkipped){if(c.from>=l)return null;let f=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+f}}s=c.to}}function UD({closing:e,align:t=!0,units:n=1}){return r=>U3(r,t,n,e)}function U3(e,t,n,r,i){let a=e.textAfter,l=a.match(/^\s*/)[0].length,s=r&&a.slice(l,l+r.length)==r||i==e.pos+l,c=t?lY(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}const oY=200;function sY(){return qe.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+oY)return e;let a=n.sliceString(i.from,r);if(!t.some(f=>f.test(a)))return e;let{state:l}=e,s=-1,c=[];for(let{head:f}of l.selection.ranges){let d=l.doc.lineAt(f);if(d.from==s)continue;s=d.from;let p=HO(l,d.from);if(p==null)continue;let g=/^\s*/.exec(d.text)[0],v=wh(l,p);g!=v&&c.push({from:d.from,to:d.from+g.length,insert:v})}return c.length?[e,{changes:c,sequential:!0}]:e})}const uY=me.define(),H3=new Ie;function cY(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function fY(e,t,n){let r=Dn(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let l=i;l;l=l.next){let s=l.node;if(s.to<=n||s.from>n)continue;if(a&&s.from<t)break;let c=s.type.prop(H3);if(c&&(s.to<r.length-50||r.length==e.doc.length||!hY(s))){let f=c(s,e);f&&f.from<=n&&f.from>=t&&f.to>n&&(a=f)}}return a}function hY(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function gg(e,t,n){for(let r of e.facet(uY)){let i=r(e,t,n);if(i)return i}return fY(e,t,n)}function F3(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const Fv=_e.define({map:F3}),Kh=_e.define({map:F3});function q3(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(r=>r.from<=n&&r.to>=n)||t.push(e.lineBlockAt(n));return t}const us=Nn.define({create(){return Ce.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((r,i)=>e=HD(e,r,i)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(Fv)&&!dY(e,r.value.from,r.value.to)?n.push(r.value):r.is(Kh)&&(e=e.update({filter:(i,a)=>r.value.from!=i||r.value.to!=a,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=t.state.facet(K3),i=n.map(a=>(r?Ce.replace({widget:new xY(r(t.state,a))}):FD).range(a.from,a.to));e=e.update({add:i})}return t.selection&&(e=HD(e,t.selection.main.head)),e},provide:e=>de.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");t.push(FD.range(r,i))}return Ce.set(t,!0)}});function HD(e,t,n=t){let r=!1;return e.between(t,n,(i,a)=>{i<n&&a>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(i,a)=>i>=n||a<=t}):e}function vg(e,t,n){var r;let i=null;return(r=e.field(us,!1))===null||r===void 0||r.between(t,n,(a,l)=>{(!i||i.from>a)&&(i={from:a,to:l})}),i}function dY(e,t,n){let r=!1;return e.between(t,t,(i,a)=>{i==t&&a==n&&(r=!0)}),r}function W3(e,t){return e.field(us,!1)?t:t.concat(_e.appendConfig.of(X3()))}const pY=e=>{for(let t of q3(e)){let n=gg(e.state,t.from,t.to);if(n)return e.dispatch({effects:W3(e.state,[Fv.of(n),V3(e,n)])}),!0}return!1},mY=e=>{if(!e.state.field(us,!1))return!1;let t=[];for(let n of q3(e)){let r=vg(e.state,n.from,n.to);r&&t.push(Kh.of(r),V3(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function V3(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return de.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}const gY=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=gg(t,i.from,i.to);a&&n.push(Fv.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:W3(e.state,n)}),!!n.length},vY=e=>{let t=e.state.field(us,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(r,i)=>{n.push(Kh.of({from:r,to:i}))}),e.dispatch({effects:n}),!0},yY=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:pY},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:mY},{key:"Ctrl-Alt-[",run:gY},{key:"Ctrl-Alt-]",run:vY}],bY={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},K3=me.define({combine(e){return aa(e,bY)}});function X3(e){return[us,OY]}function Q3(e,t){let{state:n}=e,r=n.facet(K3),i=l=>{let s=e.lineBlockAt(e.posAtDOM(l.target)),c=vg(e.state,s.from,s.to);c&&e.dispatch({effects:Kh.of(c)}),l.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement("span");return a.textContent=r.placeholderText,a.setAttribute("aria-label",n.phrase("folded code")),a.title=n.phrase("unfold"),a.className="cm-foldPlaceholder",a.onclick=i,a}const FD=Ce.replace({widget:new class extends la{toDOM(e){return Q3(e,null)}}});class xY extends la{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Q3(t,this.value)}}const SY={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Ix extends qa{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function wY(e={}){let t={...SY,...e},n=new Ix(t,!0),r=new Ix(t,!1),i=_t.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Jl)!=l.state.facet(Jl)||l.startState.field(us,!1)!=l.state.field(us,!1)||Dn(l.startState)!=Dn(l.state)||t.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let s=new Ha;for(let c of l.viewportLineBlocks){let f=vg(l.state,c.from,c.to)?r:gg(l.state,c.from,c.to)?n:null;f&&s.add(c.from,c.from,f)}return s.finish()}}),{domEventHandlers:a}=t;return[i,OQ({class:"cm-foldGutter",markers(l){var s;return((s=l.plugin(i))===null||s===void 0?void 0:s.markers)||ze.empty},initialSpacer(){return new Ix(t,!1)},domEventHandlers:{...a,click:(l,s,c)=>{if(a.click&&a.click(l,s,c))return!0;let f=vg(l.state,s.from,s.to);if(f)return l.dispatch({effects:Kh.of(f)}),!0;let d=gg(l.state,s.from,s.to);return d?(l.dispatch({effects:Fv.of(d)}),!0):!1}}}),X3()]}const OY=de.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Xh{constructor(t,n){this.specs=t;let r;function i(s){let c=Ql.newName();return(r||(r=Object.create(null)))["."+c]=s,c}const a=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,l=n.scope;this.scope=l instanceof pi?s=>s.prop(Au)==l.data:l?s=>s==l:void 0,this.style=L3(t.map(s=>({tag:s.tag,class:s.class||i(Object.assign({},s,{tag:null}))})),{all:a}).style,this.module=r?new Ql(r):null,this.themeType=n.themeType}static define(t,n){return new Xh(t,n||{})}}const IS=me.define(),Y3=me.define({combine(e){return e.length?[e[0]]:null}});function Lx(e){let t=e.facet(IS);return t.length?t:e.facet(Y3)}function G3(e,t){let n=[kY],r;return e instanceof Xh&&(e.module&&n.push(de.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(Y3.of(e)):r?n.push(IS.computeN([de.darkTheme],i=>i.facet(de.darkTheme)==(r=="dark")?[e]:[])):n.push(IS.of(e)),n}class AY{constructor(t){this.markCache=Object.create(null),this.tree=Dn(t.state),this.decorations=this.buildDeco(t,Lx(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Dn(t.state),r=Lx(t.state),i=r!=Lx(t.startState),{viewport:a}=t.view,l=t.changes.mapPos(this.decoratedTo,1);n.length<a.to&&!i&&n.type==this.tree.type&&l>=a.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=l):(n!=this.tree||t.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(t.view,r),this.decoratedTo=a.to)}buildDeco(t,n){if(!n||!this.tree.length)return Ce.none;let r=new Ha;for(let{from:i,to:a}of t.visibleRanges)VQ(this.tree,n,(l,s,c)=>{r.add(l,s,this.markCache[c]||(this.markCache[c]=Ce.mark({class:c})))},i,a);return r.finish()}}const kY=vs.high(_t.fromClass(AY,{decorations:e=>e.decorations})),CY=Xh.define([{tag:Y.meta,color:"#404740"},{tag:Y.link,textDecoration:"underline"},{tag:Y.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Y.emphasis,fontStyle:"italic"},{tag:Y.strong,fontWeight:"bold"},{tag:Y.strikethrough,textDecoration:"line-through"},{tag:Y.keyword,color:"#708"},{tag:[Y.atom,Y.bool,Y.url,Y.contentSeparator,Y.labelName],color:"#219"},{tag:[Y.literal,Y.inserted],color:"#164"},{tag:[Y.string,Y.deleted],color:"#a11"},{tag:[Y.regexp,Y.escape,Y.special(Y.string)],color:"#e40"},{tag:Y.definition(Y.variableName),color:"#00f"},{tag:Y.local(Y.variableName),color:"#30a"},{tag:[Y.typeName,Y.namespace],color:"#085"},{tag:Y.className,color:"#167"},{tag:[Y.special(Y.variableName),Y.macroName],color:"#256"},{tag:Y.definition(Y.propertyName),color:"#00c"},{tag:Y.comment,color:"#940"},{tag:Y.invalid,color:"#f00"}]),EY=de.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Z3=1e4,J3="()[]{}",eB=me.define({combine(e){return aa(e,{afterCursor:!0,brackets:J3,maxScanDistance:Z3,renderMatch:DY})}}),TY=Ce.mark({class:"cm-matchingBracket"}),MY=Ce.mark({class:"cm-nonmatchingBracket"});function DY(e){let t=[],n=e.matched?TY:MY;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function qD(e){let t=[],n=e.facet(eB);for(let r of e.selection.ranges){if(!r.empty)continue;let i=Wi(e,r.head,-1,n)||r.head>0&&Wi(e,r.head-1,1,n)||n.afterCursor&&(Wi(e,r.head,1,n)||r.head<e.doc.length&&Wi(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return Ce.set(t,!0)}const PY=_t.fromClass(class{constructor(e){this.paused=!1,this.decorations=qD(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=qD(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),_Y=[PY,EY];function NY(e={}){return[eB.of(e),_Y]}const RY=new Ie;function LS(e,t,n){let r=e.prop(t<0?Ie.openedBy:Ie.closedBy);if(r)return r;if(e.name.length==1){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function BS(e){let t=e.type.prop(RY);return t?t(e.node):e}function Wi(e,t,n,r={}){let i=r.maxScanDistance||Z3,a=r.brackets||J3,l=Dn(e),s=l.resolveInner(t,n);for(let c=s;c;c=c.parent){let f=LS(c.type,n,a);if(f&&c.from<c.to){let d=BS(c);if(d&&(n>0?t>=d.from&&t<d.to:t>d.from&&t<=d.to))return jY(e,t,n,c,d,f,a)}}return IY(e,t,n,l,s.type,i,a)}function jY(e,t,n,r,i,a,l){let s=r.parent,c={from:i.from,to:i.to},f=0,d=s?.cursor();if(d&&(n<0?d.childBefore(r.from):d.childAfter(r.to)))do if(n<0?d.to<=r.from:d.from>=r.to){if(f==0&&a.indexOf(d.type.name)>-1&&d.from<d.to){let p=BS(d);return{start:c,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(LS(d.type,n,l))f++;else if(LS(d.type,-n,l)){if(f==0){let p=BS(d);return{start:c,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}f--}}while(n<0?d.prevSibling():d.nextSibling());return{start:c,matched:!1}}function IY(e,t,n,r,i,a,l){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=l.indexOf(s);if(c<0||c%2==0!=n>0)return null;let f={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),p=0;for(let g=0;!d.next().done&&g<=a;){let v=d.value;n<0&&(g+=v.length);let y=t+g*n;for(let x=n>0?0:v.length-1,w=n>0?v.length:-1;x!=w;x+=n){let A=l.indexOf(v[x]);if(!(A<0||r.resolveInner(y+x,1).type!=i))if(A%2==0==n>0)p++;else{if(p==1)return{start:f,end:{from:y+x,to:y+x+1},matched:A>>1==c>>1};p--}}n>0&&(g+=v.length)}return d.done?{start:f,matched:!1}:null}const LY=Object.create(null),WD=[hr.none],VD=[],KD=Object.create(null),BY=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])BY[e]=zY(LY,t);function Bx(e,t){VD.indexOf(e)>-1||(VD.push(e),console.warn(t))}function zY(e,t){let n=[];for(let s of t.split(" ")){let c=[];for(let f of s.split(".")){let d=e[f]||Y[f];d?typeof d=="function"?c.length?c=c.map(d):Bx(f,`Modifier ${f} used at start of tag`):c.length?Bx(f,`Tag ${f} used as modifier`):c=Array.isArray(d)?d:[d]:Bx(f,`Unknown highlighting tag ${f}`)}for(let f of c)n.push(f)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(s=>s.id),a=KD[i];if(a)return a.id;let l=KD[i]=hr.define({id:WD.length,name:r,props:[j3({[r]:n})]});return WD.push(l),l.id}ft.RTL,ft.LTR;const $Y=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=WO(e.state,n.from);return r.line?UY(e):r.block?FY(e):!1};function qO(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}const UY=qO(VY,0),HY=qO(tB,0),FY=qO((e,t)=>tB(e,t,WY(t)),0);function WO(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const kf=50;function qY(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-kf,r),l=e.sliceDoc(i,i+kf),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(l)[0].length,f=a.length-s;if(a.slice(f-t.length,f)==t&&l.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let d,p;i-r<=2*kf?d=p=e.sliceDoc(r,i):(d=e.sliceDoc(r,r+kf),p=e.sliceDoc(i-kf,i));let g=/^\s*/.exec(d)[0].length,v=/\s*$/.exec(p)[0].length,y=p.length-v-n.length;return d.slice(g,g+t.length)==t&&p.slice(y,y+n.length)==n?{open:{pos:r+g+t.length,margin:/\s/.test(d.charAt(g+t.length))?1:0},close:{pos:i-v-n.length,margin:/\s/.test(p.charAt(y-1))?1:0}}:null}function WY(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function tB(e,t,n=t.selection.ranges){let r=n.map(a=>WO(t,a.from).block);if(!r.every(a=>a))return null;let i=n.map((a,l)=>qY(t,r[l],a.from,a.to));if(e!=2&&!i.every(a=>a))return{changes:t.changes(n.map((a,l)=>i[l]?[]:[{from:a.from,insert:r[l].open+" "},{from:a.to,insert:" "+r[l].close}]))};if(e!=1&&i.some(a=>a)){let a=[];for(let l=0,s;l<i.length;l++)if(s=i[l]){let c=r[l],{open:f,close:d}=s;a.push({from:f.pos-c.open.length,to:f.pos+f.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:a}}return null}function VY(e,t,n=t.selection.ranges){let r=[],i=-1;e:for(let{from:a,to:l}of n){let s=r.length,c=1e9,f;for(let d=a;d<=l;){let p=t.doc.lineAt(d);if(f==null&&(f=WO(t,p.from).line,!f))continue e;if(p.from>i&&(a==l||l>p.from)){i=p.from;let g=/^\s*/.exec(p.text)[0].length,v=g==p.length,y=p.text.slice(g,g+f.length)==f?g:-1;g<p.text.length&&g<c&&(c=g),r.push({line:p,comment:y,token:f,indent:g,empty:v,single:!1})}d=p.to+1}if(c<1e9)for(let d=s;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==s+1&&(r[s].single=!0)}if(e!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:s,token:c,indent:f,empty:d,single:p}of r)(p||!d)&&a.push({from:s.from+f,insert:c+" "});let l=t.changes(a);return{changes:l,selection:t.selection.map(l,1)}}else if(e!=1&&r.some(a=>a.comment>=0)){let a=[];for(let{line:l,comment:s,token:c}of r)if(s>=0){let f=l.from+s,d=f+c.length;l.text[d-l.from]==" "&&d++,a.push({from:f,to:d})}return{changes:a}}return null}const zS=ia.define(),KY=ia.define(),XY=me.define(),nB=me.define({combine(e){return aa(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,i)=>t(r,i)||n(r,i)})}}),rB=Nn.define({create(){return Vi.empty},update(e,t){let n=t.state.facet(nB),r=t.annotation(zS);if(r){let c=or.fromTransaction(t,r.selection),f=r.side,d=f==0?e.undone:e.done;return c?d=yg(d,d.length,n.minDepth,c):d=lB(d,t.startState.selection),new Vi(f==0?r.rest:d,f==0?d:r.rest)}let i=t.annotation(KY);if((i=="full"||i=="before")&&(e=e.isolate()),t.annotation(Zt.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=or.fromTransaction(t),l=t.annotation(Zt.time),s=t.annotation(Zt.userEvent);return a?e=e.addChanges(a,l,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,s,n.newGroupDelay)),(i=="full"||i=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Vi(e.done.map(or.fromJSON),e.undone.map(or.fromJSON))}});function QY(e={}){return[rB,nB.of(e),de.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?iB:t.inputType=="historyRedo"?$S:null;return r?(t.preventDefault(),r(n)):!1}})]}function qv(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(rB,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}const iB=qv(0,!1),$S=qv(1,!1),YY=qv(0,!0),GY=qv(1,!0);class or{constructor(t,n,r,i,a){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=a}setSelAfter(t){return new or(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(t){return new or(t.changes&&Yt.fromJSON(t.changes),[],t.mapped&&Qi.fromJSON(t.mapped),t.startSelection&&J.fromJSON(t.startSelection),t.selectionsAfter.map(J.fromJSON))}static fromTransaction(t,n){let r=Qr;for(let i of t.startState.facet(XY)){let a=i(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new or(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Qr)}static selection(t){return new or(void 0,Qr,void 0,void 0,t)}}function yg(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function ZY(e,t){let n=[],r=!1;return e.iterChangedRanges((i,a)=>n.push(i,a)),t.iterChangedRanges((i,a,l,s)=>{for(let c=0;c<n.length;){let f=n[c++],d=n[c++];s>=f&&l<=d&&(r=!0)}}),r}function JY(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function aB(e,t){return e.length?t.length?e.concat(t):e:t}const Qr=[],eG=200;function lB(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-eG));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),yg(e,e.length-1,1e9,n.setSelAfter(r)))}else return[or.selection([t])]}function tG(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function zx(e,t){if(!e.length)return e;let n=e.length,r=Qr;for(;n;){let i=nG(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let a=e.slice(0,n);return a[n-1]=i,a}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[or.selection(r)]:Qr}function nG(e,t,n){let r=aB(e.selectionsAfter.length?e.selectionsAfter.map(s=>s.map(t)):Qr,n);if(!e.changes)return or.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(a):a;return new or(i,_e.mapEffects(e.effects,t),l,e.startSelection.map(a),r)}const rG=/^(input\.type|delete)($|\.)/;class Vi{constructor(t,n,r=0,i=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Vi(this.done,this.undone):this}addChanges(t,n,r,i,a){let l=this.done,s=l[l.length-1];return s&&s.changes&&!s.changes.empty&&t.changes&&(!r||rG.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,ZY(s.changes,t.changes))||r=="input.type.compose")?l=yg(l,l.length-1,i.minDepth,new or(t.changes.compose(s.changes),aB(_e.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Qr)):l=yg(l,l.length,i.minDepth,t),new Vi(l,Qr,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Qr;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&JY(a[a.length-1],t)?this:new Vi(lB(this.done,t),this.undone,n,r)}addMapping(t){return new Vi(zx(this.done,t),zx(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let i=t==0?this.done:this.undone;if(i.length==0)return null;let a=i[i.length-1],l=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):n.selection);if(r&&a.selectionsAfter.length)return n.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:zS.of({side:t,rest:tG(i),selection:l}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let s=i.length==1?Qr:i.slice(0,i.length-1);return a.mapped&&(s=zx(s,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:zS.of({side:t,rest:s,selection:l}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Vi.empty=new Vi(Qr,Qr);const iG=[{key:"Mod-z",run:iB,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:$S,preventDefault:!0},{linux:"Ctrl-Shift-z",run:$S,preventDefault:!0},{key:"Mod-u",run:YY,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:GY,preventDefault:!0}];function hc(e,t){return J.create(e.ranges.map(t),e.mainIndex)}function Oi(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Ai({state:e,dispatch:t},n){let r=hc(e.selection,n);return r.eq(e.selection,!0)?!1:(t(Oi(e,r)),!0)}function Wv(e,t){return J.cursor(t?e.to:e.from)}function oB(e,t){return Ai(e,n=>n.empty?e.moveByChar(n,t):Wv(n,t))}function Rn(e){return e.textDirectionAt(e.state.selection.main.head)==ft.LTR}const sB=e=>oB(e,!Rn(e)),uB=e=>oB(e,Rn(e));function cB(e,t){return Ai(e,n=>n.empty?e.moveByGroup(n,t):Wv(n,t))}const aG=e=>cB(e,!Rn(e)),lG=e=>cB(e,Rn(e));function oG(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Vv(e,t,n){let r=Dn(e).resolveInner(t.head),i=n?Ie.closedBy:Ie.openedBy;for(let c=t.head;;){let f=n?r.childAfter(c):r.childBefore(c);if(!f)break;oG(e,f,i)?r=f:c=n?f.to:f.from}let a=r.type.prop(i),l,s;return a&&(l=n?Wi(e,r.from,1):Wi(e,r.to,-1))&&l.matched?s=n?l.end.to:l.end.from:s=n?r.to:r.from,J.cursor(s,n?-1:1)}const sG=e=>Ai(e,t=>Vv(e.state,t,!Rn(e))),uG=e=>Ai(e,t=>Vv(e.state,t,Rn(e)));function fB(e,t){return Ai(e,n=>{if(!n.empty)return Wv(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const hB=e=>fB(e,!1),dB=e=>fB(e,!0);function pB(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let a of e.state.facet(de.scrollMargins)){let l=a(e);l?.top&&(n=Math.max(l?.top,n)),l?.bottom&&(r=Math.max(l?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function mB(e,t){let n=pB(e),{state:r}=e,i=hc(r.selection,l=>l.empty?e.moveVertically(l,t,n.height):Wv(l,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let l=e.coordsAtPos(r.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),c=s.top+n.marginTop,f=s.bottom-n.marginBottom;l&&l.top>c&&l.bottom<f&&(a=de.scrollIntoView(i.main.head,{y:"start",yMargin:l.top-c}))}return e.dispatch(Oi(r,i),{effects:a}),!0}const XD=e=>mB(e,!1),US=e=>mB(e,!0);function ao(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head!=r.from+a&&(i=J.cursor(r.from+a))}return i}const cG=e=>Ai(e,t=>ao(e,t,!0)),fG=e=>Ai(e,t=>ao(e,t,!1)),hG=e=>Ai(e,t=>ao(e,t,!Rn(e))),dG=e=>Ai(e,t=>ao(e,t,Rn(e))),pG=e=>Ai(e,t=>J.cursor(e.lineBlockAt(t.head).from,1)),mG=e=>Ai(e,t=>J.cursor(e.lineBlockAt(t.head).to,-1));function gG(e,t,n){let r=!1,i=hc(e.selection,a=>{let l=Wi(e,a.head,-1)||Wi(e,a.head,1)||a.head>0&&Wi(e,a.head-1,1)||a.head<e.doc.length&&Wi(e,a.head+1,-1);if(!l||!l.end)return a;r=!0;let s=l.start.from==a.head?l.end.to:l.end.from;return J.cursor(s)});return r?(t(Oi(e,i)),!0):!1}const vG=({state:e,dispatch:t})=>gG(e,t);function ni(e,t,n){let r=hc(e.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=t&&(i=J.range(i.head,i.anchor));let a=n(i);return J.range(i.anchor,a.head,a.goalColumn,a.bidiLevel||void 0,a.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(Oi(e.state,r)),!0)}function gB(e,t){return ni(e,t,n=>e.moveByChar(n,t))}const vB=e=>gB(e,!Rn(e)),yB=e=>gB(e,Rn(e));function bB(e,t){return ni(e,t,n=>e.moveByGroup(n,t))}const yG=e=>bB(e,!Rn(e)),bG=e=>bB(e,Rn(e)),xG=e=>{let t=!Rn(e);return ni(e,t,n=>Vv(e.state,n,t))},SG=e=>{let t=Rn(e);return ni(e,t,n=>Vv(e.state,n,t))};function xB(e,t){return ni(e,t,n=>e.moveVertically(n,t))}const SB=e=>xB(e,!1),wB=e=>xB(e,!0);function OB(e,t){return ni(e,t,n=>e.moveVertically(n,t,pB(e).height))}const QD=e=>OB(e,!1),YD=e=>OB(e,!0),wG=e=>ni(e,!0,t=>ao(e,t,!0)),OG=e=>ni(e,!1,t=>ao(e,t,!1)),AG=e=>{let t=!Rn(e);return ni(e,t,n=>ao(e,n,t))},kG=e=>{let t=Rn(e);return ni(e,t,n=>ao(e,n,t))},CG=e=>ni(e,!1,t=>J.cursor(e.lineBlockAt(t.head).from)),EG=e=>ni(e,!0,t=>J.cursor(e.lineBlockAt(t.head).to)),GD=({state:e,dispatch:t})=>(t(Oi(e,{anchor:0})),!0),ZD=({state:e,dispatch:t})=>(t(Oi(e,{anchor:e.doc.length})),!0),JD=({state:e,dispatch:t})=>(t(Oi(e,{anchor:e.selection.main.anchor,head:0})),!0),eP=({state:e,dispatch:t})=>(t(Oi(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),TG=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),MG=({state:e,dispatch:t})=>{let n=Kv(e).map(({from:r,to:i})=>J.range(r,Math.min(i+1,e.doc.length)));return t(e.update({selection:J.create(n),userEvent:"select"})),!0},DG=({state:e,dispatch:t})=>{let n=hc(e.selection,r=>{let i=Dn(e),a=i.resolveStack(r.from,1);if(r.empty){let l=i.resolveStack(r.from,-1);l.node.from>=a.node.from&&l.node.to<=a.node.to&&(a=l)}for(let l=a;l;l=l.next){let{node:s}=l;if((s.from<r.from&&s.to>=r.to||s.to>r.to&&s.from<=r.from)&&l.next)return J.range(s.to,s.from)}return r});return n.eq(e.selection)?!1:(t(Oi(e,n)),!0)};function AB(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let a of n.selection.ranges){let l=n.doc.lineAt(a.head);if(t?l.to<e.state.doc.length:l.from>0)for(let s=a;;){let c=e.moveVertically(s,t);if(c.head<l.from||c.head>l.to){i.some(f=>f.head==c.head)||i.push(c);break}else{if(c.head==s.head)break;s=c}}}return i.length==r.ranges.length?!1:(e.dispatch(Oi(n,J.create(i,i.length-1))),!0)}const PG=e=>AB(e,!1),_G=e=>AB(e,!0),NG=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=J.create([n.main]):n.main.empty||(r=J.create([J.cursor(n.main.head)])),r?(t(Oi(e,r)),!0):!1};function Qh(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(a=>{let{from:l,to:s}=a;if(l==s){let c=t(a);c<l?(n="delete.backward",c=am(e,c,!1)):c>l&&(n="delete.forward",c=am(e,c,!0)),l=Math.min(l,c),s=Math.max(s,c)}else l=am(e,l,!1),s=am(e,s,!0);return l==s?{range:a}:{changes:{from:l,to:s},range:J.cursor(l,l<a.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?de.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function am(e,t,n){if(e instanceof de)for(let r of e.state.facet(de.atomicRanges).map(i=>i(e)))r.between(t,t,(i,a)=>{i<t&&a>t&&(t=n?a:i)});return t}const kB=(e,t,n)=>Qh(e,r=>{let i=r.from,{state:a}=e,l=a.doc.lineAt(i),s,c;if(n&&!t&&i>l.from&&i<l.from+200&&!/[^ \t]/.test(s=l.text.slice(0,i-l.from))){if(s[s.length-1]==" ")return i-1;let f=fc(s,a.tabSize),d=f%mg(a)||mg(a);for(let p=0;p<d&&s[s.length-1-p]==" ";p++)i--;c=i}else c=on(l.text,i-l.from,t,t)+l.from,c==i&&l.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(l.text.slice(c-l.from,i-l.from))&&(c=on(l.text,c-l.from,!1,!1)+l.from);return c}),HS=e=>kB(e,!1,!0),CB=e=>kB(e,!0,!1),EB=(e,t)=>Qh(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),l=i.charCategorizer(r);for(let s=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let c=on(a.text,r-a.from,t)+a.from,f=a.text.slice(Math.min(r,c)-a.from,Math.max(r,c)-a.from),d=l(f);if(s!=null&&d!=s)break;(f!=" "||r!=n.head)&&(s=d),r=c}return r}),TB=e=>EB(e,!1),RG=e=>EB(e,!0),jG=e=>Qh(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),IG=e=>Qh(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),LG=e=>Qh(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),BG=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Je.of(["",""])},range:J.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},zG=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let i=r.from,a=e.doc.lineAt(i),l=i==a.from?i-1:on(a.text,i-a.from,!1)+a.from,s=i==a.to?i+1:on(a.text,i-a.from,!0)+a.from;return{changes:{from:l,to:s,insert:e.doc.slice(i,s).append(e.doc.slice(l,i))},range:J.cursor(s)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Kv(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let l=t[t.length-1];l.to=a.to,l.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function MB(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let a of Kv(e)){if(n?a.to==e.doc.length:a.from==0)continue;let l=e.doc.lineAt(n?a.to+1:a.from-1),s=l.length+1;if(n){r.push({from:a.to,to:l.to},{from:a.from,insert:l.text+e.lineBreak});for(let c of a.ranges)i.push(J.range(Math.min(e.doc.length,c.anchor+s),Math.min(e.doc.length,c.head+s)))}else{r.push({from:l.from,to:a.from},{from:a.to,insert:e.lineBreak+l.text});for(let c of a.ranges)i.push(J.range(c.anchor-s,c.head-s))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:J.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const $G=({state:e,dispatch:t})=>MB(e,t,!1),UG=({state:e,dispatch:t})=>MB(e,t,!0);function DB(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of Kv(e))n?r.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):r.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const HG=({state:e,dispatch:t})=>DB(e,t,!1),FG=({state:e,dispatch:t})=>DB(e,t,!0),qG=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Kv(t).map(({from:i,to:a})=>(i>0?i--:a<t.doc.length&&a++,{from:i,to:a}))),r=hc(t.selection,i=>{let a;if(e.lineWrapping){let l=e.lineBlockAt(i.head),s=e.coordsAtPos(i.head,i.assoc||1);s&&(a=l.bottom+e.documentTop-s.bottom+e.defaultLineHeight/2)}return e.moveVertically(i,!0,a)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function WG(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Dn(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(Ie.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const tP=PB(!1),VG=PB(!0);function PB(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(i=>{let{from:a,to:l}=i,s=t.doc.lineAt(a),c=!e&&a==l&&WG(t,a);e&&(a=l=(l<=s.to?s:t.doc.lineAt(l)).to);let f=new Hv(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=HO(f,a);for(d==null&&(d=fc(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));l<s.to&&/\s/.test(s.text[l-s.from]);)l++;c?{from:a,to:l}=c:a>s.from&&a<s.from+100&&!/\S/.test(s.text.slice(0,a))&&(a=s.from);let p=["",wh(t,d)];return c&&p.push(wh(t,f.lineIndent(s.from,-1))),{changes:{from:a,to:l,insert:Je.of(p)},range:J.cursor(a+1+p[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function VO(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let l=r.from;l<=r.to;){let s=e.doc.lineAt(l);s.number>n&&(r.empty||r.to>s.from)&&(t(s,i,r),n=s.number),l=s.to+1}let a=e.changes(i);return{changes:i,range:J.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const KG=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Hv(e,{overrideIndentation:a=>{let l=n[a];return l??-1}}),i=VO(e,(a,l,s)=>{let c=HO(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let f=/^\s*/.exec(a.text)[0],d=wh(e,c);(f!=d||s.from<a.from+f.length)&&(n[a.from]=c,l.push({from:a.from,to:a.from+f.length,insert:d}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0},_B=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(VO(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Uv)})}),{userEvent:"input.indent"})),!0),NB=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(VO(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let a=fc(i,e.tabSize),l=0,s=wh(e,Math.max(0,a-mg(e)));for(;l<i.length&&l<s.length&&i.charCodeAt(l)==s.charCodeAt(l);)l++;r.push({from:n.from+l,to:n.from+i.length,insert:s.slice(l)})}),{userEvent:"delete.dedent"})),!0),XG=e=>(e.setTabFocusMode(),!0),QG=[{key:"Ctrl-b",run:sB,shift:vB,preventDefault:!0},{key:"Ctrl-f",run:uB,shift:yB},{key:"Ctrl-p",run:hB,shift:SB},{key:"Ctrl-n",run:dB,shift:wB},{key:"Ctrl-a",run:pG,shift:CG},{key:"Ctrl-e",run:mG,shift:EG},{key:"Ctrl-d",run:CB},{key:"Ctrl-h",run:HS},{key:"Ctrl-k",run:jG},{key:"Ctrl-Alt-h",run:TB},{key:"Ctrl-o",run:BG},{key:"Ctrl-t",run:zG},{key:"Ctrl-v",run:US}],YG=[{key:"ArrowLeft",run:sB,shift:vB,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:aG,shift:yG,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:hG,shift:AG,preventDefault:!0},{key:"ArrowRight",run:uB,shift:yB,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:lG,shift:bG,preventDefault:!0},{mac:"Cmd-ArrowRight",run:dG,shift:kG,preventDefault:!0},{key:"ArrowUp",run:hB,shift:SB,preventDefault:!0},{mac:"Cmd-ArrowUp",run:GD,shift:JD},{mac:"Ctrl-ArrowUp",run:XD,shift:QD},{key:"ArrowDown",run:dB,shift:wB,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ZD,shift:eP},{mac:"Ctrl-ArrowDown",run:US,shift:YD},{key:"PageUp",run:XD,shift:QD},{key:"PageDown",run:US,shift:YD},{key:"Home",run:fG,shift:OG,preventDefault:!0},{key:"Mod-Home",run:GD,shift:JD},{key:"End",run:cG,shift:wG,preventDefault:!0},{key:"Mod-End",run:ZD,shift:eP},{key:"Enter",run:tP,shift:tP},{key:"Mod-a",run:TG},{key:"Backspace",run:HS,shift:HS,preventDefault:!0},{key:"Delete",run:CB,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:TB,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:RG,preventDefault:!0},{mac:"Mod-Backspace",run:IG,preventDefault:!0},{mac:"Mod-Delete",run:LG,preventDefault:!0}].concat(QG.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),GG=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:sG,shift:xG},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:uG,shift:SG},{key:"Alt-ArrowUp",run:$G},{key:"Shift-Alt-ArrowUp",run:HG},{key:"Alt-ArrowDown",run:UG},{key:"Shift-Alt-ArrowDown",run:FG},{key:"Mod-Alt-ArrowUp",run:PG},{key:"Mod-Alt-ArrowDown",run:_G},{key:"Escape",run:NG},{key:"Mod-Enter",run:VG},{key:"Alt-l",mac:"Ctrl-l",run:MG},{key:"Mod-i",run:DG,preventDefault:!0},{key:"Mod-[",run:NB},{key:"Mod-]",run:_B},{key:"Mod-Alt-\\",run:KG},{key:"Shift-Mod-k",run:qG},{key:"Shift-Mod-\\",run:vG},{key:"Mod-/",run:$Y},{key:"Alt-A",run:HY},{key:"Ctrl-m",mac:"Shift-Alt-m",run:XG}].concat(YG),ZG={key:"Tab",run:_B,shift:NB},nP=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Yu{constructor(t,n,r=0,i=t.length,a,l){this.test=l,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=a?s=>a(nP(s)):nP,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return rr(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=bO(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ui(t);let i=this.normalize(n);if(i.length)for(let a=0,l=r,s=!0;;a++){let c=i.charCodeAt(a),f=this.match(c,l,s,this.bufferPos+this.bufferStart,a==i.length-1);if(f)return this.value=f,this;if(a==i.length-1)break;s&&a<n.length&&n.charCodeAt(a)==c?l++:s=!1}}}match(t,n,r,i,a){let l=null;for(let s=0;s<this.matches.length;){let c=this.matches[s],f=!1;this.query.charCodeAt(c.index)==t&&(c.index==this.query.length-1?l={from:c.from,to:i,precise:a&&c.precise}:(c.index++,f=!0)),f?s++:this.matches.splice(s,1)}return this.query.charCodeAt(0)==t&&(this.query.length==1?l={from:n,to:i,precise:r&&a}:this.matches.push({from:n,index:1,precise:r})),l&&this.test&&!this.test(l.from,l.to,this.buffer,this.bufferStart)&&(l=null),l}}typeof Symbol<"u"&&(Yu.prototype[Symbol.iterator]=function(){return this});const RB={from:-1,to:-1,match:/.*/.exec(""),precise:!0},KO="gm"+(/x/.unicode==null?"":"u");class jB{constructor(t,n,r,i=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=RB,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new IB(t,n,r,i,a);this.re=new RegExp(n,KO+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let l=t.lineAt(i);this.curLineStart=l.from,this.matchPos=bg(t,i),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=bg(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const $x=new WeakMap;class ju{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let i=$x.get(t);if(!i||i.from>=r||i.to<=n){let s=new ju(n,t.sliceString(n,r));return $x.set(t,s),s}if(i.from==n&&i.to==r)return i;let{text:a,from:l}=i;return l>n&&(a=t.sliceString(n,l)+a,l=n),i.to<r&&(a+=t.sliceString(i.to,r)),$x.set(t,new ju(l,a)),new ju(n,a.slice(n-l,r-l))}}class IB{constructor(t,n,r,i,a){this.text=t,this.to=a,this.done=!1,this.value=RB,this.matchPos=bg(t,i),this.re=new RegExp(n,KO+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=ju.get(t,i,this.chunkEnd(i+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this.matchPos=bg(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=ju.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(jB.prototype[Symbol.iterator]=IB.prototype[Symbol.iterator]=function(){return this});function JG(e){try{return new RegExp(e,KO),!0}catch{return!1}}function bg(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}const eZ=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=bQ(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return i.then(a=>{let l=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!l){e.dispatch({effects:r});return}let s=t.doc.lineAt(t.selection.main.head),[,c,f,d,p]=l,g=d?+d.slice(1):0,v=f?+f:s.number;if(f&&p){let w=v/100;c&&(w=w*(c=="-"?-1:1)+s.number/t.doc.lines),v=Math.round(t.doc.lines*w)}else f&&c&&(v=v*(c=="-"?-1:1)+s.number);let y=t.doc.line(Math.max(1,Math.min(t.doc.lines,v))),x=J.cursor(y.from+Math.max(0,Math.min(g,y.length)));e.dispatch({effects:[r,de.scrollIntoView(x.from,{y:"center"})],selection:x})}),!0},tZ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},nZ=me.define({combine(e){return aa(e,tZ,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function rZ(e){return[sZ,oZ]}const iZ=Ce.mark({class:"cm-selectionMatch"}),aZ=Ce.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function rP(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Ot.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Ot.Word)}function lZ(e,t,n,r){return e(t.sliceDoc(n,n+1))==Ot.Word&&e(t.sliceDoc(r-1,r))==Ot.Word}const oZ=_t.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(nZ),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Ce.none;let i=r.main,a,l=null;if(i.empty){if(!t.highlightWordAroundCursor)return Ce.none;let c=n.wordAt(i.head);if(!c)return Ce.none;l=n.charCategorizer(i.head),a=n.sliceDoc(c.from,c.to)}else{let c=i.to-i.from;if(c<t.minSelectionLength||c>200)return Ce.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),l=n.charCategorizer(i.head),!(rP(l,n,i.from,i.to)&&lZ(l,n,i.from,i.to)))return Ce.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Ce.none}let s=[];for(let c of e.visibleRanges){let f=new Yu(n.doc,a,c.from,c.to);for(;!f.next().done;){let{from:d,to:p}=f.value;if((!l||rP(l,n,d,p))&&(i.empty&&d<=i.from&&p>=i.to?s.push(aZ.range(d,p)):(d>=i.to||p<=i.from)&&s.push(iZ.range(d,p)),s.length>t.maxMatches))return Ce.none}}return Ce.set(s)}},{decorations:e=>e.decorations}),sZ=de.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),uZ=({state:e,dispatch:t})=>{let{selection:n}=e,r=J.create(n.ranges.map(i=>e.wordAt(i.head)||J.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function cZ(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let l=!1,s=new Yu(e.doc,t,r[r.length-1].to);;)if(s.next(),s.done){if(l)return null;s=new Yu(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),l=!0}else{if(l&&r.some(c=>c.from==s.value.from))continue;if(a){let c=e.wordAt(s.value.from);if(!c||c.from!=s.value.from||c.to!=s.value.to)continue}return s.value}}const fZ=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return uZ({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=r))return!1;let i=cZ(e,r);return i?(t(e.update({selection:e.selection.addRange(J.range(i.from,i.to),!1),effects:de.scrollIntoView(i.to)})),!0):!1},dc=me.define({combine(e){return aa(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new kZ(t),scrollToMatch:t=>de.scrollIntoView(t)})}});class LB{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||JG(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
66
- `:r=="r"?"\r":r=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new vZ(this):new pZ(this)}getCursor(t,n=0,r){let i=t.doc?t:qe.create({doc:t});return r==null&&(r=i.doc.length),this.regexp?bu(this,i,n,r):yu(this,i,n,r)}}class BB{constructor(t){this.spec=t}}function hZ(e,t,n){return(r,i,a,l)=>{if(n&&!n(r,i,a,l))return!1;let s=r>=l&&i<=l+a.length?a.slice(r-l,i-l):t.doc.sliceString(r,i);return e(s,t,r,i)}}function yu(e,t,n,r){let i;return e.wholeWord&&(i=dZ(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=hZ(e.test,t,i)),new Yu(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:a=>a.toLowerCase(),i)}function dZ(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(xg(i,n-a))!=Ot.Word||t(Sg(i,n-a))!=Ot.Word)&&(t(Sg(i,r-a))!=Ot.Word||t(xg(i,r-a))!=Ot.Word))}class pZ extends BB{constructor(t){super(t)}nextMatch(t,n,r){let i=yu(this.spec,t,r,t.doc.length).nextOverlapping();if(i.done){let a=Math.min(t.doc.length,n+this.spec.unquoted.length);i=yu(this.spec,t,0,a).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(t,n,r){for(let i=r;;){let a=Math.max(n,i-1e4-this.spec.unquoted.length),l=yu(this.spec,t,a,i),s=null;for(;!l.nextOverlapping().done;)s=l.value;if(s)return s;if(a==n)return null;i-=1e4}}prevMatch(t,n,r){let i=this.prevMatchInRange(t,0,n);return i||(i=this.prevMatchInRange(t,Math.max(0,r-this.spec.unquoted.length),t.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,n){let r=yu(this.spec,t,0,t.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let a=yu(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!a.next().done;)i(a.value.from,a.value.to)}}function mZ(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function bu(e,t,n,r){let i;return e.wholeWord&&(i=gZ(t.charCategorizer(t.selection.main.head))),e.test&&(i=mZ(e.test,t,i)),new jB(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function xg(e,t){return e.slice(on(e,t,!1),t)}function Sg(e,t){return e.slice(t,on(e,t))}function gZ(e){return(t,n,r)=>!r[0].length||(e(xg(r.input,r.index))!=Ot.Word||e(Sg(r.input,r.index))!=Ot.Word)&&(e(Sg(r.input,r.index+r[0].length))!=Ot.Word||e(xg(r.input,r.index+r[0].length))!=Ot.Word)}class vZ extends BB{nextMatch(t,n,r){let i=bu(this.spec,t,r,t.doc.length).next();return i.done&&(i=bu(this.spec,t,0,n).next()),i.done?null:i.value}prevMatchInRange(t,n,r){for(let i=1;;i++){let a=Math.max(n,r-i*1e4),l=bu(this.spec,t,a,r),s=null;for(;!l.next().done;)s=l.value;if(s&&(a==n||s.from>a+10))return s;if(a==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return t.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let a=+r.slice(0,i);if(a>0&&a<t.match.length)return t.match[a]+r.slice(i)}return n})}matchAll(t,n){let r=bu(this.spec,t,0,t.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let a=bu(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!a.next().done;)i(a.value.from,a.value.to)}}const Oh=_e.define(),XO=_e.define(),Wl=Nn.define({create(e){return new Ux(FS(e).create(),null)},update(e,t){for(let n of t.effects)n.is(Oh)?e=new Ux(n.value.create(),e.panel):n.is(XO)&&(e=new Ux(e.query,n.value?QO:null));return e},provide:e=>bh.from(e,t=>t.panel)});class Ux{constructor(t,n){this.query=t,this.panel=n}}const yZ=Ce.mark({class:"cm-searchMatch"}),bZ=Ce.mark({class:"cm-searchMatch cm-searchMatch-selected"}),xZ=_t.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Wl))}update(e){let t=e.state.field(Wl);(t!=e.startState.field(Wl)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Ce.none;let{view:n}=this,r=new Ha;for(let i=0,a=n.visibleRanges,l=a.length;i<l;i++){let{from:s,to:c}=a[i];for(;i<l-1&&c>a[i+1].from-500;)c=a[++i].to;e.highlight(n.state,s,c,(f,d)=>{let p=n.state.selection.ranges.some(g=>g.from==f&&g.to==d);r.add(f,d,p?bZ:yZ)})}return r.finish()}},{decorations:e=>e.decorations});function Yh(e){return t=>{let n=t.state.field(Wl,!1);return n&&n.query.spec.valid?e(t,n):UB(t)}}const wg=Yh((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=J.single(r.from,r.to),a=e.state.facet(dc);return e.dispatch({selection:i,effects:[YO(e,r),a.scrollToMatch(i.main,e)],userEvent:"select.search"}),$B(e),!0}),Og=Yh((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=J.single(i.from,i.to),l=e.state.facet(dc);return e.dispatch({selection:a,effects:[YO(e,i),l.scrollToMatch(a.main,e)],userEvent:"select.search"}),$B(e),!0}),SZ=Yh((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:J.create(n.map(r=>J.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),wZ=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],l=0;for(let s=new Yu(e.doc,e.sliceDoc(r,i));!s.next().done;){if(a.length>1e3)return!1;s.value.from==r&&(l=a.length),a.push(J.range(s.value.from,s.value.to))}return t(e.update({selection:J.create(a,l),userEvent:"select.search.matches"})),!0},iP=Yh((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let l=a,s=[],c,f,d=[];l.precise?l.from==r&&l.to==i&&(f=n.toText(t.getReplacement(l)),s.push({from:l.from,to:l.to,insert:f}),l=t.nextMatch(n,l.from,l.to),d.push(de.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):l=t.nextMatch(n,l.from,l.to);let p=e.state.changes(s);return l&&(c=J.single(l.from,l.to).map(p),d.push(YO(e,l)),d.push(n.facet(dc).scrollToMatch(c.main,e))),e.dispatch({changes:p,selection:c,effects:d,userEvent:"input.replace"}),!0}),OZ=Yh((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let i of t.matchAll(e.state,1e9)){let{from:a,to:l,precise:s}=i;s&&n.push({from:a,to:l,insert:t.getReplacement(i)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:de.announce.of(r),userEvent:"input.replace.all"}),!0});function QO(e){return e.state.facet(dc).createPanel(e)}function FS(e,t){var n,r,i,a,l;let s=e.selection.main,c=s.empty||s.to>s.from+100?"":e.sliceDoc(s.from,s.to);if(t&&!c)return t;let f=e.facet(dc);return new LB({search:((n=t?.literal)!==null&&n!==void 0?n:f.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r:f.caseSensitive,literal:(i=t?.literal)!==null&&i!==void 0?i:f.literal,regexp:(a=t?.regexp)!==null&&a!==void 0?a:f.regexp,wholeWord:(l=t?.wholeWord)!==null&&l!==void 0?l:f.wholeWord})}function zB(e){let t=LO(e,QO);return t&&t.dom.querySelector("[main-field]")}function $B(e){let t=zB(e);t&&t==e.root.activeElement&&t.select()}const UB=e=>{let t=e.state.field(Wl,!1);if(t&&t.panel){let n=zB(e);if(n&&n!=e.root.activeElement){let r=FS(e.state,t.query.spec);r.valid&&e.dispatch({effects:Oh.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[XO.of(!0),t?Oh.of(FS(e.state,t.query.spec)):_e.appendConfig.of(EZ)]});return!0},HB=e=>{let t=e.state.field(Wl,!1);if(!t||!t.panel)return!1;let n=LO(e,QO);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:XO.of(!1)}),!0},AZ=[{key:"Mod-f",run:UB,scope:"editor search-panel"},{key:"F3",run:wg,shift:Og,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:wg,shift:Og,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:HB,scope:"editor search-panel"},{key:"Mod-Shift-l",run:wZ},{key:"Mod-Alt-g",run:eZ},{key:"Mod-d",run:fZ,preventDefault:!0}];class kZ{constructor(t){this.view=t;let n=this.query=t.state.field(Wl).query.spec;this.commit=this.commit.bind(this),this.searchField=ot("input",{value:n.search,placeholder:Or(t,"Find"),"aria-label":Or(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ot("input",{value:n.replace,placeholder:Or(t,"Replace"),"aria-label":Or(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ot("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=ot("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=ot("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,a,l){return ot("button",{class:"cm-button",name:i,onclick:a,type:"button"},l)}this.dom=ot("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>wg(t),[Or(t,"next")]),r("prev",()=>Og(t),[Or(t,"previous")]),r("select",()=>SZ(t),[Or(t,"all")]),ot("label",null,[this.caseField,Or(t,"match case")]),ot("label",null,[this.reField,Or(t,"regexp")]),ot("label",null,[this.wordField,Or(t,"by word")]),...t.state.readOnly?[]:[ot("br"),this.replaceField,r("replace",()=>iP(t),[Or(t,"replace")]),r("replaceAll",()=>OZ(t),[Or(t,"replace all")])],ot("button",{name:"close",onclick:()=>HB(t),"aria-label":Or(t,"close"),type:"button"},["×"])])}commit(){let t=new LB({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Oh.of(t)}))}keydown(t){TX(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Og:wg)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),iP(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(Oh)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(dc).top}}function Or(e,t){return e.state.phrase(t)}const lm=30,om=/[\s\.,:;?!]/;function YO(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-lm),l=Math.min(i,n+lm),s=e.state.sliceDoc(a,l);if(a!=r.from){for(let c=0;c<lm;c++)if(!om.test(s[c+1])&&om.test(s[c])){s=s.slice(c);break}}if(l!=i){for(let c=s.length-1;c>s.length-lm;c--)if(!om.test(s[c-1])&&om.test(s[c])){s=s.slice(0,c);break}}return de.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`)}const CZ=de.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),EZ=[Wl,vs.low(xZ),CZ];class FB{constructor(t,n,r,i){this.state=t,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=Dn(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),a=i.search(qB(t,!1));return a<0?null:{from:r+a,to:this.pos,text:i.slice(a)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,r){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function aP(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function TZ(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let a=1;a<i.length;a++)n[i[a]]=!0}let r=aP(t)+aP(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function MZ(e){let t=e.map(i=>typeof i=="string"?{label:i}:i),[n,r]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:TZ(t);return i=>{let a=i.matchBefore(r);return a||i.explicit?{from:a?a.from:i.pos,options:t,validFor:n}:null}}class lP{constructor(t,n,r,i){this.completion=t,this.source=n,this.match=r,this.score=i}}function Zo(e){return e.selection.main.from}function qB(e,t){var n;let{source:r}=e,i=t&&r[0]!="^",a=r[r.length-1]!="$";return!i&&!a?e:new RegExp(`${i?"^":""}(?:${r})${a?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const WB=ia.define();function DZ(e,t,n,r){let{main:i}=e.selection,a=n-i.from,l=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+l)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+l,insert:c},range:J.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const oP=new WeakMap;function PZ(e){if(!Array.isArray(e))return e;let t=oP.get(e);return t||oP.set(e,t=MZ(e)),t}const Ag=_e.define(),Ah=_e.define();class _Z{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<t.length;){let r=rr(t,n),i=Ui(r);this.chars.push(r);let a=t.slice(n,n+i),l=a.toUpperCase();this.folded.push(rr(l==a?a.toLowerCase():l,0)),n+=i}this.astral=t.length!=this.chars.length}ret(t,n){return this.score=t,this.matched=n,this}match(t){if(this.pattern.length==0)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:a,byWord:l}=this;if(n.length==1){let C=rr(t,0),k=Ui(C),P=k==t.length?0:-100;if(C!=n[0])if(C==r[0])P+=-200;else return null;return this.ret(P,[0,k])}let s=t.indexOf(this.pattern);if(s==0)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=n.length,f=0;if(s<0){for(let C=0,k=Math.min(t.length,200);C<k&&f<c;){let P=rr(t,C);(P==n[f]||P==r[f])&&(i[f++]=C),C+=Ui(P)}if(f<c)return null}let d=0,p=0,g=!1,v=0,y=-1,x=-1,w=/[a-z]/.test(t),A=!0;for(let C=0,k=Math.min(t.length,200),P=0;C<k&&p<c;){let T=rr(t,C);s<0&&(d<c&&T==n[d]&&(a[d++]=C),v<c&&(T==n[v]||T==r[v]?(v==0&&(y=C),x=C+1,v++):v=0));let D,N=T<255?T>=48&&T<=57||T>=97&&T<=122?2:T>=65&&T<=90?1:0:(D=bO(T))!=D.toLowerCase()?1:D!=D.toUpperCase()?2:0;(!C||N==1&&w||P==0&&N!=0)&&(n[p]==T||r[p]==T&&(g=!0)?l[p++]=C:l.length&&(A=!1)),P=N,C+=Ui(T)}return p==c&&l[0]==0&&A?this.result(-100+(g?-200:0),l,t):v==c&&y==0?this.ret(-200-t.length+(x==t.length?0:-100),[0,x]):s>-1?this.ret(-700-t.length,[s,s+this.pattern.length]):v==c?this.ret(-900-t.length,[y,x]):p==c?this.result(-100+(g?-200:0)+-700+(A?0:-1100),l,t):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,t)}result(t,n,r){let i=[],a=0;for(let l of n){let s=l+(this.astral?Ui(rr(r,l)):1);a&&i[a-1]==l?i[a-1]=s:(i[a++]=l,i[a++]=s)}return this.ret(t-r.length,i)}}class NZ{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let n=t.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(t.length==this.pattern.length?0:-100),this)}}const ln=me.define({combine(e){return aa(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:RZ,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>r=>sP(t(r),n(r)),optionClass:(t,n)=>r=>sP(t(r),n(r)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function sP(e,t){return e?t?e+" "+t:e:t}function RZ(e,t,n,r,i,a){let l=e.textDirection==ft.RTL,s=l,c=!1,f="top",d,p,g=t.left-i.left,v=i.right-t.right,y=r.right-r.left,x=r.bottom-r.top;if(s&&g<Math.min(y,v)?s=!1:!s&&v<Math.min(y,g)&&(s=!0),y<=(s?g:v))d=Math.max(i.top,Math.min(n.top,i.bottom-x))-t.top,p=Math.min(400,s?g:v);else{c=!0,p=Math.min(400,(l?t.right:i.right-t.left)-30);let C=i.bottom-t.bottom;C>=x||C>t.top?d=n.bottom-t.top:(f="bottom",d=t.bottom-n.top)}let w=(t.bottom-t.top)/a.offsetHeight,A=(t.right-t.left)/a.offsetWidth;return{style:`${f}: ${d/w}px; max-width: ${p/A}px`,class:"cm-completionInfo-"+(c?l?"left-narrow":"right-narrow":s?"left":"right")}}const GO=_e.define();function jZ(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),t.push({render(n,r,i,a){let l=document.createElement("span");l.className="cm-completionLabel";let s=n.displayLabel||n.label,c=0;for(let f=0;f<a.length;){let d=a[f++],p=a[f++];d>c&&l.appendChild(document.createTextNode(s.slice(c,d)));let g=l.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(s.slice(d,p))),g.className="cm-completionMatchedText",c=p}return c<s.length&&l.appendChild(document.createTextNode(s.slice(c))),l},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),t.sort((n,r)=>n.position-r.position).map(n=>n.render)}function Hx(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let i=Math.floor(t/n);return{from:i*n,to:(i+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}class IZ{constructor(t,n,r){this.view=t,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let i=t.state.field(n),{options:a,selected:l}=i.open,s=t.state.facet(ln);this.optionContent=jZ(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=Hx(a.length,l,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:f}=t.state.field(n).open;for(let d=c.target,p;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(p=/-(\d+)$/.exec(d.id))&&+p[1]<f.length){this.applyCompletion(t,f[+p[1]]),c.preventDefault();return}if(c.target==this.list){let d=this.list.classList.contains("cm-completionListIncompleteTop")&&c.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&c.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:GO.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let f=t.state.field(this.stateField,!1);f&&f.tooltip&&t.state.facet(ln).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:Ah.of(null)})}),this.showOptions(a,i.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let r=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),r!=i){let{options:a,selected:l,disabled:s}=r.open;(!i.open||i.open.options!=a)&&(this.range=Hx(a.length,l,t.state.facet(ln).maxRenderedOptions),this.showOptions(a,r.id)),this.updateSel(),s!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=Hx(n.options.length,n.selected,this.view.state.facet(ln).maxRenderedOptions),this.showOptions(n.options,t.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:i}=n.options[n.selected],{info:a}=i;if(!a)return;let l=typeof a=="string"?document.createTextNode(a):a(i);if(!l)return;"then"in l?l.then(s=>{s&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(s,i)}).catch(s=>lr(this.view.state,s,"completion info")):(this.addInfoPane(l,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)r.appendChild(t),this.infoDestroy=null;else{let{dom:i,destroy:a}=t;r.appendChild(i),this.infoDestroy=a||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==t?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&BZ(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),a=this.space;if(!a){let l=this.dom.ownerDocument.documentElement;a={left:0,top:0,right:l.clientWidth,bottom:l.clientHeight}}return i.top>Math.min(a.bottom,n.bottom)-10||i.bottom<Math.max(a.top,n.top)+10?null:this.view.state.facet(ln).positionInfo(this.view,n,i,r,a,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",l=>{l.target==i&&l.preventDefault()});let a=null;for(let l=r.from;l<r.to;l++){let{completion:s,match:c}=t[l],{section:f}=s;if(f){let g=typeof f=="string"?f:f.name;if(g!=a&&(l>r.from||r.from==0))if(a=g,typeof f!="string"&&f.header)i.appendChild(f.header(f));else{let v=i.appendChild(document.createElement("completion-section"));v.textContent=g}}const d=i.appendChild(document.createElement("li"));d.id=n+"-"+l,d.setAttribute("role","option");let p=this.optionClass(s);p&&(d.className=p);for(let g of this.optionContent){let v=g(s,this.view.state,this.view,c);v&&d.appendChild(v)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<t.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function LZ(e,t){return n=>new IZ(n,e,t)}function BZ(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function uP(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function zZ(e,t){let n=[],r=null,i=null,a=d=>{n.push(d);let{section:p}=d.completion;if(p){r||(r=[]);let g=typeof p=="string"?p:p.name;r.some(v=>v.name==g)||r.push(typeof p=="string"?{name:g}:p)}},l=t.facet(ln);for(let d of e)if(d.hasResult()){let p=d.result.getMatch;if(d.result.filter===!1)for(let g of d.result.options)a(new lP(g,d.source,p?p(g):[],1e9-n.length));else{let g=t.sliceDoc(d.from,d.to),v,y=l.filterStrict?new NZ(g):new _Z(g);for(let x of d.result.options)if(v=y.match(x.label)){let w=x.displayLabel?p?p(x,v.matched):[]:v.matched,A=v.score+(x.boost||0);if(a(new lP(x,d.source,w,A)),typeof x.section=="object"&&x.section.rank==="dynamic"){let{name:C}=x.section;i||(i=Object.create(null)),i[C]=Math.max(A,i[C]||-1e9)}}}}if(r){let d=Object.create(null),p=0,g=(v,y)=>(v.rank==="dynamic"&&y.rank==="dynamic"?i[y.name]-i[v.name]:0)||(typeof v.rank=="number"?v.rank:1e9)-(typeof y.rank=="number"?y.rank:1e9)||(v.name<y.name?-1:1);for(let v of r.sort(g))p-=1e5,d[v.name]=p;for(let v of n){let{section:y}=v.completion;y&&(v.score+=d[typeof y=="string"?y:y.name])}}let s=[],c=null,f=l.compareCompletions;for(let d of n.sort((p,g)=>g.score-p.score||f(p.completion,g.completion))){let p=d.completion;!c||c.label!=p.label||c.detail!=p.detail||c.type!=null&&p.type!=null&&c.type!=p.type||c.apply!=p.apply||c.boost!=p.boost?s.push(d):uP(d.completion)>uP(c)&&(s[s.length-1]=d),c=d.completion}return s}class ku{constructor(t,n,r,i,a,l){this.options=t,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=a,this.disabled=l}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new ku(this.options,cP(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,l){if(i&&!l&&t.some(f=>f.isPending))return i.setDisabled();let s=zZ(t,n);if(!s.length)return i&&t.some(f=>f.isPending)?i.setDisabled():null;let c=n.facet(ln).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let f=i.options[i.selected].completion;for(let d=0;d<s.length;d++)if(s[d].completion==f){c=d;break}}return new ku(s,cP(r,c),{pos:t.reduce((f,d)=>d.hasResult()?Math.min(f,d.from):f,1e8),create:WZ,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new ku(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new ku(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class kg{constructor(t,n,r){this.active=t,this.id=n,this.open=r}static start(){return new kg(FZ,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(ln),a=(r.override||n.languageDataAt("autocomplete",Zo(n)).map(PZ)).map(c=>(this.active.find(d=>d.source==c)||new Yr(c,this.active.some(d=>d.state!=0)?1:0)).update(t,r));a.length==this.active.length&&a.every((c,f)=>c==this.active[f])&&(a=this.active);let l=this.open,s=t.effects.some(c=>c.is(ZO));l&&t.docChanged&&(l=l.map(t.changes)),t.selection||a.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!$Z(a,this.active)||s?l=ku.build(a,n,this.id,l,r,s):l&&l.disabled&&!a.some(c=>c.isPending)&&(l=null),!l&&a.every(c=>!c.isPending)&&a.some(c=>c.hasResult())&&(a=a.map(c=>c.hasResult()?new Yr(c.source,0):c));for(let c of t.effects)c.is(GO)&&(l=l&&l.setSelected(c.value,this.id));return a==this.active&&l==this.open?this:new kg(a,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?UZ:HZ}}function $Z(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}const UZ={"aria-autocomplete":"list"},HZ={};function cP(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const FZ=[];function VB(e,t){if(e.isUserEvent("input.complete")){let r=e.annotation(WB);if(r&&t.activateOnCompletion(r))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Yr{constructor(t,n,r=!1){this.source=t,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=VB(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new Yr(i.source,0)),r&4&&i.state==0&&(i=new Yr(this.source,1)),i=i.updateFor(t,r);for(let a of t.effects)if(a.is(Ag))i=new Yr(i.source,1,a.value);else if(a.is(Ah))i=new Yr(i.source,0);else if(a.is(ZO))for(let l of a.value)l.source==i.source&&(i=l);return i}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Zo(t.state))}}class Iu extends Yr{constructor(t,n,r,i,a,l){super(t,3,n),this.limit=r,this.result=i,this.from=a,this.to=l}hasResult(){return!0}updateFor(t,n){var r;if(!(n&3))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let a=t.changes.mapPos(this.from),l=t.changes.mapPos(this.to,1),s=Zo(t.state);if(s>l||!i||n&2&&(Zo(t.startState)==this.from||s<this.limit))return new Yr(this.source,n&4?1:0);let c=t.changes.mapPos(this.limit);return qZ(i.validFor,t.state,a,l)?new Iu(this.source,this.explicit,c,i,a,l):i.update&&(i=i.update(i,a,l,new FB(t.state,s,!1)))?new Iu(this.source,this.explicit,c,i,i.from,(r=i.to)!==null&&r!==void 0?r:Zo(t.state)):new Yr(this.source,1,this.explicit)}map(t){if(t.empty)return this;let n=this.result.map?this.result.map(this.result,t):this.result;return n?new Iu(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new Yr(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function qZ(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e=="function"?e(i,n,r,t):qB(e,!0).test(i)}const ZO=_e.define({map(e,t){return e.map(n=>n.map(t))}}),ir=Nn.define({create(){return kg.start()},update(e,t){return e.update(t)},provide:e=>[IO.from(e,t=>t.tooltip),de.contentAttributes.from(e,t=>t.attrs)]});function JO(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(ir).active.find(i=>i.source==t.source);return r instanceof Iu?(typeof n=="string"?e.dispatch({...DZ(e.state,n,r.from,r.to),annotations:WB.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}const WZ=LZ(ir,JO);function sm(e,t="option"){return n=>{let r=n.state.field(ir,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(ln).interactionDelay)return!1;let i=1,a;t=="page"&&(a=A3(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector("li").offsetHeight)-1));let{length:l}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:l-1;return s<0?s=t=="page"?0:l-1:s>=l&&(s=t=="page"?l-1:0),n.dispatch({effects:GO.of(s)}),!0}}const VZ=e=>{let t=e.state.field(ir,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(ln).interactionDelay?!1:JO(e,t.open.options[t.open.selected])},Fx=e=>e.state.field(ir,!1)?(e.dispatch({effects:Ag.of(!0)}),!0):!1,KZ=e=>{let t=e.state.field(ir,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:Ah.of(null)}),!0)};class XZ{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const QZ=50,YZ=1e3,GZ=_t.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(ir).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(ir),n=e.state.facet(ln);if(!e.selectionSet&&!e.docChanged&&e.startState.field(ir)==t)return;let r=e.transactions.some(a=>{let l=VB(a,n);return l&8||(a.selection||a.docChanged)&&!(l&3)});for(let a=0;a<this.running.length;a++){let l=this.running[a];if(r||l.context.abortOnDocChange&&e.docChanged||l.updates.length+e.transactions.length>QZ&&Date.now()-l.time>YZ){for(let s of l.context.abortListeners)try{s()}catch(c){lr(this.view.state,c)}l.context.abortListeners=null,this.running.splice(a--,1)}else l.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(a=>a.effects.some(l=>l.is(Ag)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(a=>a.isPending&&!this.running.some(l=>l.active.source==a.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let a of e.transactions)a.isUserEvent("input.type")?this.composing=2:this.composing==2&&a.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(ir);for(let n of t.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ln).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Zo(t),r=new FB(t,n,e.explicit,this.view),i=new XZ(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(a=>{i.context.aborted||(i.done=a||null,this.scheduleAccept())},a=>{this.view.dispatch({effects:Ah.of(null)}),lr(this.view.state,a)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ln).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(ln),r=this.view.state.field(ir);for(let i=0;i<this.running.length;i++){let a=this.running[i];if(a.done===void 0)continue;if(this.running.splice(i--,1),a.done){let s=Zo(a.updates.length?a.updates[0].startState:this.view.state),c=Math.min(s,a.done.from+(a.active.explicit?0:1)),f=new Iu(a.active.source,a.active.explicit,c,a.done,a.done.from,(e=a.done.to)!==null&&e!==void 0?e:s);for(let d of a.updates)f=f.update(d,n);if(f.hasResult()){t.push(f);continue}}let l=r.active.find(s=>s.source==a.active.source);if(l&&l.isPending)if(a.done==null){let s=new Yr(a.active.source,0);for(let c of a.updates)s=s.update(c,n);s.isPending||t.push(s)}else this.startQuery(l)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:ZO.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(ir,!1);if(t&&t.tooltip&&this.view.state.facet(ln).closeOnBlur){let n=t.open&&A3(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Ah.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Ag.of(!1)}),20),this.composing=0}}}),ZZ=typeof navigator=="object"&&/Win/.test(navigator.platform),JZ=vs.highest(de.domEventHandlers({keydown(e,t){let n=t.state.field(ir,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(ZZ&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(l=>l.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&JO(t,r),!1}})),eJ=de.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),kh={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Fo=_e.define({map(e,t){let n=t.mapPos(e,-1,Fn.TrackAfter);return n??void 0}}),eA=new class extends Xl{};eA.startSide=1;eA.endSide=-1;const KB=Nn.define({create(){return ze.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of t.effects)n.is(Fo)&&(e=e.update({add:[eA.range(n.value,n.value+1)]}));return e}});function tJ(){return[rJ,KB]}const qx="()[]{}<>«»»«[]{}";function XB(e){for(let t=0;t<qx.length;t+=2)if(qx.charCodeAt(t)==e)return qx.charAt(t+1);return bO(e<128?e:e+1)}function QB(e,t){return e.languageDataAt("closeBrackets",t)[0]||kh}const nJ=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),rJ=de.inputHandler.of((e,t,n,r)=>{if((nJ?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&Ui(rr(r,0))==1||t!=i.from||n!=i.to)return!1;let a=lJ(e.state,r);return a?(e.dispatch(a),!0):!1}),iJ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=QB(e,e.selection.main.head).brackets||kh.brackets,i=null,a=e.changeByRange(l=>{if(l.empty){let s=oJ(e.doc,l.head);for(let c of r)if(c==s&&Xv(e.doc,l.head)==XB(rr(c,0)))return{changes:{from:l.head-c.length,to:l.head+c.length},range:J.cursor(l.head-c.length)}}return{range:i=l}});return i||t(e.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},aJ=[{key:"Backspace",run:iJ}];function lJ(e,t){let n=QB(e,e.selection.main.head),r=n.brackets||kh.brackets;for(let i of r){let a=XB(rr(i,0));if(t==i)return a==i?cJ(e,i,r.indexOf(i+i+i)>-1,n):sJ(e,i,a,n.before||kh.before);if(t==a&&YB(e,e.selection.main.from))return uJ(e,i,a)}return null}function YB(e,t){let n=!1;return e.field(KB).between(0,e.doc.length,r=>{r==t&&(n=!0)}),n}function Xv(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Ui(rr(n,0)))}function oJ(e,t){let n=e.sliceString(t-2,t);return Ui(rr(n,0))==n.length?n:n.slice(1)}function sJ(e,t,n,r){let i=null,a=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:n,from:l.to}],effects:Fo.of(l.to+t.length),range:J.range(l.anchor+t.length,l.head+t.length)};let s=Xv(e.doc,l.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:l.head},effects:Fo.of(l.head+t.length),range:J.cursor(l.head+t.length)}:{range:i=l}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function uJ(e,t,n){let r=null,i=e.changeByRange(a=>a.empty&&Xv(e.doc,a.head)==n?{changes:{from:a.head,to:a.head+n.length,insert:n},range:J.cursor(a.head+n.length)}:r={range:a});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function cJ(e,t,n,r){let i=r.stringPrefixes||kh.stringPrefixes,a=null,l=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:t,from:s.to}],effects:Fo.of(s.to+t.length),range:J.range(s.anchor+t.length,s.head+t.length)};let c=s.head,f=Xv(e.doc,c),d;if(f==t){if(fP(e,c))return{changes:{insert:t+t,from:c},effects:Fo.of(c+t.length),range:J.cursor(c+t.length)};if(YB(e,c)){let g=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+g.length,insert:g},range:J.cursor(c+g.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=hP(e,c-2*t.length,i))>-1&&fP(e,d))return{changes:{insert:t+t+t+t,from:c},effects:Fo.of(c+t.length),range:J.cursor(c+t.length)};if(e.charCategorizer(c)(f)!=Ot.Word&&hP(e,c,i)>-1&&!fJ(e,c,t,i))return{changes:{insert:t+t,from:c},effects:Fo.of(c+t.length),range:J.cursor(c+t.length)}}return{range:a=s}});return a?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function fP(e,t){let n=Dn(e).resolveInner(t+1);return n.parent&&n.from==t}function fJ(e,t,n,r){let i=Dn(e).resolveInner(t,-1),a=r.reduce((l,s)=>Math.max(l,s.length),0);for(let l=0;l<5;l++){let s=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),c=s.indexOf(n);if(!c||c>-1&&r.indexOf(s.slice(0,c))>-1){let d=i.firstChild;for(;d&&d.from==i.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let f=i.to==t&&i.parent;if(!f)break;i=f}return!1}function hP(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=Ot.Word)return t;for(let i of n){let a=t-i.length;if(e.sliceDoc(a,t)==i&&r(e.sliceDoc(a-1,a))!=Ot.Word)return a}return-1}function hJ(e={}){return[JZ,ir,ln.of(e),GZ,dJ,eJ]}const GB=[{key:"Ctrl-Space",run:Fx},{mac:"Alt-`",run:Fx},{mac:"Alt-i",run:Fx},{key:"Escape",run:KZ},{key:"ArrowDown",run:sm(!0)},{key:"ArrowUp",run:sm(!1)},{key:"PageDown",run:sm(!0,"page")},{key:"PageUp",run:sm(!1,"page")},{key:"Enter",run:VZ}],dJ=vs.highest(zv.computeN([ln],e=>e.facet(ln).defaultKeymap?[GB]:[]));class dP{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class Bo{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let i=r.facet(Ch).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((v,y)=>v.from-y.from||v.to-y.to),l=new Ha,s=[],c=0,f=r.doc.iter(),d=0,p=r.doc.length;for(let v=0;;){let y=v==a.length?null:a[v];if(!y&&!s.length)break;let x,w;if(s.length)x=c,w=s.reduce((k,P)=>Math.min(k,P.to),y&&y.from>x?y.from:1e8);else{if(x=y.from,x>p)break;w=y.to,s.push(y),v++}for(;v<a.length;){let k=a[v];if(k.from==x&&(k.to>k.from||k.to==x))s.push(k),v++,w=Math.min(k.to,w);else{w=Math.min(k.from,w);break}}w=Math.min(w,p);let A=!1;if(s.some(k=>k.from==x&&(k.to==w||w==p))&&(A=x==w,!A&&w-x<10)){let k=x-(d+f.value.length);k>0&&(f.next(k),d=x);for(let P=x;;){if(P>=w){A=!0;break}if(!f.lineBreak&&d+f.value.length>P)break;P=d+f.value.length,d+=f.value.length,f.next()}}let C=CJ(s);if(A)l.add(x,x,Ce.widget({widget:new wJ(C),diagnostics:s.slice()}));else{let k=s.reduce((P,T)=>T.markClass?P+" "+T.markClass:P,"");l.add(x,w,Ce.mark({class:"cm-lintRange cm-lintRange-"+C+k,diagnostics:s.slice(),inclusiveEnd:s.some(P=>P.to>w)}))}if(c=w,c==p)break;for(let k=0;k<s.length;k++)s[k].to<=c&&s.splice(k--,1)}let g=l.finish();return new Bo(g,n,eo(g))}}function eo(e,t=null,n=0){let r=null;return e.between(n,1e9,(i,a,{spec:l})=>{if(!(t&&l.diagnostics.indexOf(t)<0))if(!r)r=new dP(i,a,t||l.diagnostics[0]);else{if(l.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new dP(r.from,a,r.diagnostic)}}),r}function pJ(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(Ch).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(l=>l.is(ZB))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function mJ(e,t){return e.field(Tr,!1)?t:t.concat(_e.appendConfig.of(EJ))}const ZB=_e.define(),tA=_e.define(),JB=_e.define(),Tr=Nn.define({create(){return new Bo(Ce.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let a=t.changes.mapPos(e.selected.from,1);r=eo(n,e.selected.diagnostic,a)||eo(n,null,a)}!n.size&&i&&t.state.facet(Ch).autoPanel&&(i=null),e=new Bo(n,i,r)}for(let n of t.effects)if(n.is(ZB)){let r=t.state.facet(Ch).autoPanel?n.value.length?Eh.open:null:e.panel;e=Bo.init(n.value,r,t.state)}else n.is(tA)?e=new Bo(e.diagnostics,n.value?Eh.open:null,e.selected):n.is(JB)&&(e=new Bo(e.diagnostics,e.panel,n.value));return e},provide:e=>[bh.from(e,t=>t.panel),de.decorations.from(e,t=>t.diagnostics)]}),gJ=Ce.mark({class:"cm-lintRange cm-lintRange-active"});function vJ(e,t,n){let{diagnostics:r}=e.state.field(Tr),i,a=-1,l=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(c,f,{spec:d})=>{if(t>=c&&t<=f&&(c==f||(t>c||n>0)&&(t<f||n<0)))return i=d.diagnostics,a=c,l=f,!1});let s=e.state.facet(Ch).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:l,above:!0,create(){return{dom:yJ(e,i)}}}:null}function yJ(e,t){return ot("ul",{class:"cm-tooltip-lint"},t.map(n=>tz(e,n,!1)))}const bJ=e=>{let t=e.state.field(Tr,!1);(!t||!t.panel)&&e.dispatch({effects:mJ(e.state,[tA.of(!0)])});let n=LO(e,Eh.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},pP=e=>{let t=e.state.field(Tr,!1);return!t||!t.panel?!1:(e.dispatch({effects:tA.of(!1)}),!0)},xJ=e=>{let t=e.state.field(Tr,!1);if(!t)return!1;let n=e.state.selection.main,r=eo(t.diagnostics,null,n.to+1);return!r&&(r=eo(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),vQ(e,r.from,1,{tooltip:nz,until:i=>i.docChanged||i.newSelection.main.head<r.from||i.newSelection.main.head>r.to}),!0)},SJ=[{key:"Mod-Shift-m",run:bJ,preventDefault:!0},{key:"F8",run:xJ}],Ch=me.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...aa(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:mP,tooltipFilter:mP,needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n,hideOn:(t,n)=>t?n?(r,i,a)=>t(r,i,a)||n(r,i,a):t:n,autoPanel:(t,n)=>t||n})}}});function mP(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function ez(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!t.some(a=>a.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}function tz(e,t,n){var r;let i=n?ez(t.actions):[];return ot("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},ot("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((a,l)=>{let s=!1,c=v=>{if(v.preventDefault(),s)return;s=!0;let y=eo(e.state.field(Tr).diagnostics,t);y&&a.apply(e,y.from,y.to)},{name:f}=a,d=i[l]?f.indexOf(i[l]):-1,p=d<0?f:[f.slice(0,d),ot("u",f.slice(d,d+1)),f.slice(d+1)],g=a.markClass?" "+a.markClass:"";return ot("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${f}${d<0?"":` (access key "${i[l]})"`}.`},p)}),t.source&&ot("div",{class:"cm-diagnosticSource"},t.source))}class wJ extends la{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return ot("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class gP{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=tz(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Eh{constructor(t){this.view=t,this.items=[];let n=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)pP(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],l=ez(a.actions);for(let s=0;s<l.length;s++)if(l[s].toUpperCase().charCodeAt(0)==i.keyCode){let c=eo(this.view.state.field(Tr).diagnostics,a);c&&a.actions[s].apply(t,c.from,c.to)}}else return;i.preventDefault()}},r=i=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(i.target)&&this.moveSelection(a)};this.list=ot("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=ot("div",{class:"cm-panel-lint"},this.list,ot("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>pP(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Tr).selected;if(!t)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==t.diagnostic)return n;return-1}update(){let{diagnostics:t,selected:n}=this.view.state.field(Tr),r=0,i=!1,a=null,l=new Set;for(t.between(0,this.view.state.doc.length,(s,c,{spec:f})=>{for(let d of f.diagnostics){if(l.has(d))continue;l.add(d);let p=-1,g;for(let v=r;v<this.items.length;v++)if(this.items[v].diagnostic==d){p=v;break}p<0?(g=new gP(this.view,d),this.items.splice(r,0,g),i=!0):(g=this.items[p],p>r&&(this.items.splice(r,p-r),i=!0)),n&&g.diagnostic==n.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),a=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new gP(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),a?(this.list.setAttribute("aria-activedescendant",a.id),this.view.requestMeasure({key:this,read:()=>({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:c})=>{let f=c.height/this.list.offsetHeight;s.top<c.top?this.list.scrollTop-=(c.top-s.top)/f:s.bottom>c.bottom&&(this.list.scrollTop+=(s.bottom-c.bottom)/f)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function n(){let r=t;t=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(Tr),r=eo(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:JB.of(r)})}static open(t){return new Eh(t)}}function OJ(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function um(e){return OJ(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const AJ=de.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:um("#f11")},".cm-lintRange-warning":{backgroundImage:um("orange")},".cm-lintRange-info":{backgroundImage:um("#999")},".cm-lintRange-hint":{backgroundImage:um("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function kJ(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function CJ(e){let t="hint",n=1;for(let r of e){let i=kJ(r.severity);i>n&&(n=i,t=r.severity)}return t}const nz=gQ(vJ,{hideOn:pJ}),EJ=[Tr,de.decorations.compute([Tr],e=>{let{selected:t,panel:n}=e.field(Tr);return!t||!n||t.from==t.to?Ce.none:Ce.set([gJ.range(t.from,t.to)])}),nz,AJ];var vP=function(t){t===void 0&&(t={});var n=t,r=n.crosshairCursor,i=r===void 0?!1:r,a=[];t.closeBracketsKeymap!==!1&&(a=a.concat(aJ)),t.defaultKeymap!==!1&&(a=a.concat(GG)),t.searchKeymap!==!1&&(a=a.concat(AZ)),t.historyKeymap!==!1&&(a=a.concat(iG)),t.foldKeymap!==!1&&(a=a.concat(yY)),t.completionKeymap!==!1&&(a=a.concat(GB)),t.lintKeymap!==!1&&(a=a.concat(SJ));var l=[];return t.lineNumbers!==!1&&l.push(DQ()),t.highlightActiveLineGutter!==!1&&l.push(NQ()),t.highlightSpecialChars!==!1&&l.push(WX()),t.history!==!1&&l.push(QY()),t.foldGutter!==!1&&l.push(wY()),t.drawSelection!==!1&&l.push(RX()),t.dropCursor!==!1&&l.push(zX()),t.allowMultipleSelections!==!1&&l.push(qe.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&l.push(sY()),t.syntaxHighlighting!==!1&&l.push(G3(CY,{fallback:!0})),t.bracketMatching!==!1&&l.push(NY()),t.closeBrackets!==!1&&l.push(tJ()),t.autocompletion!==!1&&l.push(hJ()),t.rectangularSelection!==!1&&l.push(aQ()),i!==!1&&l.push(sQ()),t.highlightActiveLine!==!1&&l.push(GX()),t.highlightSelectionMatches!==!1&&l.push(rZ()),t.tabSize&&typeof t.tabSize=="number"&&l.push(Uv.of(" ".repeat(t.tabSize))),l.concat([zv.of(a.flat())]).filter(Boolean)};const TJ="#e5c07b",yP="#e06c75",MJ="#56b6c2",DJ="#ffffff",$m="#abb2bf",qS="#7d8799",PJ="#61afef",_J="#98c379",bP="#d19a66",NJ="#c678dd",RJ="#21252b",xP="#2c313a",SP="#282c34",Wx="#353a42",jJ="#3E4451",wP="#528bff",IJ=de.theme({"&":{color:$m,backgroundColor:SP},".cm-content":{caretColor:wP},".cm-cursor, .cm-dropCursor":{borderLeftColor:wP},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:jJ},".cm-panels":{backgroundColor:RJ,color:$m},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:SP,color:qS,border:"none"},".cm-activeLineGutter":{backgroundColor:xP},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Wx},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Wx,borderBottomColor:Wx},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:xP,color:$m}}},{dark:!0}),LJ=Xh.define([{tag:Y.keyword,color:NJ},{tag:[Y.name,Y.deleted,Y.character,Y.propertyName,Y.macroName],color:yP},{tag:[Y.function(Y.variableName),Y.labelName],color:PJ},{tag:[Y.color,Y.constant(Y.name),Y.standard(Y.name)],color:bP},{tag:[Y.definition(Y.name),Y.separator],color:$m},{tag:[Y.typeName,Y.className,Y.number,Y.changed,Y.annotation,Y.modifier,Y.self,Y.namespace],color:TJ},{tag:[Y.operator,Y.operatorKeyword,Y.url,Y.escape,Y.regexp,Y.link,Y.special(Y.string)],color:MJ},{tag:[Y.meta,Y.comment],color:qS},{tag:Y.strong,fontWeight:"bold"},{tag:Y.emphasis,fontStyle:"italic"},{tag:Y.strikethrough,textDecoration:"line-through"},{tag:Y.link,color:qS,textDecoration:"underline"},{tag:Y.heading,fontWeight:"bold",color:yP},{tag:[Y.atom,Y.bool,Y.special(Y.variableName)],color:bP},{tag:[Y.processingInstruction,Y.string,Y.inserted],color:_J},{tag:Y.invalid,color:DJ}]),BJ=[IJ,G3(LJ)];var zJ=de.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),$J=function(t){t===void 0&&(t={});var n=t,r=n.indentWithTab,i=r===void 0?!0:r,a=n.editable,l=a===void 0?!0:a,s=n.readOnly,c=s===void 0?!1:s,f=n.theme,d=f===void 0?"light":f,p=n.placeholder,g=p===void 0?"":p,v=n.basicSetup,y=v===void 0?!0:v,x=[];switch(i&&x.unshift(zv.of([ZG])),y&&(typeof y=="boolean"?x.unshift(vP()):x.unshift(vP(y))),g&&x.unshift(tQ(g)),d){case"light":x.push(zJ);break;case"dark":x.push(BJ);break;case"none":break;default:x.push(d);break}return l===!1&&x.push(de.editable.of(!1)),c&&x.push(qe.readOnly.of(!0)),[...x]},UJ=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class HJ{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class OP{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Vx=null,FJ=()=>typeof window>"u"?new OP:(Vx||(Vx=new OP),Vx),AP=ia.define(),qJ=200,WJ=[];function VJ(e){var t=e.value,n=e.selection,r=e.onChange,i=e.onStatistics,a=e.onCreateEditor,l=e.onUpdate,s=e.extensions,c=s===void 0?WJ:s,f=e.autoFocus,d=e.theme,p=d===void 0?"light":d,g=e.height,v=g===void 0?null:g,y=e.minHeight,x=y===void 0?null:y,w=e.maxHeight,A=w===void 0?null:w,C=e.width,k=C===void 0?null:C,P=e.minWidth,T=P===void 0?null:P,D=e.maxWidth,N=D===void 0?null:D,I=e.placeholder,U=I===void 0?"":I,K=e.editable,V=K===void 0?!0:K,B=e.readOnly,ae=B===void 0?!1:B,ie=e.indentWithTab,oe=ie===void 0?!0:ie,z=e.basicSetup,G=z===void 0?!0:z,ne=e.root,ce=e.initialState,fe=O.useState(),R=fe[0],X=fe[1],re=O.useState(),le=re[0],ge=re[1],Oe=O.useState(),De=Oe[0],mt=Oe[1],se=O.useState(()=>({current:null}))[0],Te=O.useState(()=>({current:null}))[0],Ee=de.theme({"&":{height:v,minHeight:x,maxHeight:A,width:k,minWidth:T,maxWidth:N},"& .cm-scroller":{height:"100% !important"}}),ue=de.updateListener.of(xe=>{if(xe.docChanged&&typeof r=="function"&&!xe.transactions.some(sa=>sa.annotation(AP))){se.current?se.current.reset():(se.current=new HJ(()=>{if(Te.current){var sa=Te.current;Te.current=null,sa()}se.current=null},qJ),FJ().add(se.current));var gt=xe.state.doc,dn=gt.toString();r(dn,xe)}i&&i(UJ(xe))}),Nt=$J({theme:p,editable:V,readOnly:ae,placeholder:U,indentWithTab:oe,basicSetup:G}),Ne=[ue,Ee,...Nt];return l&&typeof l=="function"&&Ne.push(de.updateListener.of(l)),Ne=Ne.concat(c),O.useLayoutEffect(()=>{if(R&&!De){var xe={doc:t,selection:n,extensions:Ne},gt=ce?qe.fromJSON(ce.json,xe,ce.fields):qe.create(xe);if(mt(gt),!le){var dn=new de({state:gt,parent:R,root:ne});ge(dn),a&&a(dn,gt)}}return()=>{le&&(mt(void 0),ge(void 0))}},[R,De]),O.useEffect(()=>{e.container&&X(e.container)},[e.container]),O.useEffect(()=>()=>{le&&(le.destroy(),ge(void 0)),se.current&&(se.current.cancel(),se.current=null)},[le]),O.useEffect(()=>{f&&le&&le.focus()},[f,le]),O.useEffect(()=>{le&&le.dispatch({effects:_e.reconfigure.of(Ne)})},[p,c,v,x,A,k,T,N,U,V,ae,oe,G,r,l]),O.useEffect(()=>{if(t!==void 0){var xe=le?le.state.doc.toString():"";if(le&&t!==xe){var gt=se.current&&!se.current.isDone,dn=()=>{le&&t!==le.state.doc.toString()&&le.dispatch({changes:{from:0,to:le.state.doc.toString().length,insert:t||""},annotations:[AP.of(!0)]})};gt?Te.current=dn:dn()}}},[t,le]),{state:De,setState:mt,view:le,setView:ge,container:R,setContainer:X}}var KJ=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],rz=O.forwardRef((e,t)=>{var n=e.className,r=e.value,i=r===void 0?"":r,a=e.selection,l=e.extensions,s=l===void 0?[]:l,c=e.onChange,f=e.onStatistics,d=e.onCreateEditor,p=e.onUpdate,g=e.autoFocus,v=e.theme,y=v===void 0?"light":v,x=e.height,w=e.minHeight,A=e.maxHeight,C=e.width,k=e.minWidth,P=e.maxWidth,T=e.basicSetup,D=e.placeholder,N=e.indentWithTab,I=e.editable,U=e.readOnly,K=e.root,V=e.initialState,B=S7(e,KJ),ae=O.useRef(null),ie=VJ({root:K,value:i,autoFocus:g,theme:y,height:x,minHeight:w,maxHeight:A,width:C,minWidth:k,maxWidth:P,basicSetup:T,placeholder:D,indentWithTab:N,editable:I,readOnly:U,selection:a,onChange:c,onStatistics:f,onCreateEditor:d,onUpdate:p,extensions:s,initialState:V}),oe=ie.state,z=ie.view,G=ie.container,ne=ie.setContainer;O.useImperativeHandle(t,()=>({editor:ae.current,state:oe,view:z}),[ae,G,oe,z]);var ce=O.useCallback(R=>{ae.current=R,ne(R)},[ne]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var fe=typeof y=="string"?"cm-theme-"+y:"cm-theme";return M.jsx("div",Y1({ref:ce,className:""+fe+(n?" "+n:"")},B))});rz.displayName="CodeMirror";var kP={};class Cg{constructor(t,n,r,i,a,l,s,c,f,d=0,p){this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=a,this.score=l,this.buffer=s,this.bufferBase=c,this.curContext=f,this.lookAhead=d,this.parent=p}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,r=0){let i=t.parser.context;return new Cg(t,[],n,r,r,0,[],0,i?new CP(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let r=t>>19,i=t&65535,{parser:a}=this.p,l=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),s=a.dynamicPrecedence(i);if(s&&(this.score+=s),r==0){i<a.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(a.getGoto(this.state,i,!0),this.reducePos),i<a.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,l?8:4,!0),this.reduceContext(i,this.reducePos);return}let c=this.stack.length-(r-1)*3-(t&262144?6:0),f=c?this.stack[c-2]:this.p.ranges[0].from;i<a.minRepeatTerm&&f==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let d=this.reducePos-f;d>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(f==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=f,this.p.lastBigReductionSize=d));let p=c?this.stack[c-1]:0,g=this.bufferBase+this.buffer.length-p;if(i<a.minRepeatTerm||t&131072){let v=a.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,f,v,g+4,!0)}if(t&262144)this.state=this.stack[c];else{let v=this.stack[c-3];this.state=a.getGoto(v,i,!0)}for(;this.stack.length>c;)this.stack.pop();this.reduceContext(i,f)}storeNode(t,n,r,i=4,a=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let l=this.buffer.length;if(l>0&&this.buffer[l-4]==0&&this.buffer[l-1]>-1){if(n==r)return;if(this.buffer[l-2]>=n){this.buffer[l-2]=r;return}}}if(!a||this.pos==r)this.buffer.push(t,n,r,i);else{let l=this.buffer.length;if(l>0&&(this.buffer[l-4]!=0||this.buffer[l-1]<0)){let s=!1;for(let c=l;c>0&&this.buffer[c-2]>r;c-=4)if(this.buffer[c-1]>=0){s=!0;break}if(s)for(;l>0&&this.buffer[l-2]>r;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,i>4&&(i-=4)}this.buffer[l]=t,this.buffer[l+1]=n,this.buffer[l+2]=r,this.buffer[l+3]=i}}shift(t,n,r,i){if(t&131072)this.pushState(t&65535,this.pos);else if((t&262144)==0){let a=t,{parser:l}=this.p;this.pos=i;let s=l.stateFlag(a,1);!s&&(i>r||n<=l.maxNode)&&(this.reducePos=i),this.pushState(a,s?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=l.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(t,n,r,i){t&65536?this.reduce(t):this.shift(t,n,r,i)}useNode(t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=t)&&(this.p.reused.push(t),r++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new Cg(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let r=t<=this.p.parser.maxNode;r&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new XJ(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let a=0,l;a<n.length;a+=2)(l=n[a+1])!=this.state&&this.p.parser.hasAction(l,t)&&i.push(n[a],l);if(this.stack.length<120)for(let a=0;i.length<8&&a<n.length;a+=2){let l=n[a+1];i.some((s,c)=>c&1&&s==l)||i.push(n[a],l)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let a=n[i+1];if(a==this.state)continue;let l=this.split();l.pushState(a,this.pos),l.storeNode(0,l.pos,l.pos,4,!0),l.shiftContext(n[i],this.pos),l.reducePos=this.pos,l.score-=200,r.push(l)}return r}forceReduce(){let{parser:t}=this.p,n=t.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!t.validAction(this.state,n)){let r=n>>19,i=n&65535,a=this.stack.length-r*3;if(a<0||t.getGoto(this.stack[a],i,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;n=l}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],r=(i,a)=>{if(!n.includes(i))return n.push(i),t.allActions(i,l=>{if(!(l&393216))if(l&65536){let s=(l>>19)-a;if(s>1){let c=l&65535,f=this.stack.length-s*3;if(f>=0&&t.getGoto(this.stack[f],c,!1)>=0)return s<<19|65536|c}}else{let s=r(l,a+1);if(s!=null)return s}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=t.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(n)))}reduceContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(n)))}emitContext(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let n=new CP(this.curContext.tracker,t);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(t){return t<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=t,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class CP{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class XJ{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,r=t>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class Eg{constructor(t,n,r){this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new Eg(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Eg(this.stack,this.pos,this.index)}}function cm(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let l=e.charCodeAt(r++),s=!1;if(l==126){a=65535;break}l>=92&&l--,l>=34&&l--;let c=l-32;if(c>=46&&(c-=46,s=!0),a+=c,s)break;a*=46}n?n[i++]=a:n=new t(a)}return n}class Um{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const EP=new Um;class QJ{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=EP,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let r=this.range,i=this.rangeIndex,a=this.pos+t;for(;a<r.from;){if(!i)return null;let l=this.ranges[--i];a-=r.from-l.to,r=l}for(;n<0?a>r.to:a>=r.to;){if(i==this.ranges.length-1)return null;let l=this.ranges[++i];a+=l.from-r.to,r=l}return a}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let n of this.ranges)if(n.to>t)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+t,i=this.chunk.charCodeAt(n);else{let a=this.resolveOffset(t,1);if(a==null)return-1;if(r=a,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let l=this.rangeIndex,s=this.range;for(;s.to<=r;)s=this.ranges[++l];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>s.to&&(this.chunk2=this.chunk2.slice(0,s.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(t,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=r}acceptTokenTo(t,n){this.token.value=t,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),n=this.pos+t.length;this.chunk=n>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=EP,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,n){if(t>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>t&&(r+=this.input.read(Math.max(i.from,t),Math.min(i.to,n)))}return r}}class Lu{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:r}=n.p;YJ(this.data,t,n,this.id,r.data,r.tokenPrecTable)}}Lu.prototype.contextual=Lu.prototype.fallback=Lu.prototype.extend=!1;Lu.prototype.fallback=Lu.prototype.extend=!1;class Qv{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function YJ(e,t,n,r,i,a){let l=0,s=1<<r,{dialect:c}=n.p.parser;e:for(;(s&e[l])!=0;){let f=e[l+1];for(let v=l+3;v<f;v+=2)if((e[v+1]&s)>0){let y=e[v];if(c.allows(y)&&(t.token.value==-1||t.token.value==y||GJ(y,t.token.value,i,a))){t.acceptToken(y);break}}let d=t.next,p=0,g=e[l+2];if(t.next<0&&g>p&&e[f+g*3-3]==65535){l=e[f+g*3-1];continue e}for(;p<g;){let v=p+g>>1,y=f+v+(v<<1),x=e[y],w=e[y+1]||65536;if(d<x)g=v;else if(d>=w)p=v+1;else{l=e[y+2],t.advance();continue e}}break}}function TP(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function GJ(e,t,n,r){let i=TP(n,r,t);return i<0||TP(n,r,e)<i}const Ar=typeof process<"u"&&kP&&/\bparse\b/.test(kP.LOG);let Kx=null;function MP(e,t,n){let r=e.cursor(Dt.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class ZJ{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?MP(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?MP(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let a=r.children[i],l=this.start[n]+r.positions[i];if(l>t)return this.nextStart=l,null;if(a instanceof Lt){if(l==t){if(l<this.safeFrom)return null;let s=l+a.length;if(s<=this.safeTo){let c=a.prop(Ie.lookAhead);if(!c||s+c<this.fragment.to)return a}}this.index[n]++,l+a.length>=Math.max(this.safeFrom,t)&&(this.trees.push(a),this.start.push(l),this.index.push(0))}else this.index[n]++,this.nextStart=l+a.length}}}class JJ{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(r=>new Um)}getActions(t){let n=0,r=null,{parser:i}=t.p,{tokenizers:a}=i,l=i.stateSlot(t.state,3),s=t.curContext?t.curContext.hash:0,c=0;for(let f=0;f<a.length;f++){if((1<<f&l)==0)continue;let d=a[f],p=this.tokens[f];if(!(r&&!d.fallback)&&((d.contextual||p.start!=t.pos||p.mask!=l||p.context!=s)&&(this.updateCachedToken(p,d,t),p.mask=l,p.context=s),p.lookAhead>p.end+25&&(c=Math.max(p.lookAhead,c)),p.value!=0)){let g=n;if(p.extended>-1&&(n=this.addActions(t,p.extended,p.end,n)),n=this.addActions(t,p.value,p.end,n),!d.extend&&(r=p,n>g))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!r&&t.pos==this.stream.end&&(r=new Um,r.value=t.p.parser.eofTerm,r.start=r.end=t.pos,n=this.addActions(t,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new Um,{pos:r,p:i}=t;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(t,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,t),r),t.value>-1){let{parser:a}=r.p;for(let l=0;l<a.specialized.length;l++)if(a.specialized[l]==t.value){let s=a.specializers[l](this.stream.read(t.start,t.end),r);if(s>=0&&r.p.parser.dialect.allows(s>>1)){(s&1)==0?t.value=s>>1:t.extended=s>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,n,r,i){for(let a=0;a<i;a+=3)if(this.actions[a]==t)return i;return this.actions[i++]=t,this.actions[i++]=n,this.actions[i++]=r,i}addActions(t,n,r,i){let{state:a}=t,{parser:l}=t.p,{data:s}=l;for(let c=0;c<2;c++)for(let f=l.stateSlot(a,c?2:1);;f+=3){if(s[f]==65535)if(s[f+1]==1)f=Ta(s,f+2);else{i==0&&s[f+1]==2&&(i=this.putAction(Ta(s,f+2),n,r,i));break}s[f]==n&&(i=this.putAction(Ta(s,f+1),n,r,i))}return i}}class eee{constructor(t,n,r,i){this.parser=t,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new QJ(n,i),this.tokens=new JJ(t,this.stream),this.topTerm=t.top[1];let{from:a}=i[0];this.stacks=[Cg.start(this,t.top[0],a)],this.fragments=r.length&&this.stream.end-a>t.bufferLength*4?new ZJ(r,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,r=this.stacks=[],i,a;if(this.bigReductionCount>300&&t.length==1){let[l]=t;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;l<t.length;l++){let s=t[l];for(;;){if(this.tokens.mainToken=null,s.pos>n)r.push(s);else{if(this.advanceStack(s,r,t))continue;{i||(i=[],a=[]),i.push(s);let c=this.tokens.getMainToken(s);a.push(c.value,c.end)}}break}}if(!r.length){let l=i&&ree(i);if(l)return Ar&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw Ar&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let l=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,a,r);if(l)return Ar&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(r.length>l)for(r.sort((s,c)=>c.score-s.score);r.length>l;)r.pop();r.some(s=>s.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let l=0;l<r.length-1;l++){let s=r[l];for(let c=l+1;c<r.length;c++){let f=r[c];if(s.sameState(f)||s.buffer.length>500&&f.buffer.length>500)if((s.score-f.score||s.buffer.length-f.buffer.length)>0)r.splice(c--,1);else{r.splice(l--,1);continue e}}}r.length>12&&(r.sort((l,s)=>s.score-l.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let l=1;l<r.length;l++)r[l].pos<this.minStackPos&&(this.minStackPos=r[l].pos);return null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,n,r){let i=t.pos,{parser:a}=this,l=Ar?this.stackID(t)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let f=t.curContext&&t.curContext.tracker.strict,d=f?t.curContext.hash:0;for(let p=this.fragments.nodeAt(i);p;){let g=this.parser.nodeSet.types[p.type.id]==p.type?a.getGoto(t.state,p.type.id):-1;if(g>-1&&p.length&&(!f||(p.prop(Ie.contextHash)||0)==d))return t.useNode(p,g),Ar&&console.log(l+this.stackID(t)+` (via reuse of ${a.getName(p.type.id)})`),!0;if(!(p instanceof Lt)||p.children.length==0||p.positions[0]>0)break;let v=p.children[0];if(v instanceof Lt&&p.positions[0]==0)p=v;else break}}let s=a.stateSlot(t.state,4);if(s>0)return t.reduce(s),Ar&&console.log(l+this.stackID(t)+` (via always-reduce ${a.getName(s&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let f=0;f<c.length;){let d=c[f++],p=c[f++],g=c[f++],v=f==c.length||!r,y=v?t:t.split(),x=this.tokens.mainToken;if(y.apply(d,p,x?x.start:y.pos,g),Ar&&console.log(l+this.stackID(y)+` (via ${(d&65536)==0?"shift":`reduce of ${a.getName(d&65535)}`} for ${a.getName(p)} @ ${i}${y==t?"":", split"})`),v)return!0;y.pos>i?n.push(y):r.push(y)}return!1}advanceFully(t,n){let r=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>r)return DP(t,n),!0}}runRecovery(t,n,r){let i=null,a=!1;for(let l=0;l<t.length;l++){let s=t[l],c=n[l<<1],f=n[(l<<1)+1],d=Ar?this.stackID(s)+" -> ":"";if(s.deadEnd&&(a||(a=!0,s.restart(),Ar&&console.log(d+this.stackID(s)+" (restarted)"),this.advanceFully(s,r))))continue;let p=s.split(),g=d;for(let v=0;v<10&&p.forceReduce()&&(Ar&&console.log(g+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,r));v++)Ar&&(g=this.stackID(p)+" -> ");for(let v of s.recoverByInsert(c))Ar&&console.log(d+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,r);this.stream.end>s.pos?(f==s.pos&&(f++,c=0),s.recoverByDelete(c,f),Ar&&console.log(d+this.stackID(s)+` (via recover-delete ${this.parser.getName(c)})`),DP(s,r)):(!i||i.score<p.score)&&(i=p)}return i}stackToTree(t){return t.close(),Lt.build({buffer:Eg.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let n=(Kx||(Kx=new WeakMap)).get(t);return n||Kx.set(t,n=String.fromCodePoint(this.nextStackID++)),n+t}}function DP(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class tee{constructor(t,n,r){this.source=t,this.flags=n,this.disabled=r}allows(t){return!this.disabled||this.disabled[t]==0}}const Xx=e=>e;class nee{constructor(t){this.start=t.start,this.shift=t.shift||Xx,this.reduce=t.reduce||Xx,this.reuse=t.reuse||Xx,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class Tg extends R3{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let s=0;s<t.repeatNodeCount;s++)n.push("");let r=Object.keys(t.topRules).map(s=>t.topRules[s][1]),i=[];for(let s=0;s<n.length;s++)i.push([]);function a(s,c,f){i[s].push([c,c.deserialize(String(f))])}if(t.nodeProps)for(let s of t.nodeProps){let c=s[0];typeof c=="string"&&(c=Ie[c]);for(let f=1;f<s.length;){let d=s[f++];if(d>=0)a(d,c,s[f++]);else{let p=s[f+-d];for(let g=-d;g>0;g--)a(s[f++],c,p);f++}}}this.nodeSet=new BO(n.map((s,c)=>hr.define({name:c>=this.minRepeatTerm?void 0:s,id:c,props:i[c],top:r.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=D3;let l=cm(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let s=0;s<this.specializerSpecs.length;s++)this.specialized[s]=this.specializerSpecs[s].term;this.specializers=this.specializerSpecs.map(PP),this.states=cm(t.states,Uint32Array),this.data=cm(t.stateData),this.goto=cm(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(s=>typeof s=="number"?new Lu(l,s):s),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,r){let i=new eee(this,t,n,r);for(let a of this.wrappers)i=a(i,t,n,r);return i}getGoto(t,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let a=i[n+1];;){let l=i[a++],s=l&1,c=i[a++];if(s&&r)return c;for(let f=a+(l>>1);a<f;a++)if(i[a]==t)return c;if(s)return-1}}hasAction(t,n){let r=this.data;for(let i=0;i<2;i++)for(let a=this.stateSlot(t,i?2:1),l;;a+=3){if((l=r[a])==65535)if(r[a+1]==1)l=r[a=Ta(r,a+2)];else{if(r[a+1]==2)return Ta(r,a+2);break}if(l==n||l==0)return Ta(r,a+1)}return 0}stateSlot(t,n){return this.states[t*6+n]}stateFlag(t,n){return(this.stateSlot(t,0)&n)>0}validAction(t,n){return!!this.allActions(t,r=>r==n?!0:null)}allActions(t,n){let r=this.stateSlot(t,4),i=r?n(r):void 0;for(let a=this.stateSlot(t,1);i==null;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=Ta(this.data,a+2);else break;i=n(Ta(this.data,a+1))}return i}nextStates(t){let n=[];for(let r=this.stateSlot(t,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Ta(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((a,l)=>l&1&&a==i)||n.push(this.data[r],i)}}return n}configure(t){let n=Object.assign(Object.create(Tg.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let r=this.topRules[t.top];if(!r)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=r}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=t.tokenizers.find(a=>a.from==r);return i?i.to:r})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let a=t.specializers.find(s=>s.from==r.external);if(!a)return r;let l=Object.assign(Object.assign({},r),{external:a.to});return n.specializers[i]=PP(l),l})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(t)for(let a of t.split(" ")){let l=n.indexOf(a);l>=0&&(r[l]=!0)}let i=null;for(let a=0;a<n.length;a++)if(!r[a])for(let l=this.dialects[n[a]],s;(s=this.data[l++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[s]=1;return new tee(t,r,i)}static deserialize(t){return new Tg(t)}}function Ta(e,t){return e[t]|e[t+1]<<16}function ree(e){let t=null;for(let n of e){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function PP(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}const xu=63,_P=64,iee=1,aee=2,iz=3,lee=4,az=5,oee=6,see=7,lz=65,uee=66,cee=8,fee=9,hee=10,dee=11,pee=12,oz=13,mee=19,gee=20,vee=29,yee=33,bee=34,xee=47,See=0,nA=1,WS=2,Th=3,VS=4;class zo{constructor(t,n,r){this.parent=t,this.depth=n,this.type=r,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+r}}zo.top=new zo(null,-1,See);function th(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let i=e.peek(r);if(Wa(i)||i==-1)return n}}function KS(e){return e==32||e==9}function Wa(e){return e==10||e==13}function sz(e){return KS(e)||Wa(e)}function qo(e){return e<0||sz(e)}const wee=new nee({start:zo.top,reduce(e,t){return e.type==Th&&(t==gee||t==bee)?e.parent:e},shift(e,t,n,r){if(t==iz)return new zo(e,th(r,r.pos),nA);if(t==lz||t==az)return new zo(e,th(r,r.pos),WS);if(t==xu)return e.parent;if(t==mee||t==yee)return new zo(e,0,Th);if(t==oz&&e.type==VS)return e.parent;if(t==xee){let i=/[1-9]/.exec(r.read(r.pos,n.pos));if(i)return new zo(e,e.depth+ +i[0],VS)}return e},hash(e){return e.hash}});function Gu(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&qo(e.peek(n+3))}const Oee=new Qv((e,t)=>{if(e.next==-1&&t.canShift(_P))return e.acceptToken(_P);let n=e.peek(-1);if((Wa(n)||n<0)&&t.context.type!=Th){if(Gu(e,45))if(t.canShift(xu))e.acceptToken(xu);else return e.acceptToken(iee,3);if(Gu(e,46))if(t.canShift(xu))e.acceptToken(xu);else return e.acceptToken(aee,3);let r=0;for(;e.next==32;)r++,e.advance();(r<t.context.depth||r==t.context.depth&&t.context.type==nA&&(e.next!=45||!qo(e.peek(1))))&&e.next!=-1&&!Wa(e.next)&&e.next!=35&&e.acceptToken(xu,-r)}},{contextual:!0}),Aee=new Qv((e,t)=>{if(t.context.type==Th){e.next==63&&(e.advance(),qo(e.next)&&e.acceptToken(see));return}if(e.next==45)e.advance(),qo(e.next)&&e.acceptToken(t.context.type==nA&&t.context.depth==th(e,e.pos-1)?lee:iz);else if(e.next==63)e.advance(),qo(e.next)&&e.acceptToken(t.context.type==WS&&t.context.depth==th(e,e.pos-1)?oee:az);else{let n=e.pos;for(;;)if(KS(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)uz(e);else if(e.next==38)XS(e);else if(e.next==42){XS(e);break}else if(e.next==39||e.next==34){if(rA(e,!0))break;return}else if(e.next==91||e.next==123){if(!Cee(e))return;break}else{cz(e,!0,!1,0);break}for(;KS(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(vee))return;let r=e.peek(1);qo(r)&&e.acceptTokenTo(t.context.type==WS&&t.context.depth==th(e,n)?uee:lz,n)}}},{contextual:!0});function kee(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function NP(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function RP(e,t){return e.next==37?(e.advance(),NP(e.next)&&e.advance(),NP(e.next)&&e.advance(),!0):kee(e.next)||t&&e.next==44?(e.advance(),!0):!1}function uz(e){if(e.advance(),e.next==60){for(e.advance();;)if(!RP(e,!0)){e.next==62&&e.advance();break}}else for(;RP(e,!1););}function XS(e){for(e.advance();!qo(e.next)&&Mg(e.next)!="f";)e.advance()}function rA(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let a=e.next;if(a<0)break;if(e.advance(),a==n)if(a==39)if(e.next==39)e.advance();else break;else break;else if(a==92&&n==34)e.next>=0&&e.advance();else if(Wa(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function Cee(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!rA(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||Wa(e.next))return!1;e.advance()}}const Eee="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function Mg(e){return e<33?"u":e>125?"s":Eee[e-33]}function Qx(e,t){let n=Mg(e);return n!="u"&&!(t&&n=="f")}function cz(e,t,n,r){if(Mg(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&Qx(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,l=0,s=r+1;for(;sz(a);){if(Wa(a)){if(t)return!1;s=0}else s++;a=e.peek(++l)}if(!(a>=0&&(a==58?Qx(e.peek(l+1),n):a==35?e.peek(l-1)!=32:Qx(a,n)))||!n&&s<=r||s==0&&!n&&(Gu(e,45,l)||Gu(e,46,l)))break;if(t&&Mg(a)=="f")return!1;for(let f=l;f>=0;f--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}const Tee=new Qv((e,t)=>{if(e.next==33)uz(e),e.acceptToken(pee);else if(e.next==38||e.next==42){let n=e.next==38?hee:dee;XS(e),e.acceptToken(n)}else e.next==39||e.next==34?(rA(e,!1),e.acceptToken(fee)):cz(e,!1,t.context.type==Th,t.context.depth)&&e.acceptToken(cee)}),Mee=new Qv((e,t)=>{let n=t.context.type==VS?t.context.depth:-1,r=e.pos;e:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(Gu(e,45,i)||Gu(e,46,i))||!Wa(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break e;let l=Wa(e.next);if(e.advance(),l)continue e;r=e.pos}}e.acceptTokenTo(oz,r)}),Dee=j3({DirectiveName:Y.keyword,DirectiveContent:Y.attributeValue,"DirectiveEnd DocEnd":Y.meta,QuotedLiteral:Y.string,BlockLiteralHeader:Y.special(Y.string),BlockLiteralContent:Y.content,Literal:Y.content,"Key/Literal Key/QuotedLiteral":Y.definition(Y.propertyName),"Anchor Alias":Y.labelName,Tag:Y.typeName,Comment:Y.lineComment,": , -":Y.separator,"?":Y.punctuation,"[ ]":Y.squareBracket,"{ }":Y.brace}),Pee=Tg.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:wee,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[Dee],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[Oee,Aee,Tee,Mee,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),_ee=dg.define({name:"yaml",parser:Pee.configure({props:[z3.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.from<t.to)return e.baseIndentFor(t);if(t.name=="BlockLiteral")return e.baseIndentFor(t)+e.unit;if(t.name=="BlockSequence"||t.name=="BlockMapping")return e.column(t.firstChild.from,1);if(t.name=="QuotedLiteral")return null;if(t.name=="Literal"){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:UD({closing:"}"}),FlowSequence:UD({closing:"]"})}),H3.add({"FlowMapping FlowSequence":cY,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function Nee(){return new JQ(_ee)}function jP(e){const t=io(),n=e.mode==="create"?e.initialContent:e.config.content,[r,i]=O.useState(n),[a,l]=O.useState("new-config.yaml"),[s,c]=O.useState(null),f=r!==n,d=O.useMemo(()=>window.matchMedia("(prefers-color-scheme: dark)").matches,[]),p=Uu({mutationFn:async()=>{const y=await qt.validateConfig(r);if(!y.valid)throw new oh(400,y.error??"invalid config");if(e.mode==="create")return qt.createConfig(a,r);if(e.mode==="edit")return qt.updateConfig(e.config.id,r,e.config.content_hash);throw new Error("unreachable")},onSuccess:y=>{c(null),t.invalidateQueries({queryKey:["configs"]}),e.mode!=="view"&&e.onSaved?.(y)},onError:y=>c(y.message)}),g=p.error instanceof oh&&p.error.status===409,v=e.mode==="view";return M.jsxs("div",{className:"space-y-3",children:[e.mode==="create"&&M.jsxs("label",{className:"block text-sm",children:[M.jsx("span",{className:"mb-1 block text-xs uppercase tracking-wide text-ink-muted",children:"Filename"}),M.jsx("input",{value:a,onChange:y=>l(y.target.value),className:"w-72 rounded-md border border-edge bg-page px-3 py-1.5 font-mono text-sm outline-none focus:border-accent",placeholder:"my-config.yaml"})]}),g&&M.jsx("div",{className:"rounded-md border border-warning/50 bg-surface px-3 py-2 text-sm text-ink-secondary",children:"⚠ The file changed on disk since you loaded it. Reload the page and reapply your edits."}),s&&!g&&M.jsx("div",{className:"rounded-md border border-critical/50 bg-surface px-3 py-2 text-sm text-critical",children:s}),M.jsx("div",{className:"overflow-hidden rounded-md border border-edge",children:M.jsx(rz,{value:r,onChange:i,extensions:[Nee()],editable:!v,theme:d?"dark":"light",minHeight:"240px",maxHeight:"560px"})}),!v&&M.jsxs("div",{className:"flex items-center gap-3",children:[M.jsx("button",{onClick:()=>p.mutate(),disabled:p.isPending||e.mode==="edit"&&!f,className:"rounded-md bg-accent px-3.5 py-1.5 text-sm font-medium text-white transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:p.isPending?"Saving…":e.mode==="create"?"Create config":"Save changes"}),e.mode==="create"&&M.jsx("button",{onClick:()=>e.onCancel?.(),className:"text-sm text-ink-muted hover:text-ink-secondary",children:"Cancel"}),e.mode==="edit"&&f&&M.jsx("span",{className:"text-xs text-ink-muted",children:"unsaved changes"}),M.jsxs("span",{className:"ml-auto text-xs text-ink-muted",children:["Secrets stay as ",M.jsx("code",{children:"${ENV_VAR}"})," placeholders — they are resolved only inside sync jobs."]})]})]})}function Ree({runs:e,showConfig:t=!1,configNames:n}){return e.length===0?M.jsx("p",{className:"py-8 text-center text-sm text-ink-muted",children:"No runs yet."}):M.jsx("div",{className:"overflow-x-auto",children:M.jsxs("table",{className:"w-full text-sm",children:[M.jsx("thead",{children:M.jsxs("tr",{className:"border-b border-edge text-left text-xs uppercase tracking-wide text-ink-muted",children:[M.jsx("th",{className:"py-2 pr-4 font-medium",children:"Run"}),t&&M.jsx("th",{className:"py-2 pr-4 font-medium",children:"Config"}),M.jsx("th",{className:"py-2 pr-4 font-medium",children:"Status"}),M.jsx("th",{className:"py-2 pr-4 font-medium",children:"Trigger"}),M.jsx("th",{className:"py-2 pr-4 font-medium",children:"Started"}),M.jsx("th",{className:"py-2 pr-4 font-medium",children:"Duration"}),M.jsx("th",{className:"py-2 font-medium",children:"Detail"})]})}),M.jsx("tbody",{children:e.map(r=>M.jsxs("tr",{className:"border-b border-edge/60 hover:bg-ink/[0.03]",children:[M.jsx("td",{className:"py-2.5 pr-4",children:M.jsxs(gi,{to:`/runs/${r.id}`,className:"font-medium text-accent hover:underline",children:["#",r.id]})}),t&&M.jsx("td",{className:"py-2.5 pr-4",children:M.jsx(gi,{to:`/configs/${r.config_id}`,className:"hover:underline",children:n?.get(r.config_id)??r.config_name??`config ${r.config_id}`})}),M.jsx("td",{className:"py-2.5 pr-4",children:M.jsx(Tv,{status:r.status})}),M.jsx("td",{className:"py-2.5 pr-4 text-ink-secondary",children:r.trigger}),M.jsx("td",{className:"py-2.5 pr-4 text-ink-secondary",children:Ua(r.started_at??r.queued_at)}),M.jsx("td",{className:"py-2.5 pr-4 text-ink-secondary",children:r.status==="running"||r.status==="queued"?"…":lO(r.started_at,r.finished_at)}),M.jsx("td",{className:"max-w-md truncate py-2.5 text-ink-muted",title:r.error??void 0,children:r.error??(r.stats?.sources?`${r.stats.sources.length} source(s)`:"")})]},r.id))})]})})}function fz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=fz(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function st(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=fz(e))&&(r&&(r+=" "),r+=t);return r}var jee=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function iA(e){if(typeof e!="string")return!1;var t=jee;return t.includes(e)}var Iee=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Lee=new Set(Iee);function hz(e){return typeof e!="string"?!1:Lee.has(e)}function dz(e){return typeof e=="string"&&e.startsWith("data-")}function bi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(hz(n)||dz(n))&&(t[n]=e[n]);return t}function Gh(e){if(e==null)return null;if(O.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return bi(t)}return typeof e=="object"&&!Array.isArray(e)?bi(e):null}function Pr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(hz(n)||dz(n)||iA(n))&&(t[n]=e[n]);return t}function Bee(e){return e==null?null:O.isValidElement(e)?Pr(e.props):typeof e=="object"&&!Array.isArray(e)?Pr(e):null}var zee=["children","width","height","viewBox","className","style","title","desc"];function QS(){return QS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QS.apply(null,arguments)}function $ee(e,t){if(e==null)return{};var n,r,i=Uee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Uee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var aA=O.forwardRef((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,l=e.className,s=e.style,c=e.title,f=e.desc,d=$ee(e,zee),p=a||{width:r,height:i,x:0,y:0},g=st("recharts-surface",l);return O.createElement("svg",QS({},Pr(d),{className:g,width:r,height:i,style:s,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),O.createElement("title",null,c),O.createElement("desc",null,f),n)}),Hee=["children","className"];function YS(){return YS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YS.apply(null,arguments)}function Fee(e,t){if(e==null)return{};var n,r,i=qee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function qee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _r=O.forwardRef((e,t)=>{var n=e.children,r=e.className,i=Fee(e,Hee),a=st("recharts-layer",r);return O.createElement("g",YS({className:a},Pr(i),{ref:t}),n)}),pz=O.createContext(null),Wee=()=>O.useContext(pz);function dt(e){return function(){return e}}const mz=Math.cos,Dg=Math.sin,ki=Math.sqrt,Pg=Math.PI,Yv=2*Pg,GS=Math.PI,ZS=2*GS,jo=1e-6,Vee=ZS-jo;function gz(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Kee(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return gz;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Xee{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?gz:Kee(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+l}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let l=this._x1,s=this._y1,c=r-t,f=i-n,d=l-t,p=s-n,g=d*d+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>jo)if(!(Math.abs(p*c-f*d)>jo)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-l,y=i-s,x=c*c+f*f,w=v*v+y*y,A=Math.sqrt(x),C=Math.sqrt(g),k=a*Math.tan((GS-Math.acos((x+g-w)/(2*A*C)))/2),P=k/C,T=k/A;Math.abs(P-1)>jo&&this._append`L${t+P*d},${n+P*p}`,this._append`A${a},${a},0,0,${+(p*v>d*y)},${this._x1=t+T*c},${this._y1=n+T*f}`}}arc(t,n,r,i,a,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),c=r*Math.sin(i),f=t+s,d=n+c,p=1^l,g=l?i-a:a-i;this._x1===null?this._append`M${f},${d}`:(Math.abs(this._x1-f)>jo||Math.abs(this._y1-d)>jo)&&this._append`L${f},${d}`,r&&(g<0&&(g=g%ZS+ZS),g>Vee?this._append`A${r},${r},0,1,${p},${t-s},${n-c}A${r},${r},0,1,${p},${this._x1=f},${this._y1=d}`:g>jo&&this._append`A${r},${r},0,${+(g>=GS)},${p},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function lA(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Xee(t)}function oA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function vz(e){this._context=e}vz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Gv(e){return new vz(e)}function yz(e){return e[0]}function bz(e){return e[1]}function xz(e,t){var n=dt(!0),r=null,i=Gv,a=null,l=lA(s);e=typeof e=="function"?e:e===void 0?yz:dt(e),t=typeof t=="function"?t:t===void 0?bz:dt(t);function s(c){var f,d=(c=oA(c)).length,p,g=!1,v;for(r==null&&(a=i(v=l())),f=0;f<=d;++f)!(f<d&&n(p=c[f],f,c))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+e(p,f,c),+t(p,f,c));if(v)return a=null,v+""||null}return s.x=function(c){return arguments.length?(e=typeof c=="function"?c:dt(+c),s):e},s.y=function(c){return arguments.length?(t=typeof c=="function"?c:dt(+c),s):t},s.defined=function(c){return arguments.length?(n=typeof c=="function"?c:dt(!!c),s):n},s.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),s):i},s.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),s):r},s}function fm(e,t,n){var r=null,i=dt(!0),a=null,l=Gv,s=null,c=lA(f);e=typeof e=="function"?e:e===void 0?yz:dt(+e),t=typeof t=="function"?t:dt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?bz:dt(+n);function f(p){var g,v,y,x=(p=oA(p)).length,w,A=!1,C,k=new Array(x),P=new Array(x);for(a==null&&(s=l(C=c())),g=0;g<=x;++g){if(!(g<x&&i(w=p[g],g,p))===A)if(A=!A)v=g,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),y=g-1;y>=v;--y)s.point(k[y],P[y]);s.lineEnd(),s.areaEnd()}A&&(k[g]=+e(w,g,p),P[g]=+t(w,g,p),s.point(r?+r(w,g,p):k[g],n?+n(w,g,p):P[g]))}if(C)return s=null,C+""||null}function d(){return xz().defined(i).curve(l).context(a)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:dt(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:dt(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:dt(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:dt(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:dt(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:dt(+p),f):n},f.lineX0=f.lineY0=function(){return d().x(e).y(t)},f.lineY1=function(){return d().x(e).y(n)},f.lineX1=function(){return d().x(r).y(t)},f.defined=function(p){return arguments.length?(i=typeof p=="function"?p:dt(!!p),f):i},f.curve=function(p){return arguments.length?(l=p,a!=null&&(s=l(a)),f):l},f.context=function(p){return arguments.length?(p==null?a=s=null:s=l(a=p),f):a},f}class Sz{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Qee(e){return new Sz(e,!0)}function Yee(e){return new Sz(e,!1)}const sA={draw(e,t){const n=ki(t/Pg);e.moveTo(n,0),e.arc(0,0,n,0,Yv)}},Gee={draw(e,t){const n=ki(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},wz=ki(1/3),Zee=wz*2,Jee={draw(e,t){const n=ki(t/Zee),r=n*wz;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ete={draw(e,t){const n=ki(t),r=-n/2;e.rect(r,r,n,n)}},tte=.8908130915292852,Oz=Dg(Pg/10)/Dg(7*Pg/10),nte=Dg(Yv/10)*Oz,rte=-mz(Yv/10)*Oz,ite={draw(e,t){const n=ki(t*tte),r=nte*n,i=rte*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=Yv*a/5,s=mz(l),c=Dg(l);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*i,c*r+s*i)}e.closePath()}},Yx=ki(3),ate={draw(e,t){const n=-ki(t/(Yx*3));e.moveTo(0,n*2),e.lineTo(-Yx*n,-n),e.lineTo(Yx*n,-n),e.closePath()}},qr=-.5,Wr=ki(3)/2,JS=1/ki(12),lte=(JS/2+1)*3,ote={draw(e,t){const n=ki(t/lte),r=n/2,i=n*JS,a=r,l=n*JS+n,s=-a,c=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(s,c),e.lineTo(qr*r-Wr*i,Wr*r+qr*i),e.lineTo(qr*a-Wr*l,Wr*a+qr*l),e.lineTo(qr*s-Wr*c,Wr*s+qr*c),e.lineTo(qr*r+Wr*i,qr*i-Wr*r),e.lineTo(qr*a+Wr*l,qr*l-Wr*a),e.lineTo(qr*s+Wr*c,qr*c-Wr*s),e.closePath()}};function ste(e,t){let n=null,r=lA(i);e=typeof e=="function"?e:dt(e||sA),t=typeof t=="function"?t:dt(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:dt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:dt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function _g(){}function Ng(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Az(e){this._context=e}Az.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ng(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ng(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ute(e){return new Az(e)}function kz(e){this._context=e}kz.prototype={areaStart:_g,areaEnd:_g,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ng(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cte(e){return new kz(e)}function Cz(e){this._context=e}Cz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ng(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fte(e){return new Cz(e)}function Ez(e){this._context=e}Ez.prototype={areaStart:_g,areaEnd:_g,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function hte(e){return new Ez(e)}function IP(e){return e<0?-1:1}function LP(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),s=(a*i+l*r)/(r+i);return(IP(a)+IP(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(s))||0}function BP(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Gx(e,t,n){var r=e._x0,i=e._y0,a=e._x1,l=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,l-s*n,a,l)}function Rg(e){this._context=e}Rg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Gx(this,this._t0,BP(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Gx(this,BP(this,n=LP(this,e,t)),n);break;default:Gx(this,this._t0,n=LP(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Tz(e){this._context=new Mz(e)}(Tz.prototype=Object.create(Rg.prototype)).point=function(e,t){Rg.prototype.point.call(this,t,e)};function Mz(e){this._context=e}Mz.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function dte(e){return new Rg(e)}function pte(e){return new Tz(e)}function Dz(e){this._context=e}Dz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=zP(e),i=zP(t),a=0,l=1;l<n;++a,++l)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function zP(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),l=new Array(n);for(i[0]=0,a[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function mte(e){return new Dz(e)}function Zv(e,t){this._context=e,this._t=t}Zv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function gte(e){return new Zv(e,.5)}function vte(e){return new Zv(e,0)}function yte(e){return new Zv(e,1)}function cs(e,t){if((l=e.length)>1)for(var n=1,r,i,a=e[t[0]],l,s=a.length;n<l;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function ew(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function bte(e,t){return e[t]}function xte(e){const t=[];return t.key=e,t}function Ste(){var e=dt([]),t=ew,n=cs,r=bte;function i(a){var l=Array.from(e.apply(this,arguments),xte),s,c=l.length,f=-1,d;for(const p of a)for(s=0,++f;s<c;++s)(l[s][f]=[0,+r(p,l[s].key,f,a)]).data=p;for(s=0,d=oA(t(l));s<c;++s)l[d[s]].index=s;return n(l,d),l}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:dt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:dt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?ew:typeof a=="function"?a:dt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??cs,i):n},i}function wte(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,l;i<a;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}cs(e,t)}}function Ote(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var l=0,s=0;l<i;++l)s+=e[l][n][1]||0;r[n][1]+=r[n][0]=-s/2}cs(e,t)}}function Ate(e,t){if(!(!((l=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,l;r<a;++r){for(var s=0,c=0,f=0;s<l;++s){for(var d=e[t[s]],p=d[r][1]||0,g=d[r-1][1]||0,v=(p-g)/2,y=0;y<s;++y){var x=e[t[y]],w=x[r][1]||0,A=x[r-1][1]||0;v+=w-A}c+=p,f+=v*p}i[r-1][1]+=i[r-1][0]=n,c&&(n-=f/c)}i[r-1][1]+=i[r-1][0]=n,cs(e,t)}}function tw(e){return e==="__proto__"}function Pz(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function uA(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function _z(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(_z).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function cA(e){if(Array.isArray(e))return e.map(uA);if(typeof e=="symbol")return[e];e=_z(e);const t=[],n=e.length;if(n===0)return t;let r=0,i="",a="",l=!1;for(e.charCodeAt(0)===46&&t.push("");r<n;){const s=e[r];if(a)s==="\\"&&r+1<n?(r++,i+=e[r]):s===a?a="":i+=s;else if(l)s==='"'||s==="'"?a=s:s==="]"?(l=!1,t.push(i),i=""):i+=s;else if(s==="[")l=!0,i&&(t.push(i),i="");else if(s==="."){i&&(t.push(i),i="");const c=e[r+1];(c===void 0||c===".")&&t.push("")}else i+=s;r++}return i&&t.push(i),t}function Va(e,t,n){if(e==null)return n;switch(typeof t){case"string":{if(tw(t))return n;const r=e[t];return r===void 0?Pz(t)&&!Object.hasOwn(e,t)?Va(e,cA(t),n):n:r}case"number":case"symbol":{typeof t=="number"&&(t=uA(t));const r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return kte(e,t,n);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),tw(t))return n;const r=e[t];return r===void 0?n:r}}}function kte(e,t,n){if(t.length===0)return n;let r=e;for(let i=0;i<t.length;i++){if(r==null||tw(t[i]))return n;r=r[t[i]]}return r===void 0?n:r}var Cte=4;function Na(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Cte,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Sn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,l)=>{var s=n[l-1];return typeof s=="string"?i+s+a:s!==void 0?i+Na(s)+a:i+a},"")}var sr=e=>e===0?0:e>0?1:-1,Ji=e=>typeof e=="number"&&e!=+e,fs=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,be=e=>(typeof e=="number"||e instanceof Number)&&!Ji(e),ea=e=>be(e)||typeof e=="string",Ete=0,Mh=e=>{var t=++Ete;return"".concat(e||"").concat(t)},xi=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!be(t)&&typeof t!="string")return r;var a;if(fs(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return Ji(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},Nz=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Ft(e,t,n){return be(e)&&be(t)?Na(e+n*(t-e)):t}function Rz(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Va(r,t))===n)}var kt=e=>e===null||typeof e>"u",Zh=e=>kt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function ur(e){return e!=null}function ys(){}var Tte=["type","size","sizeType"];function nw(){return nw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nw.apply(null,arguments)}function $P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function UP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$P(Object(n),!0).forEach(function(r){Mte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$P(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mte(e,t,n){return(t=Dte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dte(e){var t=Pte(e,"string");return typeof t=="symbol"?t:t+""}function Pte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _te(e,t){if(e==null)return{};var n,r,i=Nte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Nte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var jz={symbolCircle:sA,symbolCross:Gee,symbolDiamond:Jee,symbolSquare:ete,symbolStar:ite,symbolTriangle:ate,symbolWye:ote},Rte=Math.PI/180,jte=e=>{var t="symbol".concat(Zh(e));return jz[t]||sA},Ite=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*Rte;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Lte=(e,t)=>{jz["symbol".concat(Zh(e))]=t},Iz=e=>{var t=e.type,n=t===void 0?"circle":t,r=e.size,i=r===void 0?64:r,a=e.sizeType,l=a===void 0?"area":a,s=_te(e,Tte),c=UP(UP({},s),{},{type:n,size:i,sizeType:l}),f="circle";typeof n=="string"&&(f=n);var d=()=>{var x=jte(f),w=ste().type(x).size(Ite(i,l,f)),A=w();if(A!==null)return A},p=c.className,g=c.cx,v=c.cy,y=Pr(c);return be(g)&&be(v)&&be(i)?O.createElement("path",nw({},y,{className:st("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(v,")"),d:d()})):null};Iz.registerSymbol=Lte;var Lz=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,fA=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(O.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{iA(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Bte=(e,t,n)=>r=>(e(t,n,r),null),Jv=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];iA(i)&&typeof a=="function"&&(r||(r={}),r[i]=Bte(a,t,n))}),r};function HP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HP(Object(n),!0).forEach(function(r){$te(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $te(e,t,n){return(t=Ute(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ute(e){var t=Hte(e,"string");return typeof t=="symbol"?t:t+""}function Hte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jn(e,t){var n=zte({},e),r=t,i=Object.keys(t),a=i.reduce((l,s)=>(l[s]===void 0&&r[s]!==void 0&&(l[s]=r[s]),l),n);return a}function jg(){return jg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jg.apply(null,arguments)}function FP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FP(Object(n),!0).forEach(function(r){Fte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fte(e,t,n){return(t=qte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qte(e){var t=Wte(e,"string");return typeof t=="symbol"?t:t+""}function Wte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kr=32,Vte={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Kte(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Xte(e){var t=e.data,n=e.iconType,r=e.inactiveColor,i=Kr/2,a=Kr/6,l=Kr/3,s=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return O.createElement("line",{strokeWidth:4,fill:"none",stroke:s,strokeDasharray:Kte(t.payload),x1:0,y1:i,x2:Kr,y2:i,className:"recharts-legend-icon"});if(c==="line")return O.createElement("path",{strokeWidth:4,fill:"none",stroke:s,d:"M0,".concat(i,"h").concat(l,`
67
- A`).concat(a,",").concat(a,",0,1,1,").concat(2*l,",").concat(i,`
68
- H`).concat(Kr,"M").concat(2*l,",").concat(i,`
69
- A`).concat(a,",").concat(a,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return O.createElement("path",{stroke:"none",fill:s,d:"M0,".concat(Kr/8,"h").concat(Kr,"v").concat(Kr*3/4,"h").concat(-Kr,"z"),className:"recharts-legend-icon"});if(O.isValidElement(t.legendIcon)){var f=Bz({},t);return delete f.legendIcon,O.cloneElement(t.legendIcon,f)}return O.createElement(Iz,{fill:s,cx:i,cy:i,size:Kr,sizeType:"diameter",type:c})}function Qte(e){var t=e.payload,n=e.iconSize,r=e.layout,i=e.formatter,a=e.inactiveColor,l=e.iconType,s=e.labelStyle,c={x:0,y:0,width:Kr,height:Kr},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},d={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((p,g)=>{var v=p.formatter||i,y=st({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:p.inactive});if(p.type==="none")return null;var x=typeof s=="object"?Bz({},s):{};x.color=p.inactive?a:x.color||p.color;var w=v?v(p.value,p,g):p.value;return O.createElement("li",jg({className:y,style:f,key:"legend-item-".concat(g)},Jv(e,p,g)),O.createElement(aA,{width:n,height:n,viewBox:c,style:d,"aria-label":p.value==null?"legend icon":"".concat(p.value," legend icon")},O.createElement(Xte,{data:p,iconType:l,inactiveColor:a})),O.createElement("span",{className:"recharts-legend-item-text",style:x},w))})}var Yte=e=>{var t=jn(e,Vte),n=t.payload,r=t.layout,i=t.align;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return O.createElement("ul",{className:"recharts-default-legend",style:a},O.createElement(Qte,jg({},t,{payload:n})))};function Gte(e,t){const n=new Map;for(let r=0;r<e.length;r++){const i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function Zte(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function zz(e){return e}function Jte(e){return function(t){return Va(t,e)}}function rw(e){return e==null||typeof e!="object"&&typeof e!="function"}function ene(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function tne(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function hA(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const nne="[object RegExp]",$z="[object String]",Uz="[object Number]",Hz="[object Boolean]",Fz="[object Arguments]",rne="[object Symbol]",ine="[object Date]",ane="[object Map]",lne="[object Set]",one="[object Array]",sne="[object ArrayBuffer]",une="[object Object]",cne="[object DataView]",fne="[object Uint8Array]",hne="[object Uint8ClampedArray]",dne="[object Uint16Array]",pne="[object Uint32Array]",mne="[object Int8Array]",gne="[object Int16Array]",vne="[object Int32Array]",yne="[object Float32Array]",bne="[object Float64Array]",qP=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function xne(e){return typeof qP.Buffer<"u"&&qP.Buffer.isBuffer(e)}function Sne(e,t){return Wo(e,void 0,e,new Map,t)}function Wo(e,t,n,r=new Map,i=void 0){const a=i?.(e,t,n,r);if(a!==void 0)return a;if(rw(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const l=new Array(e.length);r.set(e,l);for(let s=0;s<e.length;s++)l[s]=Wo(e[s],s,n,r,i);return Object.hasOwn(e,"index")&&(l.index=e.index),Object.hasOwn(e,"input")&&(l.input=e.input),l}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const l=new RegExp(e.source,e.flags);return l.lastIndex=e.lastIndex,l}if(e instanceof Map){const l=new Map;r.set(e,l);for(const[s,c]of e)l.set(s,Wo(c,s,n,r,i));return l}if(e instanceof Set){const l=new Set;r.set(e,l);for(const s of e)l.add(Wo(s,void 0,n,r,i));return l}if(xne(e))return e.subarray();if(ene(e)){const l=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,l);for(let s=0;s<e.length;s++)l[s]=Wo(e[s],s,n,r,i);return l}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const l=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,l),ui(l,e,n,r,i),l}if(typeof File<"u"&&e instanceof File){const l=new File([e],e.name,{type:e.type});return r.set(e,l),ui(l,e,n,r,i),l}if(typeof Blob<"u"&&e instanceof Blob){const l=new Blob([e],{type:e.type});return r.set(e,l),ui(l,e,n,r,i),l}if(e instanceof Error){const l=structuredClone(e);return r.set(e,l),l.message=e.message,l.name=e.name,l.stack=e.stack,l.cause=e.cause,l.constructor=e.constructor,ui(l,e,n,r,i),l}if(e instanceof Boolean){const l=new Boolean(e.valueOf());return r.set(e,l),ui(l,e,n,r,i),l}if(e instanceof Number){const l=new Number(e.valueOf());return r.set(e,l),ui(l,e,n,r,i),l}if(e instanceof String){const l=new String(e.valueOf());return r.set(e,l),ui(l,e,n,r,i),l}if(typeof e=="object"&&wne(e)){const l=Object.create(Object.getPrototypeOf(e));return r.set(e,l),ui(l,e,n,r,i),l}return e}function ui(e,t,n=e,r,i){const a=[...Object.keys(t),...tne(t)];for(let l=0;l<a.length;l++){const s=a[l],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=Wo(t[s],s,n,r,i))}}function wne(e){switch(hA(e)){case Fz:case one:case sne:case cne:case Hz:case ine:case yne:case bne:case mne:case gne:case vne:case ane:case Uz:case une:case nne:case lne:case $z:case rne:case fne:case hne:case dne:case pne:return!0;default:return!1}}function One(e){return Wo(e,void 0,e,new Map,void 0)}function Hm(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function qz(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function Wz(e,t,n){return typeof n!="function"?Wz(e,t,()=>{}):iw(e,t,function r(i,a,l,s,c,f){const d=n(i,a,l,s,c,f);return d!==void 0?!!d:iw(i,a,r,f,!1)},new Map,!0)}function iw(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case"object":return Ane(e,t,n,r);case"function":return Object.keys(t).length>0?iw(e,{...t},n,r,i):Hm(e,t);default:return qz(e)&&i?typeof t=="string"?t==="":!0:Hm(e,t)}}function Ane(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return Vz(e,t,n,r);if(t instanceof Map)return kne(e,t,n,r);if(t instanceof Set)return Cne(e,t,n,r);const i=Object.keys(t);if(e==null||rw(e))return i.length===0;if(i.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let a=0;a<i.length;a++){const l=i[a];if(!rw(e)&&!(l in e)||t[l]===void 0&&e[l]!==void 0||t[l]===null&&e[l]!==null||!n(e[l],t[l],l,e,t,r))return!1}return!0}finally{r?.delete(t)}}function kne(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(const[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function Vz(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;const i=new Set;for(let a=0;a<t.length;a++){const l=t[a];let s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;const f=e[c];let d=!1;if(n(f,l,a,e,t,r)&&(d=!0),d){i.add(c),s=!0;break}}if(!s)return!1}return!0}function Cne(e,t,n,r){return t.size===0?!0:e instanceof Set?Vz([...e],[...t],n,r):!1}function Kz(e,t){return Wz(e,t,()=>{})}function Ene(e){return e=One(e),t=>Kz(t,e)}function Tne(e,t){return Sne(e,(n,r,i,a)=>{if(typeof e=="object"){if(hA(e)==="[object Object]"&&typeof e.constructor!="function"){const l={};return a.set(e,l),ui(l,e,i,a),l}switch(Object.prototype.toString.call(e)){case Uz:case $z:case Hz:{const l=new e.constructor(e?.valueOf());return ui(l,e),l}case Fz:{const l={};return ui(l,e),l.length=e.length,l[Symbol.iterator]=e[Symbol.iterator],l}default:return}}})}function Mne(e){return Tne(e)}const Dne=/^(?:0|[1-9]\d*)$/;function Xz(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return Dne.test(e)}}function Pne(e){return e!==null&&typeof e=="object"&&hA(e)==="[object Arguments]"}function _ne(e,t){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&Pz(t)&&e?.[t]==null?n=cA(t):n=[t],n.length===0)return!1;let r=e;for(let i=0;i<n.length;i++){const a=n[i];if((r==null||!Object.hasOwn(r,a))&&!((Array.isArray(r)||Pne(r))&&Xz(a)&&a<r.length))return!1;r=r[a]}return!0}function Nne(e,t){switch(typeof e){case"object":Object.is(e?.valueOf(),-0)&&(e="-0");break;case"number":e=uA(e);break}return t=Mne(t),function(n){const r=Va(n,e);return r===void 0?_ne(n,e):t===void 0?r===void 0:Kz(r,t)}}function Rne(e){if(e==null)return zz;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?Nne(e[0],e[1]):Ene(e);case"string":case"symbol":case"number":return Jte(e)}}function jne(e){return Number.isSafeInteger(e)&&e>=0}function Qz(e){return e!=null&&typeof e!="function"&&jne(e.length)}function Ine(e){return typeof e=="object"&&e!==null}function Lne(e){return Ine(e)&&Qz(e)}function WP(e,t=zz){return Lne(e)?Gte(Array.from(e),Zte(Rne(t),1)):[]}function Yz(e,t,n){return t===!0?WP(e,n):typeof t=="function"?WP(e,t):e}var Zx={exports:{}},Jx={},e1={exports:{}},t1={};var VP;function Bne(){if(VP)return t1;VP=1;var e=lc();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function s(p,g){var v=g(),y=r({inst:{value:v,getSnapshot:g}}),x=y[0].inst,w=y[1];return a(function(){x.value=v,x.getSnapshot=g,c(x)&&w({inst:x})},[p,v,g]),i(function(){return c(x)&&w({inst:x}),p(function(){c(x)&&w({inst:x})})},[p]),l(v),v}function c(p){var g=p.getSnapshot;p=p.value;try{var v=g();return!n(p,v)}catch{return!0}}function f(p,g){return g()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:s;return t1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,t1}var KP;function zne(){return KP||(KP=1,e1.exports=Bne()),e1.exports}var XP;function $ne(){if(XP)return Jx;XP=1;var e=lc(),t=zne();function n(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,s=e.useMemo,c=e.useDebugValue;return Jx.useSyncExternalStoreWithSelector=function(f,d,p,g,v){var y=a(null);if(y.current===null){var x={hasValue:!1,value:null};y.current=x}else x=y.current;y=s(function(){function A(D){if(!C){if(C=!0,k=D,D=g(D),v!==void 0&&x.hasValue){var N=x.value;if(v(N,D))return P=N}return P=D}if(N=P,r(k,D))return N;var I=g(D);return v!==void 0&&v(N,I)?(k=D,N):(k=D,P=I)}var C=!1,k,P,T=p===void 0?null:p;return[function(){return A(d())},T===null?void 0:function(){return A(T())}]},[d,p,g,v]);var w=i(f,y[0],y[1]);return l(function(){x.hasValue=!0,x.value=w},[w]),c(w),w},Jx}var QP;function Une(){return QP||(QP=1,Zx.exports=$ne()),Zx.exports}var Hne=Une(),dA=O.createContext(null),Fne=e=>e,St=()=>{var e=O.useContext(dA);return e?e.store.dispatch:Fne},Fm=()=>{},qne=()=>Fm,Wne=(e,t)=>e===t;function we(e){var t=O.useContext(dA),n=O.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Fm,[t,e]);return Hne.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:qne,t?t.store.getState:Fm,t?t.store.getState:Fm,n,Wne)}function Vne(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Kne(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var YP=e=>Array.isArray(e)?e:[e];function Xne(e){const t=Array.isArray(e[0])?e[0]:e;return Kne(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Qne(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Yne=class{constructor(e){this.value=e}deref(){return this.value}},Gne=()=>typeof WeakRef>"u"?Yne:WeakRef,Gz=Gne(),Zne=0,GP=1;function hm(){return{s:Zne,v:void 0,o:null,p:null}}function Jne(e){return e instanceof Gz?e.deref():e}function Zz(e,t={}){let n=hm();const{resultEqualityCheck:r}=t;let i,a=0;function l(){let s=n;const{length:c}=arguments;for(let p=0,g=c;p<g;p++){const v=arguments[p];if(typeof v=="function"||typeof v=="object"&&v!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);const x=y.get(v);x===void 0?(s=hm(),y.set(v,s)):s=x}else{let y=s.p;y===null&&(s.p=y=new Map);const x=y.get(v);x===void 0?(s=hm(),y.set(v,s)):s=x}}const f=s;let d;if(s.s===GP)d=s.v;else if(d=e.apply(null,arguments),a++,r){const p=Jne(i);p!=null&&r(p,d)&&(d=p,a!==0&&a--),i=typeof d=="object"&&d!==null||typeof d=="function"?new Gz(d):d}return f.s=GP,f.v=d,d}return l.clearCache=()=>{n=hm(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function ere(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,l=0,s,c={},f=i.pop();typeof f=="object"&&(c=f,f=i.pop()),Vne(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const d={...n,...c},{memoize:p,memoizeOptions:g=[],argsMemoize:v=Zz,argsMemoizeOptions:y=[]}=d,x=YP(g),w=YP(y),A=Xne(i),C=p(function(){return a++,f.apply(null,arguments)},...x),k=v(function(){l++;const T=Qne(A,arguments);return s=C.apply(null,T),s},...w);return Object.assign(k,{resultFunc:f,memoizedResultFunc:C,dependencies:A,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:p,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var q=ere(Zz);function tre(e,t=1){const n=[],r=Math.floor(t),i=(a,l)=>{for(let s=0;s<a.length;s++){const c=a[s];Array.isArray(c)&&l<r?i(c,l+1):n.push(c)}};return i(e,0),n}function aw(e,t,n){return qz(n)&&(typeof t=="number"&&Qz(n)&&Xz(t)&&t<n.length||typeof t=="string"&&t in n)?Hm(n[t],e):!1}function ZP(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}const nre=(e,t,n)=>{if(e!==t){const r=ZP(e),i=ZP(t);if(r===i&&r===0){if(e<t)return n==="desc"?1:-1;if(e>t)return n==="desc"?-1:1}return n==="desc"?i-r:r-i}return 0};function Jz(e){return typeof e=="symbol"||e instanceof Symbol}const rre=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ire=/^\w*$/;function are(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||Jz(e)?!0:typeof e=="string"&&(ire.test(e)||!rre.test(e))||t!=null}function lre(e,t,n,r){if(e==null)return[];n=n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(s=>String(s));const i=(s,c)=>{let f=s;for(let d=0;d<c.length&&f!=null;++d)f=f[c[d]];return f},a=(s,c)=>c==null||s==null?c:typeof s=="object"&&"key"in s?Object.hasOwn(c,s.key)?c[s.key]:i(c,s.path):typeof s=="function"?s(c):Array.isArray(s)?i(c,s):typeof c=="object"?c[s]:c,l=t.map(s=>(Array.isArray(s)&&s.length===1&&(s=s[0]),s==null||typeof s=="function"||Array.isArray(s)||are(s)?s:{key:s,path:cA(s)}));return e.map(s=>({original:s,criteria:l.map(c=>a(c,s))})).slice().sort((s,c)=>{for(let f=0;f<l.length;f++){const d=nre(s.criteria[f],c.criteria[f],n[f]);if(d!==0)return d}return 0}).map(s=>s.original)}function ey(e,...t){const n=t.length;return n>1&&aw(e,t[0],t[1])?t=[]:n>2&&aw(t[0],t[1],t[2])&&(t=[t[0]]),lre(e,tre(t),["asc"])}var e5=e=>e.legend.settings,ore=e=>e.legend.size,sre=e=>e.legend.payload,ure=q([sre,e5],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?ey(r,n):r});function cre(){return we(ure)}function fre(e,t){return mre(e)||pre(e,t)||dre(e,t)||hre()}function hre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
70
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dre(e,t){if(e){if(typeof e=="string")return JP(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?JP(e,t):void 0}}function JP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function mre(e){if(Array.isArray(e))return e}var dm=1;function e_(e,t){return Math.abs(e.height-t.height)>dm||Math.abs(e.left-t.left)>dm||Math.abs(e.top-t.top)>dm||Math.abs(e.width-t.width)>dm}function t_(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function t5(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=O.useState({height:0,left:0,top:0,width:0}),n=fre(t,2),r=n[0],i=n[1],a=O.useRef(null),l=O.useRef(r);l.current=r;var s=O.useCallback(c=>{if(a.current!=null&&(a.current.disconnect(),a.current=null),c!=null){var f=t_(c);if(e_(f,l.current)&&i(f),typeof ResizeObserver<"u"){var d=new ResizeObserver(()=>{var p=t_(c);e_(p,l.current)&&i(p)});d.observe(c),a.current=d}}},[...e]);return O.useEffect(()=>()=>{var c;(c=a.current)===null||c===void 0||c.disconnect()},[]),[r,s]}function bn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var gre=typeof Symbol=="function"&&Symbol.observable||"@@observable",n_=gre,n1=()=>Math.random().toString(36).substring(7).split("").join("."),vre={INIT:`@@redux/INIT${n1()}`,REPLACE:`@@redux/REPLACE${n1()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${n1()}`},Ig=vre;function pA(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function n5(e,t,n){if(typeof e!="function")throw new Error(bn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(bn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(bn(1));return n(n5)(e,t)}let r=e,i=t,a=new Map,l=a,s=0,c=!1;function f(){l===a&&(l=new Map,a.forEach((w,A)=>{l.set(A,w)}))}function d(){if(c)throw new Error(bn(3));return i}function p(w){if(typeof w!="function")throw new Error(bn(4));if(c)throw new Error(bn(5));let A=!0;f();const C=s++;return l.set(C,w),function(){if(A){if(c)throw new Error(bn(6));A=!1,f(),l.delete(C),a=null}}}function g(w){if(!pA(w))throw new Error(bn(7));if(typeof w.type>"u")throw new Error(bn(8));if(typeof w.type!="string")throw new Error(bn(17));if(c)throw new Error(bn(9));try{c=!0,i=r(i,w)}finally{c=!1}return(a=l).forEach(C=>{C()}),w}function v(w){if(typeof w!="function")throw new Error(bn(10));r=w,g({type:Ig.REPLACE})}function y(){const w=p;return{subscribe(A){if(typeof A!="object"||A===null)throw new Error(bn(11));function C(){const P=A;P.next&&P.next(d())}return C(),{unsubscribe:w(C)}},[n_](){return this}}}return g({type:Ig.INIT}),{dispatch:g,subscribe:p,getState:d,replaceReducer:v,[n_]:y}}function yre(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Ig.INIT})>"u")throw new Error(bn(12));if(typeof n(void 0,{type:Ig.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(bn(13))})}function r5(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const l=t[a];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{yre(n)}catch(a){i=a}return function(l={},s){if(i)throw i;let c=!1;const f={};for(let d=0;d<r.length;d++){const p=r[d],g=n[p],v=l[p],y=g(v,s);if(typeof y>"u")throw s&&s.type,new Error(bn(14));f[p]=y,c=c||y!==v}return c=c||r.length!==Object.keys(l).length,c?f:l}}function Lg(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function bre(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(bn(15))};const l={getState:i.getState,dispatch:(c,...f)=>a(c,...f)},s=e.map(c=>c(l));return a=Lg(...s)(i.dispatch),{...i,dispatch:a}}}function i5(e){return pA(e)&&"type"in e&&typeof e.type=="string"}var a5=Symbol.for("immer-nothing"),r_=Symbol.for("immer-draftable"),Kn=Symbol.for("immer-state");function fi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Mr=Object,Zu=Mr.getPrototypeOf,Bg="constructor",ty="prototype",lw="configurable",zg="enumerable",qm="writable",Dh="value",Ka=e=>!!e&&!!e[Kn];function Si(e){return e?l5(e)||ry(e)||!!e[r_]||!!e[Bg]?.[r_]||iy(e)||ay(e):!1}var xre=Mr[ty][Bg].toString(),i_=new WeakMap;function l5(e){if(!e||!mA(e))return!1;const t=Zu(e);if(t===null||t===Mr[ty])return!0;const n=Mr.hasOwnProperty.call(t,Bg)&&t[Bg];if(n===Object)return!0;if(!Su(n))return!1;let r=i_.get(n);return r===void 0&&(r=Function.toString.call(n),i_.set(n,r)),r===xre}function ny(e,t,n=!0){Jh(e)===0?(n?Reflect.ownKeys(e):Mr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Jh(e){const t=e[Kn];return t?t.type_:ry(e)?1:iy(e)?2:ay(e)?3:0}var r1=(e,t,n=Jh(e))=>n===2?e.has(t):Mr[ty].hasOwnProperty.call(e,t),ow=(e,t,n=Jh(e))=>n===2?e.get(t):e[t],$g=(e,t,n,r=Jh(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Sre(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ry=Array.isArray,iy=e=>e instanceof Map,ay=e=>e instanceof Set,mA=e=>typeof e=="object",Su=e=>typeof e=="function",i1=e=>typeof e=="boolean";function wre(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Bi=e=>e.copy_||e.base_,gA=e=>e.modified_?e.copy_:e.base_;function sw(e,t){if(iy(e))return new Map(e);if(ay(e))return new Set(e);if(ry(e))return Array[ty].slice.call(e);const n=l5(e);if(t===!0||t==="class_only"&&!n){const r=Mr.getOwnPropertyDescriptors(e);delete r[Kn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],s=r[l];s[qm]===!1&&(s[qm]=!0,s[lw]=!0),(s.get||s.set)&&(r[l]={[lw]:!0,[qm]:!0,[zg]:s[zg],[Dh]:e[l]})}return Mr.create(Zu(e),r)}else{const r=Zu(e);if(r!==null&&n)return{...e};const i=Mr.create(r);return Mr.assign(i,e)}}function vA(e,t=!1){return ly(e)||Ka(e)||!Si(e)||(Jh(e)>1&&Mr.defineProperties(e,{set:pm,add:pm,clear:pm,delete:pm}),Mr.freeze(e),t&&ny(e,(n,r)=>{vA(r,!0)},!1)),e}function Ore(){fi(2)}var pm={[Dh]:Ore};function ly(e){return e===null||!mA(e)?!0:Mr.isFrozen(e)}var Ug="MapSet",uw="Patches",a_="ArrayMethods",o5={};function hs(e){const t=o5[e];return t||fi(0,e),t}var l_=e=>!!o5[e],Ph,s5=()=>Ph,Are=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:l_(Ug)?hs(Ug):void 0,arrayMethodsPlugin_:l_(a_)?hs(a_):void 0});function o_(e,t){t&&(e.patchPlugin_=hs(uw),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function cw(e){fw(e),e.drafts_.forEach(kre),e.drafts_=null}function fw(e){e===Ph&&(Ph=e.parent_)}var s_=e=>Ph=Are(Ph,e);function kre(e){const t=e[Kn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function u_(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Kn].modified_&&(cw(t),fi(4)),Si(e)&&(e=c_(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Kn].base_,e,t)}else e=c_(t,n);return Cre(t,e,!0),cw(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==a5?e:void 0}function c_(e,t){if(ly(t))return t;const n=t[Kn];if(!n)return Hg(t,e.handledSet_,e);if(!oy(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);f5(n,e)}return n.copy_}function Cre(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&vA(t,n)}function u5(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var oy=(e,t)=>e.scope_===t,Ere=[];function c5(e,t,n,r){const i=Bi(e),a=e.type_;if(r!==void 0&&ow(i,r,a)===t){$g(i,r,n,a);return}if(!e.draftLocations_){const s=e.draftLocations_=new Map;ny(i,(c,f)=>{if(Ka(f)){const d=s.get(f)||[];d.push(c),s.set(f,d)}})}const l=e.draftLocations_.get(t)??Ere;for(const s of l)$g(i,s,n,a)}function Tre(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!oy(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const l=gA(a);c5(e,a.draft_??a,l,n),f5(a,i)})}function f5(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const i=r.getPath(e);i&&r.generatePatches_(e,i,t)}u5(e)}}function Mre(e,t,n){const{scope_:r}=e;if(Ka(n)){const i=n[Kn];oy(i,r)&&i.callbacks_.push(function(){Wm(e);const l=gA(i);c5(e,n,l,t)})}else Si(n)&&e.callbacks_.push(function(){const a=Bi(e);e.type_===3?a.has(n)&&Hg(n,r.handledSet_,r):ow(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Hg(ow(e.copy_,t,e.type_),r.handledSet_,r)})}function Hg(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ka(e)||t.has(e)||!Si(e)||ly(e)||(t.add(e),ny(e,(r,i)=>{if(Ka(i)){const a=i[Kn];if(oy(a,n)){const l=gA(a);$g(e,r,l,e.type_),u5(a)}}else Si(i)&&Hg(i,t,n)})),e}function Dre(e,t){const n=ry(e),r={type_:n?1:0,scope_:t?t.scope_:s5(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Fg;n&&(i=[r],a=_h);const{revoke:l,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=l,[s,r]}var Fg={get(e,t){if(t===Kn)return e;if(t==="constructor"||t==="__proto__"){const s=Bi(e)[t];return new Proxy(s||{},{get:(c,f)=>f==="__proto__"||f==="prototype"?Object.freeze(Object.create(null)):Reflect.get(c,f),set:()=>!0,apply:(c,f,d)=>Reflect.apply(c,f,d)})}let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=Bi(e);if(!r1(i,t,e.type_))return Pre(e,i,t);const a=i[t];if(e.finalized_||!Si(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&wre(t))return a;if(a===a1(e.base_,t)){Wm(e);const l=e.type_===1?+t:t,s=dw(e.scope_,a,e,l);return e.copy_[l]=s}return a},has(e,t){return t==="constructor"||t==="__proto__"||t==="prototype"?!1:t in Bi(e)},ownKeys(e){return Reflect.ownKeys(Bi(e))},set(e,t,n){if(t==="constructor"||t==="__proto__"||t==="prototype")return!0;const r=h5(Bi(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=a1(Bi(e),t),a=i?.[Kn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Sre(n,i)&&(n!==void 0||r1(e.base_,t,e.type_)))return!0;Wm(e),hw(e)}return e.copy_[t]===n&&(n!==void 0||r1(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Mre(e,t,n)),!0},deleteProperty(e,t){return Wm(e),a1(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),hw(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Bi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[qm]:!0,[lw]:e.type_!==1||t!=="length",[zg]:r[zg],[Dh]:n[t]}},defineProperty(){fi(11)},getPrototypeOf(e){return Zu(e.base_)},setPrototypeOf(){fi(12)}},_h={};for(let e in Fg){let t=Fg[e];_h[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}_h.deleteProperty=function(e,t){return _h.set.call(this,e,t,void 0)};_h.set=function(e,t,n){return Fg.set.call(this,e[0],t,n,e[0])};function a1(e,t){const n=e[Kn];return(n?Bi(n):e)[t]}function Pre(e,t,n){const r=h5(t,n);return r?Dh in r?r[Dh]:r.get?.call(e.draft_):void 0}function h5(e,t){if(!(t in e))return;let n=Zu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Zu(n)}}function hw(e){e.modified_||(e.modified_=!0,e.parent_&&hw(e.parent_))}function Wm(e){e.copy_||(e.assigned_=new Map,e.copy_=sw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var _re=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(Su(t)&&!Su(n)){const a=n;n=t;const l=this;return function(c=a,...f){return l.produce(c,d=>n.call(this,d,...f))}}Su(n)||fi(6),r!==void 0&&!Su(r)&&fi(7);let i;if(Si(t)){const a=s_(this),l=dw(a,t,void 0);let s=!0;try{i=n(l),s=!1}finally{s?cw(a):fw(a)}return o_(a,r),u_(i,a)}else if(!t||!mA(t)){if(i=n(t),i===void 0&&(i=t),i===a5&&(i=void 0),this.autoFreeze_&&vA(i,!0),r){const a=[],l=[];hs(uw).generateReplacementPatches_(t,i,{patches_:a,inversePatches_:l}),r(a,l)}return i}else fi(1,t)},this.produceWithPatches=(t,n)=>{if(Su(t))return(l,...s)=>this.produceWithPatches(l,c=>t(c,...s));let r,i;return[this.produce(t,n,(l,s)=>{r=l,i=s}),r,i]},i1(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),i1(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),i1(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Si(e)||fi(8),Ka(e)&&(e=Gr(e));const t=s_(this),n=dw(t,e,void 0);return n[Kn].isManual_=!0,fw(t),n}finishDraft(e,t){const n=e&&e[Kn];(!n||!n.isManual_)&&fi(9);const{scope_:r}=n;return o_(r,t),u_(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=hs(uw).applyPatches_;return Ka(e)?r(e,t):this.produce(e,i=>r(i,t))}};function dw(e,t,n,r){const[i,a]=iy(t)?hs(Ug).proxyMap_(t,n):ay(t)?hs(Ug).proxySet_(t,n):Dre(t,n);return(n?.scope_??s5()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Tre(n,a,r):a.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(a);const{patchPlugin_:f}=c;a.modified_&&f&&f.generatePatches_(a,[],c)}),i}function Gr(e){return Ka(e)||fi(10,e),d5(e)}function d5(e){if(!Si(e)||ly(e))return e;const t=e[Kn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=sw(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=sw(e,!0);return ny(n,(i,a)=>{$g(n,i,d5(a))},r),t&&(t.finalized_=!1),n}var Nre=new _re,p5=Nre.produce,Ye=e=>e;function m5(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var Rre=m5(),jre=m5,Ire=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Lg:Lg.apply(null,arguments)};function Nr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Dr(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>i5(r)&&r.type===e,n}var g5=class Uf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Uf.prototype)}static get[Symbol.species](){return Uf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Uf(...t[0].concat(this)):new Uf(...t.concat(this))}};function f_(e){return Si(e)?p5(e,()=>{}):e}function mm(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Lre(e){return typeof e=="boolean"}var Bre=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new g5;return n&&(Lre(n)?l.push(Rre):l.push(jre(n.extraArgument))),l},v5="RTK_autoBatch",bt=()=>e=>({payload:e,meta:{[v5]:!0}}),h_=e=>t=>{setTimeout(t,e)},zre=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(l),n())},a=e(i),l=setTimeout(i,t)},y5=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,l=!1;const s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?zre(window.requestAnimationFrame,100):h_(10):e.type==="callback"?e.queueNotification:h_(e.timeout),f=()=>{l=!1,a&&(a=!1,s.forEach(d=>d()))};return Object.assign({},r,{subscribe(d){const p=()=>i&&d(),g=r.subscribe(p);return s.add(d),()=>{g(),s.delete(d)}},dispatch(d){try{return i=!d?.meta?.[v5],a=!i,a&&(l||(l=!0,c(f))),r.dispatch(d)}finally{i=!0}}})},$re=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new g5(e);return r&&i.push(y5(typeof r=="object"?r:void 0)),i};function Ure(e){const t=Bre(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{};let s;if(typeof n=="function")s=n;else if(pA(n))s=r5(n);else throw new Error(Dr(1));let c;typeof r=="function"?c=r(t):c=t();let f=Lg;i&&(f=Ire({trace:!1,...typeof i=="object"&&i}));const d=bre(...c),p=$re(d);let g=typeof l=="function"?l(p):p();const v=f(...g);return n5(s,a,v)}function b5(e){const t={},n=[];let r;const i={addCase(a,l){const s=typeof a=="string"?a:a.type;if(!s)throw new Error(Dr(28));if(s in t)throw new Error(Dr(29));return t[s]=l,i},addAsyncThunk(a,l){return l.pending&&(t[a.pending.type]=l.pending),l.rejected&&(t[a.rejected.type]=l.rejected),l.fulfilled&&(t[a.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:a.settled,reducer:l.settled}),i},addMatcher(a,l){return n.push({matcher:a,reducer:l}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function Hre(e){return typeof e=="function"}function Fre(e,t){let[n,r,i]=b5(t),a;if(Hre(e))a=()=>f_(e());else{const s=f_(e);a=()=>s}function l(s=a(),c){let f=[n[c.type],...r.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return f.filter(d=>!!d).length===0&&(f=[i]),f.reduce((d,p)=>{if(p)if(Ka(d)){const v=p(d,c);return v===void 0?d:v}else{if(Si(d))return p5(d,g=>p(g,c));{const g=p(d,c);if(g===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return d},s)}return l.getInitialState=a,l}var qre="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Wre=(e=21)=>{let t="",n=e;for(;n--;)t+=qre[Math.random()*64|0];return t},Vre=Symbol.for("rtk-slice-createasyncthunk");function Kre(e,t){return`${e}/${t}`}function Xre({creators:e}={}){const t=e?.asyncThunk?.[Vre];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(Dr(11));const l=(typeof r.reducers=="function"?r.reducers(Yre()):r.reducers)||{},s=Object.keys(l),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(k,P){const T=typeof k=="string"?k:k.type;if(!T)throw new Error(Dr(12));if(T in c.sliceCaseReducersByType)throw new Error(Dr(13));return c.sliceCaseReducersByType[T]=P,f},addMatcher(k,P){return c.sliceMatchers.push({matcher:k,reducer:P}),f},exposeAction(k,P){return c.actionCreators[k]=P,f},exposeCaseReducer(k,P){return c.sliceCaseReducersByName[k]=P,f}};s.forEach(k=>{const P=l[k],T={reducerName:k,type:Kre(i,k),createNotation:typeof r.reducers=="function"};Zre(P)?eie(T,P,f,t):Gre(T,P,f)});function d(){const[k={},P=[],T=void 0]=typeof r.extraReducers=="function"?b5(r.extraReducers):[r.extraReducers],D={...k,...c.sliceCaseReducersByType};return Fre(r.initialState,N=>{for(let I in D)N.addCase(I,D[I]);for(let I of c.sliceMatchers)N.addMatcher(I.matcher,I.reducer);for(let I of P)N.addMatcher(I.matcher,I.reducer);T&&N.addDefaultCase(T)})}const p=k=>k,g=new Map,v=new WeakMap;let y;function x(k,P){return y||(y=d()),y(k,P)}function w(){return y||(y=d()),y.getInitialState()}function A(k,P=!1){function T(N){let I=N[k];return typeof I>"u"&&P&&(I=mm(v,T,w)),I}function D(N=p){const I=mm(g,P,()=>new WeakMap);return mm(I,N,()=>{const U={};for(const[K,V]of Object.entries(r.selectors??{}))U[K]=Qre(V,N,()=>mm(v,N,w),P);return U})}return{reducerPath:k,getSelectors:D,get selectors(){return D(T)},selectSlice:T}}const C={name:i,reducer:x,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:w,...A(a),injectInto(k,{reducerPath:P,...T}={}){const D=P??a;return k.inject({reducerPath:D,reducer:x},T),{...C,...A(D,!0)}}};return C}}function Qre(e,t,n,r){function i(a,...l){let s=t(a);return typeof s>"u"&&r&&(s=n()),e(s,...l)}return i.unwrapped=e,i}var In=Xre();function Yre(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Gre({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!Jre(r))throw new Error(Dr(17));a=r.reducer,l=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?Nr(e,l):Nr(e))}function Zre(e){return e._reducerDefinitionType==="asyncThunk"}function Jre(e){return e._reducerDefinitionType==="reducerWithPrepare"}function eie({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Dr(18));const{payloadCreator:a,fulfilled:l,pending:s,rejected:c,settled:f,options:d}=n,p=i(e,a,d);r.exposeAction(t,p),l&&r.addCase(p.fulfilled,l),s&&r.addCase(p.pending,s),c&&r.addCase(p.rejected,c),f&&r.addMatcher(p.settled,f),r.exposeCaseReducer(t,{fulfilled:l||gm,pending:s||gm,rejected:c||gm,settled:f||gm})}function gm(){}var tie="task",x5="listener",S5="completed",yA="cancelled",nie=`task-${yA}`,rie=`task-${S5}`,pw=`${x5}-${yA}`,iie=`${x5}-${S5}`,sy=class{constructor(e){this.code=e,this.message=`${tie} ${yA} (reason: ${e})`}code;name="TaskAbortError";message},bA=(e,t)=>{if(typeof e!="function")throw new TypeError(Dr(32))},qg=()=>{},w5=(e,t=qg)=>(e.catch(t),e),O5=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Jo=e=>{if(e.aborted)throw new sy(e.reason)};function A5(e,t){let n=qg;return new Promise((r,i)=>{const a=()=>i(new sy(e.reason));if(e.aborted){a();return}n=O5(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=qg})}var aie=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof sy?"cancelled":"rejected",error:n}}finally{t?.()}},Wg=e=>t=>w5(A5(e,t).then(n=>(Jo(e),n))),k5=e=>{const t=Wg(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Bu}=Object,d_={},uy="listenerMiddleware",lie=(e,t)=>{const n=r=>O5(e,()=>r.abort(e.reason));return(r,i)=>{bA(r);const a=new AbortController;n(a);const l=aie(async()=>{Jo(e),Jo(a.signal);const s=await r({pause:Wg(a.signal),delay:k5(a.signal),signal:a.signal});return Jo(a.signal),s},()=>a.abort(rie));return i?.autoJoin&&t.push(l.catch(qg)),{result:Wg(e)(l),cancel(){a.abort(nie)}}}},oie=(e,t)=>{const n=async(r,i)=>{Jo(t);let a=()=>{};const s=[new Promise((c,f)=>{let d=e({predicate:r,effect:(p,g)=>{g.unsubscribe(),c([p,g.getState(),g.getOriginalState()])}});a=()=>{d(),f()}})];i!=null&&s.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await A5(t,Promise.race(s));return Jo(t),c}finally{a()}};return((r,i)=>w5(n(r,i)))},C5=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Nr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Dr(21));return bA(a),{predicate:i,type:t,effect:a}},E5=Bu(e=>{const{type:t,predicate:n,effect:r}=C5(e);return{id:Wre(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Dr(22))}}},{withTypes:()=>E5}),p_=(e,t)=>{const{type:n,effect:r,predicate:i}=C5(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},mw=e=>{e.pending.forEach(t=>{t.abort(pw)})},sie=(e,t)=>()=>{for(const n of t.keys())mw(n);e.clear()},m_=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},T5=Bu(Nr(`${uy}/add`),{withTypes:()=>T5}),uie=Nr(`${uy}/removeAll`),M5=Bu(Nr(`${uy}/remove`),{withTypes:()=>M5}),cie=(...e)=>{console.error(`${uy}/error`,...e)},ed=(e={})=>{const t=new Map,n=new Map,r=v=>{const y=n.get(v)??0;n.set(v,y+1)},i=v=>{const y=n.get(v)??1;y===1?n.delete(v):n.set(v,y-1)},{extra:a,onError:l=cie}=e;bA(l);const s=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),y=>{v.unsubscribe(),y?.cancelActive&&mw(v)}),c=(v=>{const y=p_(t,v)??E5(v);return s(y)});Bu(c,{withTypes:()=>c});const f=v=>{const y=p_(t,v);return y&&(y.unsubscribe(),v.cancelActive&&mw(y)),!!y};Bu(f,{withTypes:()=>f});const d=async(v,y,x,w)=>{const A=new AbortController,C=oie(c,A.signal),k=[];try{v.pending.add(A),r(v),await Promise.resolve(v.effect(y,Bu({},x,{getOriginalState:w,condition:(P,T)=>C(P,T).then(Boolean),take:C,delay:k5(A.signal),pause:Wg(A.signal),extra:a,signal:A.signal,fork:lie(A.signal,k),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((P,T,D)=>{P!==A&&(P.abort(pw),D.delete(P))})},cancel:()=>{A.abort(pw),v.pending.delete(A)},throwIfCancelled:()=>{Jo(A.signal)}})))}catch(P){P instanceof sy||m_(l,P,{raisedBy:"effect"})}finally{await Promise.all(k),A.abort(iie),i(v),v.pending.delete(A)}},p=sie(t,n);return{middleware:v=>y=>x=>{if(!i5(x))return y(x);if(T5.match(x))return c(x.payload);if(uie.match(x)){p();return}if(M5.match(x))return f(x.payload);let w=v.getState();const A=()=>{if(w===d_)throw new Error(Dr(23));return w};let C;try{if(C=y(x),t.size>0){const k=v.getState(),P=Array.from(t.values());for(const T of P){let D=!1;try{D=T.predicate(x,k,w)}catch(N){D=!1,m_(l,N,{raisedBy:"predicate"})}D&&d(T,x,v,A)}}}finally{w=d_}return C},startListening:c,stopListening:f,clearListeners:p}};function Dr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var fie={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},D5=In({name:"chartLayout",initialState:fie,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),cy=D5.actions,hie=cy.setMargin,die=cy.setLayout,pie=cy.setChartSize,mie=cy.setScale,gie=D5.reducer;function P5(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Ve(e){return Number.isFinite(e)}function ta(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function g_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g_(Object(n),!0).forEach(function(r){vie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vie(e,t,n){return(t=yie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yie(e){var t=bie(e,"string");return typeof t=="symbol"?t:t+""}function bie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bt(e,t,n){return kt(e)||kt(t)?n:ea(t)?Va(e,t,n):typeof t=="function"?t(e):n}var xie=(e,t,n)=>{if(t&&n){var r=n.width,i=n.height,a=t.align,l=t.verticalAlign,s=t.layout;if((s==="vertical"||s==="horizontal"&&l==="middle")&&a!=="center"&&be(e[a]))return Cu(Cu({},e),{},{[a]:e[a]+(r||0)});if((s==="horizontal"||s==="vertical"&&a==="center")&&l!=="middle"&&be(e[l]))return Cu(Cu({},e),{},{[l]:e[l]+(i||0)})}return e},Za=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",_5=(e,t,n,r)=>{if(r)return e.map(s=>s.coordinate);var i,a,l=e.map(s=>(s.coordinate===t&&(i=!0),s.coordinate===n&&(a=!0),s.coordinate));return i||l.push(t),a||l.push(n),l},N5=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,l=e.scale,s=e.realScaleType,c=e.isCategorical,f=e.categoricalDomain,d=e.tickCount,p=e.ticks,g=e.niceTicks,v=e.axisType;if(!l)return null;var y=s==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,x=i==="category"&&l.bandwidth?l.bandwidth()/y:0;if(x=v==="angleAxis"&&a&&a.length>=2?sr(a[0]-a[1])*2*x:x,p||g){var w=(p||g||[]).map((A,C)=>{var k=r?r.indexOf(A):A,P=l.map(k);return Ve(P)?{coordinate:P+x,value:A,offset:x,index:C}:null}).filter(ur);return w}return c&&f?f.map((A,C)=>{var k=l.map(A);return Ve(k)?{coordinate:k+x,value:A,index:C,offset:x}:null}).filter(ur):l.ticks&&d!=null?l.ticks(d).map((A,C)=>{var k=l.map(A);return Ve(k)?{coordinate:k+x,value:A,index:C,offset:x}:null}).filter(ur):l.domain().map((A,C)=>{var k=l.map(A);return Ve(k)?{coordinate:k+x,value:r?r[A]:A,index:C,offset:x}:null}).filter(ur)},Sie=(e,t)=>{if(!t||t.length!==2||!be(t[0])||!be(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!be(e[0])||e[0]<n)&&(i[0]=n),(!be(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},wie=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,l=0,s=0;s<n;++s){var c=e[s],f=c?.[i];if(f!=null){var d=f[1],p=f[0],g=Ji(d)?p:d;g>=0?(f[0]=a,a+=g,f[1]=a):(f[0]=l,l+=g,f[1]=l)}}}},Oie=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,l=0;l<n;++l){var s=e[l],c=s?.[i];if(c!=null){var f=Ji(c[1])?c[0]:c[1];f>=0?(c[0]=a,a+=f,c[1]=a):(c[0]=0,c[1]=0)}}}},Aie={sign:wie,expand:wte,none:cs,silhouette:Ote,wiggle:Ate,positive:Oie},kie=(e,t,n)=>{var r,i=(r=Aie[n])!==null&&r!==void 0?r:cs,a=Ste().keys(t).value((s,c)=>Number(Bt(s,c,0))).order(ew).offset(i),l=a(e);return l.forEach((s,c)=>{s.forEach((f,d)=>{var p=Bt(e[d],t[c],0);Array.isArray(p)&&p.length===2&&be(p[0])&&be(p[1])&&(f[0]=p[0],f[1]=p[1])})}),l};function Cie(e){return e==null?void 0:String(e)}function v_(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!kt(i[t.dataKey])){var s=Rz(n,"value",i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=Bt(i,kt(l)?t.dataKey:l),f=t.scale.map(c);return be(f)?f:null}var y_=e=>{var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,l=e.index;if(t.type==="category")return n[l]?n[l].coordinate+r:null;var s=Bt(a,t.dataKey,t.scale.domain()[l]);if(kt(s))return null;var c=t.scale.map(s);return be(c)?c-i/2+r:null},Eie=e=>{var t=e.numericAxis,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},Tie=e=>{var t=e.flat(2).filter(be);return[Math.min(...t),Math.max(...t)]},Mie=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Die=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return Mie(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var l=a.stackedData,s=l.reduce((c,f)=>{var d=P5(f,t,n),p=Tie(d);return!Ve(p[0])||!Ve(p[1])?c:[Math.min(c[0],p[0]),Math.max(c[1],p[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},b_=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,x_=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ju=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=ey(t,d=>d.coordinate),a=1/0,l=1,s=i.length;l<s;l++){var c=i[l],f=i[l-1];a=Math.min((c?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function S_(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return Cu(Cu({},t),{},{dataKey:n,payload:r,value:i,name:a})}function fy(e,t){if(e!=null)return String(e);if(typeof t=="string")return t}var Pie=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},_ie=(e,t)=>t==="centric"?e.angle:e.radius,Ja=e=>e.layout.width,el=e=>e.layout.height,Nie=e=>e.layout.scale,R5=e=>e.layout.margin,hy=q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),dy=q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Rie="data-recharts-item-index",jie="data-recharts-item-id",td=60;function w_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w_(Object(n),!0).forEach(function(r){Iie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iie(e,t,n){return(t=Lie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lie(e){var t=Bie(e,"string");return typeof t=="symbol"?t:t+""}function Bie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zie=e=>e.brush.height;function $ie(e){var t=dy(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:td;return n+i}return n},0)}function Uie(e){var t=dy(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:td;return n+i}return n},0)}function Hie(e){var t=hy(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Fie(e){var t=hy(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var un=q([Ja,el,R5,zie,$ie,Uie,Hie,Fie,e5,ore],(e,t,n,r,i,a,l,s,c,f)=>{var d={left:(n.left||0)+i,right:(n.right||0)+a},p={top:(n.top||0)+l,bottom:(n.bottom||0)+s},g=vm(vm({},p),d),v=g.bottom;g.bottom+=r,g=xie(g,c,f);var y=e-g.left-g.right,x=t-g.top-g.bottom;return vm(vm({brushBottom:v},g),{},{width:Math.max(y,0),height:Math.max(x,0)})}),qie=q(un,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),xA=q(Ja,el,(e,t)=>({x:0,y:0,width:e,height:t})),Wie=O.createContext(null),Ln=()=>O.useContext(Wie)!=null,py=e=>e.brush,my=q([py,un,R5],(e,t,n)=>({height:e.height,x:be(e.x)?e.x:t.left,y:be(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:be(e.width)?e.width:t.width}));function Vie(e,t,{signal:n,edges:r}={}){let i,a=null;const l=r!=null&&r.includes("leading"),s=r==null||r.includes("trailing"),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},f=()=>{s&&c(),v()};let d=null;const p=()=>{d!=null&&clearTimeout(d),d=setTimeout(()=>{d=null,f()},t)},g=()=>{d!==null&&(clearTimeout(d),d=null)},v=()=>{g(),i=void 0,a=null},y=()=>{c()},x=function(...w){if(n?.aborted)return;i=this,a=w;const A=d==null;p(),l&&A&&c()};return x.schedule=p,x.cancel=v,x.flush=y,n?.addEventListener("abort",v,{once:!0}),x}function Kie(e,t=0,n={}){typeof n!="object"&&(n={});const{leading:r=!1,trailing:i=!0,maxWait:a}=n,l=Array(2);r&&(l[0]="leading"),i&&(l[1]="trailing");let s,c=null;const f=Vie(function(...g){s=e.apply(this,g),c=null},t,{edges:l}),d=function(...g){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,g),c=Date.now(),f.cancel(),f.schedule(),s):(f.apply(this,g),s)},p=()=>(f.flush(),s);return d.cancel=f.cancel,d.flush=p,d}function Xie(e,t=0,n={}){const{leading:r=!0,trailing:i=!0}=n;return Kie(e,t,{leading:r,maxWait:t,trailing:i})}var Vg=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},Ki={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},j5=(e,t,n)=>{var r=n.width,i=r===void 0?Ki.width:r,a=n.height,l=a===void 0?Ki.height:a,s=n.aspect,c=n.maxHeight,f=fs(i)?e:Number(i),d=fs(l)?t:Number(l);return s&&s>0&&(f?d=f/s:d&&(f=d*s),c&&d!=null&&d>c&&(d=c)),{calculatedWidth:f,calculatedHeight:d}},Qie={width:0,height:0,overflow:"visible"},Yie={width:0,overflowX:"visible"},Gie={height:0,overflowY:"visible"},Zie={},Jie=e=>{var t=e.width,n=e.height,r=fs(t),i=fs(n);return r&&i?Qie:r?Yie:i?Gie:Zie};function eae(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Ki.width,a=Ki.height):i===void 0?i=r&&r>0?void 0:Ki.width:a===void 0&&(a=r&&r>0?void 0:Ki.height),{width:i,height:a}}var tae=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Kg(){return Kg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kg.apply(null,arguments)}function O_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function A_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O_(Object(n),!0).forEach(function(r){nae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nae(e,t,n){return(t=rae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rae(e){var t=iae(e,"string");return typeof t=="symbol"?t:t+""}function iae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aae(e,t){return uae(e)||sae(e,t)||oae(e,t)||lae()}function lae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
71
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oae(e,t){if(e){if(typeof e=="string")return k_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k_(e,t):void 0}}function k_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function uae(e){if(Array.isArray(e))return e}function cae(e,t){if(e==null)return{};var n,r,i=fae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var I5=O.createContext(Ki.initialDimension);function hae(e){return ta(e.width)&&ta(e.height)}function L5(e){var t=e.children,n=e.width,r=e.height,i=O.useMemo(()=>({width:n,height:r}),[n,r]);return hae(i)?O.createElement(I5.Provider,{value:i},t):null}var SA=()=>O.useContext(I5),dae=O.forwardRef((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Ki.initialDimension:r,a=e.width,l=e.height,s=e.minWidth,c=s===void 0?Ki.minWidth:s,f=e.minHeight,d=e.maxHeight,p=e.children,g=e.debounce,v=g===void 0?Ki.debounce:g,y=e.id,x=e.className,w=e.onResize,A=e.style,C=A===void 0?{}:A,k=cae(e,tae),P=O.useRef(null),T=O.useRef();T.current=w,O.useImperativeHandle(t,()=>P.current);var D=O.useState({containerWidth:i.width,containerHeight:i.height}),N=aae(D,2),I=N[0],U=N[1],K=O.useCallback((z,G)=>{U(ne=>{var ce=Math.round(z),fe=Math.round(G);return ne.containerWidth===ce&&ne.containerHeight===fe?ne:{containerWidth:ce,containerHeight:fe}})},[]);O.useEffect(()=>{if(P.current==null||typeof ResizeObserver>"u")return ys;var z=R=>{var X,re=R[0];if(re!=null){var le=re.contentRect,ge=le.width,Oe=le.height;K(ge,Oe),(X=T.current)===null||X===void 0||X.call(T,ge,Oe)}};v>0&&(z=Xie(z,v,{trailing:!0,leading:!1}));var G=new ResizeObserver(z),ne=P.current.getBoundingClientRect(),ce=ne.width,fe=ne.height;return K(ce,fe),G.observe(P.current),()=>{G.disconnect()}},[K,v]);var V=I.containerWidth,B=I.containerHeight;Vg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var ae=j5(V,B,{width:a,height:l,aspect:n,maxHeight:d}),ie=ae.calculatedWidth,oe=ae.calculatedHeight;return Vg(V<0||B<0||ie!=null&&ie>0||oe!=null&&oe>0,`The width(%s) and height(%s) of chart should be greater than 0,
72
- please check the style of container, or the props width(%s) and height(%s),
73
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
74
- height and width.`,ie,oe,a,l,c,f,n),O.createElement("div",Kg({id:y?"".concat(y):void 0,className:st("recharts-responsive-container",x),style:A_(A_({},C),{},{width:a,height:l,minWidth:c,minHeight:f,maxHeight:d}),ref:P},k),O.createElement("div",{style:Jie({width:a,height:l})},O.createElement(L5,{width:ie,height:oe},p)))}),C_=O.forwardRef((e,t)=>{var n=SA();if(ta(n.width)&&ta(n.height))return e.children;var r=eae({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,l=j5(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),s=l.calculatedWidth,c=l.calculatedHeight;return be(s)&&be(c)?O.createElement(L5,{width:s,height:c},e.children):O.createElement(dae,Kg({},e,{width:i,height:a,ref:t}))});function wA(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var gy=()=>{var e,t=Ln(),n=we(qie),r=we(my),i=(e=we(py))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},pae={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},B5=()=>{var e;return(e=we(un))!==null&&e!==void 0?e:pae},OA=()=>we(Ja),AA=()=>we(el),mae=()=>we(e=>e.layout.margin),nt=e=>e.layout.layoutType,bs=()=>we(nt),z5=()=>{var e=bs();if(e==="horizontal"||e==="vertical")return e},$5=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},gae=()=>{var e=bs();return e!==void 0},nd=e=>{var t=St(),n=Ln(),r=e.width,i=e.height,a=SA(),l=r,s=i;return a&&(l=a.width>0?a.width:r,s=a.height>0?a.height:i),O.useEffect(()=>{!n&&ta(l)&&ta(s)&&t(pie({width:l,height:s}))},[t,n,l,s]),null},vae={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},U5=In({name:"legend",initialState:vae,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(Ye(t.payload))},prepare:bt()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Gr(e).payload.indexOf(Ye(r));a>-1&&(e.payload[a]=Ye(i))},prepare:bt()},removeLegendPayload:{reducer(e,t){var n=Gr(e).payload.indexOf(Ye(t.payload));n>-1&&e.payload.splice(n,1)},prepare:bt()}}}),rd=U5.actions,E_=rd.setLegendSize,yae=rd.setLegendSettings,bae=rd.addLegendPayload,xae=rd.replaceLegendPayload,Sae=rd.removeLegendPayload,wae=U5.reducer,l1={exports:{}},o1={};var T_;function Oae(){if(T_)return o1;T_=1;var e=lc();function t(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,l=e.useMemo,s=e.useDebugValue;return o1.useSyncExternalStoreWithSelector=function(c,f,d,p,g){var v=i(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=l(function(){function w(T){if(!A){if(A=!0,C=T,T=p(T),g!==void 0&&y.hasValue){var D=y.value;if(g(D,T))return k=D}return k=T}if(D=k,n(C,T))return D;var N=p(T);return g!==void 0&&g(D,N)?(C=T,D):(C=T,k=N)}var A=!1,C,k,P=d===void 0?null:d;return[function(){return w(f())},P===null?void 0:function(){return w(P())}]},[f,d,p,g]);var x=r(c,v[0],v[1]);return a(function(){y.hasValue=!0,y.value=x},[x]),s(x),x},o1}var M_;function Aae(){return M_||(M_=1,l1.exports=Oae()),l1.exports}Aae();function kae(e){e()}function Cae(){let e=null,t=null;return{clear(){e=null,t=null},notify(){kae(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var D_={notify(){},get:()=>[]};function Eae(e,t){let n,r=D_,i=0,a=!1;function l(x){d();const w=r.subscribe(x);let A=!1;return()=>{A||(A=!0,w(),p())}}function s(){r.notify()}function c(){y.onStateChange&&y.onStateChange()}function f(){return a}function d(){i++,n||(n=e.subscribe(c),r=Cae())}function p(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=D_)}function g(){a||(a=!0,d())}function v(){a&&(a=!1,p())}const y={addNestedSub:l,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:f,trySubscribe:g,tryUnsubscribe:v,getListeners:()=>r};return y}var Tae=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Mae=Tae(),Dae=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Pae=Dae(),_ae=()=>Mae||Pae?O.useLayoutEffect:O.useEffect,Nae=_ae();function P_(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Rae(e,t){if(P_(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!P_(e[n[i]],t[n[i]]))return!1;return!0}var jae=Symbol.for("react-redux-context"),Iae=typeof globalThis<"u"?globalThis:{};function Lae(){if(!O.createContext)return{};const e=Iae[jae]??=new Map;let t=e.get(O.createContext);return t||(t=O.createContext(null),e.set(O.createContext,t)),t}var Bae=Lae();function zae(e){const{children:t,context:n,serverState:r,store:i}=e,a=O.useMemo(()=>{const c=Eae(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),l=O.useMemo(()=>i.getState(),[i]);Nae(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),l!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,l]);const s=n||Bae;return O.createElement(s.Provider,{value:a},t)}var $ae=zae,Uae=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Hae(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function pc(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Uae.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Rae(e[r],t[r]))return!1}else if(!Hae(e[r],t[r]))return!1;return!0}var Fae=["contextPayload"];function gw(){return gw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gw.apply(null,arguments)}function qae(e,t){return Xae(e)||Kae(e,t)||Vae(e,t)||Wae()}function Wae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
75
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vae(e,t){if(e){if(typeof e=="string")return __(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?__(e,t):void 0}}function __(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Kae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Xae(e){if(Array.isArray(e))return e}function N_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ec(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N_(Object(n),!0).forEach(function(r){Qae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qae(e,t,n){return(t=Yae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yae(e){var t=Gae(e,"string");return typeof t=="symbol"?t:t+""}function Gae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zae(e,t){if(e==null)return{};var n,r,i=Jae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ele(e){return e.value}function tle(e){var t=e.contextPayload,n=Zae(e,Fae),r=Yz(t,e.payloadUniqBy,ele),i=ec(ec({},n),{},{payload:r});return O.isValidElement(e.content)?O.cloneElement(e.content,i):typeof e.content=="function"?O.createElement(e.content,i):O.createElement(Yte,i)}function nle(e,t,n,r,i,a){var l=t.layout,s=t.align,c=t.verticalAlign,f,d;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(s==="center"&&l==="vertical"?f={left:((r||0)-a.width)/2}:f=s==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(c==="middle"?d={top:((i||0)-a.height)/2}:d=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),ec(ec({},f),d)}function rle(e){var t=e.align,n=e.layout,r=e.verticalAlign,i=e.itemSorter,a=St();return O.useLayoutEffect(()=>{a(yae({align:t,layout:n,verticalAlign:r,itemSorter:i}))},[a,t,n,r,i]),null}function ile(e){var t=e.width,n=e.height,r=St();return O.useLayoutEffect(()=>{r(E_({width:t,height:n}))},[r,t,n]),O.useLayoutEffect(()=>()=>{r(E_({width:0,height:0}))},[r]),null}function ale(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var lle={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",labelStyle:{},layout:"horizontal",verticalAlign:"bottom"};function ole(e){var t=jn(e,lle),n=cre(),r=Wee(),i=mae(),a=t.width,l=t.height,s=t.wrapperStyle,c=t.portal,f=t5([n]),d=qae(f,2),p=d[0],g=d[1],v=OA(),y=AA();if(v==null||y==null)return null;var x=v-(i?.left||0)-(i?.right||0),w=ale(t.layout,l,a,x),A=c?s:ec(ec({position:"absolute",width:w?.width||a||"auto",height:w?.height||l||"auto"},nle(s,t,i,v,y,p)),s),C=c??r;if(C==null||n==null)return null;var k=O.createElement("div",{className:"recharts-legend-wrapper",style:A,ref:g},O.createElement(rle,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&O.createElement(ile,{width:p.width,height:p.height}),O.createElement(tle,gw({},t,w,{margin:i,chartWidth:v,chartHeight:y,contextPayload:n})));return aO.createPortal(k,C)}var H5=O.memo(ole,pc);H5.displayName="Legend";function vw(){return vw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vw.apply(null,arguments)}function R_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R_(Object(n),!0).forEach(function(r){sle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sle(e,t,n){return(t=ule(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ule(e){var t=cle(e,"string");return typeof t=="symbol"?t:t+""}function cle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fle(e,t){return mle(e)||ple(e,t)||dle(e,t)||hle()}function hle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
76
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dle(e,t){if(e){if(typeof e=="string")return j_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j_(e,t):void 0}}function j_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ple(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function mle(e){if(Array.isArray(e))return e}function gle(e){return Array.isArray(e)&&ea(e[0])&&ea(e[1])?e.join(" ~ "):e}var uu={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function vle(e,t){return t==null?e:ey(e,t)}var yle=e=>{var t=e.separator,n=t===void 0?uu.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,l=a===void 0?uu.labelStyle:a,s=e.payload,c=e.formatter,f=e.itemSorter,d=e.wrapperClassName,p=e.labelClassName,g=e.label,v=e.labelFormatter,y=e.accessibilityLayer,x=y===void 0?uu.accessibilityLayer:y,w=()=>{if(s&&s.length){var I={padding:0,margin:0},U=vle(s,f),K=U.map((V,B)=>{if(!V||V.type==="none")return null;var ae=V.formatter||c||gle,ie=V.value,oe=V.name,z=ie,G=oe;if(ae){var ne=ae(ie,oe,V,B,s);if(Array.isArray(ne)){var ce=fle(ne,2);z=ce[0],G=ce[1]}else if(ne!=null)z=ne;else return null}var fe=Cf(Cf({},uu.itemStyle),{},{color:V.color||uu.itemStyle.color},i);return O.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(B),style:fe},ea(G)?O.createElement("span",{className:"recharts-tooltip-item-name"},G):null,ea(G)?O.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,O.createElement("span",{className:"recharts-tooltip-item-value"},z),O.createElement("span",{className:"recharts-tooltip-item-unit"},V.unit||""))});return O.createElement("ul",{className:"recharts-tooltip-item-list",style:I},K)}return null},A=Cf(Cf({},uu.contentStyle),r),C=Cf({margin:0},l),k=!kt(g),P=k?g:"",T=st("recharts-default-tooltip",d),D=st("recharts-tooltip-label",p);k&&v&&s!==void 0&&s!==null&&(P=v(g,s));var N=x?{role:"status","aria-live":"assertive"}:{};return O.createElement("div",vw({className:T,style:A},N),O.createElement("p",{className:D,style:C},O.isValidElement(P)?P:"".concat(P)),w())},Ef="recharts-tooltip-wrapper",ble={visibility:"hidden"};function xle(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return st(Ef,{["".concat(Ef,"-right")]:be(n)&&t&&be(t.x)&&n>=t.x,["".concat(Ef,"-left")]:be(n)&&t&&be(t.x)&&n<t.x,["".concat(Ef,"-bottom")]:be(r)&&t&&be(t.y)&&r>=t.y,["".concat(Ef,"-top")]:be(r)&&t&&be(t.y)&&r<t.y})}function I_(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offset,a=e.position,l=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,f=e.viewBoxDimension;if(a&&be(a[r]))return a[r];var d=n[r]-s-(i>0?i:0),p=n[r]+i;if(t[r])return l[r]?d:p;var g=c[r];if(g==null)return 0;if(l[r]){var v=d,y=g;return v<y?Math.max(p,g):Math.max(d,g)}if(f==null)return 0;var x=p+s,w=g+f;return x>w?Math.max(d,g):Math.max(p,g)}function Sle(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function wle(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,l=e.reverseDirection,s=e.tooltipBox,c=e.useTranslate3d,f=e.viewBox,d,p,g;return s.height>0&&s.width>0&&n?(p=I_({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:s.width,viewBox:f,viewBoxDimension:f.width}),g=I_({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:s.height,viewBox:f,viewBoxDimension:f.height}),d=Sle({translateX:p,translateY:g,useTranslate3d:c})):d=ble,{cssProperties:d,cssClasses:xle({translateX:p,translateY:g,coordinate:n})}}var Ole=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),id={isSsr:Ole()};function Ale(e,t){return Tle(e)||Ele(e,t)||Cle(e,t)||kle()}function kle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
77
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cle(e,t){if(e){if(typeof e=="string")return L_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L_(e,t):void 0}}function L_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ele(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Tle(e){if(Array.isArray(e))return e}function F5(){var e=O.useState(()=>id.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=Ale(e,2),n=t[0],r=t[1];return O.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),a=()=>{r(i.matches)};return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}}},[]),n}function B_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B_(Object(n),!0).forEach(function(r){Mle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mle(e,t,n){return(t=Dle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dle(e){var t=Ple(e,"string");return typeof t=="symbol"?t:t+""}function Ple(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _le(e,t){return Ile(e)||jle(e,t)||Rle(e,t)||Nle()}function Nle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
78
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rle(e,t){if(e){if(typeof e=="string")return z_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z_(e,t):void 0}}function z_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Ile(e){if(Array.isArray(e))return e}function Lle(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active){var t=typeof e.animationEasing=="string"?e.animationEasing:"ease";return"transform ".concat(e.animationDuration,"ms ").concat(t)}}function Ble(e){var t,n,r,i,a,l,s=F5(),c=O.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),f=_le(c,2),d=f[0],p=f[1];O.useEffect(()=>{var A=C=>{if(C.key==="Escape"){var k,P,T,D;p({dismissed:!0,dismissedAtCoordinate:{x:(k=(P=e.coordinate)===null||P===void 0?void 0:P.x)!==null&&k!==void 0?k:0,y:(T=(D=e.coordinate)===null||D===void 0?void 0:D.y)!==null&&T!==void 0?T:0}})}};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&p(cu(cu({},d),{},{dismissed:!1}));var g=wle({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),v=g.cssClasses,y=g.cssProperties,x=e.hasPortalFromProps?{}:cu(cu({transition:Lle({prefersReducedMotion:s,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},y),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),w=cu(cu({},x),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return O.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:v,style:w,ref:e.innerRef},e.children)}var zle=O.memo(Ble),q5=()=>{var e;return(e=we(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function yw(){return yw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yw.apply(null,arguments)}function $_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function U_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$_(Object(n),!0).forEach(function(r){$le(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $le(e,t,n){return(t=Ule(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ule(e){var t=Hle(e,"string");return typeof t=="symbol"?t:t+""}function Hle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var H_={curveBasisClosed:cte,curveBasisOpen:fte,curveBasis:ute,curveBumpX:Qee,curveBumpY:Yee,curveLinearClosed:hte,curveLinear:Gv,curveMonotoneX:dte,curveMonotoneY:pte,curveNatural:mte,curveStep:gte,curveStepAfter:yte,curveStepBefore:vte},Xg=e=>Ve(e.x)&&Ve(e.y),F_=e=>e.base!=null&&Xg(e.base)&&Xg(e),Tf=e=>e.x,Mf=e=>e.y,Fle=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Zh(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=H_["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return H_[n]||Gv},q_={connectNulls:!1,type:"linear"},qle=e=>{var t=e.type,n=t===void 0?q_.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,l=e.layout,s=e.connectNulls,c=s===void 0?q_.connectNulls:s,f=Fle(n,l),d=c?i.filter(Xg):i;if(Array.isArray(a)){var p,g=i.map((A,C)=>U_(U_({},A),{},{base:a[C]}));l==="vertical"?p=fm().y(Mf).x1(Tf).x0(A=>A.base.x):p=fm().x(Tf).y1(Mf).y0(A=>A.base.y);var v=p.defined(F_).curve(f),y=c?g.filter(F_):g;return v(y)}var x;l==="vertical"&&be(a)?x=fm().y(Mf).x1(Tf).x0(a):be(a)?x=fm().x(Tf).y1(Mf).y0(a):x=xz().x(Tf).y(Mf);var w=x.defined(Xg).curve(f);return w(d)},W5=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=bs();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?qle(l):r;return O.createElement("path",yw({},bi(e),fA(e),{className:st("recharts-curve",t),d:s===null?void 0:s,ref:i}))},Wle=["x","y","top","left","width","height","className"];function bw(){return bw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bw.apply(null,arguments)}function W_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vle(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W_(Object(n),!0).forEach(function(r){Kle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kle(e,t,n){return(t=Xle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xle(e){var t=Qle(e,"string");return typeof t=="symbol"?t:t+""}function Qle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yle(e,t){if(e==null)return{};var n,r,i=Gle(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Gle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Zle=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Jle=e=>{var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,l=a===void 0?0:a,s=e.left,c=s===void 0?0:s,f=e.width,d=f===void 0?0:f,p=e.height,g=p===void 0?0:p,v=e.className,y=Yle(e,Wle),x=Vle({x:n,y:i,top:l,left:c,width:d,height:g},y);return!be(n)||!be(i)||!be(d)||!be(g)||!be(l)||!be(c)?null:O.createElement("path",bw({},Pr(x),{className:st("recharts-cross",v),d:Zle(n,i,d,g,l,c)}))};function eoe(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}var Qg=1e-4,V5=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],K5=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),V_=(e,t)=>n=>{var r=V5(e,t);return K5(r,n)},toe=(e,t)=>n=>{var r=V5(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return K5(i,n)},noe=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},roe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=noe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},ioe=(e,t,n,r)=>{var i=V_(e,n),a=V_(t,r),l=toe(e,n),s=f=>f>1?1:f<0?0:f,c=f=>{for(var d=f>1?1:f,p=d,g=0;g<8;++g){var v=i(p)-d,y=l(p);if(Math.abs(v-d)<Qg||y<Qg)return a(p);p=s(p-v/y)}return a(p)};return c.isStepper=!1,c},K_=function(){return ioe(...roe(...arguments))},aoe=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,a=i===void 0?8:i,l=t.dt,s=l===void 0?16.67:l,c=1,f=[0],d=0,p=0,g=1e4,v=0;v<g;){var y=-(d-c)*r,x=p*a;if(p+=(y-x)*s/1e3,d+=p*s/1e3,f.push(d),Math.abs(d-c)<Qg&&Math.abs(p)<Qg)break;v++}f[f.length-1]=c;var w=f.length-1;return A=>{var C,k,P;if(A<=0)return 0;if(A>=1)return c;var T=A*w,D=Math.floor(T),N=T-D;return((C=f[D])!==null&&C!==void 0?C:0)+(((k=f[D+1])!==null&&k!==void 0?k:0)-((P=f[D])!==null&&P!==void 0?P:0))*N}},loe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return K_(e);case"spring":return aoe();default:if(e.split("(")[0]==="cubic-bezier")return K_(e)}return typeof e=="function"?e:null},ooe=(e,t,n)=>{var r,i=a=>{var l=t.tick(a);if(t.getState()==="active"){if(n(t.getInterpolated()),t.getProgress()===1){t.complete(),r=void 0;return}r=e.setTimeout(i,l);return}r=e.setTimeout(i,l)};return r=e.setTimeout(i,0),()=>{var a;return(a=r)===null||a===void 0?void 0:a()}},X5=O.createContext(ooe);X5.Provider;function soe(e){var t=O.useContext(X5);return O.useMemo(()=>e??t,[e,t])}function uoe(e,t,n){return(t=coe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function coe(e){var t=foe(e,"string");return typeof t=="symbol"?t:t+""}function foe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var X_="init",Q_="pending",Y_="active",hoe="completed";function s1(e){return Math.max(0,e)}class doe{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var n;uoe(this,"state",X_),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=s1(t.animationDuration),this.animationBegin=s1(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(n=t.onAnimationStart)===null||n===void 0||n.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===X_)return this.state=Q_,this.beginStartedTime=t,this.animationBegin;if(this.getState()===Q_){if(this.beginStartedTime==null)throw new Error;var n=t-this.beginStartedTime;return n>=this.animationBegin?(this.state=Y_,this.animationStartedTime=t,this.nextAnimationUpdate(0)):s1(this.animationBegin-n)}if(this.getState()===Y_){if(this.animationStartedTime==null)throw new Error;var r=t-this.animationStartedTime;return this.setProgress(r/this.animationDuration),this.nextAnimationUpdate(r)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=hoe}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class poe extends doe{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(Ft(this.getFrom(),this.getTo(),this.getProgress()))}}class moe{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=l=>{l-r>=n?t(l):i=requestAnimationFrame(a)};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function goe(e,t){return xoe(e)||boe(e,t)||yoe(e,t)||voe()}function voe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
79
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yoe(e,t){if(e){if(typeof e=="string")return G_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G_(e,t):void 0}}function G_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function boe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function xoe(e){if(Array.isArray(e))return e}var Soe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Z_=0,u1=1;function Q5(e){var t=jn(e,Soe),n=t.animationId,r=t.isActive,i=t.canBegin,a=t.duration,l=t.easing,s=t.begin,c=t.onAnimationEnd,f=t.onAnimationStart,d=t.children,p=F5(),g=r==="auto"?!id.isSsr&&!p:r,v=soe(t.animationController),y=O.useState(g?Z_:u1),x=goe(y,2),w=x[0],A=x[1];return O.useEffect(()=>{g||A(u1)},[g]),O.useEffect(()=>{var C=loe(l);if(!g||!i||C==null)return ys;var k=new moe,P=new poe({animationId:n,easing:C,animationDuration:a,animationBegin:s,onAnimationStart:f,onAnimationEnd:c,from:Z_,to:u1});return v(k,P,A)},[v,n,g,i,a,l,s,f,c]),d(Number(w))}function Y5(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=O.useRef(Mh(t)),r=O.useRef(e);return r.current!==e&&(n.current=Mh(t),r.current=e),n.current}var woe=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Ooe=(e,t,n)=>e.map(r=>"".concat(woe(r)," ").concat(t,"ms ").concat(n)).join(","),Aoe=["radius"],koe=["radius"],J_,eN,tN,nN,rN,iN,aN,lN,oN,sN;function uN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uN(Object(n),!0).forEach(function(r){Coe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Coe(e,t,n){return(t=Eoe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eoe(e){var t=Toe(e,"string");return typeof t=="symbol"?t:t+""}function Toe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yg(){return Yg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yg.apply(null,arguments)}function fN(e,t){if(e==null)return{};var n,r,i=Moe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Moe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Doe(e,t){return Roe(e)||Noe(e,t)||_oe(e,t)||Poe()}function Poe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
80
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _oe(e,t){if(e){if(typeof e=="string")return hN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hN(e,t):void 0}}function hN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Noe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Roe(e){if(Array.isArray(e))return e}function Ri(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var dN=(e,t,n,r,i)=>{var a=Na(n),l=Na(r),s=Math.min(Math.abs(a)/2,Math.abs(l)/2),c=l>=0?1:-1,f=a>=0?1:-1,d=l>=0&&a>=0||l<0&&a<0?1:0,p;if(s>0&&Array.isArray(i)){for(var g=[0,0,0,0],v=0,y=4;v<y;v++){var x,w=(x=i[v])!==null&&x!==void 0?x:0;g[v]=w>s?s:w}p=Sn(J_||(J_=Ri(["M",",",""])),e,t+c*g[0]),g[0]>0&&(p+=Sn(eN||(eN=Ri(["A ",",",",0,0,",",",",",""])),g[0],g[0],d,e+f*g[0],t)),p+=Sn(tN||(tN=Ri(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(p+=Sn(nN||(nN=Ri(["A ",",",",0,0,",`,
81
- `,",",""])),g[1],g[1],d,e+n,t+c*g[1])),p+=Sn(rN||(rN=Ri(["L ",",",""])),e+n,t+r-c*g[2]),g[2]>0&&(p+=Sn(iN||(iN=Ri(["A ",",",",0,0,",`,
82
- `,",",""])),g[2],g[2],d,e+n-f*g[2],t+r)),p+=Sn(aN||(aN=Ri(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(p+=Sn(lN||(lN=Ri(["A ",",",",0,0,",`,
83
- `,",",""])),g[3],g[3],d,e,t+r-c*g[3])),p+="Z"}else if(s>0&&i===+i&&i>0){var A=Math.min(s,i);p=Sn(oN||(oN=Ri(["M ",",",`
84
- A `,",",",0,0,",",",",",`
85
- L `,",",`
86
- A `,",",",0,0,",",",",",`
87
- L `,",",`
88
- A `,",",",0,0,",",",",",`
89
- L `,",",`
90
- A `,",",",0,0,",",",","," Z"])),e,t+c*A,A,A,d,e+f*A,t,e+n-f*A,t,A,A,d,e+n,t+c*A,e+n,t+r-c*A,A,A,d,e+n-f*A,t+r,e+f*A,t+r,A,A,d,e,t+r-c*A)}else p=Sn(sN||(sN=Ri(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return p},pN={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},G5=e=>{var t=jn(e,pN),n=O.useRef(null),r=O.useState(-1),i=Doe(r,2),a=i[0],l=i[1];O.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var ne=n.current.getTotalLength();ne&&l(ne)}catch{}},[]);var s=t.x,c=t.y,f=t.width,d=t.height,p=t.radius,g=t.className,v=t.animationEasing,y=t.animationDuration,x=t.animationBegin,w=t.isAnimationActive,A=t.isUpdateAnimationActive,C=O.useRef(f),k=O.useRef(d),P=O.useRef(s),T=O.useRef(c),D=O.useMemo(()=>({x:s,y:c,width:f,height:d,radius:p}),[s,c,f,d,p]),N=Y5(D,"rectangle-");if(s!==+s||c!==+c||f!==+f||d!==+d||f===0||d===0)return null;var I=st("recharts-rectangle",g);if(!A){var U=Pr(t);U.radius;var K=fN(U,Aoe);return O.createElement("path",Yg({},K,{x:Na(s),y:Na(c),width:Na(f),height:Na(d),radius:typeof p=="number"?p:void 0,className:I,d:dN(s,c,f,d,p)}))}var V=C.current,B=k.current,ae=P.current,ie=T.current,oe="0px ".concat(a===-1?1:a,"px"),z="".concat(a,"px ").concat(a,"px"),G=Ooe(["strokeDasharray"],y,typeof v=="string"?v:pN.animationEasing);return O.createElement(Q5,{animationId:N,key:N,canBegin:a>0,duration:y,easing:v,isActive:A,begin:x},ne=>{var ce=Ft(V,f,ne),fe=Ft(B,d,ne),R=Ft(ae,s,ne),X=Ft(ie,c,ne);n.current&&(C.current=ce,k.current=fe,P.current=R,T.current=X);var re;w?ne>0?re={transition:G,strokeDasharray:z}:re={strokeDasharray:oe}:re={strokeDasharray:z};var le=Pr(t);le.radius;var ge=fN(le,koe);return O.createElement("path",Yg({},ge,{radius:typeof p=="number"?p:void 0,className:I,d:dN(R,X,ce,fe,p),ref:n,style:cN(cN({},re),t.style)}))})};function mN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mN(Object(n),!0).forEach(function(r){joe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function joe(e,t,n){return(t=Ioe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ioe(e){var t=Loe(e,"string");return typeof t=="symbol"?t:t+""}function Loe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gg=Math.PI/180,Boe=e=>e*180/Math.PI,An=(e,t,n,r)=>({x:e+Math.cos(-Gg*r)*n,y:t+Math.sin(-Gg*r)*n}),zoe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},$oe=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},Uoe=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,l=$oe({x:n,y:r},{x:i,y:a});if(l<=0)return{radius:l,angle:0};var s=(n-i)/l,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:l,angle:Boe(c),angleInRadian:c}},Hoe=e=>{var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},Foe=(e,t)=>{var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),l=Math.min(i,a);return e+l*360},qoe=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=Uoe({x:n,y:r},t),a=i.radius,l=i.angle,s=t.innerRadius,c=t.outerRadius;if(a<s||a>c||a===0)return null;var f=Hoe(t),d=f.startAngle,p=f.endAngle,g=l,v;if(d<=p){for(;g>p;)g-=360;for(;g<d;)g+=360;v=g>=d&&g<=p}else{for(;g>d;)g-=360;for(;g<p;)g+=360;v=g>=p&&g<=d}return v?gN(gN({},t),{},{radius:a,angle:Foe(g,t)}):null};function Z5(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,l=An(t,n,r,i),s=An(t,n,r,a);return{points:[l,s],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var vN,yN,bN,xN,SN,wN,ON;function xw(){return xw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xw.apply(null,arguments)}function Vo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Woe=(e,t)=>{var n=sr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},ym=e=>{var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,l=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,f=s*(l?1:-1)+r,d=Math.asin(s/f)/Gg,p=c?i:i+a*d,g=An(t,n,f,p),v=An(t,n,r,p),y=c?i-a*d:i,x=An(t,n,f*Math.cos(d*Gg),y);return{center:g,circleTangency:v,lineTangency:x,theta:d}},J5=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,l=e.endAngle,s=Woe(a,l),c=a+s,f=An(t,n,i,a),d=An(t,n,i,c),p=Sn(vN||(vN=Vo(["M ",",",`
91
- A `,",",`,0,
92
- `,",",`,
93
- `,",",`
94
- `])),f.x,f.y,i,i,+(Math.abs(s)>180),+(a>c),d.x,d.y);if(r>0){var g=An(t,n,r,a),v=An(t,n,r,c);p+=Sn(yN||(yN=Vo(["L ",",",`
95
- A `,",",`,0,
96
- `,",",`,
97
- `,","," Z"])),v.x,v.y,r,r,+(Math.abs(s)>180),+(a<=c),g.x,g.y)}else p+=Sn(bN||(bN=Vo(["L ",","," Z"])),t,n);return p},Voe=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,l=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,f=e.endAngle,d=sr(f-c),p=ym({cx:t,cy:n,radius:i,angle:c,sign:d,cornerRadius:a,cornerIsExternal:s}),g=p.circleTangency,v=p.lineTangency,y=p.theta,x=ym({cx:t,cy:n,radius:i,angle:f,sign:-d,cornerRadius:a,cornerIsExternal:s}),w=x.circleTangency,A=x.lineTangency,C=x.theta,k=s?Math.abs(c-f):Math.abs(c-f)-y-C;if(k<0)return l?Sn(xN||(xN=Vo(["M ",",",`
98
- a`,",",",0,0,1,",`,0
99
- a`,",",",0,0,1,",`,0
100
- `])),v.x,v.y,a,a,a*2,a,a,-a*2):J5({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:f});var P=Sn(SN||(SN=Vo(["M ",",",`
101
- A`,",",",0,0,",",",",",`
102
- A`,",",",0,",",",",",",",`
103
- A`,",",",0,0,",",",",",`
104
- `])),v.x,v.y,a,a,+(d<0),g.x,g.y,i,i,+(k>180),+(d<0),w.x,w.y,a,a,+(d<0),A.x,A.y);if(r>0){var T=ym({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),D=T.circleTangency,N=T.lineTangency,I=T.theta,U=ym({cx:t,cy:n,radius:r,angle:f,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),K=U.circleTangency,V=U.lineTangency,B=U.theta,ae=s?Math.abs(c-f):Math.abs(c-f)-I-B;if(ae<0&&a===0)return"".concat(P,"L").concat(t,",").concat(n,"Z");P+=Sn(wN||(wN=Vo(["L",",",`
105
- A`,",",",0,0,",",",",",`
106
- A`,",",",0,",",",",",",",`
107
- A`,",",",0,0,",",",",","Z"])),V.x,V.y,a,a,+(d<0),K.x,K.y,r,r,+(ae>180),+(d>0),D.x,D.y,a,a,+(d<0),N.x,N.y)}else P+=Sn(ON||(ON=Vo(["L",",","Z"])),t,n);return P},Koe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Xoe=e=>{var t=jn(e,Koe),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,l=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,f=t.startAngle,d=t.endAngle,p=t.className;if(a<i||f===d)return null;var g=st("recharts-sector",p),v=a-i,y=xi(l,v,0,!0),x;return y>0&&Math.abs(f-d)<360?x=Voe({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(y,v/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:f,endAngle:d}):x=J5({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:d}),O.createElement("path",xw({},Pr(t),{className:g,d:x}))};function Qoe(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(Lz(t)){if(e==="centric"){var r=t.cx,i=t.cy,a=t.innerRadius,l=t.outerRadius,s=t.angle,c=An(r,i,a,s),f=An(r,i,l,s);return[{x:c.x,y:c.y},{x:f.x,y:f.y}]}return Z5(t)}}function Yoe(e){return Jz(e)?NaN:Number(e)}function c1(e){return e?(e=Yoe(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function e$(e,t,n){n&&typeof n!="number"&&aw(e,t,n)&&(t=n=void 0),e=c1(e),t===void 0?(t=e,e=0):t=c1(t),n=n===void 0?e<t?1:-1:c1(n);const r=Math.max(Math.ceil((t-e)/(n||1)),0),i=new Array(r);for(let a=0;a<r;a++)i[a]=e,e+=n;return i}var Ci=e=>e.chartData,kA=q([Ci],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),ad=(e,t,n,r)=>r?kA(e):Ci(e),Goe=(e,t,n)=>n?kA(e):Ci(e),Zoe=q([ad],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});q([kA],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});var Joe=q([Ci],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});function CA(e,t){return rse(e)||nse(e,t)||tse(e,t)||ese()}function ese(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
108
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tse(e,t){if(e){if(typeof e=="string")return AN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?AN(e,t):void 0}}function AN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nse(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function rse(e){if(Array.isArray(e))return e}function Yi(e){if(Array.isArray(e)&&e.length===2){var t=CA(e,2),n=t[0],r=t[1];if(Ve(n)&&Ve(r))return!0}return!1}function kN(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function t$(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var n=CA(e,2),r=n[0],i=n[1],a,l;if(Ve(r))a=r;else if(typeof r=="function")return;if(Ve(i))l=i;else if(typeof i=="function")return;var s=[a,l];if(Yi(s))return s}}function ise(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Yi(r))return kN(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var i=CA(e,2),a=i[0],l=i[1],s,c;if(a==="auto")t!=null&&(s=Math.min(...t));else if(be(a))s=a;else if(typeof a=="function")try{t!=null&&(s=a(t?.[0]))}catch{}else if(typeof a=="string"&&b_.test(a)){var f=b_.exec(a);if(f==null||f[1]==null||t==null)s=void 0;else{var d=+f[1];s=t[0]-d}}else s=t?.[0];if(l==="auto")t!=null&&(c=Math.max(...t));else if(be(l))c=l;else if(typeof l=="function")try{t!=null&&(c=l(t?.[1]))}catch{}else if(typeof l=="string"&&x_.test(l)){var p=x_.exec(l);if(p==null||p[1]==null||t==null)c=void 0;else{var g=+p[1];c=t[1]+g}}else c=t?.[1];var v=[s,c];if(Yi(v))return t==null?v:kN(v,t,n)}}}var mc=1e9,ase={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},TA,At=!0,ei="[DecimalError] ",es=ei+"Invalid argument: ",EA=ei+"Exponent out of range: ",gc=Math.floor,Io=Math.pow,lse=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Er,rn=1e7,xt=7,n$=9007199254740991,Zg=gc(n$/xt),ve={};ve.absoluteValue=ve.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ve.comparedTo=ve.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};ve.decimalPlaces=ve.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*xt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ve.dividedBy=ve.div=function(e){return Ba(this,new this.constructor(e))};ve.dividedToIntegerBy=ve.idiv=function(e){var t=this,n=t.constructor;return ht(Ba(t,new n(e),0,1),n.precision)};ve.equals=ve.eq=function(e){return!this.cmp(e)};ve.exponent=function(){return Wt(this)};ve.greaterThan=ve.gt=function(e){return this.cmp(e)>0};ve.greaterThanOrEqualTo=ve.gte=function(e){return this.cmp(e)>=0};ve.isInteger=ve.isint=function(){return this.e>this.d.length-2};ve.isNegative=ve.isneg=function(){return this.s<0};ve.isPositive=ve.ispos=function(){return this.s>0};ve.isZero=function(){return this.s===0};ve.lessThan=ve.lt=function(e){return this.cmp(e)<0};ve.lessThanOrEqualTo=ve.lte=function(e){return this.cmp(e)<1};ve.logarithm=ve.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Er))throw Error(ei+"NaN");if(n.s<1)throw Error(ei+(n.s?"NaN":"-Infinity"));return n.eq(Er)?new r(0):(At=!1,t=Ba(Nh(n,a),Nh(e,a),a),At=!0,ht(t,i))};ve.minus=ve.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?a$(t,e):r$(t,(e.s=-e.s,e))};ve.modulo=ve.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(ei+"NaN");return n.s?(At=!1,t=Ba(n,e,0,1).times(e),At=!0,n.minus(t)):ht(new r(n),i)};ve.naturalExponential=ve.exp=function(){return i$(this)};ve.naturalLogarithm=ve.ln=function(){return Nh(this)};ve.negated=ve.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ve.plus=ve.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?r$(t,e):a$(t,(e.s=-e.s,e))};ve.precision=ve.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(es+e);if(t=Wt(i)+1,r=i.d.length-1,n=r*xt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ve.squareRoot=ve.sqrt=function(){var e,t,n,r,i,a,l,s=this,c=s.constructor;if(s.s<1){if(!s.s)return new c(0);throw Error(ei+"NaN")}for(e=Wt(s),At=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=Xi(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=gc((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=l=n+3;;)if(a=r,r=a.plus(Ba(s,a,l+2)).times(.5),Xi(a.d).slice(0,l)===(t=Xi(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(ht(a,n+1,0),a.times(a).eq(s)){r=a;break}}else if(t!="9999")break;l+=4}return At=!0,ht(r,n)};ve.times=ve.mul=function(e){var t,n,r,i,a,l,s,c,f,d=this,p=d.constructor,g=d.d,v=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,c=g.length,f=v.length,c<f&&(a=g,g=v,v=a,l=c,c=f,f=l),a=[],l=c+f,r=l;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=c+r;i>r;)s=a[i]+v[r]*g[i-r-1]+t,a[i--]=s%rn|0,t=s/rn|0;a[i]=(a[i]+t)%rn|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,At?ht(e,p.precision):e};ve.toDecimalPlaces=ve.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(na(e,0,mc),t===void 0?t=r.rounding:na(t,0,8),ht(n,e+Wt(n)+1,t))};ve.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ds(r,!0):(na(e,0,mc),t===void 0?t=i.rounding:na(t,0,8),r=ht(new i(r),e+1,t),n=ds(r,!0,e+1)),n};ve.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?ds(i):(na(e,0,mc),t===void 0?t=a.rounding:na(t,0,8),r=ht(new a(i),e+Wt(i)+1,t),n=ds(r.abs(),!1,e+Wt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ve.toInteger=ve.toint=function(){var e=this,t=e.constructor;return ht(new t(e),Wt(e)+1,t.rounding)};ve.toNumber=function(){return+this};ve.toPower=ve.pow=function(e){var t,n,r,i,a,l,s=this,c=s.constructor,f=12,d=+(e=new c(e));if(!e.s)return new c(Er);if(s=new c(s),!s.s){if(e.s<1)throw Error(ei+"Infinity");return s}if(s.eq(Er))return s;if(r=c.precision,e.eq(Er))return ht(s,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=s.s,l){if((n=d<0?-d:d)<=n$){for(i=new c(Er),t=Math.ceil(r/xt+4),At=!1;n%2&&(i=i.times(s),EN(i.d,t)),n=gc(n/2),n!==0;)s=s.times(s),EN(s.d,t);return At=!0,e.s<0?new c(Er).div(i):ht(i,r)}}else if(a<0)throw Error(ei+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,At=!1,i=e.times(Nh(s,r+f)),At=!0,i=i$(i),i.s=a,i};ve.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Wt(i),r=ds(i,n<=a.toExpNeg||n>=a.toExpPos)):(na(e,1,mc),t===void 0?t=a.rounding:na(t,0,8),i=ht(new a(i),e,t),n=Wt(i),r=ds(i,e<=n||n<=a.toExpNeg,e)),r};ve.toSignificantDigits=ve.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(na(e,1,mc),t===void 0?t=r.rounding:na(t,0,8)),ht(new r(n),e,t)};ve.toString=ve.valueOf=ve.val=ve.toJSON=ve[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Wt(e),n=e.constructor;return ds(e,t<=n.toExpNeg||t>=n.toExpPos)};function r$(e,t){var n,r,i,a,l,s,c,f,d=e.constructor,p=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),At?ht(t,p):t;if(c=e.d,f=t.d,l=e.e,i=t.e,c=c.slice(),a=l-i,a){for(a<0?(r=c,a=-a,s=f.length):(r=f,i=l,s=c.length),l=Math.ceil(p/xt),s=l>s?l+1:s+1,a>s&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(s=c.length,a=f.length,s-a<0&&(a=s,r=f,f=c,c=r),n=0;a;)n=(c[--a]=c[a]+f[a]+n)/rn|0,c[a]%=rn;for(n&&(c.unshift(n),++i),s=c.length;c[--s]==0;)c.pop();return t.d=c,t.e=i,At?ht(t,p):t}function na(e,t,n){if(e!==~~e||e<t||e>n)throw Error(es+e)}function Xi(e){var t,n,r,i=e.length-1,a="",l=e[0];if(i>0){for(a+=l,t=1;t<i;t++)r=e[t]+"",n=xt-r.length,n&&(a+=Nl(n)),a+=r;l=e[t],r=l+"",n=xt-r.length,n&&(a+=Nl(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var Ba=(function(){function e(r,i){var a,l=0,s=r.length;for(r=r.slice();s--;)a=r[s]*i+l,r[s]=a%rn|0,l=a/rn|0;return l&&r.unshift(l),r}function t(r,i,a,l){var s,c;if(a!=l)c=a>l?1:-1;else for(s=c=0;s<a;s++)if(r[s]!=i[s]){c=r[s]>i[s]?1:-1;break}return c}function n(r,i,a){for(var l=0;a--;)r[a]-=l,l=r[a]<i[a]?1:0,r[a]=l*rn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,l){var s,c,f,d,p,g,v,y,x,w,A,C,k,P,T,D,N,I,U=r.constructor,K=r.s==i.s?1:-1,V=r.d,B=i.d;if(!r.s)return new U(r);if(!i.s)throw Error(ei+"Division by zero");for(c=r.e-i.e,N=B.length,T=V.length,v=new U(K),y=v.d=[],f=0;B[f]==(V[f]||0);)++f;if(B[f]>(V[f]||0)&&--c,a==null?C=a=U.precision:l?C=a+(Wt(r)-Wt(i))+1:C=a,C<0)return new U(0);if(C=C/xt+2|0,f=0,N==1)for(d=0,B=B[0],C++;(f<T||d)&&C--;f++)k=d*rn+(V[f]||0),y[f]=k/B|0,d=k%B|0;else{for(d=rn/(B[0]+1)|0,d>1&&(B=e(B,d),V=e(V,d),N=B.length,T=V.length),P=N,x=V.slice(0,N),w=x.length;w<N;)x[w++]=0;I=B.slice(),I.unshift(0),D=B[0],B[1]>=rn/2&&++D;do d=0,s=t(B,x,N,w),s<0?(A=x[0],N!=w&&(A=A*rn+(x[1]||0)),d=A/D|0,d>1?(d>=rn&&(d=rn-1),p=e(B,d),g=p.length,w=x.length,s=t(p,x,g,w),s==1&&(d--,n(p,N<g?I:B,g))):(d==0&&(s=d=1),p=B.slice()),g=p.length,g<w&&p.unshift(0),n(x,p,w),s==-1&&(w=x.length,s=t(B,x,N,w),s<1&&(d++,n(x,N<w?I:B,w))),w=x.length):s===0&&(d++,x=[0]),y[f++]=d,s&&x[0]?x[w++]=V[P]||0:(x=[V[P]],w=1);while((P++<T||x[0]!==void 0)&&C--)}return y[0]||y.shift(),v.e=c,ht(v,l?a+Wt(v)+1:a)}})();function i$(e,t){var n,r,i,a,l,s,c=0,f=0,d=e.constructor,p=d.precision;if(Wt(e)>16)throw Error(EA+Wt(e));if(!e.s)return new d(Er);for(At=!1,s=p,l=new d(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(Io(2,f))/Math.LN10*2+5|0,s+=r,n=i=a=new d(Er),d.precision=s;;){if(i=ht(i.times(e),s),n=n.times(++c),l=a.plus(Ba(i,n,s)),Xi(l.d).slice(0,s)===Xi(a.d).slice(0,s)){for(;f--;)a=ht(a.times(a),s);return d.precision=p,t==null?(At=!0,ht(a,p)):a}a=l}}function Wt(e){for(var t=e.e*xt,n=e.d[0];n>=10;n/=10)t++;return t}function f1(e,t,n){if(t>e.LN10.sd())throw At=!0,n&&(e.precision=n),Error(ei+"LN10 precision limit exceeded");return ht(new e(e.LN10),t)}function Nl(e){for(var t="";e--;)t+="0";return t}function Nh(e,t){var n,r,i,a,l,s,c,f,d,p=1,g=10,v=e,y=v.d,x=v.constructor,w=x.precision;if(v.s<1)throw Error(ei+(v.s?"NaN":"-Infinity"));if(v.eq(Er))return new x(0);if(t==null?(At=!1,f=w):f=t,v.eq(10))return t==null&&(At=!0),f1(x,f);if(f+=g,x.precision=f,n=Xi(y),r=n.charAt(0),a=Wt(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=Xi(v.d),r=n.charAt(0),p++;a=Wt(v),r>1?(v=new x("0."+n),a++):v=new x(r+"."+n.slice(1))}else return c=f1(x,f+2,w).times(a+""),v=Nh(new x(r+"."+n.slice(1)),f-g).plus(c),x.precision=w,t==null?(At=!0,ht(v,w)):v;for(s=l=v=Ba(v.minus(Er),v.plus(Er),f),d=ht(v.times(v),f),i=3;;){if(l=ht(l.times(d),f),c=s.plus(Ba(l,new x(i),f)),Xi(c.d).slice(0,f)===Xi(s.d).slice(0,f))return s=s.times(2),a!==0&&(s=s.plus(f1(x,f+2,w).times(a+""))),s=Ba(s,new x(p),f),x.precision=w,t==null?(At=!0,ht(s,w)):s;s=c,i+=2}}function CN(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=gc(n/xt),e.d=[],r=(n+1)%xt,n<0&&(r+=xt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=xt;r<i;)e.d.push(+t.slice(r,r+=xt));t=t.slice(r),r=xt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),At&&(e.e>Zg||e.e<-Zg))throw Error(EA+n)}else e.s=0,e.e=0,e.d=[0];return e}function ht(e,t,n){var r,i,a,l,s,c,f,d,p=e.d;for(l=1,a=p[0];a>=10;a/=10)l++;if(r=t-l,r<0)r+=xt,i=t,f=p[d=0];else{if(d=Math.ceil((r+1)/xt),a=p.length,d>=a)return e;for(f=a=p[d],l=1;a>=10;a/=10)l++;r%=xt,i=r-xt+l}if(n!==void 0&&(a=Io(10,l-i-1),s=f/a%10|0,c=t<0||p[d+1]!==void 0||f%a,c=n<4?(s||c)&&(n==0||n==(e.s<0?3:2)):s>5||s==5&&(n==4||c||n==6&&(r>0?i>0?f/Io(10,l-i):0:p[d-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return c?(a=Wt(e),p.length=1,t=t-a-1,p[0]=Io(10,(xt-t%xt)%xt),e.e=gc(-t/xt)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=d,a=1,d--):(p.length=d+1,a=Io(10,xt-r),p[d]=i>0?(f/Io(10,l-i)%Io(10,i)|0)*a:0),c)for(;;)if(d==0){(p[0]+=a)==rn&&(p[0]=1,++e.e);break}else{if(p[d]+=a,p[d]!=rn)break;p[d--]=0,a=1}for(r=p.length;p[--r]===0;)p.pop();if(At&&(e.e>Zg||e.e<-Zg))throw Error(EA+Wt(e));return e}function a$(e,t){var n,r,i,a,l,s,c,f,d,p,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),At?ht(t,v):t;if(c=e.d,p=t.d,r=t.e,f=e.e,c=c.slice(),l=f-r,l){for(d=l<0,d?(n=c,l=-l,s=p.length):(n=p,r=f,s=c.length),i=Math.max(Math.ceil(v/xt),s)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=c.length,s=p.length,d=i<s,d&&(s=i),i=0;i<s;i++)if(c[i]!=p[i]){d=c[i]<p[i];break}l=0}for(d&&(n=c,c=p,p=n,t.s=-t.s),s=c.length,i=p.length-s;i>0;--i)c[s++]=0;for(i=p.length;i>l;){if(c[--i]<p[i]){for(a=i;a&&c[--a]===0;)c[a]=rn-1;--c[a],c[i]+=rn}c[i]-=p[i]}for(;c[--s]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,At?ht(t,v):t):new g(0)}function ds(e,t,n){var r,i=Wt(e),a=Xi(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+Nl(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Nl(-i-1)+a,n&&(r=n-l)>0&&(a+=Nl(r))):i>=l?(a+=Nl(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+Nl(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=Nl(r))),e.s<0?"-"+a:a}function EN(e,t){if(e.length>t)return e.length=t,!0}function l$(e){var t,n,r;function i(a){var l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,a instanceof i){l.s=a.s,l.e=a.e,l.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(es+a);if(a>0)l.s=1;else if(a<0)a=-a,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(a===~~a&&a<1e7){l.e=0,l.d=[a];return}return CN(l,a.toString())}else if(typeof a!="string")throw Error(es+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,lse.test(a))CN(l,a);else throw Error(es+a)}if(i.prototype=ve,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=l$,i.config=i.set=ose,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function ose(e){if(!e||typeof e!="object")throw Error(ei+"Object expected");var t,n,r,i=["precision",1,mc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(gc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(es+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(es+n+": "+r);return this}var TA=l$(ase);Er=new TA(1);const We=TA;function o$(e){var t;return e===0?t=1:t=Math.floor(new We(e).abs().log(10).toNumber())+1,t}function s$(e,t,n){for(var r=new We(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}function Rh(e,t){return fse(e)||cse(e,t)||use(e,t)||sse()}function sse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
109
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function use(e,t){if(e){if(typeof e=="string")return TN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TN(e,t):void 0}}function TN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cse(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function fse(e){if(Array.isArray(e))return e}var u$=e=>{var t=Rh(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},MA=(e,t,n)=>{if(e.lte(0))return new We(0);var r=o$(e.toNumber()),i=new We(10).pow(r),a=e.div(i),l=r!==1?.05:.1,s=new We(Math.ceil(a.div(l).toNumber())).add(n).mul(l),c=s.mul(i);return t?new We(c.toNumber()):new We(Math.ceil(c.toNumber()))},c$=(e,t,n)=>{var r;if(e.lte(0))return new We(0);var i=[1,2,2.5,5],a=e.toNumber(),l=Math.floor(new We(a).abs().log(10).toNumber()),s=new We(10).pow(l),c=e.div(s).toNumber(),f=i.findIndex(v=>v>=c-1e-10);if(f===-1&&(s=s.mul(10),f=0),f+=n,f>=i.length){var d=Math.floor(f/i.length);f%=i.length,s=s.mul(new We(10).pow(d))}var p=(r=i[f])!==null&&r!==void 0?r:1,g=new We(p).mul(s);return t?g:new We(Math.ceil(g.toNumber()))},hse=(e,t,n)=>{var r=new We(1),i=new We(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new We(10).pow(o$(e)-1),i=new We(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new We(Math.floor(e)))}else e===0?i=new We(Math.floor((t-1)/2)):n||(i=new We(Math.floor(e)));for(var l=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new We(c-l).mul(r)).toNumber());return s},f$=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:MA;if(!Number.isFinite((n-t)/(r-1)))return{step:new We(0),tickMin:new We(0),tickMax:new We(0)};var s=l(new We(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new We(0):(c=new We(t).add(n).div(2),c=c.sub(new We(c).mod(s)));var f=Math.ceil(c.sub(t).div(s).toNumber()),d=Math.ceil(new We(n).sub(c).div(s).toNumber()),p=f+d+1;return p>r?f$(t,n,r,i,a+1,l):(p<r&&(d=n>0?d+(r-p):d,f=n>0?f:f+(r-p)),{step:s,tickMin:c.sub(new We(f).mul(s)),tickMax:c.add(new We(d).mul(s))})},MN=function(t){var n=Rh(t,2),r=n[0],i=n[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(a,2),f=u$([r,i]),d=Rh(f,2),p=d[0],g=d[1];if(p===-1/0||g===1/0){var v=g===1/0?[p,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),g];return r>i?v.reverse():v}if(p===g)return hse(p,a,l);var y=s==="snap125"?c$:MA,x=f$(p,g,c,l,0,y),w=x.step,A=x.tickMin,C=x.tickMax,k=s$(A,C.add(new We(.1).mul(w)),w);return r>i?k.reverse():k},DN=function(t,n){var r=Rh(t,2),i=r[0],a=r[1],l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=u$([i,a]),f=Rh(c,2),d=f[0],p=f[1];if(d===-1/0||p===1/0)return[i,a];if(d===p)return[d];var g=s==="snap125"?c$:MA,v=Math.max(n,2),y=g(new We(p).sub(d).div(v-1),l,0),x=[...s$(new We(d),new We(p),y),p];if(l===!1){x=x.map(A=>Math.round(A));var w=x.length-1;w>0&&x[w]===x[w-1]&&(x=x.slice(0,w))}return i>a?x.reverse():x},h$=e=>e.rootProps.maxBarSize,dse=e=>e.rootProps.barGap,d$=e=>e.rootProps.barCategoryGap,pse=e=>e.rootProps.barSize,vy=e=>e.rootProps.stackOffset,p$=e=>e.rootProps.reverseStackOrder,DA=e=>e.options.chartName,PA=e=>e.rootProps.syncId,m$=e=>e.rootProps.syncMethod,_A=e=>e.options.eventEmitter,sn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Mo={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},ji={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},yy=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function by(e,t,n){if(n!=="auto")return n;if(e!=null)return Za(e,t)?"category":"number"}function PN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PN(Object(n),!0).forEach(function(r){mse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mse(e,t,n){return(t=gse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gse(e){var t=vse(e,"string");return typeof t=="symbol"?t:t+""}function vse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _N={allowDataOverflow:Mo.allowDataOverflow,allowDecimals:Mo.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Mo.angleAxisId,includeHidden:!1,name:void 0,reversed:Mo.reversed,scale:Mo.scale,tick:Mo.tick,tickCount:void 0,ticks:void 0,type:Mo.type,unit:void 0,niceTicks:"auto"},NN={allowDataOverflow:ji.allowDataOverflow,allowDecimals:ji.allowDecimals,allowDuplicatedCategory:ji.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:ji.radiusAxisId,includeHidden:ji.includeHidden,name:void 0,reversed:ji.reversed,scale:ji.scale,tick:ji.tick,tickCount:ji.tickCount,ticks:void 0,type:ji.type,unit:void 0,niceTicks:"auto"},yse=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},NA=q([yse,$5],(e,t)=>{var n;if(e!=null)return e;var r=(n=by(t,"angleAxis",_N.type))!==null&&n!==void 0?n:"category";return Jg(Jg({},_N),{},{type:r})}),bse=(e,t)=>e.polarAxis.radiusAxis[t],RA=q([bse,$5],(e,t)=>{var n;if(e!=null)return e;var r=(n=by(t,"radiusAxis",NN.type))!==null&&n!==void 0?n:"category";return Jg(Jg({},NN),{},{type:r})}),xy=e=>e.polarOptions,jA=q([Ja,el,un],zoe),g$=q([xy,jA],(e,t)=>{if(e!=null)return xi(e.innerRadius,t,0)}),v$=q([xy,jA],(e,t)=>{if(e!=null)return xi(e.outerRadius,t,t*.8)}),xse=e=>{if(e==null)return[0,0];var t=e.startAngle,n=e.endAngle;return[t,n]},y$=q([xy],xse);q([NA,y$],yy);var b$=q([jA,g$,v$],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});q([RA,b$],yy);var x$=q([nt,xy,g$,v$,Ja,el],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var l=t.cx,s=t.cy,c=t.startAngle,f=t.endAngle;return{cx:xi(l,i,i/2),cy:xi(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:f,clockWise:!1}}}),cn=(e,t)=>t,Sy=(e,t,n)=>n;function IA(e){return e?.id}function S$(e,t,n){var r=t.chartData,i=r===void 0?[]:r,a=n.allowDuplicatedCategory,l=n.dataKey,s=new Map;return e.forEach(c=>{var f,d=(f=c.data)!==null&&f!==void 0?f:i;if(!(d==null||d.length===0)){var p=IA(c);d.forEach((g,v)=>{var y=l==null||a?v:String(Bt(g,l,null)),x=Bt(g,c.dataKey,0),w;s.has(y)?w=s.get(y):w={},Object.assign(w,{[p]:x}),s.set(y,w)})}}),Array.from(s.values())}function wy(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var ld=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Oy(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Sse(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var fn=e=>{var t=nt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},vc=e=>e.tooltip.settings.axisId;function LA(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function l(){return a.apply(this,arguments)}return l.toString=function(){return a.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var l=i[0],s=i[1];return l<=s?a>=l&&a<=s:a>=s&&a<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,l)=>{var s=e(a);if(s!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var c=e.bandwidth();switch(l.position){case"middle":s+=c/2;break;case"end":s+=c;break}}return s}}}}}var wse=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Yi(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Ve(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Vl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ose(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function BA(e){let t,n,r;e.length!==2?(t=Vl,n=(s,c)=>Vl(e(s),c),r=(s,c)=>e(s)-c):(t=e===Vl||e===Ose?e:Ase,n=e,r=e);function i(s,c,f=0,d=s.length){if(f<d){if(t(c,c)!==0)return d;do{const p=f+d>>>1;n(s[p],c)<0?f=p+1:d=p}while(f<d)}return f}function a(s,c,f=0,d=s.length){if(f<d){if(t(c,c)!==0)return d;do{const p=f+d>>>1;n(s[p],c)<=0?f=p+1:d=p}while(f<d)}return f}function l(s,c,f=0,d=s.length){const p=i(s,c,f,d-1);return p>f&&r(s[p-1],c)>-r(s[p],c)?p-1:p}return{left:i,center:l,right:a}}function Ase(){return 0}function w$(e){return e===null?NaN:+e}function*kse(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Cse=BA(Vl),od=Cse.right;BA(w$).center;class RN extends Map{constructor(t,n=Mse){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(jN(this,t))}has(t){return super.has(jN(this,t))}set(t,n){return super.set(Ese(this,t),n)}delete(t){return super.delete(Tse(this,t))}}function jN({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Ese({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Tse({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Mse(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Dse(e=Vl){if(e===Vl)return O$;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function O$(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Pse=Math.sqrt(50),_se=Math.sqrt(10),Nse=Math.sqrt(2);function ev(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=Pse?10:a>=_se?5:a>=Nse?2:1;let s,c,f;return i<0?(f=Math.pow(10,-i)/l,s=Math.round(e*f),c=Math.round(t*f),s/f<e&&++s,c/f>t&&--c,f=-f):(f=Math.pow(10,i)*l,s=Math.round(e/f),c=Math.round(t/f),s*f<e&&++s,c*f>t&&--c),c<s&&.5<=n&&n<2?ev(e,t,n*2):[s,c,f]}function Sw(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,l]=r?ev(t,e,n):ev(e,t,n);if(!(a>=i))return[];const s=a-i+1,c=new Array(s);if(r)if(l<0)for(let f=0;f<s;++f)c[f]=(a-f)/-l;else for(let f=0;f<s;++f)c[f]=(a-f)*l;else if(l<0)for(let f=0;f<s;++f)c[f]=(i+f)/-l;else for(let f=0;f<s;++f)c[f]=(i+f)*l;return c}function ww(e,t,n){return t=+t,e=+e,n=+n,ev(e,t,n)[2]}function Ow(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?ww(t,e,n):ww(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function IN(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function LN(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function A$(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?O$:Dse(i);r>n;){if(r-n>600){const c=r-n+1,f=t-n+1,d=Math.log(c),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(c-p)/c)*(f-c/2<0?-1:1),v=Math.max(n,Math.floor(t-f*p/c+g)),y=Math.min(r,Math.floor(t+(c-f)*p/c+g));A$(e,t,v,y,i)}const a=e[t];let l=n,s=r;for(Df(e,n,t),i(e[r],a)>0&&Df(e,n,r);l<s;){for(Df(e,l,s),++l,--s;i(e[l],a)<0;)++l;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?Df(e,n,s):(++s,Df(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Df(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Rse(e,t,n){if(e=Float64Array.from(kse(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return LN(e);if(t>=1)return IN(e);var r,i=(r-1)*t,a=Math.floor(i),l=IN(A$(e,a).subarray(0,a+1)),s=LN(e.subarray(a+1));return l+(s-l)*(i-a)}}function jse(e,t,n=w$){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),l=+n(e[a],a,e),s=+n(e[a+1],a+1,e);return l+(s-l)*(i-a)}}function Ise(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function ri(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function tl(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Aw=Symbol("implicit");function zA(){var e=new RN,t=[],n=[],r=Aw;function i(a){let l=e.get(a);if(l===void 0){if(r!==Aw)return r;e.set(a,l=t.push(a)-1)}return n[l%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new RN;for(const l of a)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return zA(t,n).unknown(r)},ri.apply(i,arguments),i}function $A(){var e=zA().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,l,s=!1,c=0,f=0,d=.5;delete e.unknown;function p(){var g=t().length,v=i<r,y=v?i:r,x=v?r:i;a=(x-y)/Math.max(1,g-c+f*2),s&&(a=Math.floor(a)),y+=(x-y-a*(g-c))*d,l=a*(1-c),s&&(y=Math.round(y),l=Math.round(l));var w=Ise(g).map(function(A){return y+a*A});return n(v?w.reverse():w)}return e.domain=function(g){return arguments.length?(t(g),p()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,p()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,s=!0,p()},e.bandwidth=function(){return l},e.step=function(){return a},e.round=function(g){return arguments.length?(s=!!g,p()):s},e.padding=function(g){return arguments.length?(c=Math.min(1,f=+g),p()):c},e.paddingInner=function(g){return arguments.length?(c=Math.min(1,g),p()):c},e.paddingOuter=function(g){return arguments.length?(f=+g,p()):f},e.align=function(g){return arguments.length?(d=Math.max(0,Math.min(1,g)),p()):d},e.copy=function(){return $A(t(),[r,i]).round(s).paddingInner(c).paddingOuter(f).align(d)},ri.apply(p(),arguments)}function k$(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return k$(t())},e}function Lse(){return k$($A.apply(null,arguments).paddingInner(1))}function UA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function C$(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function sd(){}var jh=.7,tv=1/jh,zu="\\s*([+-]?\\d+)\\s*",Ih="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bse=/^#([0-9a-f]{3,8})$/,zse=new RegExp(`^rgb\\(${zu},${zu},${zu}\\)$`),$se=new RegExp(`^rgb\\(${Gi},${Gi},${Gi}\\)$`),Use=new RegExp(`^rgba\\(${zu},${zu},${zu},${Ih}\\)$`),Hse=new RegExp(`^rgba\\(${Gi},${Gi},${Gi},${Ih}\\)$`),Fse=new RegExp(`^hsl\\(${Ih},${Gi},${Gi}\\)$`),qse=new RegExp(`^hsla\\(${Ih},${Gi},${Gi},${Ih}\\)$`),BN={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};UA(sd,Lh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:zN,formatHex:zN,formatHex8:Wse,formatHsl:Vse,formatRgb:$N,toString:$N});function zN(){return this.rgb().formatHex()}function Wse(){return this.rgb().formatHex8()}function Vse(){return E$(this).formatHsl()}function $N(){return this.rgb().formatRgb()}function Lh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Bse.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?UN(t):n===3?new cr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?bm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?bm(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=zse.exec(e))?new cr(t[1],t[2],t[3],1):(t=$se.exec(e))?new cr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Use.exec(e))?bm(t[1],t[2],t[3],t[4]):(t=Hse.exec(e))?bm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Fse.exec(e))?qN(t[1],t[2]/100,t[3]/100,1):(t=qse.exec(e))?qN(t[1],t[2]/100,t[3]/100,t[4]):BN.hasOwnProperty(e)?UN(BN[e]):e==="transparent"?new cr(NaN,NaN,NaN,0):null}function UN(e){return new cr(e>>16&255,e>>8&255,e&255,1)}function bm(e,t,n,r){return r<=0&&(e=t=n=NaN),new cr(e,t,n,r)}function Kse(e){return e instanceof sd||(e=Lh(e)),e?(e=e.rgb(),new cr(e.r,e.g,e.b,e.opacity)):new cr}function kw(e,t,n,r){return arguments.length===1?Kse(e):new cr(e,t,n,r??1)}function cr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}UA(cr,kw,C$(sd,{brighter(e){return e=e==null?tv:Math.pow(tv,e),new cr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?jh:Math.pow(jh,e),new cr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new cr(ts(this.r),ts(this.g),ts(this.b),nv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:HN,formatHex:HN,formatHex8:Xse,formatRgb:FN,toString:FN}));function HN(){return`#${Ko(this.r)}${Ko(this.g)}${Ko(this.b)}`}function Xse(){return`#${Ko(this.r)}${Ko(this.g)}${Ko(this.b)}${Ko((isNaN(this.opacity)?1:this.opacity)*255)}`}function FN(){const e=nv(this.opacity);return`${e===1?"rgb(":"rgba("}${ts(this.r)}, ${ts(this.g)}, ${ts(this.b)}${e===1?")":`, ${e})`}`}function nv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ts(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ko(e){return e=ts(e),(e<16?"0":"")+e.toString(16)}function qN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hi(e,t,n,r)}function E$(e){if(e instanceof hi)return new hi(e.h,e.s,e.l,e.opacity);if(e instanceof sd||(e=Lh(e)),!e)return new hi;if(e instanceof hi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),l=NaN,s=a-i,c=(a+i)/2;return s?(t===a?l=(n-r)/s+(n<r)*6:n===a?l=(r-t)/s+2:l=(t-n)/s+4,s/=c<.5?a+i:2-a-i,l*=60):s=c>0&&c<1?0:l,new hi(l,s,c,e.opacity)}function Qse(e,t,n,r){return arguments.length===1?E$(e):new hi(e,t,n,r??1)}function hi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}UA(hi,Qse,C$(sd,{brighter(e){return e=e==null?tv:Math.pow(tv,e),new hi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jh:Math.pow(jh,e),new hi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new cr(h1(e>=240?e-240:e+120,i,r),h1(e,i,r),h1(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new hi(WN(this.h),xm(this.s),xm(this.l),nv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=nv(this.opacity);return`${e===1?"hsl(":"hsla("}${WN(this.h)}, ${xm(this.s)*100}%, ${xm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function WN(e){return e=(e||0)%360,e<0?e+360:e}function xm(e){return Math.max(0,Math.min(1,e||0))}function h1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const HA=e=>()=>e;function Yse(e,t){return function(n){return e+n*t}}function Gse(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Zse(e){return(e=+e)==1?T$:function(t,n){return n-t?Gse(t,n,e):HA(isNaN(t)?n:t)}}function T$(e,t){var n=t-e;return n?Yse(e,n):HA(isNaN(e)?t:e)}const VN=(function e(t){var n=Zse(t);function r(i,a){var l=n((i=kw(i)).r,(a=kw(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),f=T$(i.opacity,a.opacity);return function(d){return i.r=l(d),i.g=s(d),i.b=c(d),i.opacity=f(d),i+""}}return r.gamma=e,r})(1);function Jse(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function eue(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function tue(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),l;for(l=0;l<r;++l)i[l]=yc(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(s){for(l=0;l<r;++l)a[l]=i[l](s);return a}}function nue(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function rv(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function rue(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=yc(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Cw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,d1=new RegExp(Cw.source,"g");function iue(e){return function(){return e}}function aue(e){return function(t){return e(t)+""}}function lue(e,t){var n=Cw.lastIndex=d1.lastIndex=0,r,i,a,l=-1,s=[],c=[];for(e=e+"",t=t+"";(r=Cw.exec(e))&&(i=d1.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[l]?s[l]+=a:s[++l]=a),(r=r[0])===(i=i[0])?s[l]?s[l]+=i:s[++l]=i:(s[++l]=null,c.push({i:l,x:rv(r,i)})),n=d1.lastIndex;return n<t.length&&(a=t.slice(n),s[l]?s[l]+=a:s[++l]=a),s.length<2?c[0]?aue(c[0].x):iue(t):(t=c.length,function(f){for(var d=0,p;d<t;++d)s[(p=c[d]).i]=p.x(f);return s.join("")})}function yc(e,t){var n=typeof t,r;return t==null||n==="boolean"?HA(t):(n==="number"?rv:n==="string"?(r=Lh(t))?(t=r,VN):lue:t instanceof Lh?VN:t instanceof Date?nue:eue(t)?Jse:Array.isArray(t)?tue:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?rue:rv)(e,t)}function FA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function oue(e,t){t===void 0&&(t=e,e=yc);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(l){var s=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return a[s](l-s)}}function sue(e){return function(){return e}}function iv(e){return+e}var KN=[0,1];function qn(e){return e}function Ew(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:sue(isNaN(t)?NaN:.5)}function uue(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function cue(e,t,n){var r=e[0],i=e[1],a=t[0],l=t[1];return i<r?(r=Ew(i,r),a=n(l,a)):(r=Ew(r,i),a=n(a,l)),function(s){return a(r(s))}}function fue(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=Ew(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(s){var c=od(e,s,1,r)-1;return a[c](i[c](s))}}function ud(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ay(){var e=KN,t=KN,n=yc,r,i,a,l=qn,s,c,f;function d(){var g=Math.min(e.length,t.length);return l!==qn&&(l=uue(e[0],e[g-1])),s=g>2?fue:cue,c=f=null,p}function p(g){return g==null||isNaN(g=+g)?a:(c||(c=s(e.map(r),t,n)))(r(l(g)))}return p.invert=function(g){return l(i((f||(f=s(t,e.map(r),rv)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,iv),d()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),d()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=FA,d()},p.clamp=function(g){return arguments.length?(l=g?!0:qn,d()):l!==qn},p.interpolate=function(g){return arguments.length?(n=g,d()):n},p.unknown=function(g){return arguments.length?(a=g,p):a},function(g,v){return r=g,i=v,d()}}function qA(){return Ay()(qn,qn)}function hue(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function av(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function tc(e){return e=av(Math.abs(e)),e?e[1]:NaN}function due(e,t){return function(n,r){for(var i=n.length,a=[],l=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[l=(l+1)%e.length];return a.reverse().join(t)}}function pue(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var mue=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bh(e){if(!(t=mue.exec(e)))throw new Error("invalid format: "+e);var t;return new WA({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Bh.prototype=WA.prototype;function WA(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}WA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function gue(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var lv;function vue(e,t){var n=av(e,t);if(!n)return lv=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(lv=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+av(e,Math.max(0,t+a-1))[0]}function XN(e,t){var n=av(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const QN={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:hue,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>XN(e*100,t),r:XN,s:vue,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function YN(e){return e}var GN=Array.prototype.map,ZN=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yue(e){var t=e.grouping===void 0||e.thousands===void 0?YN:due(GN.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?YN:pue(GN.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(p,g){p=Bh(p);var v=p.fill,y=p.align,x=p.sign,w=p.symbol,A=p.zero,C=p.width,k=p.comma,P=p.precision,T=p.trim,D=p.type;D==="n"?(k=!0,D="g"):QN[D]||(P===void 0&&(P=12),T=!0,D="g"),(A||v==="0"&&y==="=")&&(A=!0,v="0",y="=");var N=(g&&g.prefix!==void 0?g.prefix:"")+(w==="$"?n:w==="#"&&/[boxX]/.test(D)?"0"+D.toLowerCase():""),I=(w==="$"?r:/[%p]/.test(D)?l:"")+(g&&g.suffix!==void 0?g.suffix:""),U=QN[D],K=/[defgprs%]/.test(D);P=P===void 0?6:/[gprs]/.test(D)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function V(B){var ae=N,ie=I,oe,z,G;if(D==="c")ie=U(B)+ie,B="";else{B=+B;var ne=B<0||1/B<0;if(B=isNaN(B)?c:U(Math.abs(B),P),T&&(B=gue(B)),ne&&+B==0&&x!=="+"&&(ne=!1),ae=(ne?x==="("?x:s:x==="-"||x==="("?"":x)+ae,ie=(D==="s"&&!isNaN(B)&&lv!==void 0?ZN[8+lv/3]:"")+ie+(ne&&x==="("?")":""),K){for(oe=-1,z=B.length;++oe<z;)if(G=B.charCodeAt(oe),48>G||G>57){ie=(G===46?i+B.slice(oe+1):B.slice(oe))+ie,B=B.slice(0,oe);break}}}k&&!A&&(B=t(B,1/0));var ce=ae.length+B.length+ie.length,fe=ce<C?new Array(C-ce+1).join(v):"";switch(k&&A&&(B=t(fe+B,fe.length?C-ie.length:1/0),fe=""),y){case"<":B=ae+B+ie+fe;break;case"=":B=ae+fe+B+ie;break;case"^":B=fe.slice(0,ce=fe.length>>1)+ae+B+ie+fe.slice(ce);break;default:B=fe+ae+B+ie;break}return a(B)}return V.toString=function(){return p+""},V}function d(p,g){var v=Math.max(-8,Math.min(8,Math.floor(tc(g)/3)))*3,y=Math.pow(10,-v),x=f((p=Bh(p),p.type="f",p),{suffix:ZN[8+v/3]});return function(w){return x(y*w)}}return{format:f,formatPrefix:d}}var Sm,VA,M$;bue({thousands:",",grouping:[3],currency:["$",""]});function bue(e){return Sm=yue(e),VA=Sm.format,M$=Sm.formatPrefix,Sm}function xue(e){return Math.max(0,-tc(Math.abs(e)))}function Sue(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(tc(t)/3)))*3-tc(Math.abs(e)))}function wue(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,tc(t)-tc(e))+1}function D$(e,t,n,r){var i=Ow(e,t,n),a;switch(r=Bh(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Sue(i,l))&&(r.precision=a),M$(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=wue(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=xue(i))&&(r.precision=a-(r.type==="%")*2);break}}return VA(r)}function lo(e){var t=e.domain;return e.ticks=function(n){var r=t();return Sw(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return D$(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,l=r[i],s=r[a],c,f,d=10;for(s<l&&(f=l,l=s,s=f,f=i,i=a,a=f);d-- >0;){if(f=ww(l,s,n),f===c)return r[i]=l,r[a]=s,t(r);if(f>0)l=Math.floor(l/f)*f,s=Math.ceil(s/f)*f;else if(f<0)l=Math.ceil(l*f)/f,s=Math.floor(s*f)/f;else break;c=f}return e},e}function P$(){var e=qA();return e.copy=function(){return ud(e,P$())},ri.apply(e,arguments),lo(e)}function _$(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,iv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return _$(e).unknown(t)},e=arguments.length?Array.from(e,iv):[0,1],lo(n)}function N$(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],l;return a<i&&(l=n,n=r,r=l,l=i,i=a,a=l),e[n]=t.floor(i),e[r]=t.ceil(a),e}function JN(e){return Math.log(e)}function eR(e){return Math.exp(e)}function Oue(e){return-Math.log(-e)}function Aue(e){return-Math.exp(-e)}function kue(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Cue(e){return e===10?kue:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Eue(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function tR(e){return(t,n)=>-e(-t,n)}function KA(e){const t=e(JN,eR),n=t.domain;let r=10,i,a;function l(){return i=Eue(r),a=Cue(r),n()[0]<0?(i=tR(i),a=tR(a),e(Oue,Aue)):e(JN,eR),t}return t.base=function(s){return arguments.length?(r=+s,l()):r},t.domain=function(s){return arguments.length?(n(s),l()):n()},t.ticks=s=>{const c=n();let f=c[0],d=c[c.length-1];const p=d<f;p&&([f,d]=[d,f]);let g=i(f),v=i(d),y,x;const w=s==null?10:+s;let A=[];if(!(r%1)&&v-g<w){if(g=Math.floor(g),v=Math.ceil(v),f>0){for(;g<=v;++g)for(y=1;y<r;++y)if(x=g<0?y/a(-g):y*a(g),!(x<f)){if(x>d)break;A.push(x)}}else for(;g<=v;++g)for(y=r-1;y>=1;--y)if(x=g>0?y/a(-g):y*a(g),!(x<f)){if(x>d)break;A.push(x)}A.length*2<w&&(A=Sw(f,d,w))}else A=Sw(g,v,Math.min(v-g,w)).map(a);return p?A.reverse():A},t.tickFormat=(s,c)=>{if(s==null&&(s=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Bh(c)).precision==null&&(c.trim=!0),c=VA(c)),s===1/0)return c;const f=Math.max(1,r*s/t.ticks().length);return d=>{let p=d/a(Math.round(i(d)));return p*r<r-.5&&(p*=r),p<=f?c(d):""}},t.nice=()=>n(N$(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function R$(){const e=KA(Ay()).domain([1,10]);return e.copy=()=>ud(e,R$()).base(e.base()),ri.apply(e,arguments),e}function nR(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function rR(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function XA(e){var t=1,n=e(nR(t),rR(t));return n.constant=function(r){return arguments.length?e(nR(t=+r),rR(t)):t},lo(n)}function j$(){var e=XA(Ay());return e.copy=function(){return ud(e,j$()).constant(e.constant())},ri.apply(e,arguments)}function iR(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Tue(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Mue(e){return e<0?-e*e:e*e}function QA(e){var t=e(qn,qn),n=1;function r(){return n===1?e(qn,qn):n===.5?e(Tue,Mue):e(iR(n),iR(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},lo(t)}function YA(){var e=QA(Ay());return e.copy=function(){return ud(e,YA()).exponent(e.exponent())},ri.apply(e,arguments),e}function Due(){return YA.apply(null,arguments).exponent(.5)}function aR(e){return Math.sign(e)*e*e}function Pue(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function I$(){var e=qA(),t=[0,1],n=!1,r;function i(a){var l=Pue(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(aR(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,iv)).map(aR)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return I$(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ri.apply(i,arguments),lo(i)}function L$(){var e=[],t=[],n=[],r;function i(){var l=0,s=Math.max(1,t.length);for(n=new Array(s-1);++l<s;)n[l-1]=jse(e,l/s);return a}function a(l){return l==null||isNaN(l=+l)?r:t[od(n,l)]}return a.invertExtent=function(l){var s=t.indexOf(l);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},a.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let s of l)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Vl),i()},a.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},a.unknown=function(l){return arguments.length?(r=l,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return L$().domain(e).range(t).unknown(r)},ri.apply(a,arguments)}function B$(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(c){return c!=null&&c<=c?i[od(r,c,0,n)]:a}function s(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return l}return l.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,s()):[e,t]},l.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,s()):i.slice()},l.invertExtent=function(c){var f=i.indexOf(c);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},l.unknown=function(c){return arguments.length&&(a=c),l},l.thresholds=function(){return r.slice()},l.copy=function(){return B$().domain([e,t]).range(i).unknown(a)},ri.apply(lo(l),arguments)}function z$(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[od(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var l=t.indexOf(a);return[e[l-1],e[l]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return z$().domain(e).range(t).unknown(n)},ri.apply(i,arguments)}const p1=new Date,m1=new Date;function Jt(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const l=i(a),s=i.ceil(a);return a-l<s-a?l:s},i.offset=(a,l)=>(t(a=new Date(+a),l==null?1:Math.floor(l)),a),i.range=(a,l,s)=>{const c=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<l)||!(s>0))return c;let f;do c.push(f=new Date(+a)),t(a,s),e(a);while(f<a&&a<l);return c},i.filter=a=>Jt(l=>{if(l>=l)for(;e(l),!a(l);)l.setTime(l-1)},(l,s)=>{if(l>=l)if(s<0)for(;++s<=0;)for(;t(l,-1),!a(l););else for(;--s>=0;)for(;t(l,1),!a(l););}),n&&(i.count=(a,l)=>(p1.setTime(+a),m1.setTime(+l),e(p1),e(m1),Math.floor(n(p1,m1))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?l=>r(l)%a===0:l=>i.count(0,l)%a===0):i)),i}const ov=Jt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ov.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Jt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ov);ov.range;const Ra=1e3,Zr=Ra*60,ja=Zr*60,Xa=ja*24,GA=Xa*7,lR=Xa*30,g1=Xa*365,Xo=Jt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ra)},(e,t)=>(t-e)/Ra,e=>e.getUTCSeconds());Xo.range;const ZA=Jt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ra)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getMinutes());ZA.range;const JA=Jt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getUTCMinutes());JA.range;const ek=Jt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ra-e.getMinutes()*Zr)},(e,t)=>{e.setTime(+e+t*ja)},(e,t)=>(t-e)/ja,e=>e.getHours());ek.range;const tk=Jt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ja)},(e,t)=>(t-e)/ja,e=>e.getUTCHours());tk.range;const cd=Jt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Zr)/Xa,e=>e.getDate()-1);cd.range;const ky=Jt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Xa,e=>e.getUTCDate()-1);ky.range;const $$=Jt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Xa,e=>Math.floor(e/Xa));$$.range;function xs(e){return Jt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Zr)/GA)}const Cy=xs(0),sv=xs(1),_ue=xs(2),Nue=xs(3),nc=xs(4),Rue=xs(5),jue=xs(6);Cy.range;sv.range;_ue.range;Nue.range;nc.range;Rue.range;jue.range;function Ss(e){return Jt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/GA)}const Ey=Ss(0),uv=Ss(1),Iue=Ss(2),Lue=Ss(3),rc=Ss(4),Bue=Ss(5),zue=Ss(6);Ey.range;uv.range;Iue.range;Lue.range;rc.range;Bue.range;zue.range;const nk=Jt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());nk.range;const rk=Jt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());rk.range;const Qa=Jt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Qa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Jt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Qa.range;const Ya=Jt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ya.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Jt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Ya.range;function U$(e,t,n,r,i,a){const l=[[Xo,1,Ra],[Xo,5,5*Ra],[Xo,15,15*Ra],[Xo,30,30*Ra],[a,1,Zr],[a,5,5*Zr],[a,15,15*Zr],[a,30,30*Zr],[i,1,ja],[i,3,3*ja],[i,6,6*ja],[i,12,12*ja],[r,1,Xa],[r,2,2*Xa],[n,1,GA],[t,1,lR],[t,3,3*lR],[e,1,g1]];function s(f,d,p){const g=d<f;g&&([f,d]=[d,f]);const v=p&&typeof p.range=="function"?p:c(f,d,p),y=v?v.range(f,+d+1):[];return g?y.reverse():y}function c(f,d,p){const g=Math.abs(d-f)/p,v=BA(([,,w])=>w).right(l,g);if(v===l.length)return e.every(Ow(f/g1,d/g1,p));if(v===0)return ov.every(Math.max(Ow(f,d,p),1));const[y,x]=l[g/l[v-1][2]<l[v][2]/g?v-1:v];return y.every(x)}return[s,c]}const[$ue,Uue]=U$(Ya,rk,Ey,$$,tk,JA),[Hue,Fue]=U$(Qa,nk,Cy,cd,ek,ZA);function v1(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function y1(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Pf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function que(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,l=e.shortDays,s=e.months,c=e.shortMonths,f=_f(i),d=Nf(i),p=_f(a),g=Nf(a),v=_f(l),y=Nf(l),x=_f(s),w=Nf(s),A=_f(c),C=Nf(c),k={a:G,A:ne,b:ce,B:fe,c:null,d:hR,e:hR,f:dce,g:Oce,G:kce,H:cce,I:fce,j:hce,L:H$,m:pce,M:mce,p:R,q:X,Q:mR,s:gR,S:gce,u:vce,U:yce,V:bce,w:xce,W:Sce,x:null,X:null,y:wce,Y:Ace,Z:Cce,"%":pR},P={a:re,A:le,b:ge,B:Oe,c:null,d:dR,e:dR,f:Dce,g:$ce,G:Hce,H:Ece,I:Tce,j:Mce,L:q$,m:Pce,M:_ce,p:De,q:mt,Q:mR,s:gR,S:Nce,u:Rce,U:jce,V:Ice,w:Lce,W:Bce,x:null,X:null,y:zce,Y:Uce,Z:Fce,"%":pR},T={a:K,A:V,b:B,B:ae,c:ie,d:cR,e:cR,f:lce,g:uR,G:sR,H:fR,I:fR,j:nce,L:ace,m:tce,M:rce,p:U,q:ece,Q:sce,s:uce,S:ice,u:Que,U:Yue,V:Gue,w:Xue,W:Zue,x:oe,X:z,y:uR,Y:sR,Z:Jue,"%":oce};k.x=D(n,k),k.X=D(r,k),k.c=D(t,k),P.x=D(n,P),P.X=D(r,P),P.c=D(t,P);function D(se,Te){return function(Ee){var ue=[],Nt=-1,Ne=0,xe=se.length,gt,dn,sa;for(Ee instanceof Date||(Ee=new Date(+Ee));++Nt<xe;)se.charCodeAt(Nt)===37&&(ue.push(se.slice(Ne,Nt)),(dn=oR[gt=se.charAt(++Nt)])!=null?gt=se.charAt(++Nt):dn=gt==="e"?" ":"0",(sa=Te[gt])&&(gt=sa(Ee,dn)),ue.push(gt),Ne=Nt+1);return ue.push(se.slice(Ne,Nt)),ue.join("")}}function N(se,Te){return function(Ee){var ue=Pf(1900,void 0,1),Nt=I(ue,se,Ee+="",0),Ne,xe;if(Nt!=Ee.length)return null;if("Q"in ue)return new Date(ue.Q);if("s"in ue)return new Date(ue.s*1e3+("L"in ue?ue.L:0));if(Te&&!("Z"in ue)&&(ue.Z=0),"p"in ue&&(ue.H=ue.H%12+ue.p*12),ue.m===void 0&&(ue.m="q"in ue?ue.q:0),"V"in ue){if(ue.V<1||ue.V>53)return null;"w"in ue||(ue.w=1),"Z"in ue?(Ne=y1(Pf(ue.y,0,1)),xe=Ne.getUTCDay(),Ne=xe>4||xe===0?uv.ceil(Ne):uv(Ne),Ne=ky.offset(Ne,(ue.V-1)*7),ue.y=Ne.getUTCFullYear(),ue.m=Ne.getUTCMonth(),ue.d=Ne.getUTCDate()+(ue.w+6)%7):(Ne=v1(Pf(ue.y,0,1)),xe=Ne.getDay(),Ne=xe>4||xe===0?sv.ceil(Ne):sv(Ne),Ne=cd.offset(Ne,(ue.V-1)*7),ue.y=Ne.getFullYear(),ue.m=Ne.getMonth(),ue.d=Ne.getDate()+(ue.w+6)%7)}else("W"in ue||"U"in ue)&&("w"in ue||(ue.w="u"in ue?ue.u%7:"W"in ue?1:0),xe="Z"in ue?y1(Pf(ue.y,0,1)).getUTCDay():v1(Pf(ue.y,0,1)).getDay(),ue.m=0,ue.d="W"in ue?(ue.w+6)%7+ue.W*7-(xe+5)%7:ue.w+ue.U*7-(xe+6)%7);return"Z"in ue?(ue.H+=ue.Z/100|0,ue.M+=ue.Z%100,y1(ue)):v1(ue)}}function I(se,Te,Ee,ue){for(var Nt=0,Ne=Te.length,xe=Ee.length,gt,dn;Nt<Ne;){if(ue>=xe)return-1;if(gt=Te.charCodeAt(Nt++),gt===37){if(gt=Te.charAt(Nt++),dn=T[gt in oR?Te.charAt(Nt++):gt],!dn||(ue=dn(se,Ee,ue))<0)return-1}else if(gt!=Ee.charCodeAt(ue++))return-1}return ue}function U(se,Te,Ee){var ue=f.exec(Te.slice(Ee));return ue?(se.p=d.get(ue[0].toLowerCase()),Ee+ue[0].length):-1}function K(se,Te,Ee){var ue=v.exec(Te.slice(Ee));return ue?(se.w=y.get(ue[0].toLowerCase()),Ee+ue[0].length):-1}function V(se,Te,Ee){var ue=p.exec(Te.slice(Ee));return ue?(se.w=g.get(ue[0].toLowerCase()),Ee+ue[0].length):-1}function B(se,Te,Ee){var ue=A.exec(Te.slice(Ee));return ue?(se.m=C.get(ue[0].toLowerCase()),Ee+ue[0].length):-1}function ae(se,Te,Ee){var ue=x.exec(Te.slice(Ee));return ue?(se.m=w.get(ue[0].toLowerCase()),Ee+ue[0].length):-1}function ie(se,Te,Ee){return I(se,t,Te,Ee)}function oe(se,Te,Ee){return I(se,n,Te,Ee)}function z(se,Te,Ee){return I(se,r,Te,Ee)}function G(se){return l[se.getDay()]}function ne(se){return a[se.getDay()]}function ce(se){return c[se.getMonth()]}function fe(se){return s[se.getMonth()]}function R(se){return i[+(se.getHours()>=12)]}function X(se){return 1+~~(se.getMonth()/3)}function re(se){return l[se.getUTCDay()]}function le(se){return a[se.getUTCDay()]}function ge(se){return c[se.getUTCMonth()]}function Oe(se){return s[se.getUTCMonth()]}function De(se){return i[+(se.getUTCHours()>=12)]}function mt(se){return 1+~~(se.getUTCMonth()/3)}return{format:function(se){var Te=D(se+="",k);return Te.toString=function(){return se},Te},parse:function(se){var Te=N(se+="",!1);return Te.toString=function(){return se},Te},utcFormat:function(se){var Te=D(se+="",P);return Te.toString=function(){return se},Te},utcParse:function(se){var Te=N(se+="",!0);return Te.toString=function(){return se},Te}}}var oR={"-":"",_:" ",0:"0"},hn=/^\s*\d+/,Wue=/^%/,Vue=/[\\^$*+?|[\]().{}]/g;function Ge(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function Kue(e){return e.replace(Vue,"\\$&")}function _f(e){return new RegExp("^(?:"+e.map(Kue).join("|")+")","i")}function Nf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Xue(e,t,n){var r=hn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Que(e,t,n){var r=hn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Yue(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Gue(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Zue(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function sR(e,t,n){var r=hn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function uR(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Jue(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ece(e,t,n){var r=hn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function tce(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function cR(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function nce(e,t,n){var r=hn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function fR(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function rce(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ice(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ace(e,t,n){var r=hn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function lce(e,t,n){var r=hn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function oce(e,t,n){var r=Wue.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function sce(e,t,n){var r=hn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function uce(e,t,n){var r=hn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function hR(e,t){return Ge(e.getDate(),t,2)}function cce(e,t){return Ge(e.getHours(),t,2)}function fce(e,t){return Ge(e.getHours()%12||12,t,2)}function hce(e,t){return Ge(1+cd.count(Qa(e),e),t,3)}function H$(e,t){return Ge(e.getMilliseconds(),t,3)}function dce(e,t){return H$(e,t)+"000"}function pce(e,t){return Ge(e.getMonth()+1,t,2)}function mce(e,t){return Ge(e.getMinutes(),t,2)}function gce(e,t){return Ge(e.getSeconds(),t,2)}function vce(e){var t=e.getDay();return t===0?7:t}function yce(e,t){return Ge(Cy.count(Qa(e)-1,e),t,2)}function F$(e){var t=e.getDay();return t>=4||t===0?nc(e):nc.ceil(e)}function bce(e,t){return e=F$(e),Ge(nc.count(Qa(e),e)+(Qa(e).getDay()===4),t,2)}function xce(e){return e.getDay()}function Sce(e,t){return Ge(sv.count(Qa(e)-1,e),t,2)}function wce(e,t){return Ge(e.getFullYear()%100,t,2)}function Oce(e,t){return e=F$(e),Ge(e.getFullYear()%100,t,2)}function Ace(e,t){return Ge(e.getFullYear()%1e4,t,4)}function kce(e,t){var n=e.getDay();return e=n>=4||n===0?nc(e):nc.ceil(e),Ge(e.getFullYear()%1e4,t,4)}function Cce(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ge(t/60|0,"0",2)+Ge(t%60,"0",2)}function dR(e,t){return Ge(e.getUTCDate(),t,2)}function Ece(e,t){return Ge(e.getUTCHours(),t,2)}function Tce(e,t){return Ge(e.getUTCHours()%12||12,t,2)}function Mce(e,t){return Ge(1+ky.count(Ya(e),e),t,3)}function q$(e,t){return Ge(e.getUTCMilliseconds(),t,3)}function Dce(e,t){return q$(e,t)+"000"}function Pce(e,t){return Ge(e.getUTCMonth()+1,t,2)}function _ce(e,t){return Ge(e.getUTCMinutes(),t,2)}function Nce(e,t){return Ge(e.getUTCSeconds(),t,2)}function Rce(e){var t=e.getUTCDay();return t===0?7:t}function jce(e,t){return Ge(Ey.count(Ya(e)-1,e),t,2)}function W$(e){var t=e.getUTCDay();return t>=4||t===0?rc(e):rc.ceil(e)}function Ice(e,t){return e=W$(e),Ge(rc.count(Ya(e),e)+(Ya(e).getUTCDay()===4),t,2)}function Lce(e){return e.getUTCDay()}function Bce(e,t){return Ge(uv.count(Ya(e)-1,e),t,2)}function zce(e,t){return Ge(e.getUTCFullYear()%100,t,2)}function $ce(e,t){return e=W$(e),Ge(e.getUTCFullYear()%100,t,2)}function Uce(e,t){return Ge(e.getUTCFullYear()%1e4,t,4)}function Hce(e,t){var n=e.getUTCDay();return e=n>=4||n===0?rc(e):rc.ceil(e),Ge(e.getUTCFullYear()%1e4,t,4)}function Fce(){return"+0000"}function pR(){return"%"}function mR(e){return+e}function gR(e){return Math.floor(+e/1e3)}var fu,V$,K$;qce({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function qce(e){return fu=que(e),V$=fu.format,fu.parse,K$=fu.utcFormat,fu.utcParse,fu}function Wce(e){return new Date(e)}function Vce(e){return e instanceof Date?+e:+new Date(+e)}function ik(e,t,n,r,i,a,l,s,c,f){var d=qA(),p=d.invert,g=d.domain,v=f(".%L"),y=f(":%S"),x=f("%I:%M"),w=f("%I %p"),A=f("%a %d"),C=f("%b %d"),k=f("%B"),P=f("%Y");function T(D){return(c(D)<D?v:s(D)<D?y:l(D)<D?x:a(D)<D?w:r(D)<D?i(D)<D?A:C:n(D)<D?k:P)(D)}return d.invert=function(D){return new Date(p(D))},d.domain=function(D){return arguments.length?g(Array.from(D,Vce)):g().map(Wce)},d.ticks=function(D){var N=g();return e(N[0],N[N.length-1],D??10)},d.tickFormat=function(D,N){return N==null?T:f(N)},d.nice=function(D){var N=g();return(!D||typeof D.range!="function")&&(D=t(N[0],N[N.length-1],D??10)),D?g(N$(N,D)):d},d.copy=function(){return ud(d,ik(e,t,n,r,i,a,l,s,c,f))},d}function Kce(){return ri.apply(ik(Hue,Fue,Qa,nk,Cy,cd,ek,ZA,Xo,V$).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Xce(){return ri.apply(ik($ue,Uue,Ya,rk,Ey,ky,tk,JA,Xo,K$).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ty(){var e=0,t=1,n,r,i,a,l=qn,s=!1,c;function f(p){return p==null||isNaN(p=+p)?c:l(i===0?.5:(p=(a(p)-n)*i,s?Math.max(0,Math.min(1,p)):p))}f.domain=function(p){return arguments.length?([e,t]=p,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(p){return arguments.length?(s=!!p,f):s},f.interpolator=function(p){return arguments.length?(l=p,f):l};function d(p){return function(g){var v,y;return arguments.length?([v,y]=g,l=p(v,y),f):[l(0),l(1)]}}return f.range=d(yc),f.rangeRound=d(FA),f.unknown=function(p){return arguments.length?(c=p,f):c},function(p){return a=p,n=p(e),r=p(t),i=n===r?0:1/(r-n),f}}function oo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function X$(){var e=lo(Ty()(qn));return e.copy=function(){return oo(e,X$())},tl.apply(e,arguments)}function Q$(){var e=KA(Ty()).domain([1,10]);return e.copy=function(){return oo(e,Q$()).base(e.base())},tl.apply(e,arguments)}function Y$(){var e=XA(Ty());return e.copy=function(){return oo(e,Y$()).constant(e.constant())},tl.apply(e,arguments)}function ak(){var e=QA(Ty());return e.copy=function(){return oo(e,ak()).exponent(e.exponent())},tl.apply(e,arguments)}function Qce(){return ak.apply(null,arguments).exponent(.5)}function G$(){var e=[],t=qn;function n(r){if(r!=null&&!isNaN(r=+r))return t((od(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Vl),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>Rse(e,a/r))},n.copy=function(){return G$(t).domain(e)},tl.apply(n,arguments)}function My(){var e=0,t=.5,n=1,r=1,i,a,l,s,c,f=qn,d,p=!1,g;function v(x){return isNaN(x=+x)?g:(x=.5+((x=+d(x))-a)*(r*x<r*a?s:c),f(p?Math.max(0,Math.min(1,x)):x))}v.domain=function(x){return arguments.length?([e,t,n]=x,i=d(e=+e),a=d(t=+t),l=d(n=+n),s=i===a?0:.5/(a-i),c=a===l?0:.5/(l-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(x){return arguments.length?(p=!!x,v):p},v.interpolator=function(x){return arguments.length?(f=x,v):f};function y(x){return function(w){var A,C,k;return arguments.length?([A,C,k]=w,f=oue(x,[A,C,k]),v):[f(0),f(.5),f(1)]}}return v.range=y(yc),v.rangeRound=y(FA),v.unknown=function(x){return arguments.length?(g=x,v):g},function(x){return d=x,i=x(e),a=x(t),l=x(n),s=i===a?0:.5/(a-i),c=a===l?0:.5/(l-a),r=a<i?-1:1,v}}function Z$(){var e=lo(My()(qn));return e.copy=function(){return oo(e,Z$())},tl.apply(e,arguments)}function J$(){var e=KA(My()).domain([.1,1,10]);return e.copy=function(){return oo(e,J$()).base(e.base())},tl.apply(e,arguments)}function e4(){var e=XA(My());return e.copy=function(){return oo(e,e4()).constant(e.constant())},tl.apply(e,arguments)}function lk(){var e=QA(My());return e.copy=function(){return oo(e,lk()).exponent(e.exponent())},tl.apply(e,arguments)}function Yce(){return lk.apply(null,arguments).exponent(.5)}const t4=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:$A,scaleDiverging:Z$,scaleDivergingLog:J$,scaleDivergingPow:lk,scaleDivergingSqrt:Yce,scaleDivergingSymlog:e4,scaleIdentity:_$,scaleImplicit:Aw,scaleLinear:P$,scaleLog:R$,scaleOrdinal:zA,scalePoint:Lse,scalePow:YA,scaleQuantile:L$,scaleQuantize:B$,scaleRadial:I$,scaleSequential:X$,scaleSequentialLog:Q$,scaleSequentialPow:ak,scaleSequentialQuantile:G$,scaleSequentialSqrt:Qce,scaleSequentialSymlog:Y$,scaleSqrt:Due,scaleSymlog:j$,scaleThreshold:z$,scaleTime:Kce,scaleUtc:Xce,tickFormat:D$},Symbol.toStringTag,{value:"Module"}));function Gce(e){var t=t4;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(Zh(e));if(n in t&&typeof t[n]=="function")return t[n]()}function vR(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Gce(e);if(r!=null)return r.domain(t).range(n),r}}function ok(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?vR(e.scale,n,r):vR(t,n,r)}function Zce(e){return"scale".concat(Zh(e))}function Jce(e){return Zce(e)in t4}var n4=(e,t,n)=>{if(e!=null){var r=e.scale,i=e.type;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return Jce(r)?r:"point"}};function efe(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function r4(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var l;return(l=e(a))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var l,s,c=efe(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var f=(l=r[c-1])!==null&&l!==void 0?l:0,d=(s=r[c])!==null&&s!==void 0?s:0;return Math.abs(a-f)<=Math.abs(a-d)?n[c-1]:n[c]}}}function tfe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):r4(e,void 0)}function yR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yR(Object(n),!0).forEach(function(r){nfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nfe(e,t,n){return(t=rfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rfe(e){var t=ife(e,"string");return typeof t=="symbol"?t:t+""}function ife(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function i4(e,t){return sfe(e)||ofe(e,t)||lfe(e,t)||afe()}function afe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
110
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lfe(e,t){if(e){if(typeof e=="string")return bR(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bR(e,t):void 0}}function bR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ofe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function sfe(e){if(Array.isArray(e))return e}var Tw=[0,"auto"],Kt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},a4=(e,t)=>e.cartesianAxis.xAxis[t],nl=(e,t)=>{var n=a4(e,t);return n??Kt},Xt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Tw,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:td},l4=(e,t)=>e.cartesianAxis.yAxis[t],rl=(e,t)=>{var n=l4(e,t);return n??Xt},ufe={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},sk=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??ufe},Bn=(e,t,n)=>{switch(t){case"xAxis":return nl(e,n);case"yAxis":return rl(e,n);case"zAxis":return sk(e,n);case"angleAxis":return NA(e,n);case"radiusAxis":return RA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},cfe=(e,t,n)=>{switch(t){case"xAxis":return nl(e,n);case"yAxis":return rl(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},fd=(e,t,n)=>{switch(t){case"xAxis":return nl(e,n);case"yAxis":return rl(e,n);case"angleAxis":return NA(e,n);case"radiusAxis":return RA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},o4=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function s4(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var Dy=e=>e.graphicalItems.cartesianItems,ffe=q([cn,Sy],s4),u4=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),bc=q([Dy,Bn,ffe],u4,{memoizeOptions:{resultEqualityCheck:Oy}}),c4=q([bc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(wy)),f4=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),hfe=q([bc],f4),h4=e=>e.map(t=>t.data).filter(Boolean).flat(1),dfe=q([bc],e=>e.some(t=>!t.data)),d4=q([bc],h4,{memoizeOptions:{resultEqualityCheck:Oy}}),p4=(e,t)=>{var n=t.chartData,r=n===void 0?[]:n,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:r.slice(i,a+1)},uk=q([d4,ad],p4),pfe=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:Bt(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Bt(i,r)}))):e.map(r=>({value:r})),m4=(e,t,n,r,i,a)=>{var l=r.chartData,s=l===void 0?[]:l,c=r.dataStartIndex,f=r.dataEndIndex,d=pfe(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=s.slice(c,f+1),g=p.map(v=>({value:Bt(v,t.dataKey)})).filter(v=>v.value!=null);return[...g,...d]}return d},hd=q([uk,Bn,bc,ad,dfe,d4],m4);function $u(e){if(ea(e)||e instanceof Date){var t=Number(e);if(Ve(t))return t}}function xR(e){if(Array.isArray(e)){var t=[$u(e[0]),$u(e[1])];return Yi(t)?t:void 0}var n=$u(e);if(n!=null)return[n,n]}function wi(e){return e.map($u).filter(ur)}function mfe(e,t){var n=$u(e),r=$u(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var gfe=q([hd],e=>e?.map(t=>t.value).sort(mfe));function g4(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function vfe(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!Ji(t))r=t;else if(Array.isArray(t)){var i=wi(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:wi(n.flatMap(a=>{var l=Bt(e,a.dataKey),s,c;if(Array.isArray(l)){var f=i4(l,2);s=f[0],c=f[1]}else s=c=l;if(!(!Ve(s)||!Ve(c)))return[r-s,r+c]}))}var en=e=>{var t=fn(e),n=vc(e);return fd(e,t,n)},ic=q([en],e=>e?.dataKey),yfe=q([c4,ad,en],S$),v4=(e,t,n,r)=>{var i={},a=t.reduce((l,s)=>{if(s.stackId==null)return l;var c=l[s.stackId];return c==null&&(c=[]),c.push(s),l[s.stackId]=c,l},i);return Object.fromEntries(Object.entries(a).map(l=>{var s=i4(l,2),c=s[0],f=s[1],d=r?[...f].reverse():f,p=d.map(IA);return[c,{stackedData:kie(e,p,n),graphicalItems:d}]}))},Mw=q([yfe,c4,vy,p$],v4),y4=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!=="zAxis")return Die(e,i,a)},bfe=q([Bn],e=>e.allowDataOverflow),ck=e=>{var t;if(e==null||!("domain"in e))return Tw;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=wi(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:Tw},b4=q([Bn],ck),x4=q([b4,bfe],t$),xfe=q([Mw,Ci,cn,x4],y4,{memoizeOptions:{resultEqualityCheck:ld}}),fk=e=>e.errorBars,Sfe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>g4(n,r)),fv=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),l=Math.min(...a),s=Math.max(...a);return[l,s]}},S4=function(t,n,r,i,a){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],s,c;if(r.length>0&&r.forEach(f=>{var d,p=f.data!=null?[...f.data]:l,g=(d=i[f.id])===null||d===void 0?void 0:d.filter(v=>g4(a,v));p.forEach(v=>{var y,x=Bt(v,(y=n.dataKey)!==null&&y!==void 0?y:f.dataKey),w=vfe(v,x,g);if(w.length>=2){var A=Math.min(...w),C=Math.max(...w);(s==null||A<s)&&(s=A),(c==null||C>c)&&(c=C)}var k=xR(x);k!=null&&(s=s==null?k[0]:Math.min(s,k[0]),c=c==null?k[1]:Math.max(c,k[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var d=xR(Bt(f,n.dataKey));d!=null&&(s=s==null?d[0]:Math.min(s,d[0]),c=c==null?d[1]:Math.max(c,d[1]))}),Ve(s)&&Ve(c))return[s,c]},wfe=q([uk,Bn,hfe,fk,cn,Zoe],S4,{memoizeOptions:{resultEqualityCheck:ld}});function Ofe(e){var t=e.value;if(ea(t)||t instanceof Date)return t}var Afe=(e,t,n)=>{var r=e.map(Ofe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&Nz(r))?e$(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},w4=e=>e.referenceElements.dots,xc=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),kfe=q([w4,cn,Sy],xc),O4=e=>e.referenceElements.areas,Cfe=q([O4,cn,Sy],xc),A4=e=>e.referenceElements.lines,Efe=q([A4,cn,Sy],xc),k4=(e,t)=>{if(e!=null){var n=wi(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Tfe=q(kfe,cn,k4),C4=(e,t)=>{if(e!=null){var n=wi(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Mfe=q([Cfe,cn],C4);function Dfe(e){var t;if(e.x!=null)return wi([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:wi(n)}function Pfe(e){var t;if(e.y!=null)return wi([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:wi(n)}var E4=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Dfe(r):Pfe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},_fe=q([Efe,cn],E4),Nfe=q(Tfe,_fe,Mfe,(e,t,n)=>fv(e,n,t)),T4=(e,t,n,r,i,a,l,s,c)=>{if(n!=null)return n;var f=l==="vertical"&&s==="xAxis"||l==="horizontal"&&s==="yAxis",d=f?fv(r,a,i):fv(a,i),p=ise(t,d,e.allowDataOverflow);return p??(e.allowDataOverflow&&d==null&&c!=null?c:p)},Rfe=e=>{if(!(e==null||e.type!=="number"||!("ticks"in e)||e.ticks==null)){var t=wi(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},jfe=q([Bn],Rfe,{memoizeOptions:{resultEqualityCheck:ld}}),Ife=q([Bn,b4,x4,xfe,wfe,Nfe,nt,cn,jfe],T4,{memoizeOptions:{resultEqualityCheck:ld}}),Lfe=[0,1],M4=(e,t,n,r,i,a,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var s=e.dataKey,c=e.type,f=Za(t,a);if(f&&s==null){var d;return e$(0,(d=n?.length)!==null&&d!==void 0?d:0)}return c==="category"?Afe(r,e,f):i==="expand"&&!f?Lfe:l}},hk=q([Bn,nt,uk,hd,vy,cn,Ife],M4),Sc=q([Bn,o4,DA],n4),D4=(e,t,n)=>{var r=t.niceTicks;if(r!=="none"){var i=ck(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Yi(e)){if(a)return MN(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return DN(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&Yi(e))return MN(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Yi(e))return DN(e,t.tickCount,t.allowDecimals,"adaptive")}}},dk=q([hk,fd,Sc],D4),P4=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Yi(t)&&Array.isArray(n)&&n.length>0){var i,a,l=t[0],s=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(l,s),Math.max(c,f)]}return t},Bfe=q([Bn,hk,dk,cn],P4),zfe=q(hd,Bn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(wi(e.map(p=>p.value))).sort((p,g)=>p-g),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var l=a-i;if(l===0)return 1/0;for(var s=0;s<r.length-1;s++){var c=r[s],f=r[s+1];if(!(c==null||f==null)){var d=f-c;n=Math.min(n,d)}}return n/l}}),_4=q(zfe,nt,d$,un,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Ve(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var l=xi(n,e*a),s=e*a/2;return s-l-(s-l)/a*l}return 0}),$fe=(e,t,n)=>{var r=nl(e,t);return r==null||typeof r.padding!="string"?0:_4(e,"xAxis",t,n,r.padding)},Ufe=(e,t,n)=>{var r=rl(e,t);return r==null||typeof r.padding!="string"?0:_4(e,"yAxis",t,n,r.padding)},Hfe=q(nl,$fe,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var i=e.padding;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),Ffe=q(rl,Ufe,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var i=e.padding;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),N4=q([un,Hfe,my,py,(e,t,n)=>n],(e,t,n,r,i)=>{var a=r.padding;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),R4=q([un,nt,Ffe,my,py,(e,t,n)=>n],(e,t,n,r,i,a)=>{var l=i.padding;return a?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),dd=(e,t,n,r)=>{var i;switch(t){case"xAxis":return N4(e,n,r);case"yAxis":return R4(e,n,r);case"zAxis":return(i=sk(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return y$(e);case"radiusAxis":return b$(e,n);default:return}},j4=q([Bn,dd],yy),qfe=q([Sc,Bfe],wse),pk=q([Bn,Sc,qfe,j4],ok),I4=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var i=n.type,a=n.scale,l=Za(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(s=>s.value)}},mk=q([nt,hd,fd,cn],I4),Py=q([pk],LA);q([pk],tfe);q([pk,gfe],r4);q([bc,fk,cn],Sfe);function L4(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var _y=(e,t)=>t,Ny=(e,t,n)=>n,Wfe=q(hy,_y,Ny,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(L4)),Vfe=q(dy,_y,Ny,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(L4)),B4=(e,t)=>({width:e.width,height:t.height}),Kfe=(e,t)=>{var n=typeof t.width=="number"?t.width:td;return{width:n,height:e.height}},z4=q(un,nl,B4),Xfe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Qfe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Yfe=q(el,un,Wfe,_y,Ny,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=B4(t,s);l==null&&(l=Xfe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[s.id]=l-Number(f)*c.height,l+=(f?-1:1)*c.height}),a}),Gfe=q(Ja,un,Vfe,_y,Ny,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=Kfe(t,s);l==null&&(l=Qfe(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[s.id]=l-Number(f)*c.width,l+=(f?-1:1)*c.width}),a}),Zfe=(e,t)=>{var n=nl(e,t);if(n!=null)return Yfe(e,n.orientation,n.mirror)},Jfe=q([un,nl,Zfe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),ehe=(e,t)=>{var n=rl(e,t);if(n!=null)return Gfe(e,n.orientation,n.mirror)},the=q([un,rl,ehe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),$4=q(un,rl,(e,t)=>{var n=typeof t.width=="number"?t.width:td;return{width:n,height:e.height}}),SR=(e,t,n)=>{switch(t){case"xAxis":return z4(e,n).width;case"yAxis":return $4(e,n).height;default:return}},U4=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,l=n.dataKey,s=Za(e,r),c=t.map(d=>d.value),f=c.filter(d=>d!=null);if(l&&s&&a==="category"&&i&&Nz(f))return c}},gk=q([nt,hd,Bn,cn],U4),wR=q([nt,cfe,Sc,Py,gk,mk,dd,dk,cn],(e,t,n,r,i,a,l,s,c)=>{if(t!=null){var f=Za(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:s,range:l,realScaleType:n,scale:r}}}),nhe=(e,t,n,r,i,a,l,s,c)=>{if(!(t==null||r==null)){var f=Za(e,c),d=t.type,p=t.ticks,g=t.tickCount,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,y=d==="category"&&r.bandwidth?r.bandwidth()/v:0;y=c==="angleAxis"&&a!=null&&a.length>=2?sr(a[0]-a[1])*2*y:y;var x=p||i;return x?x.map((w,A)=>{var C=l?l.indexOf(w):w,k=r.map(C);return Ve(k)?{index:A,coordinate:k+y,value:w,offset:y}:null}).filter(ur):f&&s?s.map((w,A)=>{var C=r.map(w);return Ve(C)?{coordinate:C+y,value:w,index:A,offset:y}:null}).filter(ur):r.ticks?r.ticks(g).map((w,A)=>{var C=r.map(w);return Ve(C)?{coordinate:C+y,value:w,index:A,offset:y}:null}).filter(ur):r.domain().map((w,A)=>{var C=r.map(w);return Ve(C)?{coordinate:C+y,value:l?l[w]:w,index:A,offset:y}:null}).filter(ur)}},H4=q([nt,fd,Sc,Py,dk,dd,gk,mk,cn],nhe),rhe=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=Za(e,l),c=t.tickCount,f=0;return f=l==="angleAxis"&&r?.length>=2?sr(r[0]-r[1])*2*f:f,s&&a?a.map((d,p)=>{var g=n.map(d);return Ve(g)?{coordinate:g+f,value:d,index:p,offset:f}:null}).filter(ur):n.ticks?n.ticks(c).map((d,p)=>{var g=n.map(d);return Ve(g)?{coordinate:g+f,value:d,index:p,offset:f}:null}).filter(ur):n.domain().map((d,p)=>{var g=n.map(d);return Ve(g)?{coordinate:g+f,value:i?i[d]:d,index:p,offset:f}:null}).filter(ur)}},to=q([nt,fd,Py,dd,gk,mk,cn],rhe),no=q(Bn,Py,(e,t)=>{if(!(e==null||t==null))return cv(cv({},e),{},{scale:t})}),ihe=q([Bn,Sc,hk,j4],ok),ahe=q([ihe],LA);q((e,t,n)=>sk(e,n),ahe,(e,t)=>{if(!(e==null||t==null))return cv(cv({},e),{},{scale:t})});var lhe=q([nt,hy,dy],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),ohe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};q([ohe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var l=Math.abs(a.coordinate-t);l<r&&(r=l,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var F4=e=>e.options.defaultTooltipEventType,q4=e=>e.options.validateTooltipEventTypes;function W4(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function pd(e,t){var n=F4(e),r=q4(e);return W4(t,n,r)}function she(e){return we(t=>pd(t,e))}var V4=(e,t)=>{var n,r=Number(t);if(!(Ji(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},uhe=e=>e.tooltip.settings,Ll={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},che={itemInteraction:{click:Ll,hover:Ll},axisInteraction:{click:Ll,hover:Ll},keyboardInteraction:Ll,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},K4=In({name:"tooltip",initialState:che,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(Ye(t.payload))},prepare:bt()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Gr(e).tooltipItemPayloads.indexOf(Ye(r));a>-1&&(e.tooltipItemPayloads[a]=Ye(i))},prepare:bt()},removeTooltipEntrySettings:{reducer(e,t){var n=Gr(e).tooltipItemPayloads.indexOf(Ye(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:bt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),ii=K4.actions,fhe=ii.addTooltipEntrySettings,hhe=ii.replaceTooltipEntrySettings,dhe=ii.removeTooltipEntrySettings,phe=ii.setTooltipSettingsState,X4=ii.setActiveMouseOverItemIndex,mhe=ii.mouseLeaveItem,Q4=ii.mouseLeaveChart,ghe=ii.setActiveClickItemIndex,Y4=ii.setMouseOverAxisIndex,vhe=ii.setMouseClickAxisIndex,Hf=ii.setSyncInteraction,hv=ii.setKeyboardInteraction,yhe=K4.reducer;function OR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OR(Object(n),!0).forEach(function(r){bhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bhe(e,t,n){return(t=xhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xhe(e){var t=She(e,"string");return typeof t=="symbol"?t:t+""}function She(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function whe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Ohe(e){return e.index!=null}var G4=(e,t,n,r)=>{if(t==null)return Ll;var i=whe(e,t,n);if(i==null)return Ll;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(Ohe(i)){if(a)return wm(wm({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return wm(wm({},Ll),{},{coordinate:i.coordinate})};function Ahe(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function khe(e,t){var n=Ahe(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),l=Math.max(r,i);return n>=a&&n<=l}function Che(e,t,n){if(n==null||t==null)return!0;var r=Bt(e,t);return r==null||!Yi(n)?!0:khe(r,n)}var nh=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!Ve(a))return i;var l=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(l,Math.min(a,s)),f=t[c];return f==null||Che(f,n,r)?String(c):null},Z4=(e,t,n,r,i,a,l)=>{if(a!=null){var s=l[0],c=s?.getPosition(a);if(c!=null)return c;var f=i?.[Number(a)];if(f)return n==="horizontal"?{x:f.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:f.coordinate}}},J4=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(l=>{var s;return((s=l.settings)===null||s===void 0?void 0:s.graphicalItemId)===i})},e8=e=>e.options.tooltipPayloadSearcher,wc=e=>e.tooltip;function AR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AR(Object(n),!0).forEach(function(r){Ehe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ehe(e,t,n){return(t=The(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function The(e){var t=Mhe(e,"string");return typeof t=="symbol"?t:t+""}function Mhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dhe(e){if(typeof e=="string"||typeof e=="number")return e}function Phe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function _he(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function CR(e){if(typeof e=="string")return e}function Nhe(e){if(!(e==null||typeof e!="object")){var t="name"in e?Dhe(e.name):void 0,n="unit"in e?Phe(e.unit):void 0,r="dataKey"in e?_he(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?CR(e.color):void 0,l="fill"in e?CR(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function Rhe(e,t){return e??t}var t8=(e,t,n,r,i,a,l)=>{if(!(t==null||a==null)){var s=n.chartData,c=n.computedData,f=n.dataStartIndex,d=n.dataEndIndex,p=[];return e.reduce((g,v)=>{var y,x=v.dataDefinedOnItem,w=v.settings,A=Rhe(x,s),C=Array.isArray(A)?P5(A,f,d):A,k=(y=w?.dataKey)!==null&&y!==void 0?y:r,P=w?.nameKey,T;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&l==="axis"?T=Rz(C,r,i):T=a(C,t,c,P),Array.isArray(T))T.forEach(N=>{var I,U,K=Nhe(N),V=K?.name,B=K?.dataKey,ae=K?.payload,ie=kR(kR({},w),{},{name:V,unit:K?.unit,color:(I=K?.color)!==null&&I!==void 0?I:w?.color,fill:(U=K?.fill)!==null&&U!==void 0?U:w?.fill});g.push(S_({tooltipEntrySettings:ie,dataKey:B,payload:ae,value:Bt(ae,B),name:V==null?void 0:String(V)}))});else{var D;g.push(S_({tooltipEntrySettings:w,dataKey:k,payload:T,value:Bt(T,k),name:(D=Bt(T,P))!==null&&D!==void 0?D:w?.name}))}return g},p)}},vk=q([en,o4,DA],n4),jhe=q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Ihe=q([fn,vc],s4),ws=q([jhe,en,Ihe],u4,{memoizeOptions:{resultEqualityCheck:Oy}}),Lhe=q([ws],e=>e.filter(wy)),n8=q([ws],h4,{memoizeOptions:{resultEqualityCheck:Oy}}),Bhe=q([ws],e=>e.some(t=>!t.data)),ps=q([n8,Ci],p4),zhe=q([Lhe,Ci,en],S$),yk=q([ps,en,ws,Ci,Bhe,n8],m4),r8=q([en],ck),$he=q([en],e=>e.allowDataOverflow),i8=q([r8,$he],t$),Uhe=q([ws],e=>e.filter(wy)),Hhe=q([zhe,Uhe,vy,p$],v4),Fhe=q([Hhe,Ci,fn,i8],y4),qhe=q([ws],f4),Whe=q([ps,en,qhe,fk,fn,Joe],S4,{memoizeOptions:{resultEqualityCheck:ld}}),Vhe=q([w4,fn,vc],xc),Khe=q([Vhe,fn],k4),Xhe=q([O4,fn,vc],xc),Qhe=q([Xhe,fn],C4),Yhe=q([A4,fn,vc],xc),Ghe=q([Yhe,fn],E4),Zhe=q([Khe,Ghe,Qhe],fv),Jhe=q([en,r8,i8,Fhe,Whe,Zhe,nt,fn],T4),ac=q([en,nt,ps,yk,vy,fn,Jhe],M4),ede=q([ac,en,vk],D4),tde=q([en,ac,ede,fn],P4),a8=e=>{var t=fn(e),n=vc(e),r=!1;return dd(e,t,n,r)},l8=q([en,a8],yy),nde=q([en,vk,tde,l8],ok),o8=q([nde],LA),rde=q([nt,yk,en,fn],U4),ide=q([nt,yk,en,fn],I4),ade=(e,t,n,r,i,a,l,s)=>{if(t){var c=t.type,f=Za(e,s);if(r){var d=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,p=c==="category"&&r.bandwidth?r.bandwidth()/d:0;return p=s==="angleAxis"&&i!=null&&i?.length>=2?sr(i[0]-i[1])*2*p:p,f&&l?l.map((g,v)=>{var y=r.map(g);return Ve(y)?{coordinate:y+p,value:g,index:v,offset:p}:null}).filter(ur):r.domain().map((g,v)=>{var y=r.map(g);return Ve(y)?{coordinate:y+p,value:a?a[g]:g,index:v,offset:p}:null}).filter(ur)}}},il=q([nt,en,vk,o8,a8,rde,ide,fn],ade),bk=q([F4,q4,uhe],(e,t,n)=>W4(n.shared,e,t)),s8=e=>e.tooltip.settings.trigger,xk=e=>e.tooltip.settings.defaultIndex,md=q([wc,bk,s8,xk],G4),ms=q([md,ps,ic,ac],nh),u8=q([il,ms],V4),c8=q([md],e=>{if(e)return e.dataKey}),lde=q([md],e=>{if(e)return e.graphicalItemId}),f8=q([wc,bk,s8,xk],J4),ode=q([Ja,el,nt,un,il,xk,f8],Z4),sde=q([md,ode],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),ude=q([md],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),cde=q([f8,ms,Ci,ic,u8,e8,bk],t8),fde=q([cde],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function ER(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function TR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ER(Object(n),!0).forEach(function(r){hde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ER(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hde(e,t,n){return(t=dde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dde(e){var t=pde(e,"string");return typeof t=="symbol"?t:t+""}function pde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mde=()=>we(en),gde=()=>{var e=mde(),t=we(il),n=we(o8);return Ju(!e||!n?void 0:TR(TR({},e),{},{scale:n}),t)};function MR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MR(Object(n),!0).forEach(function(r){vde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vde(e,t,n){return(t=yde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yde(e){var t=bde(e,"string");return typeof t=="symbol"?t:t+""}function bde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xde=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},Sde=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,l=r.radius;return hu(hu(hu({},r),An(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var s=i.coordinate,c=r.angle;return hu(hu(hu({},r),An(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function wde(e,t){var n=e.relativeX,r=e.relativeY;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var h8=(e,t,n,r,i)=>{var a,l=(a=t?.length)!==null&&a!==void 0?a:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var s=0;s<l;s++){var c,f,d,p,g,v=s>0?(c=n[s-1])===null||c===void 0?void 0:c.coordinate:(f=n[l-1])===null||f===void 0?void 0:f.coordinate,y=(d=n[s])===null||d===void 0?void 0:d.coordinate,x=s>=l-1?(p=n[0])===null||p===void 0?void 0:p.coordinate:(g=n[s+1])===null||g===void 0?void 0:g.coordinate,w=void 0;if(!(v==null||y==null||x==null))if(sr(y-v)!==sr(x-y)){var A=[];if(sr(x-y)===sr(i[1]-i[0])){w=x;var C=y+i[1]-i[0];A[0]=Math.min(C,(C+v)/2),A[1]=Math.max(C,(C+v)/2)}else{w=v;var k=x+i[1]-i[0];A[0]=Math.min(y,(k+y)/2),A[1]=Math.max(y,(k+y)/2)}var P=[Math.min(y,(w+y)/2),Math.max(y,(w+y)/2)];if(e>P[0]&&e<=P[1]||e>=A[0]&&e<=A[1]){var T;return(T=n[s])===null||T===void 0?void 0:T.index}}else{var D=Math.min(v,x),N=Math.max(v,x);if(e>(D+y)/2&&e<=(N+y)/2){var I;return(I=n[s])===null||I===void 0?void 0:I.index}}}else if(t)for(var U=0;U<l;U++){var K=t[U];if(K!=null){var V=t[U+1],B=t[U-1];if(U===0&&V!=null&&e<=(K.coordinate+V.coordinate)/2||U===l-1&&B!=null&&e>(K.coordinate+B.coordinate)/2||U>0&&U<l-1&&B!=null&&V!=null&&e>(K.coordinate+B.coordinate)/2&&e<=(K.coordinate+V.coordinate)/2)return K.index}}return-1},Ode=()=>we(DA),Sk=(e,t)=>t,d8=(e,t,n)=>n,wk=(e,t,n,r)=>r,Ade=q(il,e=>ey(e,t=>t.coordinate)),Ok=q([wc,Sk,d8,wk],G4),Ak=q([Ok,ps,ic,ac],nh),kde=(e,t,n)=>{if(t!=null){var r=wc(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},p8=q([wc,Sk,d8,wk],J4),dv=q([Ja,el,nt,un,il,wk,p8],Z4),Cde=q([Ok,dv],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),m8=q([il,Ak],V4),Ede=q([p8,Ak,Ci,ic,m8,e8,Sk],t8),Tde=q([Ok,Ak],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Mde=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&wde(e,l)){var s=Pie(e,t),c=h8(s,a,i,n,r),f=xde(t,i,c,e);return{activeIndex:String(c),activeCoordinate:f}}},Dde=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var s=qoe(e,n);if(s){var c=_ie(s,t),f=h8(c,l,a,r,i),d=Sde(t,a,f,s);return{activeIndex:String(f),activeCoordinate:d}}}},Pde=(e,t,n,r,i,a,l,s)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?Mde(e,t,r,i,a,l,s):Dde(e,t,n,r,i,a,l)},_de=q(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),Nde=q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(sn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Sse}});function DR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function PR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DR(Object(n),!0).forEach(function(r){Rde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rde(e,t,n){return(t=jde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jde(e){var t=Ide(e,"string");return typeof t=="symbol"?t:t+""}function Ide(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lde={},Bde={zIndexMap:Object.values(sn).reduce((e,t)=>PR(PR({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Lde)},zde=new Set(Object.values(sn));function $de(e){return zde.has(e)}var g8=In({name:"zIndex",initialState:Bde,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:bt()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!$de(n)&&delete e.zIndexMap[n])},prepare:bt()},registerZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload,r=n.zIndex,i=n.element,a=n.isPanorama;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=Ye(i):e.zIndexMap[r].element=Ye(i):e.zIndexMap[r]={consumers:0,element:a?void 0:Ye(i),panoramaElement:a?Ye(i):void 0}},prepare:bt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:bt()}}}),Ry=g8.actions,Ude=Ry.registerZIndexPortal,b1=Ry.unregisterZIndexPortal,Hde=Ry.registerZIndexPortalElement,Fde=Ry.unregisterZIndexPortalElement,qde=g8.reducer;function ai(e){var t=e.zIndex,n=e.children,r=gae(),i=r&&t!==void 0&&t!==0,a=Ln(),l=O.useRef(void 0),s=O.useRef(new Set),c=St(),f=we(p=>_de(p,t,a));if(O.useLayoutEffect(()=>{if(!i){var p=s.current;p.forEach(v=>{c(b1({zIndex:v}))}),p.clear(),l.current=void 0;return}if(s.current.has(t)||(c(Ude({zIndex:t})),s.current.add(t)),f){l.current=f;var g=s.current;g.forEach(v=>{v!==t&&(c(b1({zIndex:v})),g.delete(v))})}},[c,t,i,f]),O.useLayoutEffect(()=>{var p=s.current;return()=>{p.forEach(g=>{c(b1({zIndex:g}))}),p.clear()}},[c]),!i)return n;var d=f??l.current;return d?aO.createPortal(n,d):null}function Dw(){return Dw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dw.apply(null,arguments)}function _R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Om(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_R(Object(n),!0).forEach(function(r){Wde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_R(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wde(e,t,n){return(t=Vde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vde(e){var t=Kde(e,"string");return typeof t=="symbol"?t:t+""}function Kde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xde(e){var t=e.cursor,n=e.cursorComp,r=e.cursorProps;return O.isValidElement(t)?O.cloneElement(t,r):O.createElement(n,r)}function Qde(e){var t,n=e.coordinate,r=e.payload,i=e.index,a=e.offset,l=e.tooltipAxisBandSize,s=e.layout,c=e.cursor,f=e.tooltipEventType,d=e.chartName,p=n,g=r,v=i;if(!c||!p||d!=="ScatterChart"&&f!=="axis")return null;var y,x,w;if(d==="ScatterChart")y=p,x=Jle,w=sn.cursorLine;else if(d==="BarChart")y=eoe(s,p,a,l),x=G5,w=sn.cursorRectangle;else if(s==="radial"&&Lz(p)){var A=Z5(p),C=A.cx,k=A.cy,P=A.radius,T=A.startAngle,D=A.endAngle;y={cx:C,cy:k,startAngle:T,endAngle:D,innerRadius:P,outerRadius:P},x=Xoe,w=sn.cursorLine}else y={points:Qoe(s,p,a)},x=W5,w=sn.cursorLine;var N=typeof c=="object"&&"className"in c?c.className:void 0,I=Om(Om(Om(Om({stroke:"#ccc",pointerEvents:"none"},a),y),Gh(c)),{},{payload:g,payloadIndex:v,className:st("recharts-tooltip-cursor",N)});return O.createElement(ai,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:w},O.createElement(Xde,{cursor:c,cursorComp:x,cursorProps:I}))}function Yde(e){var t=gde(),n=B5(),r=bs(),i=Ode();return t==null||n==null||r==null||i==null?null:O.createElement(Qde,Dw({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var v8=O.createContext(null),Gde=()=>O.useContext(v8),x1={exports:{}},NR;function Zde(){return NR||(NR=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,f,d){this.fn=c,this.context=f,this.once=d||!1}function a(c,f,d,p,g){if(typeof d!="function")throw new TypeError("The listener must be a function");var v=new i(d,p||c,g),y=n?n+f:f;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],v]:c._events[y].push(v):(c._events[y]=v,c._eventsCount++),c}function l(c,f){--c._eventsCount===0?c._events=new r:delete c._events[f]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var f=[],d,p;if(this._eventsCount===0)return f;for(p in d=this._events)t.call(d,p)&&f.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(d)):f},s.prototype.listeners=function(f){var d=n?n+f:f,p=this._events[d];if(!p)return[];if(p.fn)return[p.fn];for(var g=0,v=p.length,y=new Array(v);g<v;g++)y[g]=p[g].fn;return y},s.prototype.listenerCount=function(f){var d=n?n+f:f,p=this._events[d];return p?p.fn?1:p.length:0},s.prototype.emit=function(f,d,p,g,v,y){var x=n?n+f:f;if(!this._events[x])return!1;var w=this._events[x],A=arguments.length,C,k;if(w.fn){switch(w.once&&this.removeListener(f,w.fn,void 0,!0),A){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,d),!0;case 3:return w.fn.call(w.context,d,p),!0;case 4:return w.fn.call(w.context,d,p,g),!0;case 5:return w.fn.call(w.context,d,p,g,v),!0;case 6:return w.fn.call(w.context,d,p,g,v,y),!0}for(k=1,C=new Array(A-1);k<A;k++)C[k-1]=arguments[k];w.fn.apply(w.context,C)}else{var P=w.length,T;for(k=0;k<P;k++)switch(w[k].once&&this.removeListener(f,w[k].fn,void 0,!0),A){case 1:w[k].fn.call(w[k].context);break;case 2:w[k].fn.call(w[k].context,d);break;case 3:w[k].fn.call(w[k].context,d,p);break;case 4:w[k].fn.call(w[k].context,d,p,g);break;default:if(!C)for(T=1,C=new Array(A-1);T<A;T++)C[T-1]=arguments[T];w[k].fn.apply(w[k].context,C)}}return!0},s.prototype.on=function(f,d,p){return a(this,f,d,p,!1)},s.prototype.once=function(f,d,p){return a(this,f,d,p,!0)},s.prototype.removeListener=function(f,d,p,g){var v=n?n+f:f;if(!this._events[v])return this;if(!d)return l(this,v),this;var y=this._events[v];if(y.fn)y.fn===d&&(!g||y.once)&&(!p||y.context===p)&&l(this,v);else{for(var x=0,w=[],A=y.length;x<A;x++)(y[x].fn!==d||g&&!y[x].once||p&&y[x].context!==p)&&w.push(y[x]);w.length?this._events[v]=w.length===1?w[0]:w:l(this,v)}return this},s.prototype.removeAllListeners=function(f){var d;return f?(d=n?n+f:f,this._events[d]&&l(this,d)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(x1)),x1.exports}var Jde=Zde();const epe=Ov(Jde);var zh=new epe,Pw="recharts.syncEvent.tooltip",RR="recharts.syncEvent.brush",y8=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Ji(n))return e[n]}},tpe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},b8=In({name:"options",initialState:tpe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),npe=b8.reducer,rpe=b8.actions.createEventEmitter;function ipe(e){return e.tooltip.syncInteraction}var ape={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},x8=In({name:"chartData",initialState:ape,reducers:{setChartData(e,t){if(e.chartData=Ye(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var n=t.payload,r=n.startIndex,i=n.endIndex;r!=null&&(e.dataStartIndex=r),i!=null&&(e.dataEndIndex=i)}}}),kk=x8.actions,jR=kk.setChartData,lpe=kk.setDataStartEndIndexes;kk.setComputedData;var ope=x8.reducer,spe=["x","y"];function IR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function du(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IR(Object(n),!0).forEach(function(r){upe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function upe(e,t,n){return(t=cpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cpe(e){var t=fpe(e,"string");return typeof t=="symbol"?t:t+""}function fpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hpe(e,t){if(e==null)return{};var n,r,i=dpe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dpe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ppe(){var e=we(PA),t=we(_A),n=St(),r=we(m$),i=we(il),a=bs(),l=gy(),s=we(c=>c.rootProps.className);O.useEffect(()=>{if(e==null)return ys;var c=(f,d,p)=>{if(t!==p&&e===f){if(d.payload.active===!1){n(Hf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var g;if(l&&d!==null&&d!==void 0&&(g=d.payload)!==null&&g!==void 0&&g.coordinate&&d.payload.sourceViewBox){var v=d.payload.coordinate,y=v.x,x=v.y,w=hpe(v,spe),A=d.payload.sourceViewBox,C=A.x,k=A.y,P=A.width,T=A.height,D=du(du({},w),{},{x:l.x+(P?(y-C)/P:0)*l.width,y:l.y+(T?(x-k)/T:0)*l.height});n(du(du({},d),{},{payload:du(du({},d.payload),{},{coordinate:D})}))}else n(d);return}if(i!=null){var N;if(typeof r=="function"){var I={activeTooltipIndex:d.payload.index==null?void 0:Number(d.payload.index),isTooltipActive:d.payload.active,activeIndex:d.payload.index==null?void 0:Number(d.payload.index),activeLabel:d.payload.label,activeDataKey:d.payload.dataKey,activeCoordinate:d.payload.coordinate},U=r(i,I);N=i[U]}else r==="value"&&(N=i.find(G=>String(G.value)===d.payload.label));var K=d.payload.coordinate;if(K==null||l==null){n(Hf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(N==null){n(Hf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:void 0}));return}var V=K.x,B=K.y,ae=Math.min(V,l.x+l.width),ie=Math.min(B,l.y+l.height),oe={x:a==="horizontal"?N.coordinate:ae,y:a==="horizontal"?ie:N.coordinate},z=Hf({active:d.payload.active,coordinate:oe,dataKey:d.payload.dataKey,index:String(N.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n(z)}}};return zh.on(Pw,c),()=>{zh.off(Pw,c)}},[s,n,t,e,r,i,a,l])}function mpe(){var e=we(PA),t=we(_A),n=St();O.useEffect(()=>{if(e==null)return ys;var r=(i,a,l)=>{t!==l&&e===i&&n(lpe(a))};return zh.on(RR,r),()=>{zh.off(RR,r)}},[n,t,e])}function gpe(){var e=St();O.useEffect(()=>{e(rpe())},[e]),ppe(),mpe()}function vpe(e,t,n,r,i,a){var l=we(y=>kde(y,e,t)),s=we(lde),c=we(_A),f=we(PA),d=we(m$),p=we(ipe),g=p?.sourceViewBox!=null,v=gy();O.useEffect(()=>{if(!g&&f!=null&&c!=null){var y=Hf({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:s});zh.emit(Pw,f,y,c)}},[g,n,l,s,i,r,c,f,d,a,v])}function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LR(Object(n),!0).forEach(function(r){ype(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ype(e,t,n){return(t=bpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bpe(e){var t=xpe(e,"string");return typeof t=="symbol"?t:t+""}function xpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Spe(e,t){return kpe(e)||Ape(e,t)||Ope(e,t)||wpe()}function wpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
111
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ope(e,t){if(e){if(typeof e=="string")return zR(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zR(e,t):void 0}}function zR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ape(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function kpe(e){if(Array.isArray(e))return e}function Cpe(e){return e.dataKey}function Epe(e,t){return O.isValidElement(e)?O.cloneElement(e,t):typeof e=="function"?O.createElement(e,t):O.createElement(yle,t)}var $R=[],Tpe={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function UR(e){var t,n,r=jn(e,Tpe),i=r.active,a=r.allowEscapeViewBox,l=r.animationDuration,s=r.animationEasing,c=r.content,f=r.filterNull,d=r.isAnimationActive,p=r.offset,g=r.payloadUniqBy,v=r.position,y=r.reverseDirection,x=r.useTranslate3d,w=r.wrapperStyle,A=r.cursor,C=r.shared,k=r.trigger,P=r.defaultIndex,T=r.portal,D=r.axisId,N=St(),I=typeof P=="number"?String(P):P;O.useEffect(()=>{N(phe({shared:C,trigger:k,axisId:D,active:i,defaultIndex:I}))},[N,C,k,D,i,I]);var U=gy(),K=q5(),V=she(C),B=(t=we(Ee=>Tde(Ee,V,k,I)))!==null&&t!==void 0?t:{},ae=B.activeIndex,ie=B.isActive,oe=we(Ee=>Ede(Ee,V,k,I)),z=we(Ee=>m8(Ee,V,k,I)),G=we(Ee=>Cde(Ee,V,k,I)),ne=oe,ce=Gde(),fe=(n=i??ie)!==null&&n!==void 0?n:!1,R=t5([ne,fe]),X=Spe(R,2),re=X[0],le=X[1],ge=V==="axis"?z:void 0;vpe(V,k,G,ge,ae,fe);var Oe=T??ce;if(Oe==null||U==null||V==null)return null;var De=ne??$R;fe||(De=$R),f&&De.length&&(De=Yz(De.filter(Ee=>Ee.value!=null&&(Ee.hide!==!0||r.includeHidden)),g,Cpe));var mt=De.length>0,se=BR(BR({},r),{},{payload:De,label:ge,active:fe,activeIndex:ae,coordinate:G,accessibilityLayer:K}),Te=O.createElement(zle,{allowEscapeViewBox:a,animationDuration:l,animationEasing:s,isAnimationActive:d,active:fe,coordinate:G,hasPayload:mt,offset:p,position:v,reverseDirection:y,useTranslate3d:x,viewBox:U,wrapperStyle:w,lastBoundingBox:re,innerRef:le,hasPortalFromProps:!!T},Epe(c,se));return O.createElement(O.Fragment,null,aO.createPortal(Te,Oe),fe&&O.createElement(Yde,{cursor:A,tooltipEventType:V,coordinate:G,payload:De,index:ae}))}var S8=e=>null;S8.displayName="Cell";function Mpe(e,t,n){return(t=Dpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dpe(e){var t=Ppe(e,"string");return typeof t=="symbol"?t:t+""}function Ppe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class _pe{constructor(t){Mpe(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function HR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Npe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HR(Object(n),!0).forEach(function(r){Rpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rpe(e,t,n){return(t=jpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jpe(e){var t=Ipe(e,"string");return typeof t=="symbol"?t:t+""}function Ipe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lpe={cacheSize:2e3,enableCache:!0},w8=Npe({},Lpe),FR=new _pe(w8.cacheSize),Bpe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},qR="recharts_measurement_span";function zpe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",l=t.letterSpacing||"",s=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(l,"|").concat(s)}var WR=(e,t)=>{try{var n=document.getElementById(qR);n||(n=document.createElement("span"),n.setAttribute("id",qR),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Bpe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},rh=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||id.isSsr)return{width:0,height:0};if(!w8.enableCache)return WR(t,n);var r=zpe(t,n),i=FR.get(r);if(i)return i;var a=WR(t,n);return FR.set(r,a),a},O8;function pv(e,t){return Fpe(e)||Hpe(e,t)||Upe(e,t)||$pe()}function $pe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
112
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Upe(e,t){if(e){if(typeof e=="string")return VR(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?VR(e,t):void 0}}function VR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Hpe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Fpe(e){if(Array.isArray(e))return e}function qpe(e,t,n){return(t=Wpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wpe(e){var t=Vpe(e,"string");return typeof t=="symbol"?t:t+""}function Vpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var KR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,XR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Kpe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Xpe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Qpe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Ype=["cm","mm","pt","pc","in","Q","px"];function Gpe(e){return Ype.includes(e)}var Eu="NaN";function Zpe(e,t){return e*Qpe[t]}class wn{static parse(t){var n,r=(n=Xpe.exec(t))!==null&&n!==void 0?n:[],i=pv(r,3),a=i[1],l=i[2];return a==null?wn.NaN:new wn(parseFloat(a),l??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Ji(t)&&(this.unit=""),n!==""&&!Kpe.test(n)&&(this.num=NaN,this.unit=""),Gpe(n)&&(this.num=Zpe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new wn(NaN,""):new wn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new wn(NaN,""):new wn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new wn(NaN,""):new wn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new wn(NaN,""):new wn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Ji(this.num)}}O8=wn;qpe(wn,"NaN",new O8(NaN,""));function A8(e){if(e==null||e.includes(Eu))return Eu;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=KR.exec(t))!==null&&n!==void 0?n:[],i=pv(r,4),a=i[1],l=i[2],s=i[3],c=wn.parse(a??""),f=wn.parse(s??""),d=l==="*"?c.multiply(f):c.divide(f);if(d.isNaN())return Eu;t=t.replace(KR,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,g=(p=XR.exec(t))!==null&&p!==void 0?p:[],v=pv(g,4),y=v[1],x=v[2],w=v[3],A=wn.parse(y??""),C=wn.parse(w??""),k=x==="+"?A.add(C):A.subtract(C);if(k.isNaN())return Eu;t=t.replace(XR,k.toString())}return t}var QR=/\(([^()]*)\)/;function Jpe(e){for(var t=e,n;(n=QR.exec(t))!=null;){var r=n,i=pv(r,2),a=i[1];t=t.replace(QR,A8(a))}return t}function eme(e){var t=e.replace(/\s+/g,"");return t=Jpe(t),t=A8(t),t}function tme(e){try{return eme(e)}catch{return Eu}}function S1(e){var t=tme(e.slice(5,-1));return t===Eu?"":t}var nme=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],rme=["dx","dy","angle","className","breakAll"];function _w(){return _w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_w.apply(null,arguments)}function YR(e,t){if(e==null)return{};var n,r,i=ime(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ime(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function GR(e,t){return sme(e)||ome(e,t)||lme(e,t)||ame()}function ame(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
113
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lme(e,t){if(e){if(typeof e=="string")return ZR(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ZR(e,t):void 0}}function ZR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ome(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function sme(e){if(Array.isArray(e))return e}var k8=/[ \f\n\r\t\v\u2028\u2029]+/,C8=e=>{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];kt(t)||(n?i=t.toString().split(""):i=t.toString().split(k8));var a=i.map(s=>({word:s,width:rh(s,r).width})),l=n?0:rh(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function E8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function ume(e){return kt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var T8=(e,t,n,r)=>e.reduce((i,a)=>{var l=a.word,s=a.width,c=i[i.length-1];if(c&&s!=null&&(t==null||r||c.width+s+n<Number(t)))c.words.push(l),c.width+=s+n;else{var f={words:[l],width:s};i.push(f)}return i},[]),M8=e=>e.reduce((t,n)=>t.width>n.width?t:n),cme="…",JR=(e,t,n,r,i,a,l,s)=>{var c=e.slice(0,t),f=C8({breakAll:n,style:r,children:c+cme});if(!f)return[!1,[]];var d=T8(f.wordsWithComputedWidth,a,l,s),p=d.length>i||M8(d).width>Number(a);return[p,d]},fme=(e,t,n,r,i)=>{var a=e.maxLines,l=e.children,s=e.style,c=e.breakAll,f=be(a),d=String(l),p=T8(t,r,n,i);if(!f||i)return p;var g=p.length>a||M8(p).width>Number(r);if(!g)return p;for(var v=0,y=d.length-1,x=0,w;v<=y&&x<=d.length-1;){var A=Math.floor((v+y)/2),C=A-1,k=JR(d,C,c,s,a,r,n,i),P=GR(k,2),T=P[0],D=P[1],N=JR(d,A,c,s,a,r,n,i),I=GR(N,1),U=I[0];if(!T&&!U&&(v=A+1),T&&U&&(y=A-1),!T&&U){w=D;break}x++}return w||p},ej=e=>{var t=kt(e)?[]:e.toString().split(k8);return[{words:t,width:void 0}]},hme=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,l=e.maxLines;if((t||n)&&!id.isSsr){var s,c,f=C8({breakAll:a,children:r,style:i});if(f){var d=f.wordsWithComputedWidth,p=f.spaceWidth;s=d,c=p}else return ej(r);return fme({breakAll:a,children:r,maxLines:l,style:i},s,c,t,!!n)}return ej(r)},D8="#808080",dme={angle:0,breakAll:!1,capHeight:"0.71em",fill:D8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Ck=O.forwardRef((e,t)=>{var n=jn(e,dme),r=n.x,i=n.y,a=n.lineHeight,l=n.capHeight,s=n.fill,c=n.scaleToFit,f=n.textAnchor,d=n.verticalAnchor,p=YR(n,nme),g=O.useMemo(()=>hme({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:c,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,c,p.style,p.width]),v=p.dx,y=p.dy,x=p.angle,w=p.className,A=p.breakAll,C=YR(p,rme);if(!ea(r)||!ea(i)||g.length===0)return null;var k=Number(r)+(be(v)?v:0),P=Number(i)+(be(y)?y:0);if(!Ve(k)||!Ve(P))return null;var T;switch(d){case"start":T=S1("calc(".concat(l,")"));break;case"middle":T=S1("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:T=S1("calc(".concat(g.length-1," * -").concat(a,")"));break}var D=[],N=g[0];if(c&&N!=null){var I=N.width,U=p.width;D.push("scale(".concat(be(U)&&be(I)?U/I:1,")"))}return x&&D.push("rotate(".concat(x,", ").concat(k,", ").concat(P,")")),D.length&&(C.transform=D.join(" ")),O.createElement("text",_w({},Pr(C),{ref:t,x:k,y:P,className:st("recharts-text",w),textAnchor:f,fill:s.includes("url")?D8:s}),g.map((K,V)=>{var B=K.words.join(A?"":" ");return O.createElement("tspan",{x:k,dy:V===0?T:a,key:"".concat(B,"-").concat(V)},B)}))});Ck.displayName="Text";function tj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ii(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tj(Object(n),!0).forEach(function(r){pme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pme(e,t,n){return(t=mme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mme(e){var t=gme(e,"string");return typeof t=="symbol"?t:t+""}function gme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vme=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,l=wA(t),s=l.x,c=l.y,f=l.height,d=l.upperWidth,p=l.lowerWidth,g=s,v=s+(d-p)/2,y=(g+v)/2,x=(d+p)/2,w=g+d/2,A=f>=0?1:-1,C=A*i,k=A>0?"end":"start",P=A>0?"start":"end",T=d>=0?1:-1,D=T*i,N=T>0?"end":"start",I=T>0?"start":"end",U=a;if(n==="top"){var K={x:g+d/2,y:c-C,horizontalAnchor:"middle",verticalAnchor:k};return U&&(K.height=Math.max(c-U.y,0),K.width=d),K}if(n==="bottom"){var V={x:v+p/2,y:c+f+C,horizontalAnchor:"middle",verticalAnchor:P};return U&&(V.height=Math.max(U.y+U.height-(c+f),0),V.width=p),V}if(n==="left"){var B={x:y-D,y:c+f/2,horizontalAnchor:N,verticalAnchor:"middle"};return U&&(B.width=Math.max(B.x-U.x,0),B.height=f),B}if(n==="right"){var ae={x:y+x+D,y:c+f/2,horizontalAnchor:I,verticalAnchor:"middle"};return U&&(ae.width=Math.max(U.x+U.width-ae.x,0),ae.height=f),ae}var ie=U?{width:x,height:f}:{};return n==="insideLeft"?Ii({x:y+D,y:c+f/2,horizontalAnchor:I,verticalAnchor:"middle"},ie):n==="insideRight"?Ii({x:y+x-D,y:c+f/2,horizontalAnchor:N,verticalAnchor:"middle"},ie):n==="insideTop"?Ii({x:g+d/2,y:c+C,horizontalAnchor:"middle",verticalAnchor:P},ie):n==="insideBottom"?Ii({x:v+p/2,y:c+f-C,horizontalAnchor:"middle",verticalAnchor:k},ie):n==="insideTopLeft"?Ii({x:g+D,y:c+C,horizontalAnchor:I,verticalAnchor:P},ie):n==="insideTopRight"?Ii({x:g+d-D,y:c+C,horizontalAnchor:N,verticalAnchor:P},ie):n==="insideBottomLeft"?Ii({x:v+D,y:c+f-C,horizontalAnchor:I,verticalAnchor:k},ie):n==="insideBottomRight"?Ii({x:v+p-D,y:c+f-C,horizontalAnchor:N,verticalAnchor:k},ie):n&&typeof n=="object"&&(be(n.x)||fs(n.x))&&(be(n.y)||fs(n.y))?Ii({x:s+xi(n.x,x),y:c+xi(n.y,f),horizontalAnchor:"end",verticalAnchor:"end"},ie):Ii({x:w,y:c+f/2,horizontalAnchor:"middle",verticalAnchor:"middle"},ie)},yme=["labelRef"],bme=["content"];function nj(e,t){if(e==null)return{};var n,r,i=xme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function rj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ff(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rj(Object(n),!0).forEach(function(r){Sme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sme(e,t,n){return(t=wme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wme(e){var t=Ome(e,"string");return typeof t=="symbol"?t:t+""}function Ome(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Da(){return Da=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Da.apply(null,arguments)}var P8=O.createContext(null),Ame=e=>{var t=e.x,n=e.y,r=e.upperWidth,i=e.lowerWidth,a=e.width,l=e.height,s=e.children,c=O.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l}),[t,n,r,i,a,l]);return O.createElement(P8.Provider,{value:c},s)},_8=()=>{var e=O.useContext(P8),t=gy();return e||(t?wA(t):void 0)},kme=O.createContext(null),Cme=()=>{var e=O.useContext(kme),t=we(x$);return e||t},Eme=e=>{var t=e.value,n=e.formatter,r=kt(e.children)?t:e.children;return typeof n=="function"?n(r):r},Ek=e=>e!=null&&typeof e=="function",Tme=(e,t)=>{var n=sr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Mme=(e,t,n,r,i)=>{var a=e.offset,l=e.className,s=i.cx,c=i.cy,f=i.innerRadius,d=i.outerRadius,p=i.startAngle,g=i.endAngle,v=i.clockWise,y=(f+d)/2,x=Tme(p,g),w=x>=0?1:-1,A,C;switch(t){case"insideStart":A=p+w*a,C=v;break;case"insideEnd":A=g-w*a,C=!v;break;case"end":A=g+w*a,C=v;break;default:throw new Error("Unsupported position ".concat(t))}C=x<=0?C:!C;var k=An(s,c,y,A),P=An(s,c,y,A+(C?1:-1)*359),T="M".concat(k.x,",").concat(k.y,`
114
- A`).concat(y,",").concat(y,",0,1,").concat(C?0:1,`,
115
- `).concat(P.x,",").concat(P.y),D=kt(e.id)?Mh("recharts-radial-line-"):e.id;return O.createElement("text",Da({},r,{dominantBaseline:"central",className:st("recharts-radial-bar-label",l)}),O.createElement("defs",null,O.createElement("path",{id:D,d:T})),O.createElement("textPath",{xlinkHref:"#".concat(D)},n))},Dme=(e,t,n)=>{var r=e.cx,i=e.cy,a=e.innerRadius,l=e.outerRadius,s=e.startAngle,c=e.endAngle,f=(s+c)/2;if(n==="outside"){var d=An(r,i,l+t,f),p=d.x,g=d.y;return{x:p,y:g,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var v=(a+l)/2,y=An(r,i,v,f),x=y.x,w=y.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Vm=e=>e!=null&&"cx"in e&&be(e.cx),Pme={angle:0,offset:5,zIndex:sn.label,position:"middle",textBreakAll:!1};function _me(e){if(!Vm(e))return e;var t=e.cx,n=e.cy,r=e.outerRadius,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function Rl(e){var t=jn(e,Pme),n=t.viewBox,r=t.parentViewBox,i=t.position,a=t.value,l=t.children,s=t.content,c=t.className,f=c===void 0?"":c,d=t.textBreakAll,p=t.labelRef,g=Cme(),v=_8(),y=i==="center"?v:g??v,x,w,A;n==null?x=y:Vm(n)?x=n:x=wA(n);var C=_me(x);if(!x||kt(a)&&kt(l)&&!O.isValidElement(s)&&typeof s!="function")return null;var k=Ff(Ff({},t),{},{viewBox:x});if(O.isValidElement(s)){k.labelRef;var P=nj(k,yme);return O.cloneElement(s,P)}if(typeof s=="function"){k.content;var T=nj(k,bme);if(w=O.createElement(s,T),O.isValidElement(w))return w}else w=Eme(t);var D=Pr(t);if(Vm(x)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Mme(t,i,w,D,x);A=Dme(x,t.offset,t.position)}else{if(!C)return null;var N=vme({viewBox:C,position:i,offset:t.offset,parentViewBox:Vm(r)?void 0:r});A=Ff(Ff({x:N.x,y:N.y,textAnchor:N.horizontalAnchor,verticalAnchor:N.verticalAnchor},N.width!==void 0?{width:N.width}:{}),N.height!==void 0?{height:N.height}:{})}return O.createElement(ai,{zIndex:t.zIndex},O.createElement(Ck,Da({ref:p,className:st("recharts-label",f)},D,A,{textAnchor:E8(D.textAnchor)?D.textAnchor:A.textAnchor,breakAll:d}),w))}Rl.displayName="Label";var Nme=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?O.createElement(Rl,Da({key:"label-implicit"},r)):ea(e)?O.createElement(Rl,Da({key:"label-implicit",value:e},r)):O.isValidElement(e)?e.type===Rl?O.cloneElement(e,Ff({key:"label-implicit"},r)):O.createElement(Rl,Da({key:"label-implicit",content:e},r)):Ek(e)?O.createElement(Rl,Da({key:"label-implicit",content:e},r)):e&&typeof e=="object"?O.createElement(Rl,Da({},e,{key:"label-implicit"},r)):null};function Rme(e){var t=e.label,n=e.labelRef,r=_8();return Nme(t,r,n)||null}var jme=["valueAccessor"],Ime=["dataKey","clockWise","id","textBreakAll","zIndex"];function mv(){return mv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mv.apply(null,arguments)}function ij(e,t){if(e==null)return{};var n,r,i=Lme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Bme=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(ume(t))return t},N8=O.createContext(void 0),R8=N8.Provider,j8=O.createContext(void 0);j8.Provider;function zme(){return O.useContext(N8)}function $me(){return O.useContext(j8)}function Km(e){var t=e.valueAccessor,n=t===void 0?Bme:t,r=ij(e,jme),i=r.dataKey;r.clockWise;var a=r.id,l=r.textBreakAll,s=r.zIndex,c=ij(r,Ime),f=zme(),d=$me(),p=f||d;return!p||!p.length?null:O.createElement(ai,{zIndex:s??sn.label},O.createElement(_r,{className:"recharts-label-list"},p.map((g,v)=>{var y,x=kt(i)?n(g,v):Bt(g.payload,i),w=kt(a)?{}:{id:"".concat(a,"-").concat(v)};return O.createElement(Rl,mv({key:"label-".concat(v)},Pr(g),c,w,{fill:(y=r.fill)!==null&&y!==void 0?y:g.fill,parentViewBox:g.parentViewBox,value:x,textBreakAll:l,viewBox:g.viewBox,index:v,zIndex:0}))})))}Km.displayName="LabelList";function I8(e){var t=e.label;return t?t===!0?O.createElement(Km,{key:"labelList-implicit"}):O.isValidElement(t)||Ek(t)?O.createElement(Km,{key:"labelList-implicit",content:t}):typeof t=="object"?O.createElement(Km,mv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Nw(){return Nw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nw.apply(null,arguments)}var L8=e=>{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=st("recharts-dot",i);return be(t)&&be(n)&&be(r)?O.createElement("circle",Nw({},bi(e),fA(e),{className:a,cx:t,cy:n,r})):null},Ume={radiusAxis:{},angleAxis:{}},B8=In({name:"polarAxis",initialState:Ume,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=Ye(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=Ye(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),jy=B8.actions;jy.addRadiusAxis;jy.removeRadiusAxis;jy.addAngleAxis;jy.removeAngleAxis;var Hme=B8.reducer;function Fme(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var w1={exports:{}},lt={};var aj;function qme(){if(aj)return lt;aj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function y(x){if(typeof x=="object"&&x!==null){var w=x.$$typeof;switch(w){case e:switch(x=x.type,x){case n:case i:case r:case c:case f:case g:return x;default:switch(x=x&&x.$$typeof,x){case l:case s:case p:case d:return x;case a:return x;default:return w}}case t:return w}}}return lt.ContextConsumer=a,lt.ContextProvider=l,lt.Element=e,lt.ForwardRef=s,lt.Fragment=n,lt.Lazy=p,lt.Memo=d,lt.Portal=t,lt.Profiler=i,lt.StrictMode=r,lt.Suspense=c,lt.SuspenseList=f,lt.isContextConsumer=function(x){return y(x)===a},lt.isContextProvider=function(x){return y(x)===l},lt.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},lt.isForwardRef=function(x){return y(x)===s},lt.isFragment=function(x){return y(x)===n},lt.isLazy=function(x){return y(x)===p},lt.isMemo=function(x){return y(x)===d},lt.isPortal=function(x){return y(x)===t},lt.isProfiler=function(x){return y(x)===i},lt.isStrictMode=function(x){return y(x)===r},lt.isSuspense=function(x){return y(x)===c},lt.isSuspenseList=function(x){return y(x)===f},lt.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===i||x===r||x===c||x===f||typeof x=="object"&&x!==null&&(x.$$typeof===p||x.$$typeof===d||x.$$typeof===l||x.$$typeof===a||x.$$typeof===s||x.$$typeof===v||x.getModuleId!==void 0)},lt.typeOf=y,lt}var lj;function Wme(){return lj||(lj=1,w1.exports=qme()),w1.exports}var Vme=Wme(),oj=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",sj=null,O1=null,z8=e=>{if(e===sj&&Array.isArray(O1))return O1;var t=[];return O.Children.forEach(e,n=>{kt(n)||(Vme.isFragment(n)?t=t.concat(z8(n.props.children)):t.push(n))}),O1=t,sj=e,t};function Kme(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>oj(i)):r=[oj(t)],z8(e).forEach(i=>{var a=Va(i,"type.displayName")||Va(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var $8=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function uj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uj(Object(n),!0).forEach(function(r){Xme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xme(e,t,n){return(t=Qme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qme(e){var t=Yme(e,"string");return typeof t=="symbol"?t:t+""}function Yme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function U8(e,t){return cj(cj({},t),e)}function Gme(e){return O.isValidElement(e)?e.props:e}function Zme(e,t){return O.cloneElement(e,U8(Gme(e),t))}function Jme(e){if("index"in e){var t=e.index;return typeof t=="number"||typeof t=="string"?t:void 0}}function ege(e){return"isActive"in e&&e.isActive===!0}function H8(e){var t=e.option,n=e.DefaultShape,r=e.shapeProps,i=e.activeClassName,a=i===void 0?"recharts-active-shape":i,l=e.inActiveClassName,s=l===void 0?"recharts-shape":l,c=Jme(r),f;return O.isValidElement(t)?f=Zme(t,r):t===n?f=O.createElement(n,r):typeof t=="function"?f=t(r,c):typeof t=="object"?f=O.createElement(n,U8(t,r)):f=O.createElement(n,r),ege(r)?O.createElement(_r,{className:a},f):O.createElement(_r,{className:s},f)}var F8=(e,t,n)=>{var r=St();return(i,a)=>l=>{e?.(i,a,l),r(X4({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},q8=e=>{var t=St();return(n,r)=>i=>{e?.(n,r,i),t(mhe())}},W8=(e,t,n)=>{var r=St();return(i,a)=>l=>{e?.(i,a,l),r(ghe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function V8(e){var t=e.tooltipEntrySettings,n=St(),r=Ln(),i=O.useRef(null);return O.useLayoutEffect(()=>{r||(i.current===null?n(fhe(t)):i.current!==t&&n(hhe({prev:i.current,next:t})),i.current=t)},[t,n,r]),O.useLayoutEffect(()=>()=>{i.current&&(n(dhe(i.current)),i.current=null)},[n]),null}function K8(e){var t=e.legendPayload,n=St(),r=Ln(),i=O.useRef(null);return O.useLayoutEffect(()=>{r||(i.current===null?n(bae(t)):i.current!==t&&n(xae({prev:i.current,next:t})),i.current=t)},[n,r,t]),O.useLayoutEffect(()=>()=>{i.current&&(n(Sae(i.current)),i.current=null)},[n]),null}function tge(e,t){return age(e)||ige(e,t)||rge(e,t)||nge()}function nge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
116
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rge(e,t){if(e){if(typeof e=="string")return fj(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fj(e,t):void 0}}function fj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ige(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function age(e){if(Array.isArray(e))return e}var Tk="index",X8="append";function Mk(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=[];for(var i of n)r.push({status:"removed",prev:i});for(var a=0;a<t.length;a++){var l=e[a],s=t[a];l!=null?r.push({status:"matched",prev:l,next:s}):r.push({status:"added",next:s})}return r}function lge(e,t){var n=e.length/t.length,r=t.map((i,a)=>e[Math.floor(a*n)]);return Mk(r,t)}function oge(e,t){var n=t.map((r,i)=>e[i]);return Mk(n,t)}function sge(e,t){for(var n=new Map,r=0;r<e.length;r++){var i=e[r];if(i!=null){var a=t(i,r);a!=null&&!n.has(a)&&n.set(a,i)}}return n}function uge(e,t,n){var r=sge(e,n),i=new Set,a=t.map((p,g)=>{var v=n(p,g);if(v!=null){var y=r.get(v);if(y!==void 0)return i.add(v),y}}),l=[];for(var s of r){var c=tge(s,2),f=c[0],d=c[1];i.has(f)||l.push(d)}return Mk(a,t,l)}function cge(e,t,n){return t==null?null:e==null?t.map(r=>({status:"added",next:r})):n===Tk?lge(e,t):n===X8?oge(e,t):uge(e,t,n)}function fge(e,t){var n=O.useRef(e),r=O.useRef(t.current),i=O.useRef(!0);n.current!==e&&(n.current=e,r.current=t.current,i.current=!1);var a=O.useCallback(function(l,s){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(s===0){i.current=!0;return}s===1&&(r.current=l),s>0&&i.current&&c&&(t.current=l)},[t]);return{startValue:r.current,syncStepValue:a}}function hge(e,t){return gge(e)||mge(e,t)||pge(e,t)||dge()}function dge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
117
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pge(e,t){if(e){if(typeof e=="string")return hj(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hj(e,t):void 0}}function hj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mge(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function gge(e){if(Array.isArray(e))return e}function Q8(e,t){var n=O.useState(!1),r=hge(n,2),i=r[0],a=r[1],l=O.useCallback(()=>{typeof e=="function"&&e(),a(!0)},[e]),s=O.useCallback(()=>{typeof t=="function"&&t(),a(!1)},[t]);return{isAnimating:i,handleAnimationStart:l,handleAnimationEnd:s}}function Y8(e){var t,n=e.animationInput,r=e.animationIdPrefix,i=e.items,a=e.previousItemsRef,l=e.isAnimationActive,s=e.animationBegin,c=e.animationDuration,f=e.animationEasing,d=e.onAnimationStart,p=e.onAnimationEnd,g=e.animationInterpolateFn,v=e.animationMatchBy,y=e.shouldUpdatePreviousRef,x=e.children,w=e.layout,A=Y5(n,r),C=fge(A,a),k=(t=C.startValue)!==null&&t!==void 0?t:null,P=cge(k,i,v??Tk);return O.createElement(Q5,{animationId:A,begin:s,duration:c,isActive:l,easing:f,onAnimationEnd:p,onAnimationStart:d,key:A},T=>{var D=k==null,N=i==null?i:g(P,T,w),I=y?y(T):T>0;return C.syncStepValue(N,T,I),N==null?null:x(N,T,D)})}var A1;function vge(e,t){return Sge(e)||xge(e,t)||bge(e,t)||yge()}function yge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
118
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bge(e,t){if(e){if(typeof e=="string")return dj(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dj(e,t):void 0}}function dj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xge(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Sge(e){if(Array.isArray(e))return e}var wge=()=>{var e=O.useState(()=>Mh("uid-")),t=vge(e,1),n=t[0];return n},Oge=(A1=c9.useId)!==null&&A1!==void 0?A1:wge;function Age(e,t){var n=Oge();return t||(e?"".concat(e,"-").concat(n):n)}var kge=O.createContext(void 0),G8=e=>{var t=e.id,n=e.type,r=e.children,i=Age("recharts-".concat(n),t);return O.createElement(kge.Provider,{value:i},r(i))},Cge={cartesianItems:[],polarItems:[]},Z8=In({name:"graphicalItems",initialState:Cge,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(Ye(t.payload))},prepare:bt()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Gr(e).cartesianItems.indexOf(Ye(r));a>-1&&(e.cartesianItems[a]=Ye(i))},prepare:bt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Gr(e).cartesianItems.indexOf(Ye(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:bt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(Ye(t.payload))},prepare:bt()},removePolarGraphicalItem:{reducer(e,t){var n=Gr(e).polarItems.indexOf(Ye(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:bt()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Gr(e).polarItems.indexOf(Ye(r));a>-1&&(e.polarItems[a]=Ye(i))},prepare:bt()}}}),Oc=Z8.actions,Ege=Oc.addCartesianGraphicalItem,Tge=Oc.replaceCartesianGraphicalItem,Mge=Oc.removeCartesianGraphicalItem;Oc.addPolarGraphicalItem;Oc.removePolarGraphicalItem;Oc.replacePolarGraphicalItem;var Dge=Z8.reducer,Pge=e=>{var t=St(),n=O.useRef(null);return O.useLayoutEffect(()=>{n.current===null?t(Ege(e)):n.current!==e&&t(Tge({prev:n.current,next:e})),n.current=e},[t,e]),O.useLayoutEffect(()=>()=>{n.current&&(t(Mge(n.current)),n.current=null)},[t]),null},J8=O.memo(Pge),_ge=["points"];function pj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function k1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pj(Object(n),!0).forEach(function(r){Nge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nge(e,t,n){return(t=Rge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rge(e){var t=jge(e,"string");return typeof t=="symbol"?t:t+""}function jge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gv(){return gv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gv.apply(null,arguments)}function Ige(e,t){if(e==null)return{};var n,r,i=Lge(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Bge(e){var t=e.option,n=e.dotProps,r=e.className;if(O.isValidElement(t))return O.cloneElement(t,n);if(typeof t=="function")return t(n);var i=st(r,typeof t!="boolean"?t.className:""),a=n??{};a.points;var l=Ige(a,_ge);return O.createElement(L8,gv({},l,{className:i}))}function zge(e,t){return e==null?!1:t?!0:e.length===1}function $ge(e){var t=e.points,n=e.dot,r=e.className,i=e.dotClassName,a=e.dataKey,l=e.baseProps,s=e.needClip,c=e.clipPathId,f=e.zIndex,d=f===void 0?sn.scatter:f;if(!zge(t,n))return null;var p=$8(n),g=Bee(n),v=t.map((x,w)=>{var A,C,k=k1(k1(k1({r:3},l),g),{},{index:w,cx:(A=x.x)!==null&&A!==void 0?A:void 0,cy:(C=x.y)!==null&&C!==void 0?C:void 0,dataKey:a,value:x.value,payload:x.payload,points:t});return O.createElement(Bge,{key:"dot-".concat(w),option:n,dotProps:k,className:i})}),y={};return s&&c!=null&&(y.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(c,")")),O.createElement(ai,{zIndex:d},O.createElement(_r,gv({className:r},y),v))}function mj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mj(Object(n),!0).forEach(function(r){Uge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uge(e,t,n){return(t=Hge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hge(e){var t=Fge(e,"string");return typeof t=="symbol"?t:t+""}function Fge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var e6=0,qge={xAxis:{},yAxis:{},zAxis:{}},t6=In({name:"cartesianAxis",initialState:qge,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=Ye(t.payload)},prepare:bt()},replaceXAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.xAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.xAxis[r.id],e.xAxis[i.id]=Ye(i))},prepare:bt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:bt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=Ye(t.payload)},prepare:bt()},replaceYAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.yAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.yAxis[r.id],e.yAxis[i.id]=Ye(i))},prepare:bt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:bt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=Ye(t.payload)},prepare:bt()},replaceZAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.zAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.zAxis[r.id],e.zAxis[i.id]=Ye(i))},prepare:bt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:bt()},updateYAxisWidth(e,t){var n=t.payload,r=n.id,i=n.width,a=e.yAxis[r];if(a){var l,s=a.widthHistory||[];if(s.length===3&&s[0]===s[2]&&i===s[1]&&i!==a.width&&Math.abs(i-((l=s[0])!==null&&l!==void 0?l:0))<=1)return;var c=[...s,i].slice(-3);e.yAxis[r]=gj(gj({},a),{},{width:i,widthHistory:c})}}}}),oa=t6.actions,Wge=oa.addXAxis,Vge=oa.replaceXAxis,Kge=oa.removeXAxis,Xge=oa.addYAxis,Qge=oa.replaceYAxis,Yge=oa.removeYAxis;oa.addZAxis;oa.replaceZAxis;oa.removeZAxis;var Gge=oa.updateYAxisWidth,Zge=t6.reducer,Jge=q([un],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),eve=q([Jge,Ja,el],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),Dk=()=>we(eve),tve=()=>we(fde);function vj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function C1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vj(Object(n),!0).forEach(function(r){nve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nve(e,t,n){return(t=rve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rve(e){var t=ive(e,"string");return typeof t=="symbol"?t:t+""}function ive(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ave=e=>{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,a=e.dataKey,l=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var s={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=C1(C1(C1({},s),Gh(i)),fA(i)),f;return O.isValidElement(i)?f=O.cloneElement(i,c):typeof i=="function"?f=i(c):f=O.createElement(L8,c),O.createElement(_r,{className:"recharts-active-dot",clipPath:l},f)};function lve(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,l=e.zIndex,s=l===void 0?sn.activeDot:l,c=we(ms),f=tve();if(t==null||f==null)return null;var d=t.find(p=>f.includes(p.payload));return kt(d)?null:O.createElement(ai,{zIndex:s},O.createElement(ave,{point:d,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}function ove(e,t){return fve(e)||cve(e,t)||uve(e,t)||sve()}function sve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
119
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uve(e,t){if(e){if(typeof e=="string")return yj(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yj(e,t):void 0}}function yj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function fve(e){if(Array.isArray(e))return e}var bj=(e,t,n)=>{var r=n??e;if(!kt(r))return xi(r,t,0)},hve=(e,t,n)=>{var r={},i=e.filter(wy),a=e.filter(f=>f.stackId==null),l=i.reduce((f,d)=>{var p=f[d.stackId];return p==null&&(p=[]),p.push(d),f[d.stackId]=p,f},r),s=Object.entries(l).map(f=>{var d,p=ove(f,2),g=p[0],v=p[1],y=v.map(w=>w.dataKey),x=bj(t,n,(d=v[0])===null||d===void 0?void 0:d.barSize);return{stackId:g,dataKeys:y,barSize:x}}),c=a.map(f=>{var d=[f.dataKey].filter(g=>g!=null),p=bj(t,n,f.barSize);return{stackId:void 0,dataKeys:d,barSize:p}});return[...s,...c]};function xj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Am(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xj(Object(n),!0).forEach(function(r){dve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dve(e,t,n){return(t=pve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pve(e){var t=mve(e,"string");return typeof t=="symbol"?t:t+""}function mve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gve(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var s=xi(e,n,0,!0),c,f=[];if(Ve((a=r[0])===null||a===void 0?void 0:a.barSize)){var d=!1,p=n/l,g=r.reduce((C,k)=>C+(k.barSize||0),0);g+=(l-1)*s,g>=n&&(g-=(l-1)*s,s=0),g>=n&&p>0&&(d=!0,p*=.9,g=l*p);var v=Math.round((n-g)/2),y={offset:v-s,size:0};c=r.reduce((C,k)=>{var P,T={stackId:k.stackId,dataKeys:k.dataKeys,position:{offset:y.offset+y.size+s,size:d?p:(P=k.barSize)!==null&&P!==void 0?P:0}},D=[...C,T];return y=T.position,D},f)}else{var x=xi(t,n,0,!0);n-2*x-(l-1)*s<=0&&(s=0);var w=(n-2*x-(l-1)*s)/l;w>1&&(w=Math.round(w));var A=Ve(i)?Math.min(w,i):w;c=r.reduce((C,k,P)=>[...C,{stackId:k.stackId,dataKeys:k.dataKeys,position:{offset:x+(w+s)*P+(w-A)/2,size:A}}],f)}return c}}var vve=(e,t,n,r,i,a,l)=>{var s=kt(l)?t:l,c=gve(n,r,i!==a?i:a,e,s);return i!==a&&c!=null&&(c=c.map(f=>Am(Am({},f),{},{position:Am(Am({},f.position),{},{offset:f.position.offset-i/2})}))),c},yve=(e,t)=>{var n=IA(t);if(!(!e||n==null||t==null)){var r=t.stackId;if(r!=null){var i=e[r];if(i){var a=i.stackedData;if(a)return a.find(l=>l.key===n)}}}},bve=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function xve(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Ve(e.zIndex)?e.zIndex:t}var Sve=e=>{var t=e.chartData,n=St(),r=Ln();return O.useEffect(()=>r?()=>{}:(n(jR(t)),()=>{n(jR(void 0))}),[t,n,r]),null},Sj={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},n6=In({name:"brush",initialState:Sj,reducers:{setBrushSettings(e,t){return t.payload==null?Sj:t.payload}}});n6.actions.setBrushSettings;var wve=n6.reducer;function Ove(e){return(e%180+180)%180}var Ave=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Ove(i),l=a*Math.PI/180,s=Math.atan(r/n),c=l>s&&l<Math.PI-s?r/Math.sin(l):n/Math.cos(l);return Math.abs(c)},kve={dots:[],areas:[],lines:[]},r6=In({name:"referenceElements",initialState:kve,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Gr(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Gr(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(Ye(t.payload))},removeLine:(e,t)=>{var n=Gr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),Ac=r6.actions;Ac.addDot;Ac.removeDot;Ac.addArea;Ac.removeArea;Ac.addLine;Ac.removeLine;var Cve=r6.reducer;function Eve(e,t){return Pve(e)||Dve(e,t)||Mve(e,t)||Tve()}function Tve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
120
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mve(e,t){if(e){if(typeof e=="string")return wj(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wj(e,t):void 0}}function wj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Dve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Pve(e){if(Array.isArray(e))return e}var _ve=O.createContext(void 0),Nve=e=>{var t=e.children,n=O.useState("".concat(Mh("recharts"),"-clip")),r=Eve(n,1),i=r[0],a=Dk();if(a==null)return null;var l=a.x,s=a.y,c=a.width,f=a.height;return O.createElement(_ve.Provider,{value:i},O.createElement("defs",null,O.createElement("clipPath",{id:i},O.createElement("rect",{x:l,y:s,height:f,width:c}))),t)};function i6(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function Rve(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Ave(r,n)}function jve(e,t,n){var r=n==="width",i=e.x,a=e.y,l=e.width,s=e.height;return t===1?{start:r?i:a,end:r?i+l:a+s}:{start:r?i+l:a+s,end:r?i:a}}function $h(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function Ive(e,t){return i6(e,t+1)}function Lve(e,t,n,r,i){for(var a=(r||[]).slice(),l=t.start,s=t.end,c=0,f=1,d=l,p=function(){var y=r?.[c];if(y===void 0)return{v:i6(r,f)};var x=c,w,A=()=>(w===void 0&&(w=n(y,x)),w),C=y.coordinate,k=c===0||$h(e,C,A,d,s);k||(c=0,d=l,f+=1),k&&(d=C+e*(A()/2+i),c+=f)},g;f<=a.length;)if(g=p(),g)return g.v;return[]}function Bve(e,t,n,r,i){var a=(r||[]).slice(),l=a.length;if(l===0)return[];for(var s=t.start,c=t.end,f=1;f<=l;f++){for(var d=(l-1)%f,p=s,g=!0,v=function(){var P=r[x];if(P==null)return 0;var T=x,D,N=()=>(D===void 0&&(D=n(P,T)),D),I=P.coordinate,U=x===d||$h(e,I,N,p,c);if(!U)return g=!1,1;U&&(p=I+e*(N()/2+i))},y,x=d;x<l&&(y=v(),!(y!==0&&y===1));x+=f);if(g){for(var w=[],A=d;A<l;A+=f){var C=r[A];C!=null&&w.push(C)}return w}}return[]}function Oj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function En(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Oj(Object(n),!0).forEach(function(r){zve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zve(e,t,n){return(t=$ve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ve(e){var t=Uve(e,"string");return typeof t=="symbol"?t:t+""}function Uve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hve(e,t,n,r,i){for(var a=(r||[]).slice(),l=a.length,s=t.start,c=t.end,f=function(g){var v=a[g];if(v==null)return 1;var y=v,x,w=()=>(x===void 0&&(x=n(v,g)),x);if(g===l-1){var A=e*(y.coordinate+e*w()/2-c);a[g]=y=En(En({},y),{},{tickCoord:A>0?y.coordinate-A*e:y.coordinate})}else a[g]=y=En(En({},y),{},{tickCoord:y.coordinate});if(y.tickCoord!=null){var C=$h(e,y.tickCoord,w,s,c);C&&(c=y.tickCoord-e*(w()/2+i),a[g]=En(En({},y),{},{isShow:!0}))}},d=l-1;d>=0;d--)f(d);return a}function Fve(e,t,n,r,i,a){var l=(r||[]).slice(),s=l.length,c=t.start,f=t.end;if(a){var d=r[s-1];if(d!=null){var p=n(d,s-1),g=e*(d.coordinate+e*p/2-f);if(l[s-1]=d=En(En({},d),{},{tickCoord:g>0?d.coordinate-g*e:d.coordinate}),d.tickCoord!=null){var v=$h(e,d.tickCoord,()=>p,c,f);v&&(f=d.tickCoord-e*(p/2+i),l[s-1]=En(En({},d),{},{isShow:!0}))}}}for(var y=a?s-1:s,x=function(C){var k=l[C];if(k==null)return 1;var P=k,T,D=()=>(T===void 0&&(T=n(k,C)),T);if(C===0){var N=e*(P.coordinate-e*D()/2-c);l[C]=P=En(En({},P),{},{tickCoord:N<0?P.coordinate-N*e:P.coordinate})}else l[C]=P=En(En({},P),{},{tickCoord:P.coordinate});if(P.tickCoord!=null){var I=$h(e,P.tickCoord,D,c,f);I&&(c=P.tickCoord+e*(D()/2+i),l[C]=En(En({},P),{},{isShow:!0}))}},w=0;w<y;w++)x(w);return l}function Pk(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,l=e.minTickGap,s=e.orientation,c=e.interval,f=e.tickFormatter,d=e.unit,p=e.angle;if(!i||!i.length||!r)return[];if(be(c)||id.isSsr){var g;return(g=Ive(i,be(c)?c:0))!==null&&g!==void 0?g:[]}var v=[],y=s==="top"||s==="bottom"?"width":"height",x=d&&y==="width"?rh(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},w=(T,D)=>{var N=typeof f=="function"?f(T.value,D):T.value;return y==="width"?Rve(rh(N,{fontSize:t,letterSpacing:n}),x,p):rh(N,{fontSize:t,letterSpacing:n})[y]},A=i[0],C=i[1],k=i.length>=2&&A!=null&&C!=null?sr(C.coordinate-A.coordinate):1,P=jve(a,k,y);return c==="equidistantPreserveStart"?Lve(k,P,w,i,l):c==="equidistantPreserveEnd"?Bve(k,P,w,i,l):(c==="preserveStart"||c==="preserveStartEnd"?v=Fve(k,P,w,i,l,c==="preserveStartEnd"):v=Hve(k,P,w,i,l),v.filter(T=>T.isShow))}var qve=e=>{var t=e.ticks,n=e.label,r=e.labelGapWithTick,i=r,a=e.tickSize,l=a===void 0?0:a,s=e.tickMargin,c=s===void 0?0:s,f=0;if(t){Array.from(t).forEach(v=>{if(v){var y=v.getBoundingClientRect();y.width>f&&(f=y.width)}});var d=n?n.getBoundingClientRect().width:0,p=l+c,g=f+p+d+(n?i:0);return Math.round(g)}return 0},Wve={xAxis:{},yAxis:{}},a6=In({name:"renderedTicks",initialState:Wve,reducers:{setRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId,a=n.ticks;e[r][i]=Ye(a)},removeRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId;delete e[r][i]}}}),l6=a6.actions,Vve=l6.setRenderedTicks,Kve=l6.removeRenderedTicks,Xve=a6.reducer,Qve=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Aj(e,t){return Jve(e)||Zve(e,t)||Gve(e,t)||Yve()}function Yve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
121
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gve(e,t){if(e){if(typeof e=="string")return kj(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kj(e,t):void 0}}function kj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Jve(e){if(Array.isArray(e))return e}function eye(e,t){if(e==null)return{};var n,r,i=tye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function tye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gs(){return gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gs.apply(null,arguments)}function Cj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cj(Object(n),!0).forEach(function(r){nye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nye(e,t,n){return(t=rye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rye(e){var t=iye(e,"string");return typeof t=="symbol"?t:t+""}function iye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var za={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:sn.axis};function aye(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,l=e.mirror,s=e.axisLine,c=e.otherSvgProps;if(!s)return null;var f=Mt(Mt(Mt({},c),bi(s)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!l||a==="bottom"&&l);f=Mt(Mt({},f),{},{x1:t,y1:n+d*i,x2:t+r,y2:n+d*i})}else{var p=+(a==="left"&&!l||a==="right"&&l);f=Mt(Mt({},f),{},{x1:t+p*r,y1:n,x2:t+p*r,y2:n+i})}return O.createElement("line",gs({},f,{className:st("recharts-cartesian-axis-line",Va(s,"className"))}))}function lye(e,t,n,r,i,a,l,s,c){var f,d,p,g,v,y,x=s?-1:1,w=e.tickSize||l,A=be(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=d=e.coordinate,g=n+ +!s*i,p=g-x*w,y=p-x*c,v=A;break;case"left":p=g=e.coordinate,d=t+ +!s*r,f=d-x*w,v=f-x*c,y=A;break;case"right":p=g=e.coordinate,d=t+ +s*r,f=d+x*w,v=f+x*c,y=A;break;default:f=d=e.coordinate,g=n+ +s*i,p=g+x*w,y=p+x*c,v=A;break}return{line:{x1:f,y1:p,x2:d,y2:g},tick:{x:v,y}}}function oye(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function sye(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function uye(e){var t=e.option,n=e.tickProps,r=e.value,i,a=st(n.className,"recharts-cartesian-axis-tick-value");if(O.isValidElement(t))i=O.cloneElement(t,Mt(Mt({},n),{},{className:a}));else if(typeof t=="function")i=t(Mt(Mt({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=st(l,Fme(t))),i=O.createElement(Ck,gs({},n,{className:l}),r)}return i}function cye(e){var t=e.ticks,n=e.axisType,r=e.axisId,i=St();return O.useEffect(()=>{if(r==null||n==null)return ys;var a=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(Vve({ticks:a,axisId:r,axisType:n})),()=>{i(Kve({axisId:r,axisType:n}))}},[i,t,r,n]),null}var fye=O.forwardRef((e,t)=>{var n=e.ticks,r=n===void 0?[]:n,i=e.tick,a=e.tickLine,l=e.stroke,s=e.tickFormatter,c=e.unit,f=e.padding,d=e.tickTextProps,p=e.orientation,g=e.mirror,v=e.x,y=e.y,x=e.width,w=e.height,A=e.tickSize,C=e.tickMargin,k=e.fontSize,P=e.letterSpacing,T=e.getTicksConfig,D=e.events,N=e.axisType,I=e.axisId,U=Pk(Mt(Mt({},T),{},{ticks:r}),k,P),K=bi(T),V=Gh(i),B=E8(K.textAnchor)?K.textAnchor:oye(p,g),ae=sye(p,g),ie={};typeof a=="object"&&(ie=a);var oe=Mt(Mt({},K),{},{fill:"none"},ie),z=U.map(ce=>Mt({entry:ce},lye(ce,v,y,x,w,p,A,g,C))),G=z.map(ce=>{var fe=ce.entry,R=ce.line;return O.createElement(_r,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(fe.value,"-").concat(fe.coordinate,"-").concat(fe.tickCoord)},a&&O.createElement("line",gs({},oe,R,{className:st("recharts-cartesian-axis-tick-line",Va(a,"className"))})))}),ne=z.map((ce,fe)=>{var R,X,re=ce.entry,le=ce.tick,ge=Mt(Mt(Mt(Mt({verticalAnchor:ae},K),{},{textAnchor:B,stroke:"none",fill:l},le),{},{index:fe,payload:re,visibleTicksCount:U.length,tickFormatter:s,padding:f},d),{},{angle:(R=(X=d?.angle)!==null&&X!==void 0?X:K.angle)!==null&&R!==void 0?R:0}),Oe=Mt(Mt({},ge),V);return O.createElement(_r,gs({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(re.value,"-").concat(re.coordinate,"-").concat(re.tickCoord)},Jv(D,re,fe)),i&&O.createElement(uye,{option:i,tickProps:Oe,value:"".concat(typeof s=="function"?s(re.value,fe):re.value).concat(c||"")}))});return O.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(N,"-ticks")},O.createElement(cye,{ticks:U,axisId:I,axisType:N}),ne.length>0&&O.createElement(ai,{zIndex:sn.label},O.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(N,"-tick-labels"),ref:t},ne)),G.length>0&&O.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(N,"-tick-lines")},G))}),hye=O.forwardRef((e,t)=>{var n=e.axisLine,r=e.width,i=e.height,a=e.className,l=e.hide,s=e.ticks,c=e.axisType,f=e.axisId,d=eye(e,Qve),p=O.useState(""),g=Aj(p,2),v=g[0],y=g[1],x=O.useState(""),w=Aj(x,2),A=w[0],C=w[1],k=O.useRef(null);O.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var T;return qve({ticks:k.current,label:(T=e.labelRef)===null||T===void 0?void 0:T.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var P=O.useCallback(T=>{if(T){var D=T.getElementsByClassName("recharts-cartesian-axis-tick-value");k.current=D;var N=D[0];if(N){var I=window.getComputedStyle(N),U=I.fontSize,K=I.letterSpacing;(U!==v||K!==A)&&(y(U),C(K))}}},[v,A]);return l||r!=null&&r<=0||i!=null&&i<=0?null:O.createElement(ai,{zIndex:e.zIndex},O.createElement(_r,{className:st("recharts-cartesian-axis",a)},O.createElement(aye,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:bi(e)}),O.createElement(fye,{ref:P,axisType:c,events:d,fontSize:v,getTicksConfig:e,height:e.height,letterSpacing:A,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),O.createElement(Ame,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},O.createElement(Rme,{label:e.label,labelRef:e.labelRef}),e.children)))}),_k=O.forwardRef((e,t)=>{var n=jn(e,za);return O.createElement(hye,gs({},n,{ref:t}))});_k.displayName="CartesianAxis";var dye=["x1","y1","x2","y2","key"],pye=["offset"],mye=["xAxisId","yAxisId"],gye=["xAxisId","yAxisId"];function Ej(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ej(Object(n),!0).forEach(function(r){vye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ej(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vye(e,t,n){return(t=yye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yye(e){var t=bye(e,"string");return typeof t=="symbol"?t:t+""}function bye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qo(){return Qo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qo.apply(null,arguments)}function vv(e,t){if(e==null)return{};var n,r,i=xye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Sye=e=>{var t=e.fill;if(!t||t==="none")return null;var n=e.fillOpacity,r=e.x,i=e.y,a=e.width,l=e.height,s=e.ry;return O.createElement("rect",{x:r,y:i,ry:s,width:a,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function o6(e){var t=e.option,n=e.lineItemProps,r;if(O.isValidElement(t))r=O.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,a=n.x1,l=n.y1,s=n.x2,c=n.y2,f=n.key,d=vv(n,dye),p=(i=bi(d))!==null&&i!==void 0?i:{};p.offset;var g=vv(p,pye);r=O.createElement("line",Qo({},g,{x1:a,y1:l,x2:s,y2:c,fill:"none",key:f}))}return r}function wye(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var l=vv(e,mye),s=a.map((c,f)=>{var d=Mn(Mn({},l),{},{x1:t,y1:c,x2:t+n,y2:c,key:"line-".concat(f),index:f});return O.createElement(o6,{key:"line-".concat(f),option:i,lineItemProps:d})});return O.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function Oye(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var l=vv(e,gye),s=a.map((c,f)=>{var d=Mn(Mn({},l),{},{x1:c,y1:t,x2:c,y2:t+n,key:"line-".concat(f),index:f});return O.createElement(o6,{option:i,lineItemProps:d,key:"line-".concat(f)})});return O.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function Aye(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,l=e.height,s=e.horizontalPoints,c=e.horizontal,f=c===void 0?!0:c;if(!f||!t||!t.length||s==null)return null;var d=s.map(g=>Math.round(g+i-i)).sort((g,v)=>g-v);i!==d[0]&&d.unshift(0);var p=d.map((g,v)=>{var y=d[v+1],x=y==null,w=x?i+l-g:y-g;if(w<=0)return null;var A=v%t.length;return O.createElement("rect",{key:"react-".concat(v),y:g,x:r,height:w,width:a,stroke:"none",fill:t[A],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return O.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function kye(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,l=e.y,s=e.width,c=e.height,f=e.verticalPoints;if(!n||!r||!r.length)return null;var d=f.map(g=>Math.round(g+a-a)).sort((g,v)=>g-v);a!==d[0]&&d.unshift(0);var p=d.map((g,v)=>{var y=d[v+1],x=y==null,w=x?a+s-g:y-g;if(w<=0)return null;var A=v%r.length;return O.createElement("rect",{key:"react-".concat(v),x:g,y:l,width:w,height:c,stroke:"none",fill:r[A],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return O.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Cye=(e,t)=>{var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return _5(Pk(Mn(Mn(Mn({},za),n),{},{ticks:N5(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Eye=(e,t)=>{var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return _5(Pk(Mn(Mn(Mn({},za),n),{},{ticks:N5(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Tye={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:sn.grid};function Rw(e){var t=OA(),n=AA(),r=B5(),i=Mn(Mn({},jn(e,Tye)),{},{x:be(e.x)?e.x:r.left,y:be(e.y)?e.y:r.top,width:be(e.width)?e.width:r.width,height:be(e.height)?e.height:r.height}),a=i.xAxisId,l=i.yAxisId,s=i.x,c=i.y,f=i.width,d=i.height,p=i.syncWithTicks,g=i.horizontalValues,v=i.verticalValues,y=Ln(),x=we(U=>wR(U,"xAxis",a,y)),w=we(U=>wR(U,"yAxis",l,y));if(!ta(f)||!ta(d)||!be(s)||!be(c))return null;var A=i.verticalCoordinatesGenerator||Cye,C=i.horizontalCoordinatesGenerator||Eye,k=i.horizontalPoints,P=i.verticalPoints;if((!k||!k.length)&&typeof C=="function"){var T=g&&g.length,D=C({yAxis:w?Mn(Mn({},w),{},{ticks:T?g:w.ticks}):void 0,width:t??f,height:n??d,offset:r},T?!0:p);Vg(Array.isArray(D),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof D,"]")),Array.isArray(D)&&(k=D)}if((!P||!P.length)&&typeof A=="function"){var N=v&&v.length,I=A({xAxis:x?Mn(Mn({},x),{},{ticks:N?v:x.ticks}):void 0,width:t??f,height:n??d,offset:r},N?!0:p);Vg(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof I,"]")),Array.isArray(I)&&(P=I)}return O.createElement(ai,{zIndex:i.zIndex},O.createElement("g",{className:"recharts-cartesian-grid"},O.createElement(Sye,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),O.createElement(Aye,Qo({},i,{horizontalPoints:k})),O.createElement(kye,Qo({},i,{verticalPoints:P})),O.createElement(wye,Qo({},i,{offset:r,horizontalPoints:k,xAxis:x,yAxis:w})),O.createElement(Oye,Qo({},i,{offset:r,verticalPoints:P,xAxis:x,yAxis:w}))))}Rw.displayName="CartesianGrid";var Mye=["animationElapsedTime","isAnimating","isEntrance","visibleLength","strokeDasharray","connectNulls"];function jw(){return jw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jw.apply(null,arguments)}function Dye(e,t){if(e==null)return{};var n,r,i=Pye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Pye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function _ye(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function s6(e,t){return"".concat(t,"px ").concat(e,"px")}function Nye(e){return e.length%2!==0?[...e,...e]:e}function Rye(e,t){for(var n=[],r=0;r<t;++r)n.push(...e);return n}function jye(e,t,n){var r=Nye(n),i=r.reduce((v,y)=>v+y,0);if(!i)return s6(t,e);for(var a=Math.floor(e/i),l=e%i,s=[],c=0,f=0;c<r.length;f+=(d=r[c])!==null&&d!==void 0?d:0,++c){var d,p=r[c];if(p!=null&&f+p>l){s=[...r.slice(0,c),l-f];break}}var g=s.length%2===0?[0,t]:[t];return[...Rye(r,a),...s,...g].map(v=>"".concat(v,"px")).join(", ")}function Iye(e,t,n){if(e){var r="".concat(e).split(/[,\s]+/gim).map(i=>parseFloat(i));return jye(n,t,r)}return s6(t,n)}function Lye(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=Dye(e,Mye),a=r??!1,l;if(t!=null){var s,c=i.pathRef,f=_ye((s=c?.current)!==null&&s!==void 0?s:null);l=Iye(n,f,t)}else n!=null&&(l=String(n));return O.createElement(W5,jw({},i,{connectNulls:a,strokeDasharray:l}))}function Bye(e){var t=O.useRef(0),n=O.useRef(0),r=O.useRef(!1),i=O.useRef(e);return i.current!==e&&(t.current=n.current,i.current=e),O.useCallback((a,l)=>{if(r.current)return null;var s=Math.min(Na(t.current+a*l),l);return a>0&&l>0&&(n.current=Math.max(n.current,s),s>=l)?(r.current=!0,null):s},[])}var zye={},u6=In({name:"errorBars",initialState:zye,reducers:{addErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]||(e[r]=[]),e[r].push(i)},replaceErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.prev,a=n.next;e[r]&&(e[r]=e[r].map(l=>l.dataKey===i.dataKey&&l.direction===i.direction?a:l))},removeErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]&&(e[r]=e[r].filter(a=>a.dataKey!==i.dataKey||a.direction!==i.direction))}}}),Nk=u6.actions;Nk.addErrorBar;Nk.replaceErrorBar;Nk.removeErrorBar;var $ye=u6.reducer,Uye=["children"];function Hye(e,t){if(e==null)return{};var n,r,i=Fye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var qye={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Wye=O.createContext(qye);function c6(e){var t=e.children,n=Hye(e,Uye);return O.createElement(Wye.Provider,{value:n},t)}function Rk(e,t){var n,r,i=we(f=>nl(f,e)),a=we(f=>rl(f,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Kt.allowDataOverflow,s=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Xt.allowDataOverflow,c=l||s;return{needClip:c,needClipX:l,needClipY:s}}function f6(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=Dk(),a=Rk(t,n),l=a.needClipX,s=a.needClipY,c=a.needClip,f=we(k=>N4(k,t,!1)),d=we(k=>R4(k,n,!1));if(!c||!i)return null;var p=i.x,g=i.y,v=i.width,y=i.height,x=l&&f?Math.min(f[0],f[1]):p-v/2,w=s&&d?Math.min(d[0],d[1]):g-y/2,A=l&&f?Math.abs(f[1]-f[0]):v*2,C=s&&d?Math.abs(d[1]-d[0]):y*2;return O.createElement("clipPath",{id:"clipPath-".concat(r)},O.createElement("rect",{x,y:w,width:A,height:C}))}var h6=(e,t,n,r)=>no(e,"xAxis",t,r),d6=(e,t,n,r)=>to(e,"xAxis",t,r),p6=(e,t,n,r)=>no(e,"yAxis",n,r),m6=(e,t,n,r)=>to(e,"yAxis",n,r),Vye=q([nt,h6,p6,d6,m6],(e,t,n,r,i)=>Za(e,"xAxis")?Ju(t,r,!1):Ju(n,i,!1)),Kye=(e,t,n,r,i)=>i;function Xye(e){return e.type==="line"}var Qye=q([Dy,Kye],(e,t)=>e.filter(Xye).find(n=>n.id===t)),Yye=q([nt,h6,p6,d6,m6,Qye,Vye,ad],(e,t,n,r,i,a,l,s)=>{var c=s.chartData,f=s.dataStartIndex,d=s.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null||e!=="horizontal"&&e!=="vertical")){var p=a.dataKey,g=a.data,v;if(g!=null&&g.length>0?v=g:v=c?.slice(f,d+1),v!=null)return y0e({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:p,bandSize:l,displayedData:v})}});function Gye(e){var t=Gh(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,l=Number(i),s=Number(a);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(s)||s<0)&&(s=r),{r:l,strokeWidth:s}}return{r:n,strokeWidth:r}}var Zye=["id"],Jye=["type","layout","connectNulls","needClip","shape","strokeDasharray"],e0e=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function yv(){return yv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yv.apply(null,arguments)}function jk(e,t){if(e==null)return{};var n,r,i=t0e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function t0e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Tj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tj(Object(n),!0).forEach(function(r){n0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n0e(e,t,n){return(t=r0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r0e(e){var t=i0e(e,"string");return typeof t=="symbol"?t:t+""}function i0e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a0e(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function l0e(e){var t=0,n=0;for(var r of e)r.status==="matched"&&r.prev.x!=null&&r.next.x!=null&&(t+=r.next.x-r.prev.x,n++);return n>0?t/n:0}var o0e=(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(s=>s.status==="removed"?[]:[s.next]);var n=l0e(e),r=[];for(var i of e)if(i.status==="matched")r.push(zi(zi({},i.next),{},{x:Ft(i.prev.x,i.next.x,t),y:Ft(i.prev.y,i.next.y,t)}));else if(i.status==="added")if(i.next.x!=null){var a=i.next.x-n;r.push(zi(zi({},i.next),{},{x:Ft(a,i.next.x,t),y:i.next.y}))}else r.push(i.next);else if(i.status==="removed"&&i.prev.x!=null){var l=i.prev.x+n;r.push(zi(zi({},i.prev),{},{x:Ft(i.prev.x,l,t),y:i.prev.y}))}return r},Ik={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:o0e,animationMatchBy:Tk,connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",shape:Lye,stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:sn.line,type:"linear"},s0e=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:r,value:fy(n,t),payload:e}]},u0e=O.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,l=e.name,s=e.hide,c=e.unit,f=e.formatter,d=e.tooltipType,p=e.id,g={dataDefinedOnItem:n,getPosition:ys,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:fy(l,t),hide:s,type:d,color:r,unit:c,formatter:f,graphicalItemId:p}};return O.createElement(V8,{tooltipEntrySettings:g})});function c0e(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,l=r.needClip;r.id;var s=jk(r,Zye),c=bi(s);return O.createElement($ge,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:c,needClip:l,clipPathId:t})}function f0e(e){var t=e.showLabels,n=e.children,r=e.points,i=O.useMemo(()=>r?.map(a=>{var l,s,c={x:(l=a.x)!==null&&l!==void 0?l:0,y:(s=a.y)!==null&&s!==void 0?s:0,width:0,lowerWidth:0,upperWidth:0,height:0};return zi(zi({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return O.createElement(R8,{value:t?i:void 0},n)}function h0e(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,l=e.isAnimating,s=e.isEntrance,c=e.visibleLength,f=i.type,d=i.layout,p=i.connectNulls,g=i.needClip,v=i.shape,y=i.strokeDasharray,x=jk(i,Jye),w=zi(zi({},Pr(x)),{},{fill:"none",className:"recharts-line-curve",clipPath:g?"url(#clipPath-".concat(t,")"):void 0,points:r,type:f,layout:d,connectNulls:p,strokeDasharray:y??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:l,isEntrance:i.animateNewValues?s:!1,visibleLength:c});return O.createElement(O.Fragment,null,r?.length>1&&O.createElement(H8,{option:v,DefaultShape:Ik.shape,shapeProps:w}),O.createElement(c0e,{points:r,clipPathId:t,props:i}))}function d0e(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,l=n.isAnimationActive,s=n.animationBegin,c=n.animationDuration,f=n.animationEasing,d=n.animationMatchBy,p=n.animationInterpolateFn,g=n.layout,v=a0e(r.current),y=Q8(n.onAnimationStart,n.onAnimationEnd),x=y.isAnimating,w=y.handleAnimationStart,A=y.handleAnimationEnd,C=!x,k=Bye(a),P=O.useCallback(T=>T>0&&v>0,[v]);return O.createElement(f0e,{points:a,showLabels:C},n.children,O.createElement(Y8,{animationInput:a,animationIdPrefix:"recharts-line-",items:a,previousItemsRef:i,isAnimationActive:l,animationBegin:s,animationDuration:c,animationEasing:f,onAnimationStart:w,onAnimationEnd:A,animationInterpolateFn:p,animationMatchBy:d,shouldUpdatePreviousRef:P,layout:g},(T,D,N)=>{var I=x||D<1,U=I?k(D,v):null;return O.createElement(h0e,{props:n,points:T,clipPathId:t,pathRef:r,animationElapsedTime:D,isAnimating:I,isEntrance:N,visibleLength:U})}),O.createElement(I8,{label:n.label}))}function p0e(e){var t=e.clipPathId,n=e.props,r=O.useRef(null),i=O.useRef(null);return O.createElement(d0e,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var m0e=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:Bt(e.payload,t)}};class g0e extends O.Component{render(){var t=this.props,n=t.hide,r=t.dot,i=t.points,a=t.className,l=t.xAxisId,s=t.yAxisId,c=t.top,f=t.left,d=t.width,p=t.height,g=t.id,v=t.needClip,y=t.zIndex;if(n)return null;var x=st("recharts-line",a),w=g,A=Gye(r),C=A.r,k=A.strokeWidth,P=$8(r),T=C*2+k,D=v?"url(#clipPath-".concat(P?"":"dots-").concat(w,")"):void 0;return O.createElement(ai,{zIndex:y},O.createElement(_r,{className:x},v&&O.createElement("defs",null,O.createElement(f6,{clipPathId:w,xAxisId:l,yAxisId:s}),!P&&O.createElement("clipPath",{id:"clipPath-dots-".concat(w)},O.createElement("rect",{x:f-T/2,y:c-T/2,width:d+T,height:p+T}))),O.createElement(c6,{xAxisId:l,yAxisId:s,data:i,dataPointFormatter:m0e,errorBarOffset:0},O.createElement(p0e,{props:this.props,clipPathId:w}))),O.createElement(lve,{activeDot:this.props.activeDot,points:i,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:D}))}}function v0e(e){var t=jn(e,Ik),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,l=t.animationEasing,s=t.connectNulls,c=t.dot,f=t.hide,d=t.isAnimationActive,p=t.label,g=t.legendType,v=t.xAxisId,y=t.yAxisId,x=t.id,w=jk(t,e0e),A=Rk(v,y),C=A.needClip,k=Dk(),P=bs(),T=Ln(),D=we(V=>Yye(V,v,y,T,x));if(P!=="horizontal"&&P!=="vertical"||D==null||k==null)return null;var N=k.height,I=k.width,U=k.x,K=k.y;return O.createElement(g0e,yv({},w,{id:x,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:l,isAnimationActive:d,hide:f,label:p,legendType:g,xAxisId:v,yAxisId:y,points:D,layout:P,height:N,width:I,left:U,top:K,needClip:C}))}function y0e(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,l=e.dataKey,s=e.bandSize,c=e.displayedData;return c.map((f,d)=>{var p=Bt(f,l);if(t==="horizontal"){var g=v_({axis:n,ticks:i,bandSize:s,entry:f,index:d}),v=kt(p)?null:r.scale.map(p);return{x:g,y:v??null,value:p,payload:f}}var y=kt(p)?null:n.scale.map(p),x=v_({axis:r,ticks:a,bandSize:s,entry:f,index:d});return y==null||x==null?null:{x:y,y:x,value:p,payload:f}}).filter(Boolean)}function b0e(e){var t=jn(e,Ik),n=Ln();return O.createElement(G8,{id:t.id,type:"line"},r=>O.createElement(O.Fragment,null,O.createElement(K8,{legendPayload:s0e(t)}),O.createElement(u0e,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:r}),O.createElement(J8,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),O.createElement(v0e,yv({},t,{id:r}))))}var g6=O.memo(b0e,pc);g6.displayName="Line";function Os(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:e6}function As(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:e6}var x0e="Invariant failed";function S0e(e,t){throw new Error(x0e)}var w0e=["option"];function O0e(e,t){if(e==null)return{};var n,r,i=A0e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function A0e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Lk=G5;function Bk(e){var t=e.option,n=O0e(e,w0e);return O.createElement(H8,{option:t,DefaultShape:Lk,shapeProps:n,activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"})}var k0e=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(be(t))return t;var a=be(r)||kt(r);return a?t(r,i):(a||S0e(),n)}},C0e=(e,t,n)=>n,E0e=(e,t)=>t,gd=q([Dy,E0e],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),T0e=q([gd],e=>e?.maxBarSize),M0e=(e,t,n,r)=>r,D0e=q([nt,Dy,Os,As,C0e],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),P0e=(e,t,n)=>{var r=nt(e),i=Os(e,t),a=As(e,t);if(!(i==null||a==null))return r==="horizontal"?Mw(e,"yAxis",a,n):Mw(e,"xAxis",i,n)},_0e=(e,t)=>{var n=nt(e),r=Os(e,t),i=As(e,t);if(!(r==null||i==null))return n==="horizontal"?SR(e,"xAxis",r):SR(e,"yAxis",i)},N0e=q([D0e,pse,_0e],hve),R0e=(e,t,n)=>{var r,i,a=gd(e,t);if(a==null)return 0;var l=Os(e,t),s=As(e,t);if(l==null||s==null)return 0;var c=nt(e),f=h$(e),d=a.maxBarSize,p=kt(d)?f:d,g,v;return c==="horizontal"?(g=no(e,"xAxis",l,n),v=to(e,"xAxis",l,n)):(g=no(e,"yAxis",s,n),v=to(e,"yAxis",s,n)),(r=(i=Ju(g,v,!0))!==null&&i!==void 0?i:p)!==null&&r!==void 0?r:0},v6=(e,t,n)=>{var r=nt(e),i=Os(e,t),a=As(e,t);if(!(i==null||a==null)){var l,s;return r==="horizontal"?(l=no(e,"xAxis",i,n),s=to(e,"xAxis",i,n)):(l=no(e,"yAxis",a,n),s=to(e,"yAxis",a,n)),Ju(l,s)}},j0e=q([N0e,h$,dse,d$,R0e,v6,T0e],vve),I0e=(e,t,n)=>{var r=Os(e,t);if(r!=null)return no(e,"xAxis",r,n)},L0e=(e,t,n)=>{var r=As(e,t);if(r!=null)return no(e,"yAxis",r,n)},B0e=(e,t,n)=>{var r=Os(e,t);if(r!=null)return to(e,"xAxis",r,n)},z0e=(e,t,n)=>{var r=As(e,t);if(r!=null)return to(e,"yAxis",r,n)},$0e=q([j0e,gd],bve),U0e=q([P0e,gd],yve),H0e=q([un,xA,I0e,L0e,B0e,z0e,$0e,nt,Goe,v6,U0e,gd,M0e],(e,t,n,r,i,a,l,s,c,f,d,p,g)=>{var v=c.chartData,y=c.dataStartIndex,x=c.dataEndIndex;if(!(p==null||l==null||t==null||s!=="horizontal"&&s!=="vertical"||n==null||r==null||i==null||a==null||f==null)){var w=p.data,A;if(w!=null&&w.length>0?A=w:A=v?.slice(y,x+1),A!=null)return Sbe({layout:s,barSettings:p,pos:l,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:d,displayedData:A,offset:e,cells:g,dataStartIndex:y})}}),F0e=["index"];function Iw(){return Iw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iw.apply(null,arguments)}function q0e(e,t){if(e==null)return{};var n,r,i=W0e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function W0e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var y6=O.createContext(void 0),V0e=e=>{var t=O.useContext(y6);if(t!=null)return t.stackId;if(e!=null)return Cie(e)},K0e=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),X0e=e=>{var t=O.useContext(y6);if(t!=null){var n=t.stackId;return"url(#".concat(K0e(n,e),")")}},b6=e=>{var t=e.index,n=q0e(e,F0e),r=X0e(t);return O.createElement(_r,Iw({className:"recharts-bar-stack-layer",clipPath:r},n))},Q0e=["onMouseEnter","onMouseLeave","onClick"],Y0e=["value","background","tooltipPosition"],G0e=["id"],Z0e=["onMouseEnter","onClick","onMouseLeave"];function Mj(e,t){return nbe(e)||tbe(e,t)||ebe(e,t)||J0e()}function J0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
122
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ebe(e,t){if(e){if(typeof e=="string")return Dj(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dj(e,t):void 0}}function Dj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tbe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function nbe(e){if(Array.isArray(e))return e}function ro(){return ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ro.apply(null,arguments)}function Pj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pj(Object(n),!0).forEach(function(r){rbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rbe(e,t,n){return(t=ibe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ibe(e){var t=abe(e,"string");return typeof t=="symbol"?t:t+""}function abe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bv(e,t){if(e==null)return{};var n,r,i=lbe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function lbe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var obe=e=>{var t=e.dataKey,n=e.name,r=e.fill,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:r,value:fy(n,t),payload:e}]},sbe=O.memo(e=>{var t=e.dataKey,n=e.stroke,r=e.strokeWidth,i=e.fill,a=e.name,l=e.hide,s=e.unit,c=e.formatter,f=e.tooltipType,d=e.id,p={dataDefinedOnItem:void 0,getPosition:ys,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:fy(a,t),hide:l,type:f,color:i,unit:s,formatter:c,graphicalItemId:d}};return O.createElement(V8,{tooltipEntrySettings:p})});function ube(e){var t=we(ms),n=e.data,r=e.dataKey,i=e.background,a=e.allOtherBarProps,l=a.onMouseEnter,s=a.onMouseLeave,c=a.onClick,f=bv(a,Q0e),d=F8(l,r,a.id),p=q8(s),g=W8(c,r,a.id);if(!i||n==null)return null;var v=Gh(i);return O.createElement(ai,{zIndex:xve(i,sn.barBackground)},n.map((y,x)=>{y.value;var w=y.background;y.tooltipPosition;var A=bv(y,Y0e);if(!w)return null;var C=d(y,y.originalDataIndex),k=p(y,y.originalDataIndex),P=g(y,y.originalDataIndex),T=Qt(Qt(Qt(Qt(Qt({option:i,isActive:String(y.originalDataIndex)===t},A),{},{fill:"#eee"},w),v),Jv(f,y,x)),{},{onMouseEnter:C,onMouseLeave:k,onClick:P,dataKey:r,index:x,className:"recharts-bar-background-rectangle"});return O.createElement(Bk,ro({key:"background-bar-".concat(x)},T))}))}function cbe(e){var t=e.showLabels,n=e.children,r=e.rects,i=r?.map(a=>{var l={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return Qt(Qt({},l),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:l,fill:a.fill})});return O.createElement(R8,{value:t?i:void 0},n)}function fbe(e){var t=e.shape,n=e.activeBar,r=e.baseProps,i=e.entry,a=e.index,l=e.dataKey,s=we(ms),c=we(c8),f=n&&String(i.originalDataIndex)===s&&(c==null||l===c),d=O.useState(!1),p=Mj(d,2),g=p[0],v=p[1],y=O.useState(!1),x=Mj(y,2),w=x[0],A=x[1];O.useEffect(()=>{var N;return f?(v(!0),N=requestAnimationFrame(()=>{A(!0)})):A(!1),()=>{cancelAnimationFrame(N)}},[f]);var C=O.useCallback(()=>{f||v(!1)},[f]),k=f&&w,P=f||g,T;f?n===!0?T=t:T=n:T=t;var D=O.createElement(Bk,ro({},r,{name:String(r.name)},i,{isActive:k,option:T,index:a,dataKey:l,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance,onTransitionEnd:C}));return P?O.createElement(ai,{zIndex:sn.activeBar},O.createElement(b6,{index:i.originalDataIndex},D)):D}function hbe(e){var t=e.shape,n=e.baseProps,r=e.entry,i=e.index,a=e.dataKey;return O.createElement(Bk,ro({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance}))}function dbe(e){var t,n=e.data,r=e.props,i=e.animationElapsedTime,a=e.isAnimating,l=e.isEntrance,s=(t=bi(r))!==null&&t!==void 0?t:{},c=s.id,f=bv(s,G0e),d=r.shape,p=r.dataKey,g=r.activeBar,v=r.onMouseEnter,y=r.onClick,x=r.onMouseLeave,w=bv(r,Z0e),A=F8(v,p,c),C=q8(x),k=W8(y,p,c);return n?O.createElement(O.Fragment,null,n.map((P,T)=>O.createElement(b6,ro({index:P.originalDataIndex,key:"rectangle-".concat(P?.x,"-").concat(P?.y,"-").concat(P?.value,"-").concat(T),className:"recharts-bar-rectangle"},Jv(w,P,T),{onMouseEnter:A(P,P.originalDataIndex),onMouseLeave:C(P,P.originalDataIndex),onClick:k(P,P.originalDataIndex)}),g?O.createElement(fbe,{shape:d,activeBar:g,baseProps:f,entry:P,index:T,dataKey:p,animationElapsedTime:i,isAnimating:a,isEntrance:l}):O.createElement(hbe,{shape:d,baseProps:f,entry:P,index:T,dataKey:p,animationElapsedTime:i,isAnimating:a,isEntrance:l})))):null}var pbe=(e,t,n)=>e==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>{if(r.status==="removed")return n==="horizontal"?[Qt(Qt({},r.prev),{},{height:Ft(r.prev.height,0,t),y:Ft(r.prev.y,r.prev.y+r.prev.height,t)})]:[Qt(Qt({},r.prev),{},{width:Ft(r.prev.width,0,t)})];if(r.status==="matched")return[Qt(Qt({},r.next),{},{x:Ft(r.prev.x,r.next.x,t),y:Ft(r.prev.y,r.next.y,t),width:Ft(r.prev.width,r.next.width,t),height:Ft(r.prev.height,r.next.height,t)})];var i=r.next;return n==="horizontal"?[Qt(Qt({},i),{},{height:Ft(0,i.height,t),y:Ft(i.stackedBarStart,i.y,t)})]:[Qt(Qt({},i),{},{width:Ft(0,i.width,t),x:Ft(i.stackedBarStart,i.x,t)})]});function mbe(e){var t=e.props,n=e.previousRectanglesRef,r=t.data,i=t.isAnimationActive,a=t.animationBegin,l=t.animationDuration,s=t.animationEasing,c=t.animationInterpolateFn,f=t.layout,d=Q8(t.onAnimationStart,t.onAnimationEnd),p=d.isAnimating,g=d.handleAnimationStart,v=d.handleAnimationEnd;return O.createElement(cbe,{showLabels:!p,rects:r},O.createElement(Y8,{animationInput:r,animationIdPrefix:"recharts-bar-",items:r,previousItemsRef:n,isAnimationActive:i,animationBegin:a,animationDuration:l,animationEasing:s,onAnimationStart:g,onAnimationEnd:v,animationInterpolateFn:c,animationMatchBy:t.animationMatchBy,layout:f},(y,x,w)=>O.createElement(_r,null,O.createElement(dbe,{props:t,data:y,animationElapsedTime:x,isAnimating:p||x<1,isEntrance:w}))),O.createElement(I8,{label:t.label}),t.children)}function gbe(e){var t=O.useRef(null);return O.createElement(mbe,{previousRectanglesRef:t,props:e})}var x6=0,vbe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:Bt(e,t)}};class ybe extends O.PureComponent{render(){var t=this.props,n=t.hide,r=t.data,i=t.dataKey,a=t.className,l=t.xAxisId,s=t.yAxisId,c=t.needClip,f=t.background,d=t.id;if(n||r==null)return null;var p=st("recharts-bar",a),g=d;return O.createElement(_r,{className:p,id:d},c&&O.createElement("defs",null,O.createElement(f6,{clipPathId:g,xAxisId:l,yAxisId:s})),O.createElement(_r,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(g,")"):void 0},O.createElement(ube,{data:r,dataKey:i,background:f,allOtherBarProps:this.props}),O.createElement(gbe,this.props)))}}var bbe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",animationInterpolateFn:pbe,animationMatchBy:X8,background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:x6,shape:Lk,xAxisId:0,yAxisId:0,zIndex:sn.bar};function xbe(e){var t=e.xAxisId,n=e.yAxisId,r=e.hide,i=e.legendType,a=e.minPointSize,l=e.activeBar,s=e.animationBegin,c=e.animationDuration,f=e.animationEasing,d=e.isAnimationActive,p=Rk(t,n),g=p.needClip,v=bs(),y=Ln(),x=Kme(e.children,S8),w=we(k=>H0e(k,e.id,y,x));if(v!=="vertical"&&v!=="horizontal")return null;var A,C=w?.[0];return C==null||C.height==null||C.width==null?A=0:A=v==="vertical"?C.height/2:C.width/2,O.createElement(c6,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:vbe,errorBarOffset:A},O.createElement(ybe,ro({},e,{layout:v,needClip:g,data:w,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:s,animationDuration:c,animationEasing:f,isAnimationActive:d})))}function Sbe(e){var t=e.layout,n=e.barSettings,r=n.dataKey,i=n.minPointSize,a=n.hasCustomShape,l=e.pos,s=e.bandSize,c=e.xAxis,f=e.yAxis,d=e.xAxisTicks,p=e.yAxisTicks,g=e.stackedData,v=e.displayedData,y=e.offset,x=e.cells,w=e.parentViewBox,A=e.dataStartIndex,C=t==="horizontal"?f:c,k=g?C.scale.domain():null,P=Eie({numericAxis:C}),T=C.scale.map(P);return v.map((D,N)=>{var I,U,K,V,B,ae;if(g){var ie=g[N+A];if(ie==null)return null;I=Sie(ie,k)}else I=Bt(D,r),Array.isArray(I)||(I=[P,I]);var oe=k0e(i,x6)(I[1],N);if(t==="horizontal"){var z,G=f.scale.map(I[0]),ne=f.scale.map(I[1]);if(G==null||ne==null)return null;U=y_({axis:c,ticks:d,bandSize:s,offset:l.offset,entry:D,index:N}),K=(z=ne??G)!==null&&z!==void 0?z:void 0,V=l.size;var ce=G-ne;if(B=Ji(ce)?0:ce,ae={x:U,y:y.top,width:V,height:y.height},Math.abs(oe)>0&&Math.abs(B)<Math.abs(oe)){var fe=sr(B||oe)*(Math.abs(oe)-Math.abs(B));K-=fe,B+=fe}}else{var R=c.scale.map(I[0]),X=c.scale.map(I[1]);if(R==null||X==null)return null;if(U=R,K=y_({axis:f,ticks:p,bandSize:s,offset:l.offset,entry:D,index:N}),V=X-R,B=l.size,ae={x:y.left,y:K,width:y.width,height:B},Math.abs(oe)>0&&Math.abs(V)<Math.abs(oe)){var re=sr(V||oe)*(Math.abs(oe)-Math.abs(V));V+=re}}if(U==null||K==null||V==null||B==null||!a&&(V===0||B===0))return null;var le=Qt(Qt({},D),{},{stackedBarStart:T,x:U,y:K,width:V,height:B,value:g?I:I[1],payload:D,background:ae,tooltipPosition:{x:U+V/2,y:K+B/2},parentViewBox:w,originalDataIndex:N},x&&x[N]&&x[N].props);return le}).filter(Boolean)}function wbe(e){var t=jn(e,bbe),n=V0e(t.stackId),r=Ln();return O.createElement(G8,{id:t.id,type:"bar"},i=>O.createElement(O.Fragment,null,O.createElement(K8,{legendPayload:obe(t)}),O.createElement(sbe,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:i}),O.createElement(J8,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null&&t.shape!==Lk}),O.createElement(ai,{zIndex:t.zIndex},O.createElement(xbe,ro({},t,{id:i})))))}var S6=O.memo(wbe,pc);S6.displayName="Bar";var Obe=["domain","range"],Abe=["domain","range"];function _j(e,t){if(e==null)return{};var n,r,i=kbe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kbe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Nj(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function w6(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=_j(e,Obe),a=t.domain,l=t.range,s=_j(t,Abe);return!Nj(n,a)||!Nj(r,l)?!1:pc(i,s)}var Cbe=["type"],Ebe=["dangerouslySetInnerHTML","ticks","scale"],Tbe=["id","scale"];function Lw(){return Lw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lw.apply(null,arguments)}function Rj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rj(Object(n),!0).forEach(function(r){Mbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mbe(e,t,n){return(t=Dbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dbe(e){var t=Pbe(e,"string");return typeof t=="symbol"?t:t+""}function Pbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bw(e,t){if(e==null)return{};var n,r,i=_be(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _be(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Nbe(e){var t=St(),n=O.useRef(null),r=z5(),i=e.type,a=Bw(e,Cbe),l=by(r,"xAxis",i),s=O.useMemo(()=>{if(l!=null)return jj(jj({},a),{},{type:l})},[a,l]);return O.useLayoutEffect(()=>{s!=null&&(n.current===null?t(Wge(s)):n.current!==s&&t(Vge({prev:n.current,next:s})),n.current=s)},[s,t]),O.useLayoutEffect(()=>()=>{n.current&&(t(Kge(n.current)),n.current=null)},[t]),null}var Rbe=e=>{var t=e.xAxisId,n=e.className,r=we(xA),i=Ln(),a="xAxis",l=we(g=>H4(g,a,t,i)),s=we(g=>z4(g,t)),c=we(g=>Jfe(g,t)),f=we(g=>a4(g,t));if(s==null||c==null||f==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var d=Bw(e,Ebe);f.id,f.scale;var p=Bw(f,Tbe);return O.createElement(_k,Lw({},d,p,{x:c.x,y:c.y,width:s.width,height:s.height,className:st("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a,axisId:t}))},jbe={allowDataOverflow:Kt.allowDataOverflow,allowDecimals:Kt.allowDecimals,allowDuplicatedCategory:Kt.allowDuplicatedCategory,angle:Kt.angle,axisLine:za.axisLine,height:Kt.height,hide:!1,includeHidden:Kt.includeHidden,interval:Kt.interval,label:!1,minTickGap:Kt.minTickGap,mirror:Kt.mirror,orientation:Kt.orientation,padding:Kt.padding,reversed:Kt.reversed,scale:Kt.scale,tick:Kt.tick,tickCount:Kt.tickCount,tickLine:za.tickLine,tickSize:za.tickSize,type:Kt.type,niceTicks:Kt.niceTicks,xAxisId:0},Ibe=e=>{var t=jn(e,jbe);return O.createElement(O.Fragment,null,O.createElement(Nbe,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),O.createElement(Rbe,t))},zw=O.memo(Ibe,w6);zw.displayName="XAxis";var Lbe=["type"],Bbe=["dangerouslySetInnerHTML","ticks","scale"],zbe=["id","scale"];function $w(){return $w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$w.apply(null,arguments)}function Ij(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ij(Object(n),!0).forEach(function(r){$be(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ij(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $be(e,t,n){return(t=Ube(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ube(e){var t=Hbe(e,"string");return typeof t=="symbol"?t:t+""}function Hbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Uw(e,t){if(e==null)return{};var n,r,i=Fbe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fbe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function qbe(e){var t=St(),n=O.useRef(null),r=z5(),i=e.type,a=Uw(e,Lbe),l=by(r,"yAxis",i),s=O.useMemo(()=>{if(l!=null)return Lj(Lj({},a),{},{type:l})},[l,a]);return O.useLayoutEffect(()=>{s!=null&&(n.current===null?t(Xge(s)):n.current!==s&&t(Qge({prev:n.current,next:s})),n.current=s)},[s,t]),O.useLayoutEffect(()=>()=>{n.current&&(t(Yge(n.current)),n.current=null)},[t]),null}function Wbe(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=O.useRef(null),l=O.useRef(null),s=we(xA),c=Ln(),f=St(),d="yAxis",p=we(A=>$4(A,t)),g=we(A=>the(A,t)),v=we(A=>H4(A,d,t,c)),y=we(A=>l4(A,t));if(O.useLayoutEffect(()=>{if(!(r!=="auto"||!p||Ek(i)||O.isValidElement(i)||y==null)){var A=a.current;if(A){var C=A.getCalculatedWidth();Math.round(p.width)!==Math.round(C)&&f(Gge({id:t,width:C}))}}},[v,p,f,i,t,r,y]),p==null||g==null||y==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var x=Uw(e,Bbe);y.id,y.scale;var w=Uw(y,zbe);return O.createElement(_k,$w({},x,w,{ref:a,labelRef:l,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:p.width,height:p.height,className:st("recharts-".concat(d," ").concat(d),n),viewBox:s,ticks:v,axisType:d,axisId:t}))}var Vbe={allowDataOverflow:Xt.allowDataOverflow,allowDecimals:Xt.allowDecimals,allowDuplicatedCategory:Xt.allowDuplicatedCategory,angle:Xt.angle,axisLine:za.axisLine,hide:!1,includeHidden:Xt.includeHidden,interval:Xt.interval,label:!1,minTickGap:Xt.minTickGap,mirror:Xt.mirror,orientation:Xt.orientation,padding:Xt.padding,reversed:Xt.reversed,scale:Xt.scale,tick:Xt.tick,tickCount:Xt.tickCount,tickLine:za.tickLine,tickSize:za.tickSize,type:Xt.type,niceTicks:Xt.niceTicks,width:Xt.width,yAxisId:0},Kbe=e=>{var t=jn(e,Vbe);return O.createElement(O.Fragment,null,O.createElement(qbe,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),O.createElement(Wbe,t))},Hw=O.memo(Kbe,w6);Hw.displayName="YAxis";var Xbe=(e,t)=>t,zk=q([Xbe,nt,x$,fn,l8,il,Ade,un],Pde);function Qbe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function $k(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Qbe(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var l=(s,c)=>({relativeX:Math.round((s-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(s=>l(s.clientX,s.clientY)):l(e.clientX,e.clientY)}var O6=Nr("mouseClick"),A6=ed();A6.startListening({actionCreator:O6,effect:(e,t)=>{var n=e.payload,r=zk(t.getState(),$k(n));r?.activeIndex!=null&&t.dispatch(vhe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Fw=Nr("mouseMove"),k6=ed(),pu=null,Do=null,E1=null;k6.startListening({actionCreator:Fw,effect:(e,t)=>{var n=e.payload,r=t.getState(),i=r.eventSettings,a=i.throttleDelay,l=i.throttledEvents,s=l==="all"||l?.includes("mousemove");pu!==null&&(cancelAnimationFrame(pu),pu=null),Do!==null&&(typeof a!="number"||!s)&&(clearTimeout(Do),Do=null),E1=$k(n);var c=()=>{var f=t.getState(),d=pd(f,f.tooltip.settings.shared);if(!E1){pu=null,Do=null;return}if(d==="axis"){var p=zk(f,E1);p?.activeIndex!=null?t.dispatch(Y4({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(Q4())}pu=null,Do=null};if(!s){c();return}a==="raf"?pu=requestAnimationFrame(c):typeof a=="number"&&Do===null&&(Do=setTimeout(c,a))}});function Ybe(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var Bj={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},C6=In({name:"rootProps",initialState:Bj,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:Bj.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),Gbe=C6.reducer,Zbe=C6.actions.updateOptions,Jbe=null,exe={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},E6=In({name:"polarOptions",initialState:Jbe,reducers:exe});E6.actions.updatePolarOptions;var txe=E6.reducer,T6=Nr("keyDown"),M6=Nr("focus"),D6=Nr("blur"),Iy=ed(),mu=null,Po=null,km=null;Iy.startListening({actionCreator:T6,effect:(e,t)=>{km=e.payload,mu!==null&&(cancelAnimationFrame(mu),mu=null);var n=t.getState(),r=n.eventSettings,i=r.throttleDelay,a=r.throttledEvents,l=a==="all"||a.includes("keydown");Po!==null&&(typeof i!="number"||!l)&&(clearTimeout(Po),Po=null);var s=()=>{try{var c=t.getState(),f=c.rootProps.accessibilityLayer!==!1;if(!f)return;var d=c.tooltip.keyboardInteraction,p=km;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var g=nh(d,ps(c),ic(c),ac(c)),v=g==null?-1:Number(g),y=!Number.isFinite(v)||v<0,x=il(c),w=ps(c),A=pd(c,c.tooltip.settings.shared);if(p==="Enter"){if(y)return;var C=dv(c,A,"hover",String(d.index));t.dispatch(hv({active:!d.active,activeIndex:d.index,activeCoordinate:C}));return}var k=lhe(c),P=k==="left-to-right"?1:-1,T=p==="ArrowRight"?1:-1,D;if(y){var N=ic(c),I=ac(c),U=T*P,K=oe=>({active:!1,index:String(oe),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(D=-1,U>0){for(var V=0;V<w.length;V++)if(nh(K(V),w,N,I)!=null){D=V;break}}else for(var B=w.length-1;B>=0;B--)if(nh(K(B),w,N,I)!=null){D=B;break}if(D<0)return}else{D=v+T*P;var ae=x?.length||w.length;if(ae===0||D>=ae||D<0)return}var ie=dv(c,A,"hover",String(D));t.dispatch(hv({active:!0,activeIndex:D.toString(),activeCoordinate:ie}))}finally{mu=null,Po=null}};if(!l){s();return}i==="raf"?mu=requestAnimationFrame(s):typeof i=="number"&&Po===null&&(s(),km=null,Po=setTimeout(()=>{km?s():(Po=null,mu=null)},i))}});Iy.startListening({actionCreator:M6,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;if(!i.active&&i.index==null){var a="0",l=pd(n,n.tooltip.settings.shared),s=dv(n,l,"hover",String(a));t.dispatch(hv({active:!0,activeIndex:a,activeCoordinate:s}))}}}});Iy.startListening({actionCreator:D6,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;i.active&&t.dispatch(hv({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function P6(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var Vr=Nr("externalEvent"),_6=ed(),Cm=new Map,Rf=new Map,T1=new Map;_6.startListening({actionCreator:Vr,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,l=P6(i);T1.set(a,{handler:r,reactEvent:l});var s=Cm.get(a);s!==void 0&&(cancelAnimationFrame(s),Cm.delete(a));var c=t.getState(),f=c.eventSettings,d=f.throttleDelay,p=f.throttledEvents,g=p,v=g==="all"||g?.includes(a),y=Rf.get(a);y!==void 0&&(typeof d!="number"||!v)&&(clearTimeout(y),Rf.delete(a));var x=()=>{var C=T1.get(a);try{if(!C)return;var k=C.handler,P=C.reactEvent,T=t.getState(),D={activeCoordinate:sde(T),activeDataKey:c8(T),activeIndex:ms(T),activeLabel:u8(T),activeTooltipIndex:ms(T),isTooltipActive:ude(T)};k&&k(D,P)}finally{Cm.delete(a),Rf.delete(a),T1.delete(a)}};if(!v){x();return}if(d==="raf"){var w=requestAnimationFrame(x);Cm.set(a,w)}else if(typeof d=="number"){if(!Rf.has(a)){x();var A=setTimeout(x,d);Rf.set(a,A)}}else x()}}});var nxe=q([wc],e=>e.tooltipItemPayloads),rxe=q([nxe,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var i=r.getPosition;if(i!=null)return i(t)}}}),N6=Nr("touchMove"),R6=ed(),_o=null,Dl=null,zj=null,jf=null;R6.startListening({actionCreator:N6,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){jf=P6(n);var r=t.getState(),i=r.eventSettings,a=i.throttleDelay,l=i.throttledEvents,s=l==="all"||l.includes("touchmove");_o!==null&&(cancelAnimationFrame(_o),_o=null),Dl!==null&&(typeof a!="number"||!s)&&(clearTimeout(Dl),Dl=null),zj=Array.from(n.touches).map(f=>$k({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var c=()=>{if(jf!=null){var f=t.getState(),d=pd(f,f.tooltip.settings.shared);if(d==="axis"){var p,g=(p=zj)===null||p===void 0?void 0:p[0];if(g==null){_o=null,Dl=null;return}var v=zk(f,g);v?.activeIndex!=null&&t.dispatch(Y4({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(d==="item"){var y,x=jf.touches[0];if(document.elementFromPoint==null||x==null)return;var w=document.elementFromPoint(x.clientX,x.clientY);if(!w||!w.getAttribute)return;var A=w.getAttribute(Rie),C=(y=w.getAttribute(jie))!==null&&y!==void 0?y:void 0,k=ws(f).find(D=>D.id===C);if(A==null||k==null||C==null)return;var P=k.dataKey,T=rxe(f,A,C);t.dispatch(X4({activeDataKey:P,activeIndex:A,activeCoordinate:T,activeGraphicalItemId:C}))}_o=null,Dl=null}};if(!s){c();return}a==="raf"?_o=requestAnimationFrame(c):typeof a=="number"&&Dl===null&&(c(),jf=null,Dl=setTimeout(()=>{jf?c():(Dl=null,_o=null)},a))}}});var j6={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},I6=In({name:"eventSettings",initialState:j6,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=Ye(t.payload.throttledEvents))}}}),ixe=I6.actions.setEventSettings,axe=I6.reducer,lxe=r5({brush:wve,cartesianAxis:Zge,chartData:ope,errorBars:$ye,eventSettings:axe,graphicalItems:Dge,layout:gie,legend:wae,options:npe,polarAxis:Hme,polarOptions:txe,referenceElements:Cve,renderedTicks:Xve,rootProps:Gbe,tooltip:yhe,zIndex:qde}),oxe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Ure({reducer:lxe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([A6.middleware,k6.middleware,Iy.middleware,_6.middleware,R6.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(y5({type:"raf"}))},devTools:{serialize:{replacer:Ybe},name:"recharts-".concat(n)}})};function sxe(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=Ln(),a=O.useRef(null);if(i)return n;a.current==null&&(a.current=oxe(t,r));var l=dA;return O.createElement($ae,{context:l,store:a.current},n)}function uxe(e){var t=e.layout,n=e.margin,r=St(),i=Ln();return O.useEffect(()=>{i||(r(die(t)),r(hie(n)))},[r,i,t,n]),null}var cxe=O.memo(uxe,pc);function fxe(e){var t=St();return O.useEffect(()=>{t(Zbe(e))},[t,e]),null}var hxe=e=>{var t=St();return O.useEffect(()=>{t(ixe(e))},[t,e]),null},dxe=O.memo(hxe,pc);function $j(e){var t=e.zIndex,n=e.isPanorama,r=O.useRef(null),i=St();return O.useLayoutEffect(()=>(r.current&&i(Hde({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Fde({zIndex:t,isPanorama:n}))}),[i,t,n]),O.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function Uj(e){var t=e.children,n=e.isPanorama,r=we(Nde);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),a=r.filter(l=>l>0);return O.createElement(O.Fragment,null,i.map(l=>O.createElement($j,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>O.createElement($j,{key:l,zIndex:l,isPanorama:n})))}var pxe=["children"];function mxe(e,t){if(e==null)return{};var n,r,i=gxe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gxe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function xv(){return xv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xv.apply(null,arguments)}var vxe={width:"100%",height:"100%",display:"block"},yxe=O.forwardRef((e,t)=>{var n=OA(),r=AA(),i=q5();if(!ta(n)||!ta(r))return null;var a=e.children,l=e.otherAttributes,s=e.title,c=e.desc,f,d;return l!=null&&(typeof l.tabIndex=="number"?f=l.tabIndex:f=i?0:void 0,typeof l.role=="string"?d=l.role:d=i?"application":void 0),O.createElement(aA,xv({},l,{title:s,desc:c,role:d,tabIndex:f,width:n,height:r,style:vxe,ref:t}),a)}),bxe=e=>{var t=e.children,n=we(my);if(!n)return null;var r=n.width,i=n.height,a=n.y,l=n.x;return O.createElement(aA,{width:r,height:i,x:l,y:a},t)},Hj=O.forwardRef((e,t)=>{var n=e.children,r=mxe(e,pxe),i=Ln();return i?O.createElement(bxe,null,O.createElement(Uj,{isPanorama:!0},n)):O.createElement(yxe,xv({ref:t},r),O.createElement(Uj,{isPanorama:!1},n))});function xxe(e,t){return Axe(e)||Oxe(e,t)||wxe(e,t)||Sxe()}function Sxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
123
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wxe(e,t){if(e){if(typeof e=="string")return Fj(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fj(e,t):void 0}}function Fj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oxe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Axe(e){if(Array.isArray(e))return e}function kxe(){var e=St(),t=O.useState(null),n=xxe(t,2),r=n[0],i=n[1],a=we(Nie);return O.useEffect(()=>{if(r!=null){var l=r.getBoundingClientRect(),s=l.width/r.offsetWidth;Ve(s)&&s!==a&&e(mie(s))}},[r,e,a]),i}function qj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cxe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qj(Object(n),!0).forEach(function(r){Exe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Exe(e,t,n){return(t=Txe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Txe(e){var t=Mxe(e,"string");return typeof t=="symbol"?t:t+""}function Mxe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kl.apply(null,arguments)}function Sv(e,t){return Nxe(e)||_xe(e,t)||Pxe(e,t)||Dxe()}function Dxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
124
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pxe(e,t){if(e){if(typeof e=="string")return Wj(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wj(e,t):void 0}}function Wj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _xe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Nxe(e){if(Array.isArray(e))return e}var Rxe=()=>(gpe(),null);function wv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var jxe=O.forwardRef((e,t)=>{var n,r,i=O.useRef(null),a=O.useState({containerWidth:wv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:wv((r=e.style)===null||r===void 0?void 0:r.height)}),l=Sv(a,2),s=l[0],c=l[1],f=O.useCallback((p,g)=>{c(v=>{var y=Math.round(p),x=Math.round(g);return v.containerWidth===y&&v.containerHeight===x?v:{containerWidth:y,containerHeight:x}})},[]),d=O.useCallback(p=>{if(typeof t=="function"&&t(p),i.current!=null&&(i.current.disconnect(),i.current=null),p!=null&&typeof ResizeObserver<"u"){var g=p.getBoundingClientRect(),v=g.width,y=g.height;f(v,y);var x=A=>{var C=A[0];if(C!=null){var k=C.contentRect,P=k.width,T=k.height;f(P,T)}},w=new ResizeObserver(x);w.observe(p),i.current=w}},[t,f]);return O.useEffect(()=>()=>{var p=i.current;p?.disconnect()},[f]),O.createElement(O.Fragment,null,O.createElement(nd,{width:s.containerWidth,height:s.containerHeight}),O.createElement("div",Kl({ref:d},e)))}),Ixe=O.forwardRef((e,t)=>{var n=e.width,r=e.height,i=O.useState({containerWidth:wv(n),containerHeight:wv(r)}),a=Sv(i,2),l=a[0],s=a[1],c=O.useCallback((d,p)=>{s(g=>{var v=Math.round(d),y=Math.round(p);return g.containerWidth===v&&g.containerHeight===y?g:{containerWidth:v,containerHeight:y}})},[]),f=O.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var p=d.getBoundingClientRect(),g=p.width,v=p.height;c(g,v)}},[t,c]);return O.createElement(O.Fragment,null,O.createElement(nd,{width:l.containerWidth,height:l.containerHeight}),O.createElement("div",Kl({ref:f},e)))}),Lxe=O.forwardRef((e,t)=>{var n=e.width,r=e.height;return O.createElement(O.Fragment,null,O.createElement(nd,{width:n,height:r}),O.createElement("div",Kl({ref:t},e)))}),Bxe=O.forwardRef((e,t)=>{var n=e.width,r=e.height;return typeof n=="string"||typeof r=="string"?O.createElement(Ixe,Kl({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?O.createElement(Lxe,Kl({},e,{width:n,height:r,ref:t})):O.createElement(O.Fragment,null,O.createElement(nd,{width:n,height:r}),O.createElement("div",Kl({ref:t},e)))});function zxe(e){return e?jxe:Bxe}var $xe=O.forwardRef((e,t)=>{var n=e.children,r=e.className,i=e.height,a=e.onClick,l=e.onContextMenu,s=e.onDoubleClick,c=e.onMouseDown,f=e.onMouseEnter,d=e.onMouseLeave,p=e.onMouseMove,g=e.onMouseUp,v=e.onTouchEnd,y=e.onTouchMove,x=e.onTouchStart,w=e.style,A=e.width,C=e.responsive,k=e.dispatchTouchEvents,P=k===void 0?!0:k,T=O.useRef(null),D=St(),N=O.useState(null),I=Sv(N,2),U=I[0],K=I[1],V=O.useState(null),B=Sv(V,2),ae=B[0],ie=B[1],oe=kxe(),z=SA(),G=z?.width>0?z.width:A,ne=z?.height>0?z.height:i,ce=O.useCallback(xe=>{oe(xe),typeof t=="function"&&t(xe),K(xe),ie(xe),xe!=null&&(T.current=xe)},[oe,t,K,ie]),fe=O.useCallback(xe=>{D(O6(xe)),D(Vr({handler:a,reactEvent:xe}))},[D,a]),R=O.useCallback(xe=>{D(Fw(xe)),D(Vr({handler:f,reactEvent:xe}))},[D,f]),X=O.useCallback(xe=>{D(Q4()),D(Vr({handler:d,reactEvent:xe}))},[D,d]),re=O.useCallback(xe=>{D(Fw(xe)),D(Vr({handler:p,reactEvent:xe}))},[D,p]),le=O.useCallback(()=>{D(M6())},[D]),ge=O.useCallback(()=>{D(D6())},[D]),Oe=O.useCallback(xe=>{D(T6(xe.key))},[D]),De=O.useCallback(xe=>{D(Vr({handler:l,reactEvent:xe}))},[D,l]),mt=O.useCallback(xe=>{D(Vr({handler:s,reactEvent:xe}))},[D,s]),se=O.useCallback(xe=>{D(Vr({handler:c,reactEvent:xe}))},[D,c]),Te=O.useCallback(xe=>{D(Vr({handler:g,reactEvent:xe}))},[D,g]),Ee=O.useCallback(xe=>{D(Vr({handler:x,reactEvent:xe}))},[D,x]),ue=O.useCallback(xe=>{P&&D(N6(xe)),D(Vr({handler:y,reactEvent:xe}))},[D,P,y]),Nt=O.useCallback(xe=>{D(Vr({handler:v,reactEvent:xe}))},[D,v]),Ne=zxe(C);return O.createElement(v8.Provider,{value:U},O.createElement(pz.Provider,{value:ae},O.createElement(Ne,{width:G??w?.width,height:ne??w?.height,className:st("recharts-wrapper",r),style:Cxe({position:"relative",cursor:"default",width:G,height:ne},w),onClick:fe,onContextMenu:De,onDoubleClick:mt,onFocus:le,onBlur:ge,onKeyDown:Oe,onMouseDown:se,onMouseEnter:R,onMouseLeave:X,onMouseMove:re,onMouseUp:Te,onTouchEnd:Nt,onTouchMove:ue,onTouchStart:Ee,ref:ce},O.createElement(Rxe,null),n)))}),Uxe=["width","height","responsive","children","className","style","compact","title","desc"];function Hxe(e,t){if(e==null)return{};var n,r,i=Fxe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fxe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var qxe=O.forwardRef((e,t)=>{var n=e.width,r=e.height,i=e.responsive,a=e.children,l=e.className,s=e.style,c=e.compact,f=e.title,d=e.desc,p=Hxe(e,Uxe),g=bi(p);return c?O.createElement(O.Fragment,null,O.createElement(nd,{width:n,height:r}),O.createElement(Hj,{otherAttributes:g,title:f,desc:d},a)):O.createElement($xe,{className:l,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},O.createElement(Hj,{otherAttributes:g,title:f,desc:d,ref:t},O.createElement(Nve,null,a)))});function qw(){return qw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qw.apply(null,arguments)}function Vj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wxe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vj(Object(n),!0).forEach(function(r){Vxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vxe(e,t,n){return(t=Kxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kxe(e){var t=Xxe(e,"string");return typeof t=="symbol"?t:t+""}function Xxe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qxe={top:5,right:5,bottom:5,left:5},Yxe=Wxe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Qxe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},j6),L6=O.forwardRef(function(t,n){var r,i=jn(t.categoricalChartProps,Yxe),a=t.chartName,l=t.defaultTooltipEventType,s=t.validateTooltipEventTypes,c=t.tooltipPayloadSearcher,f=t.categoricalChartProps,d={chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:s,tooltipPayloadSearcher:c,eventEmitter:void 0};return O.createElement(sxe,{preloadedState:{options:d},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},O.createElement(Sve,{chartData:f.data}),O.createElement(cxe,{layout:i.layout,margin:i.margin}),O.createElement(dxe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),O.createElement(fxe,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),O.createElement(qxe,qw({},i,{ref:n})))}),Gxe=["axis"],Zxe=O.forwardRef((e,t)=>O.createElement(L6,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Gxe,tooltipPayloadSearcher:y8,categoricalChartProps:e,ref:t})),Jxe=["axis","item"],e1e=O.forwardRef((e,t)=>O.createElement(L6,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Jxe,tooltipPayloadSearcher:y8,categoricalChartProps:e,ref:t}));const t1e={succeeded:"var(--status-good)",failed:"var(--status-critical)",skipped:"var(--status-warning)",canceled:"var(--text-muted)"},Kj=["succeeded","failed","skipped","canceled"];function Em({label:e,value:t,sub:n}){return M.jsxs("div",{className:"rounded-lg border border-edge bg-surface px-4 py-3",children:[M.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:e}),M.jsx("p",{className:"mt-1 text-2xl font-semibold",children:t}),n&&M.jsx("p",{className:"mt-0.5 text-xs text-ink-muted",children:n})]})}function Xj({active:e,payload:t,label:n,unit:r}){return!e||!t?.length?null:M.jsxs("div",{className:"rounded-md border border-edge bg-surface px-3 py-2 text-xs shadow-sm",children:[M.jsx("p",{className:"mb-1 font-medium text-ink-secondary",children:n}),t.map(i=>M.jsxs("p",{className:"flex items-center gap-2 text-ink-secondary",children:[M.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{background:i.color}}),i.name,": ",M.jsx("span",{className:"font-medium text-ink",children:r==="s"?Hu(i.value):i.value})]},i.dataKey))]})}function n1e({stats:e}){const t=O.useMemo(()=>{const l=new Map;for(const s of e.daily){const c=l.get(s.day)??{day:s.day.slice(5)};c[s.status]=s.count,l.set(s.day,c)}return[...l.values()]},[e.daily]),n=O.useMemo(()=>e.recentDurations.map(l=>({id:`#${l.id}`,duration:Math.round(l.duration_s*10)/10})),[e.recentDurations]),r=e.totals.total>0?Math.round(e.totals.succeeded/Math.max(e.totals.total-e.totals.skipped,1)*100):null,i=e.recentDurations.length>0?e.recentDurations.reduce((l,s)=>l+s.duration_s,0)/e.recentDurations.length:null,a={fill:"var(--text-muted)",fontSize:11};return M.jsxs("div",{className:"space-y-6",children:[M.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[M.jsx(Em,{label:"Runs",value:String(e.totals.total)}),M.jsx(Em,{label:"Success rate",value:r===null?"—":`${r}%`,sub:e.totals.failed>0?`${e.totals.failed} failed`:void 0}),M.jsx(Em,{label:"Skipped",value:String(e.totals.skipped),sub:"overlapping schedule"}),M.jsx(Em,{label:"Avg duration",value:i===null?"—":Hu(i),sub:"last 50 runs"})]}),M.jsxs("div",{className:"rounded-lg border border-edge bg-surface p-4",children:[M.jsx("h3",{className:"mb-3 text-sm font-semibold text-ink-secondary",children:"Runs per day"}),t.length===0?M.jsx("p",{className:"py-10 text-center text-sm text-ink-muted",children:"No runs in this period."}):M.jsx(C_,{width:"100%",height:220,children:M.jsxs(e1e,{data:t,margin:{top:4,right:8,left:-18,bottom:0},children:[M.jsx(Rw,{vertical:!1,stroke:"var(--gridline)"}),M.jsx(zw,{dataKey:"day",tick:a,axisLine:{stroke:"var(--baseline)"},tickLine:!1}),M.jsx(Hw,{tick:a,axisLine:!1,tickLine:!1,allowDecimals:!1}),M.jsx(UR,{content:M.jsx(Xj,{}),cursor:{fill:"var(--gridline)",opacity:.4}}),M.jsx(H5,{wrapperStyle:{fontSize:12,color:"var(--text-secondary)"},iconSize:8}),Kj.map((l,s)=>M.jsx(S6,{dataKey:l,name:l,stackId:"runs",fill:t1e[l],stroke:"var(--surface-1)",strokeWidth:1,maxBarSize:28,radius:s===Kj.length-1?[3,3,0,0]:void 0,isAnimationActive:!1},l))]})})]}),M.jsxs("div",{className:"rounded-lg border border-edge bg-surface p-4",children:[M.jsxs("h3",{className:"mb-3 text-sm font-semibold text-ink-secondary",children:["Run duration (last ",n.length," runs)"]}),n.length===0?M.jsx("p",{className:"py-10 text-center text-sm text-ink-muted",children:"No finished runs yet."}):M.jsx(C_,{width:"100%",height:200,children:M.jsxs(Zxe,{data:n,margin:{top:4,right:8,left:-10,bottom:0},children:[M.jsx(Rw,{vertical:!1,stroke:"var(--gridline)"}),M.jsx(zw,{dataKey:"id",tick:a,axisLine:{stroke:"var(--baseline)"},tickLine:!1}),M.jsx(Hw,{tick:a,axisLine:!1,tickLine:!1,tickFormatter:l=>Hu(l)}),M.jsx(UR,{content:M.jsx(Xj,{unit:"s"}),cursor:{stroke:"var(--baseline)"}}),M.jsx(g6,{type:"monotone",dataKey:"duration",name:"duration",stroke:"var(--series-1)",strokeWidth:2,dot:!1,activeDot:{r:4,strokeWidth:2,stroke:"var(--surface-1)"},isAnimationActive:!1})]})})]})]})}function r1e(){const{id:e}=Jw(),t=Number(e),n=kv(),r=io(),[i,a]=O.useState("runs"),[l,s]=O.useState(30),[c,f]=O.useState("form"),{data:d,error:p}=Fi({queryKey:["configs",t],queryFn:()=>qt.config(t)}),{data:g}=Fi({queryKey:["health"],queryFn:qt.health}),{data:v}=Fi({queryKey:["runs",{configId:t}],queryFn:()=>qt.runs({configId:t,limit:100})}),{data:y}=Fi({queryKey:["runs","stats",t,l],queryFn:()=>qt.configStats(t,l),enabled:i==="stats"}),x=Uu({mutationFn:()=>qt.triggerRun(t),onSettled:()=>r.invalidateQueries({queryKey:["configs"]})}),w=Uu({mutationFn:()=>qt.deleteConfig(t),onSuccess:()=>{r.invalidateQueries({queryKey:["configs"]}),n("/")}});if(p)return M.jsx("p",{className:"text-critical",children:p.message});if(!d)return M.jsx("p",{className:"text-ink-muted",children:"Loading…"});const A=g?.mode==="rw";return M.jsxs("div",{className:"space-y-6",children:[M.jsxs("div",{children:[M.jsx(gi,{to:"/",className:"text-sm text-ink-muted hover:text-accent",children:"← Configurations"}),M.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[M.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:d.name}),d.parse_error&&M.jsxs("span",{className:"rounded-full border border-critical/40 px-2 py-0.5 text-xs text-critical",title:d.parse_error,children:["invalid: ",d.parse_error]}),M.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[M.jsx("button",{onClick:()=>x.mutate(),disabled:d.busy||!!d.parse_error||x.isPending,className:"rounded-md bg-accent px-3.5 py-1.5 text-sm font-medium text-white transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:d.busy?"Running…":"Run now"}),A&&M.jsx("button",{onClick:()=>{window.confirm(`Delete config '${d.name}' and its file?
125
-
126
- Run history is kept.`)&&w.mutate()},className:"rounded-md border border-critical/40 px-3.5 py-1.5 text-sm font-medium text-critical transition hover:bg-critical/10",children:"Delete"})]})]}),x.error&&M.jsx("p",{className:"mt-2 text-sm text-critical",children:x.error.message}),w.error&&M.jsx("p",{className:"mt-2 text-sm text-critical",children:w.error.message}),M.jsxs("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[M.jsxs("div",{children:[M.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Schedule"}),M.jsxs("dd",{className:"mt-0.5 text-ink-secondary",children:[oO(d.schedule),d.schedule&&M.jsx("code",{className:"ml-2 text-xs text-ink-muted",children:d.schedule})]})]}),M.jsxs("div",{children:[M.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Next run"}),M.jsx("dd",{className:"mt-0.5 text-ink-secondary",title:d.next_run?Ua(d.next_run):void 0,children:d.next_run?z1(d.next_run):"—"})]}),M.jsxs("div",{children:[M.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"File"}),M.jsx("dd",{className:"mt-0.5 font-mono text-xs text-ink-muted",children:d.path})]})]}),M.jsx("div",{className:"mt-3",children:M.jsx(rL,{sources:d.source_summary})})]}),M.jsx("div",{className:"border-b border-edge",children:M.jsx("nav",{className:"flex gap-6 text-sm",children:["runs","stats","config"].map(C=>M.jsx("button",{onClick:()=>a(C),className:`-mb-px border-b-2 px-1 pb-2 font-medium capitalize transition ${i===C?"border-accent text-accent":"border-transparent text-ink-muted hover:text-ink-secondary"}`,children:C},C))})}),i==="runs"&&M.jsx(Ree,{runs:v??[]}),i==="stats"&&M.jsxs("div",{className:"space-y-4",children:[M.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[M.jsx("span",{className:"text-ink-muted",children:"Period:"}),[7,30,90].map(C=>M.jsxs("button",{onClick:()=>s(C),className:`rounded-md border px-2.5 py-1 text-xs font-medium transition ${l===C?"border-accent text-accent":"border-edge text-ink-muted hover:text-ink-secondary"}`,children:[C,"d"]},C))]}),y?M.jsx(n1e,{stats:y}):M.jsx("p",{className:"text-ink-muted",children:"Loading…"})]}),i==="config"&&M.jsxs("div",{className:"space-y-4",children:[M.jsx("div",{className:"flex items-center gap-2 text-sm",children:A?["form","yaml"].map(C=>M.jsx("button",{onClick:()=>f(C),className:`rounded-md border px-2.5 py-1 text-xs font-medium uppercase transition ${c===C?"border-accent text-accent":"border-edge text-ink-muted hover:text-ink-secondary"}`,children:C},C)):M.jsx("p",{className:"text-xs text-ink-muted",children:"Read-only mode — configs are managed from the files passed to the controller."})}),A&&c==="form"?M.jsx(nL,{mode:"edit",config:d,onSaved:()=>r.invalidateQueries({queryKey:["configs",t]})},d.content_hash):A?M.jsx(jP,{mode:"edit",config:d,onSaved:()=>r.invalidateQueries({queryKey:["configs",t]})},d.content_hash):M.jsx(jP,{mode:"view",config:d})]})]})}const M1=1e4,i1e=["error","warn","info","debug"],D1={error:"text-critical",warn:"text-warning",info:"text-ink-secondary",debug:"text-ink-muted"};function a1e({runId:e,isActive:t}){const[n,r]=O.useState([]),[i,a]=O.useState(!t),[l,s]=O.useState(!0),[c,f]=O.useState(new Set),[d,p]=O.useState(""),g=O.useRef(null),v=O.useRef(l);v.current=l,O.useEffect(()=>{r([]);const T=new EventSource(`/api/runs/${e}/logs/stream`);return T.addEventListener("log",D=>{const N=JSON.parse(D.data);r(I=>{const U=I.length>=M1?I.slice(I.length-M1+1):I.slice();return U.push(N),U})}),T.addEventListener("end",()=>{a(!0),T.close()}),T.onerror=()=>{},()=>T.close()},[e]);const y=O.useMemo(()=>{const T={};for(const D of n)T[D.level]=(T[D.level]??0)+1;return T},[n]),x=O.useMemo(()=>{const T=d.trim().toLowerCase();return c.size===0&&!T?n:n.filter(D=>c.size>0&&!c.has(D.level)?!1:T?D.message.toLowerCase().includes(T)||(D.module??"").toLowerCase().includes(T):!0)},[n,c,d]),w=O.useRef(!1);O.useLayoutEffect(()=>{v.current&&g.current&&(w.current=!0,g.current.scrollTop=g.current.scrollHeight)},[x,l]);const A=()=>{const T=g.current;if(!T)return;const D=T.scrollHeight-T.scrollTop-T.clientHeight<40;if(w.current){w.current=!1,D&&!v.current&&s(!0);return}D!==v.current&&s(D)},C=T=>{T.deltaY<0&&v.current&&s(!1)},k=T=>{f(D=>{const N=new Set(D);return N.has(T)?N.delete(T):N.add(T),N})},P=c.size>0||d.trim()!=="";return M.jsxs("div",{className:"rounded-lg border border-edge bg-surface",children:[M.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-edge px-4 py-2 text-xs text-ink-muted",children:[M.jsxs("span",{className:"shrink-0",children:[P?`${x.length.toLocaleString()} / `:"",n.length.toLocaleString()," lines",n.length>=M1&&" (oldest trimmed)"]}),!i&&M.jsx("span",{className:"shrink-0 text-accent",children:"● live"}),M.jsx("div",{className:"flex items-center gap-1",children:i1e.map(T=>M.jsxs("button",{onClick:()=>k(T),title:`${y[T]??0} ${T} line(s)`,className:`rounded-full border px-2 py-0.5 font-medium uppercase transition ${c.has(T)?`border-current ${D1[T]}`:"border-edge text-ink-muted hover:text-ink-secondary"}`,children:[T,(y[T]??0)>0&&M.jsx("span",{className:"ml-1 font-normal",children:y[T]})]},T))}),M.jsx("input",{value:d,onChange:T=>p(T.target.value),placeholder:"Filter by keyword…",className:"w-44 rounded-md border border-edge bg-page px-2 py-1 text-xs outline-none placeholder:text-ink-muted/60 focus:border-accent"}),P&&M.jsx("button",{onClick:()=>{f(new Set),p("")},className:"text-ink-muted underline-offset-2 hover:text-accent hover:underline",children:"clear"}),!l&&!i&&M.jsx("button",{onClick:()=>{s(!0),g.current?.scrollTo({top:g.current.scrollHeight})},className:"ml-auto rounded border border-edge px-2 py-0.5 hover:border-accent hover:text-accent",children:"↓ Follow"})]}),M.jsxs("div",{ref:g,onScroll:A,onWheel:C,className:"log-scroll max-h-[560px] overflow-auto px-4 py-3 font-mono text-xs leading-5",children:[x.length===0&&M.jsx("p",{className:"text-ink-muted",children:n.length===0?`No log output${i?"":" yet"}.`:"No lines match the current filters."}),x.map(T=>M.jsxs("div",{className:"flex gap-3 whitespace-pre-wrap break-all hover:bg-ink/[0.03]",children:[M.jsx("span",{className:"shrink-0 select-none text-ink-muted",children:T.ts.slice(11,19)}),M.jsx("span",{className:`w-10 shrink-0 select-none uppercase ${D1[T.level]??"text-ink-secondary"}`,children:T.level}),M.jsxs("span",{className:D1[T.level]??"text-ink-secondary",children:[T.module&&M.jsxs("span",{className:"text-ink-muted",children:["[",T.module.replace(/^Doc2Vec:?/,"")||"main","] "]}),T.message]})]},T.seq))]})]})}function l1e(){const{id:e}=Jw(),t=Number(e),n=io(),r=kv(),{data:i,error:a}=Fi({queryKey:["runs",t],queryFn:()=>qt.run(t),refetchInterval:f=>f.state.data&&["queued","running"].includes(f.state.data.status)?3e3:!1}),l=Uu({mutationFn:()=>qt.cancelRun(t),onSettled:()=>n.invalidateQueries({queryKey:["runs",t]})});if(a)return M.jsx("p",{className:"text-critical",children:a.message});if(!i)return M.jsx("p",{className:"text-ink-muted",children:"Loading…"});const s=i.status==="queued"||i.status==="running",c=i.stats?.sources??[];return M.jsxs("div",{className:"space-y-6",children:[M.jsxs("div",{children:[M.jsxs(gi,{to:`/configs/${i.config_id}`,className:"text-sm text-ink-muted hover:text-accent",children:["← ",i.config_name??`Config ${i.config_id}`]}),M.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[M.jsxs("h1",{className:"text-xl font-semibold tracking-tight",children:["Run #",i.id]}),M.jsx(Tv,{status:i.status}),s&&M.jsx("button",{onClick:()=>l.mutate(),disabled:l.isPending,className:"ml-auto rounded-md border border-critical/40 px-3.5 py-1.5 text-sm font-medium text-critical transition hover:bg-critical/10 disabled:opacity-40",children:"Cancel run"})]}),i.error&&M.jsx("p",{className:"mt-2 text-sm text-critical",children:i.error}),l.error&&M.jsx("p",{className:"mt-2 text-sm text-critical",children:l.error.message}),M.jsx("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[["Trigger",i.trigger],["Queued",Ua(i.queued_at)],["Started",Ua(i.started_at)],["Duration",s?"…":lO(i.started_at,i.finished_at)],["Exit code",i.exit_code===null?"—":String(i.exit_code)],["Warnings",String(i.stats?.warn_count??0)],["Errors",String(i.stats?.error_count??0)]].map(([f,d])=>M.jsxs("div",{children:[M.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:f}),M.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:d})]},f))})]}),c.length>0&&M.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge bg-surface",children:M.jsxs("table",{className:"w-full text-sm",children:[M.jsx("thead",{children:M.jsxs("tr",{className:"border-b border-edge text-left text-xs uppercase tracking-wide text-ink-muted",children:[M.jsx("th",{className:"px-4 py-2 font-medium",children:"Source"}),M.jsx("th",{className:"px-4 py-2 font-medium",children:"Type"}),M.jsx("th",{className:"px-4 py-2 font-medium",children:"Version"}),M.jsx("th",{className:"px-4 py-2 font-medium",children:"Duration"}),M.jsx("th",{className:"px-4 py-2 font-medium",children:"Changes"}),M.jsx("th",{className:"px-4 py-2 font-medium",children:"Result"}),M.jsx("th",{className:"px-4 py-2"})]})}),M.jsx("tbody",{children:c.map((f,d)=>M.jsxs("tr",{onClick:()=>r(`/runs/${i.id}/sources/${d}`),className:"cursor-pointer border-b border-edge/60 transition last:border-0 hover:bg-edge/20",children:[M.jsx("td",{className:"px-4 py-2 font-medium",children:f.product_name}),M.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:f.type}),M.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:f.version}),M.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:Hu(f.duration_ms/1e3)}),M.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:f.counters?M.jsxs("span",{className:"whitespace-nowrap tabular-nums",children:[M.jsxs("span",{className:f.counters.items_new>0?"text-good-text":"",children:["+",f.counters.items_new]})," ",M.jsxs("span",{children:["~",f.counters.items_updated]})," ",M.jsxs("span",{className:f.counters.items_deleted>0?"text-critical":"",children:["−",f.counters.items_deleted]}),M.jsx("span",{className:"ml-1 text-xs text-ink-muted",children:f.counters.items_kind})]}):"—"}),M.jsx("td",{className:"px-4 py-2",children:f.ok?M.jsx("span",{className:"text-good-text",children:"✓ ok"}):M.jsxs("span",{className:"text-critical",title:f.error,children:["✕ ",f.error??"failed"]})}),M.jsx("td",{className:"px-4 py-2 text-ink-muted",children:"›"})]},`${f.product_name}-${f.type}-${d}`))})]})}),M.jsxs("div",{children:[M.jsx("h2",{className:"mb-2 text-sm font-semibold text-ink-secondary",children:"Logs"}),M.jsx(a1e,{runId:t,isActive:s})]})]})}function o1e(e){const t=e.items_kind||"items";return[{label:`New ${t}`,value:e.items_new,tone:"good"},{label:`Updated ${t}`,value:e.items_updated},{label:`Unchanged ${t}`,value:e.items_unchanged},{label:`Deleted ${t}`,value:e.items_deleted,tone:"bad"},{label:"Chunks added",value:e.chunks_added,tone:"good"},{label:"Chunks deleted",value:e.chunks_deleted,tone:"bad"}]}const s1e={chunk_id:"asc",position:"asc",section:"asc",size:"desc"};function u1e(e,t,n,r){const i=r==="asc"?1:-1;switch(n){case"chunk_id":return e.chunk_id.localeCompare(t.chunk_id)*i;case"position":return((e.chunk_index??Number.MAX_SAFE_INTEGER)-(t.chunk_index??Number.MAX_SAFE_INTEGER))*i;case"section":return(e.section??"").localeCompare(t.section??"")*i;case"size":return(e.content.length-t.content.length)*i}}function Tm({label:e,sortKey:t,sort:n,onSort:r,align:i="left"}){const a=n.key===t;return M.jsx("th",{className:`px-4 py-2 font-medium ${i==="right"?"text-right":"text-left"}`,children:M.jsxs("button",{type:"button",onClick:()=>r(t),className:`inline-flex items-center gap-1 uppercase tracking-wide transition hover:text-accent ${a?"text-accent":""}`,title:`Sort by ${e.toLowerCase()}`,children:[e,M.jsx("span",{className:a?"":"opacity-30",children:a?n.dir==="asc"?"▲":"▼":"↕"})]})})}function c1e({chunk:e}){const[t,n]=O.useState(!1);return M.jsxs(M.Fragment,{children:[M.jsxs("tr",{onClick:()=>n(r=>!r),className:"cursor-pointer border-b border-edge/60 transition last:border-0 hover:bg-edge/20",children:[M.jsxs("td",{className:"px-4 py-2 font-mono text-xs text-ink-secondary",title:e.chunk_id,children:[e.chunk_id.slice(0,10),"…"]}),M.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:e.chunk_index!==null&&e.total_chunks!==null?`${e.chunk_index+1} / ${e.total_chunks}`:"—"}),M.jsx("td",{className:"max-w-xs truncate px-4 py-2 text-ink-secondary",title:e.section??void 0,children:e.section||"—"}),M.jsxs("td",{className:"px-4 py-2 text-right text-ink-muted",children:[e.content.length.toLocaleString()," chars"]}),M.jsx("td",{className:"px-4 py-2 text-ink-muted",children:t?"▾":"▸"})]}),t&&M.jsx("tr",{className:"border-b border-edge/60 last:border-0",children:M.jsxs("td",{colSpan:5,className:"bg-edge/10 px-4 py-3",children:[M.jsxs("dl",{className:"mb-3 flex flex-wrap gap-x-8 gap-y-1 text-xs",children:[M.jsxs("div",{children:[M.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Chunk ID"}),M.jsx("dd",{className:"mt-0.5 font-mono text-ink-secondary",children:e.chunk_id})]}),e.hash&&M.jsxs("div",{children:[M.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Content hash"}),M.jsx("dd",{className:"mt-0.5 font-mono text-ink-secondary",children:e.hash})]}),e.created_at&&M.jsxs("div",{children:[M.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Created / Updated"}),M.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:Ua(e.created_at)})]}),e.heading_hierarchy.length>0&&M.jsxs("div",{children:[M.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Headings"}),M.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:e.heading_hierarchy.join(" › ")})]}),e.product_name&&M.jsxs("div",{children:[M.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Product"}),M.jsxs("dd",{className:"mt-0.5 text-ink-secondary",children:[e.product_name,e.version?` @ ${e.version}`:""]})]})]}),M.jsx("pre",{className:"max-h-96 overflow-auto whitespace-pre-wrap rounded-md border border-edge bg-surface p-3 text-xs text-ink-secondary",children:e.content})]})})]})}function f1e(){const{id:e,sourceIndex:t}=Jw(),n=Number(e),r=Number(t),{data:i,error:a}=Fi({queryKey:["runs",n],queryFn:()=>qt.run(n)}),[l,s]=O.useState(""),[c,f]=O.useState(null),[d,p]=O.useState({key:"position",dir:"asc"}),g=k=>p(P=>P.key===k?{key:k,dir:P.dir==="asc"?"desc":"asc"}:{key:k,dir:s1e[k]}),v=i?.stats?.sources?.[r],y=Fi({queryKey:["chunks",i?.config_id,v?.product_name,v?.version,c],queryFn:()=>qt.chunksForUrl(i.config_id,{product_name:v.product_name,type:v.type,version:v.version,url:c}),enabled:i!==void 0&&v!==void 0&&c!==null,retry:!1}),x=O.useMemo(()=>y.data?[...y.data.chunks].sort((k,P)=>u1e(k,P,d.key,d.dir)):[],[y.data,d]),w=O.useMemo(()=>{const k=(y.data?.chunks??[]).map(P=>P.created_at).filter(P=>!!P);return k.length>0?k.reduce((P,T)=>P>T?P:T):null},[y.data]);if(a)return M.jsx("p",{className:"text-critical",children:a.message});if(!i)return M.jsx("p",{className:"text-ink-muted",children:"Loading…"});if(!v)return M.jsxs("div",{className:"space-y-2",children:[M.jsxs(gi,{to:`/runs/${n}`,className:"text-sm text-ink-muted hover:text-accent",children:["← Run #",n]}),M.jsx("p",{className:"text-ink-muted",children:"No per-source stats were recorded for this source in this run."})]});const A=v.counters,C=k=>{k.preventDefault();const P=l.trim();P&&f(P)};return M.jsxs("div",{className:"space-y-6",children:[M.jsxs("div",{children:[M.jsxs(gi,{to:`/runs/${n}`,className:"text-sm text-ink-muted hover:text-accent",children:["← Run #",n]}),M.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[M.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:v.product_name}),M.jsx(Tv,{status:i.status}),v.ok?M.jsx("span",{className:"text-sm text-good-text",children:"✓ ok"}):M.jsxs("span",{className:"text-sm text-critical",children:["✕ ",v.error??"failed"]})]}),M.jsx("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[["Type",v.type],["Version",v.version],["Duration",Hu(v.duration_ms/1e3)],["Run started",Ua(i.started_at)]].map(([k,P])=>M.jsxs("div",{children:[M.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:k}),M.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:P})]},k))})]}),M.jsxs("div",{children:[M.jsx("h2",{className:"mb-2 text-sm font-semibold text-ink-secondary",children:"Changes in this run"}),A?M.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:o1e(A).map(k=>M.jsxs("div",{className:"rounded-lg border border-edge bg-surface px-4 py-3",children:[M.jsx("div",{className:`text-2xl font-semibold tabular-nums ${k.value===0?"text-ink-muted":k.tone==="good"?"text-good-text":k.tone==="bad"?"text-critical":""}`,children:k.value.toLocaleString()}),M.jsx("div",{className:"mt-1 text-xs uppercase tracking-wide text-ink-muted",children:k.label})]},k.label))}):M.jsx("p",{className:"text-sm text-ink-muted",children:"This run predates detailed source statistics — trigger a new run to collect them."})]}),M.jsxs("div",{children:[M.jsx("h2",{className:"mb-2 text-sm font-semibold text-ink-secondary",children:"Chunk lookup"}),M.jsx("p",{className:"mb-2 text-xs text-ink-muted",children:"Shows the chunks currently stored in this source's vector database for a URL (live view, ordered by position — click a column heading to sort)."}),M.jsxs("form",{onSubmit:C,className:"flex gap-2",children:[M.jsx("input",{type:"text",value:l,onChange:k=>s(k.target.value),placeholder:"https://…",className:"w-full max-w-2xl rounded-md border border-edge bg-surface px-3 py-1.5 text-sm outline-none focus:border-accent"}),M.jsx("button",{type:"submit",disabled:!l.trim()||y.isFetching,className:"rounded-md border border-edge px-3.5 py-1.5 text-sm font-medium transition hover:border-accent hover:text-accent disabled:opacity-40",children:y.isFetching?"Looking up…":"Look up"})]}),y.error&&M.jsx("p",{className:"mt-3 text-sm text-critical",children:y.error.message}),y.data&&M.jsxs("div",{className:"mt-4 space-y-3",children:[M.jsxs("dl",{className:"flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[M.jsxs("div",{children:[M.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Chunks"}),M.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:y.data.chunks.length})]}),y.data.chunks.length>0&&M.jsxs("div",{children:[M.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Created / Updated"}),M.jsx("dd",{className:"mt-0.5 text-ink-secondary",title:w??"No date recorded: these chunks were stored before dates were tracked. A date is set when the page content changes and its chunks are recreated.",children:w?Ua(w):"unknown (synced before dates were recorded)"})]}),M.jsxs("div",{children:[M.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Store"}),M.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:y.data.database.type==="qdrant"?`Qdrant collection '${y.data.database.collection}'`:`SQLite ${y.data.database.path}`})]})]}),y.data.chunks.length>0&&M.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge bg-surface",children:M.jsxs("table",{className:"w-full text-sm",children:[M.jsx("thead",{children:M.jsxs("tr",{className:"border-b border-edge text-xs text-ink-muted",children:[M.jsx(Tm,{label:"Chunk",sortKey:"chunk_id",sort:d,onSort:g}),M.jsx(Tm,{label:"Position",sortKey:"position",sort:d,onSort:g}),M.jsx(Tm,{label:"Section",sortKey:"section",sort:d,onSort:g}),M.jsx(Tm,{label:"Size",sortKey:"size",sort:d,onSort:g,align:"right"}),M.jsx("th",{className:"px-4 py-2"})]})}),M.jsx("tbody",{children:x.map(k=>M.jsx(c1e,{chunk:k},k.chunk_id))})]})})]})]})]})}function h1e(){const e=io(),{data:t}=Fi({queryKey:["health"],queryFn:qt.health});return O.useEffect(()=>{const n=new EventSource("/api/events"),r=()=>{e.invalidateQueries({queryKey:["configs"]}),e.invalidateQueries({queryKey:["runs"]})};return n.addEventListener("run:update",r),n.addEventListener("config:update",r),()=>n.close()},[e]),M.jsxs("div",{className:"min-h-screen",children:[M.jsx("header",{className:"border-b border-edge bg-surface",children:M.jsxs("div",{className:"mx-auto flex max-w-6xl items-center gap-3 px-6 py-4",children:[M.jsxs(gi,{to:"/",className:"flex items-center gap-2 text-lg font-semibold tracking-tight",children:[M.jsx("span",{"aria-hidden":!0,children:"📚"})," doc2vec"]}),M.jsx("span",{className:"text-sm text-ink-muted",children:"controller"}),M.jsx("div",{className:"ml-auto flex items-center gap-3 text-sm",children:t&&M.jsxs(M.Fragment,{children:[M.jsx("span",{className:"rounded-full border border-edge px-2.5 py-0.5 text-xs font-medium text-ink-secondary",title:t.mode==="rw"?"Configs can be created and edited from this UI":"Configs are managed from files only",children:t.mode==="rw"?"read-write":"read-only"}),M.jsxs("span",{className:"text-ink-muted",children:["v",t.version]})]})})]})}),M.jsx("main",{className:"mx-auto max-w-6xl px-6 py-8",children:M.jsxs(eq,{children:[M.jsx(If,{path:"/",element:M.jsx(x7,{})}),M.jsx(If,{path:"/configs/:id",element:M.jsx(r1e,{})}),M.jsx(If,{path:"/runs/:id",element:M.jsx(l1e,{})}),M.jsx(If,{path:"/runs/:id/sources/:sourceIndex",element:M.jsx(f1e,{})})]})})]})}const d1e=new F9({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:5e3}}});v9.createRoot(document.getElementById("root")).render(M.jsx(Qj.StrictMode,{children:M.jsx(q9,{client:d1e,children:M.jsx(Aq,{children:M.jsx(h1e,{})})})}));