doc2vec 2.17.0 → 2.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/assets/index-ByuMPqOM.js +132 -0
- package/dist/ui/index.html +1 -1
- package/package.json +14 -9
- package/dist/ui/assets/index-HvEXxtAr.js +0 -126
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
function h9(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 yv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qb={exports:{}},yf={};var L2;function d9(){if(L2)return yf;L2=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 j2;function p9(){return j2||(j2=1,Qb.exports=d9()),Qb.exports}var T=p9(),Xb={exports:{}},_e={};var I2;function m9(){if(I2)return _e;I2=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,F,ee){this.props=R,this.context=F,this.refs=w,this.updater=ee||y}A.prototype.isReactComponent={},A.prototype.setState=function(R,F){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,F,"setState")},A.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function C(){}C.prototype=A.prototype;function k(R,F,ee){this.props=R,this.context=F,this.refs=w,this.updater=ee||y}var M=k.prototype=new C;M.constructor=k,x(M,A.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function P(){}var N={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function U(R,F,ee){var se=ee.ref;return{$$typeof:e,type:R,key:F,ref:se!==void 0?se:null,props:ee}}function V(R,F){return U(R.type,F,R.props)}function K(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function B(R){var F={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(ee){return F[ee]})}var oe=/\/+/g;function ie(R,F){return typeof R=="object"&&R!==null&&R.key!=null?B(""+R.key):F.toString(36)}function ue(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(P,P):(R.status="pending",R.then(function(F){R.status==="pending"&&(R.status="fulfilled",R.value=F)},function(F){R.status==="pending"&&(R.status="rejected",R.reason=F)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function z(R,F,ee,se,ge){var Oe=typeof R;(Oe==="undefined"||Oe==="boolean")&&(R=null);var Pe=!1;if(R===null)Pe=!0;else switch(Oe){case"bigint":case"string":case"number":Pe=!0;break;case"object":switch(R.$$typeof){case e:case t:Pe=!0;break;case d:return Pe=R._init,z(Pe(R._payload),F,ee,se,ge)}}if(Pe)return ge=ge(R),Pe=se===""?"."+ie(R,0):se,D(ge)?(ee="",Pe!=null&&(ee=Pe.replace(oe,"$&/")+"/"),z(ge,F,ee,"",function(Te){return Te})):ge!=null&&(K(ge)&&(ge=V(ge,ee+(ge.key==null||R&&R.key===ge.key?"":(""+ge.key).replace(oe,"$&/")+"/")+Pe)),F.push(ge)),1;Pe=0;var gt=se===""?".":se+":";if(D(R))for(var ce=0;ce<R.length;ce++)se=R[ce],Oe=gt+ie(se,ce),Pe+=z(se,F,ee,Oe,ge);else if(ce=v(R),typeof ce=="function")for(R=ce.call(R),ce=0;!(se=R.next()).done;)se=se.value,Oe=gt+ie(se,ce++),Pe+=z(se,F,ee,Oe,ge);else if(Oe==="object"){if(typeof R.then=="function")return z(ue(R),F,ee,se,ge);throw F=String(R),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Pe}function Z(R,F,ee){if(R==null)return R;var se=[],ge=0;return z(R,se,"","",function(Oe){return F.call(ee,Oe,ge++)}),se}function ae(R){if(R._status===-1){var F=R._result;F=F(),F.then(function(ee){(R._status===0||R._status===-1)&&(R._status=1,R._result=ee)},function(ee){(R._status===0||R._status===-1)&&(R._status=2,R._result=ee)}),R._status===-1&&(R._status=0,R._result=F)}if(R._status===1)return R._result.default;throw R._result}var Q=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=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(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},le={map:Z,forEach:function(R,F,ee){Z(R,function(){F.apply(this,arguments)},ee)},count:function(R){var F=0;return Z(R,function(){F++}),F},toArray:function(R){return Z(R,function(F){return F})||[]},only:function(R){if(!K(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return _e.Activity=p,_e.Children=le,_e.Component=A,_e.Fragment=n,_e.Profiler=i,_e.PureComponent=k,_e.StrictMode=r,_e.Suspense=c,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,_e.__COMPILER_RUNTIME={__proto__:null,c:function(R){return N.H.useMemoCache(R)}},_e.cache=function(R){return function(){return R.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(R,F,ee){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var se=x({},R.props),ge=R.key;if(F!=null)for(Oe in F.key!==void 0&&(ge=""+F.key),F)!j.call(F,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&F.ref===void 0||(se[Oe]=F[Oe]);var Oe=arguments.length-2;if(Oe===1)se.children=ee;else if(1<Oe){for(var Pe=Array(Oe),gt=0;gt<Oe;gt++)Pe[gt]=arguments[gt+2];se.children=Pe}return U(R.type,ge,se)},_e.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},_e.createElement=function(R,F,ee){var se,ge={},Oe=null;if(F!=null)for(se in F.key!==void 0&&(Oe=""+F.key),F)j.call(F,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ge[se]=F[se]);var Pe=arguments.length-2;if(Pe===1)ge.children=ee;else if(1<Pe){for(var gt=Array(Pe),ce=0;ce<Pe;ce++)gt[ce]=arguments[ce+2];ge.children=gt}if(R&&R.defaultProps)for(se in Pe=R.defaultProps,Pe)ge[se]===void 0&&(ge[se]=Pe[se]);return U(R,Oe,ge)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(R){return{$$typeof:s,render:R}},_e.isValidElement=K,_e.lazy=function(R){return{$$typeof:d,_payload:{_status:-1,_result:R},_init:ae}},_e.memo=function(R,F){return{$$typeof:f,type:R,compare:F===void 0?null:F}},_e.startTransition=function(R){var F=N.T,ee={};N.T=ee;try{var se=R(),ge=N.S;ge!==null&&ge(ee,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(P,Q)}catch(Oe){Q(Oe)}finally{F!==null&&ee.types!==null&&(F.types=ee.types),N.T=F}},_e.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},_e.use=function(R){return N.H.use(R)},_e.useActionState=function(R,F,ee){return N.H.useActionState(R,F,ee)},_e.useCallback=function(R,F){return N.H.useCallback(R,F)},_e.useContext=function(R){return N.H.useContext(R)},_e.useDebugValue=function(){},_e.useDeferredValue=function(R,F){return N.H.useDeferredValue(R,F)},_e.useEffect=function(R,F){return N.H.useEffect(R,F)},_e.useEffectEvent=function(R){return N.H.useEffectEvent(R)},_e.useId=function(){return N.H.useId()},_e.useImperativeHandle=function(R,F,ee){return N.H.useImperativeHandle(R,F,ee)},_e.useInsertionEffect=function(R,F){return N.H.useInsertionEffect(R,F)},_e.useLayoutEffect=function(R,F){return N.H.useLayoutEffect(R,F)},_e.useMemo=function(R,F){return N.H.useMemo(R,F)},_e.useOptimistic=function(R,F){return N.H.useOptimistic(R,F)},_e.useReducer=function(R,F,ee){return N.H.useReducer(R,F,ee)},_e.useRef=function(R){return N.H.useRef(R)},_e.useState=function(R){return N.H.useState(R)},_e.useSyncExternalStore=function(R,F,ee){return N.H.useSyncExternalStore(R,F,ee)},_e.useTransition=function(){return N.H.useTransition()},_e.version="19.2.7",_e}var B2;function ac(){return B2||(B2=1,Xb.exports=m9()),Xb.exports}var O=ac();const KL=yv(O),g9=h9({__proto__:null,default:KL},[O]);var Yb={exports:{}},bf={},Gb={exports:{}},Zb={};var z2;function v9(){return z2||(z2=1,(function(e){function t(z,Z){var ae=z.length;z.push(Z);e:for(;0<ae;){var Q=ae-1>>>1,le=z[Q];if(0<i(le,Z))z[Q]=Z,z[ae]=le,ae=Q;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var Z=z[0],ae=z.pop();if(ae!==Z){z[0]=ae;e:for(var Q=0,le=z.length,R=le>>>1;Q<R;){var F=2*(Q+1)-1,ee=z[F],se=F+1,ge=z[se];if(0>i(ee,ae))se<le&&0>i(ge,ee)?(z[Q]=ge,z[se]=ae,Q=se):(z[Q]=ee,z[F]=ae,Q=F);else if(se<le&&0>i(ge,ae))z[Q]=ge,z[se]=ae,Q=se;else break e}}return Z}function i(z,Z){var ae=z.sortIndex-Z.sortIndex;return ae!==0?ae:z.id-Z.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 M(z){for(var Z=n(f);Z!==null;){if(Z.callback===null)r(f);else if(Z.startTime<=z)r(f),Z.sortIndex=Z.expirationTime,t(c,Z);else break;Z=n(f)}}function D(z){if(x=!1,M(z),!y)if(n(c)!==null)y=!0,P||(P=!0,B());else{var Z=n(f);Z!==null&&ue(D,Z.startTime-z)}}var P=!1,N=-1,j=5,U=-1;function V(){return w?!0:!(e.unstable_now()-U<j)}function K(){if(w=!1,P){var z=e.unstable_now();U=z;var Z=!0;try{e:{y=!1,x&&(x=!1,C(N),N=-1),v=!0;var ae=g;try{t:{for(M(z),p=n(c);p!==null&&!(p.expirationTime>z&&V());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,g=p.priorityLevel;var le=Q(p.expirationTime<=z);if(z=e.unstable_now(),typeof le=="function"){p.callback=le,M(z),Z=!0;break t}p===n(c)&&r(c),M(z)}else r(c);p=n(c)}if(p!==null)Z=!0;else{var R=n(f);R!==null&&ue(D,R.startTime-z),Z=!1}}break e}finally{p=null,g=ae,v=!1}Z=void 0}}finally{Z?B():P=!1}}}var B;if(typeof k=="function")B=function(){k(K)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,ie=oe.port2;oe.port1.onmessage=K,B=function(){ie.postMessage(null)}}else B=function(){A(K,0)};function ue(z,Z){N=A(function(){z(e.unstable_now())},Z)}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"):j=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 Z=3;break;default:Z=g}var ae=g;g=Z;try{return z()}finally{g=ae}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(z,Z){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ae=g;g=z;try{return Z()}finally{g=ae}},e.unstable_scheduleCallback=function(z,Z,ae){var Q=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?Q+ae:Q):ae=Q,z){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=ae+le,z={id:d++,callback:Z,priorityLevel:z,startTime:ae,expirationTime:le,sortIndex:-1},ae>Q?(z.sortIndex=ae,t(f,z),n(c)===null&&z===n(f)&&(x?(C(N),N=-1):x=!0,ue(D,ae-Q))):(z.sortIndex=le,t(c,z),y||v||(y=!0,P||(P=!0,B()))),z},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(z){var Z=g;return function(){var ae=g;g=Z;try{return z.apply(this,arguments)}finally{g=ae}}}})(Zb)),Zb}var $2;function y9(){return $2||($2=1,Gb.exports=v9()),Gb.exports}var Jb={exports:{}},Mn={};var U2;function b9(){if(U2)return Mn;U2=1;var e=ac();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 Mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Mn.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)},Mn.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()}},Mn.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))},Mn.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Mn.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})}},Mn.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)},Mn.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})}},Mn.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)},Mn.requestFormReset=function(c){r.d.r(c)},Mn.unstable_batchedUpdates=function(c,f){return c(f)},Mn.useFormState=function(c,f,d){return l.H.useFormState(c,f,d)},Mn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Mn.version="19.2.7",Mn}var H2;function VL(){if(H2)return Jb.exports;H2=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(),Jb.exports=b9(),Jb.exports}var F2;function x9(){if(F2)return bf;F2=1;var e=y9(),t=ac(),n=VL();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"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function B(o){return o===null||typeof o!="object"?null:(o=K&&o[K]||o["@@iterator"],typeof o=="function"?o:null)}var oe=Symbol.for("react.client.reference");function ie(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===oe?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 D:return"Suspense";case P: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 M: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 j:u=o._payload,o=o._init;try{return ie(o(u))}catch{}}return null}var ue=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},Q=[],le=-1;function R(o){return{current:o}}function F(o){0>le||(o.current=Q[le],Q[le]=null,le--)}function ee(o,u){le++,Q[le]=o.current,o.current=u}var se=R(null),ge=R(null),Oe=R(null),Pe=R(null);function gt(o,u){switch(ee(Oe,u),ee(ge,o),ee(se,null),u.nodeType){case 9:case 11:o=(o=u.documentElement)&&(o=o.namespaceURI)?i2(o):0;break;default:if(o=u.tagName,u=u.namespaceURI)u=i2(u),o=a2(u,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}F(se),ee(se,o)}function ce(){F(se),F(ge),F(Oe)}function Te(o){o.memoizedState!==null&&ee(Pe,o);var u=se.current,h=a2(u,o.type);u!==h&&(ee(ge,o),ee(se,h))}function Ee(o){ge.current===o&&(F(se),F(ge)),Pe.current===o&&(F(Pe),pf._currentValue=ae)}var fe,Lt;function Re(o){if(fe===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);fe=u&&u[1]||"",Lt=-1<h.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+fe+o+Lt}var xe=!1;function vt(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 re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Y){var X=Y}Reflect.construct(o,[],re)}else{try{re.call()}catch(Y){X=Y}o.call(re.prototype)}}else{try{throw Error()}catch(Y){X=Y}(re=o())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Y){if(Y&&X&&typeof Y.stack=="string")return[Y.stack,X.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 L=E.split(`
|
|
4
|
+
`),q=_.split(`
|
|
5
|
+
`);for(b=m=0;m<L.length&&!L[m].includes("DetermineComponentFrameRoot");)m++;for(;b<q.length&&!q[b].includes("DetermineComponentFrameRoot");)b++;if(m===L.length||b===q.length)for(m=L.length-1,b=q.length-1;1<=m&&0<=b&&L[m]!==q[b];)b--;for(;1<=m&&0<=b;m--,b--)if(L[m]!==q[b]){if(m!==1||b!==1)do if(m--,b--,0>b||L[m]!==q[b]){var J=`
|
|
6
|
+
`+L[m].replace(" at new "," at ");return o.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",o.displayName)),J}while(1<=m&&0<=b);break}}}finally{xe=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?Re(h):""}function pn(o,u){switch(o.tag){case 26:case 27:case 5:return Re(o.type);case 16:return Re("Lazy");case 13:return o.child!==u&&u!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return vt(o.type,!1);case 11:return vt(o.type.render,!1);case 1:return vt(o.type,!0);case 31:return Re("Activity");default:return""}}function ha(o){try{var u="",h=null;do u+=pn(o,h),h=o,o=o.return;while(o);return u}catch(m){return`
|
|
7
|
+
Error generating stack: `+m.message+`
|
|
8
|
+
`+m.stack}}var Ny=Object.prototype.hasOwnProperty,Ry=e.unstable_scheduleCallback,Ly=e.unstable_cancelCallback,q6=e.unstable_shouldYield,W6=e.unstable_requestPaint,pr=e.unstable_now,K6=e.unstable_getCurrentPriorityLevel,jk=e.unstable_ImmediatePriority,Ik=e.unstable_UserBlockingPriority,pd=e.unstable_NormalPriority,V6=e.unstable_LowPriority,Bk=e.unstable_IdlePriority,Q6=e.log,X6=e.unstable_setDisableYieldValue,kc=null,mr=null;function sl(o){if(typeof Q6=="function"&&X6(o),mr&&typeof mr.setStrictMode=="function")try{mr.setStrictMode(kc,o)}catch{}}var gr=Math.clz32?Math.clz32:Z6,Y6=Math.log,G6=Math.LN2;function Z6(o){return o>>>=0,o===0?32:31-(Y6(o)/G6|0)|0}var md=256,gd=262144,vd=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 yd(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 J6(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 zk(){var o=vd;return vd<<=1,(vd&62914560)===0&&(vd=4194304),o}function jy(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 eU(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,L=o.expirationTimes,q=o.hiddenUpdates;for(h=E&~h;0<h;){var J=31-gr(h),re=1<<J;_[J]=0,L[J]=-1;var X=q[J];if(X!==null)for(q[J]=null,J=0;J<X.length;J++){var Y=X[J];Y!==null&&(Y.lane&=-536870913)}h&=~re}m!==0&&$k(o,m,0),S!==0&&b===0&&o.tag!==0&&(o.suspendedLanes|=S&~(E&~u))}function $k(o,u,h){o.pendingLanes|=u,o.suspendedLanes&=~u;var m=31-gr(u);o.entangledLanes|=u,o.entanglements[m]=o.entanglements[m]|1073741824|h&261930}function Uk(o,u){var h=o.entangledLanes|=u;for(o=o.entanglements;h;){var m=31-gr(h),b=1<<m;b&u|o[m]&u&&(o[m]|=u),h&=~b}}function Hk(o,u){var h=u&-u;return h=(h&42)!==0?1:Iy(h),(h&(o.suspendedLanes|u))!==0?0:h}function Iy(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 By(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Fk(){var o=Z.p;return o!==0?o:(o=window.event,o===void 0?32:T2(o.type))}function qk(o,u){var h=Z.p;try{return Z.p=o,u()}finally{Z.p=h}}var ul=Math.random().toString(36).slice(2),mn="__reactFiber$"+ul,Zn="__reactProps$"+ul,ws="__reactContainer$"+ul,zy="__reactEvents$"+ul,tU="__reactListeners$"+ul,nU="__reactHandles$"+ul,Wk="__reactResources$"+ul,Tc="__reactMarker$"+ul;function $y(o){delete o[mn],delete o[Zn],delete o[zy],delete o[tU],delete o[nU]}function Os(o){var u=o[mn];if(u)return u;for(var h=o.parentNode;h;){if(u=h[ws]||h[mn]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(o=h2(o);o!==null;){if(h=o[mn])return h;o=h2(o)}return u}o=h,h=o.parentNode}return null}function As(o){if(o=o[mn]||o[ws]){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 ks(o){var u=o[Wk];return u||(u=o[Wk]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function nn(o){o[Tc]=!0}var Kk=new Set,Vk={};function uo(o,u){Cs(o,u),Cs(o+"Capture",u)}function Cs(o,u){for(Vk[o]=u,o=0;o<u.length;o++)Kk.add(u[o])}var rU=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]*$"),Qk={},Xk={};function iU(o){return Ny.call(Xk,o)?!0:Ny.call(Qk,o)?!1:rU.test(o)?Xk[o]=!0:(Qk[o]=!0,!1)}function bd(o,u,h){if(iU(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 xd(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 da(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 Lr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Yk(o){var u=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function aU(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 Uy(o){if(!o._valueTracker){var u=Yk(o)?"checked":"value";o._valueTracker=aU(o,u,""+o[u])}}function Gk(o){if(!o)return!1;var u=o._valueTracker;if(!u)return!0;var h=u.getValue(),m="";return o&&(m=Yk(o)?o.checked?"true":"false":o.value),o=m,o!==h?(u.setValue(o),!0):!1}function Sd(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 lU=/[\n"\\]/g;function jr(o){return o.replace(lU,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Hy(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=""+Lr(u)):o.value!==""+Lr(u)&&(o.value=""+Lr(u)):E!=="submit"&&E!=="reset"||o.removeAttribute("value"),u!=null?Fy(o,E,Lr(u)):h!=null?Fy(o,E,Lr(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=""+Lr(_):o.removeAttribute("name")}function Zk(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)){Uy(o);return}h=h!=null?""+Lr(h):"",u=u!=null?""+Lr(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),Uy(o)}function Fy(o,u,h){u==="number"&&Sd(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function Es(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=""+Lr(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 Jk(o,u,h){if(u!=null&&(u=""+Lr(u),u!==o.value&&(o.value=u),h==null)){o.defaultValue!==u&&(o.defaultValue=u);return}o.defaultValue=h!=null?""+Lr(h):""}function eC(o,u,h,m){if(u==null){if(m!=null){if(h!=null)throw Error(r(92));if(ue(m)){if(1<m.length)throw Error(r(93));m=m[0]}h=m}h==null&&(h=""),u=h}h=Lr(u),o.defaultValue=h,m=o.textContent,m===h&&m!==""&&m!==null&&(o.value=m),Uy(o)}function Ts(o,u){if(u){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=u;return}}o.textContent=u}var oU=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 tC(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||oU.has(u)?u==="float"?o.cssFloat=h:o[u]=(""+h).trim():o[u]=h+"px"}function nC(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&&tC(o,b,m)}else for(var S in u)u.hasOwnProperty(S)&&tC(o,S,u[S])}function qy(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 sU=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"]]),uU=/^[\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 wd(o){return uU.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function pa(){}var Wy=null;function Ky(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Ms=null,Ps=null;function rC(o){var u=As(o);if(u&&(o=u.stateNode)){var h=o[Zn]||null;e:switch(o=u.stateNode,u.type){case"input":if(Hy(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[Zn]||null;if(!b)throw Error(r(90));Hy(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&&Gk(m)}break e;case"textarea":Jk(o,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&Es(o,!!h.multiple,u,!1)}}}var Vy=!1;function iC(o,u,h){if(Vy)return o(u,h);Vy=!0;try{var m=o(u);return m}finally{if(Vy=!1,(Ms!==null||Ps!==null)&&(up(),Ms&&(u=Ms,o=Ps,Ps=Ms=null,rC(u),o)))for(u=0;u<o.length;u++)rC(o[u])}}function Pc(o,u){var h=o.stateNode;if(h===null)return null;var m=h[Zn]||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 ma=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qy=!1;if(ma)try{var Dc={};Object.defineProperty(Dc,"passive",{get:function(){Qy=!0}}),window.addEventListener("test",Dc,Dc),window.removeEventListener("test",Dc,Dc)}catch{Qy=!1}var cl=null,Xy=null,Od=null;function aC(){if(Od)return Od;var o,u=Xy,h=u.length,m,b="value"in cl?cl.value:cl.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 Od=b.slice(o,1<m?1-m:void 0)}function Ad(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 kd(){return!0}function lC(){return!1}function Jn(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)?kd:lC,this.isPropagationStopped=lC,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=kd)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=kd)},persist:function(){},isPersistent:kd}),u}var co={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cd=Jn(co),_c=p({},co,{view:0,detail:0}),cU=Jn(_c),Yy,Gy,Nc,Ed=p({},_c,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jy,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"?(Yy=o.screenX-Nc.screenX,Gy=o.screenY-Nc.screenY):Gy=Yy=0,Nc=o),Yy)},movementY:function(o){return"movementY"in o?o.movementY:Gy}}),oC=Jn(Ed),fU=p({},Ed,{dataTransfer:0}),hU=Jn(fU),dU=p({},_c,{relatedTarget:0}),Zy=Jn(dU),pU=p({},co,{animationName:0,elapsedTime:0,pseudoElement:0}),mU=Jn(pU),gU=p({},co,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),vU=Jn(gU),yU=p({},co,{data:0}),sC=Jn(yU),bU={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xU={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"},SU={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wU(o){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(o):(o=SU[o])?!!u[o]:!1}function Jy(){return wU}var OU=p({},_c,{key:function(o){if(o.key){var u=bU[o.key]||o.key;if(u!=="Unidentified")return u}return o.type==="keypress"?(o=Ad(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?xU[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jy,charCode:function(o){return o.type==="keypress"?Ad(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Ad(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),AU=Jn(OU),kU=p({},Ed,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uC=Jn(kU),CU=p({},_c,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jy}),EU=Jn(CU),TU=p({},co,{propertyName:0,elapsedTime:0,pseudoElement:0}),MU=Jn(TU),PU=p({},Ed,{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}),DU=Jn(PU),_U=p({},co,{newState:0,oldState:0}),NU=Jn(_U),RU=[9,13,27,32],e0=ma&&"CompositionEvent"in window,Rc=null;ma&&"documentMode"in document&&(Rc=document.documentMode);var LU=ma&&"TextEvent"in window&&!Rc,cC=ma&&(!e0||Rc&&8<Rc&&11>=Rc),fC=" ",hC=!1;function dC(o,u){switch(o){case"keyup":return RU.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pC(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ds=!1;function jU(o,u){switch(o){case"compositionend":return pC(u);case"keypress":return u.which!==32?null:(hC=!0,fC);case"textInput":return o=u.data,o===fC&&hC?null:o;default:return null}}function IU(o,u){if(Ds)return o==="compositionend"||!e0&&dC(o,u)?(o=aC(),Od=Xy=cl=null,Ds=!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 cC&&u.locale!=="ko"?null:u.data;default:return null}}var BU={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 mC(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u==="input"?!!BU[o.type]:u==="textarea"}function gC(o,u,h,m){Ms?Ps?Ps.push(m):Ps=[m]:Ms=m,u=gp(u,"onChange"),0<u.length&&(h=new Cd("onChange","change",null,h,m),o.push({event:h,listeners:u}))}var Lc=null,jc=null;function zU(o){ZT(o,0)}function Td(o){var u=Mc(o);if(Gk(u))return o}function vC(o,u){if(o==="change")return u}var yC=!1;if(ma){var t0;if(ma){var n0="oninput"in document;if(!n0){var bC=document.createElement("div");bC.setAttribute("oninput","return;"),n0=typeof bC.oninput=="function"}t0=n0}else t0=!1;yC=t0&&(!document.documentMode||9<document.documentMode)}function xC(){Lc&&(Lc.detachEvent("onpropertychange",SC),jc=Lc=null)}function SC(o){if(o.propertyName==="value"&&Td(jc)){var u=[];gC(u,jc,o,Ky(o)),iC(zU,u)}}function $U(o,u,h){o==="focusin"?(xC(),Lc=u,jc=h,Lc.attachEvent("onpropertychange",SC)):o==="focusout"&&xC()}function UU(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Td(jc)}function HU(o,u){if(o==="click")return Td(u)}function FU(o,u){if(o==="input"||o==="change")return Td(u)}function qU(o,u){return o===u&&(o!==0||1/o===1/u)||o!==o&&u!==u}var vr=typeof Object.is=="function"?Object.is:qU;function Ic(o,u){if(vr(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(!Ny.call(u,b)||!vr(o[b],u[b]))return!1}return!0}function wC(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function OC(o,u){var h=wC(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=wC(h)}}function AC(o,u){return o&&u?o===u?!0:o&&o.nodeType===3?!1:u&&u.nodeType===3?AC(o,u.parentNode):"contains"in o?o.contains(u):o.compareDocumentPosition?!!(o.compareDocumentPosition(u)&16):!1:!1}function kC(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var u=Sd(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=Sd(o.document)}return u}function r0(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 WU=ma&&"documentMode"in document&&11>=document.documentMode,_s=null,i0=null,Bc=null,a0=!1;function CC(o,u,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;a0||_s==null||_s!==Sd(m)||(m=_s,"selectionStart"in m&&r0(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&&Ic(Bc,m)||(Bc=m,m=gp(i0,"onSelect"),0<m.length&&(u=new Cd("onSelect","select",null,u,h),o.push({event:u,listeners:m}),u.target=_s)))}function fo(o,u){var h={};return h[o.toLowerCase()]=u.toLowerCase(),h["Webkit"+o]="webkit"+u,h["Moz"+o]="moz"+u,h}var Ns={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")},l0={},EC={};ma&&(EC=document.createElement("div").style,"AnimationEvent"in window||(delete Ns.animationend.animation,delete Ns.animationiteration.animation,delete Ns.animationstart.animation),"TransitionEvent"in window||delete Ns.transitionend.transition);function ho(o){if(l0[o])return l0[o];if(!Ns[o])return o;var u=Ns[o],h;for(h in u)if(u.hasOwnProperty(h)&&h in EC)return l0[o]=u[h];return o}var TC=ho("animationend"),MC=ho("animationiteration"),PC=ho("animationstart"),KU=ho("transitionrun"),VU=ho("transitionstart"),QU=ho("transitioncancel"),DC=ho("transitionend"),_C=new Map,o0="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(" ");o0.push("scrollEnd");function si(o,u){_C.set(o,u),uo(u,[o])}var Md=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=[],Rs=0,s0=0;function Pd(){for(var o=Rs,u=s0=Rs=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&&NC(h,b,S)}}function Dd(o,u,h,m){Ir[Rs++]=o,Ir[Rs++]=u,Ir[Rs++]=h,Ir[Rs++]=m,s0|=m,o.lanes|=m,o=o.alternate,o!==null&&(o.lanes|=m)}function u0(o,u,h,m){return Dd(o,u,h,m),_d(o)}function po(o,u){return Dd(o,null,null,u),_d(o)}function NC(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-gr(h),o=S.hiddenUpdates,m=o[b],m===null?o[b]=[u]:m.push(u),u.lane=h|536870912),S):null}function _d(o){if(50<of)throw of=0,yb=null,Error(r(185));for(var u=o.return;u!==null;)o=u,u=o.return;return o.tag===3?o.stateNode:null}var Ls={};function XU(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 yr(o,u,h,m){return new XU(o,u,h,m)}function c0(o){return o=o.prototype,!(!o||!o.isReactComponent)}function ga(o,u){var h=o.alternate;return h===null?(h=yr(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 RC(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 Nd(o,u,h,m,b,S){var E=0;if(m=o,typeof o=="function")c0(o)&&(E=1);else if(typeof o=="string")E=e9(o,h,se.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case U:return o=yr(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=yr(12,h,u,b|2),o.elementType=A,o.lanes=S,o;case D:return o=yr(13,h,u,b),o.elementType=D,o.lanes=S,o;case P:return o=yr(19,h,u,b),o.elementType=P,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 M:E=11;break e;case N:E=14;break e;case j:E=16,m=null;break e}E=29,h=Error(r(130,o===null?"null":typeof o,"")),m=null}return u=yr(E,h,u,b),u.elementType=o,u.type=m,u.lanes=S,u}function mo(o,u,h,m){return o=yr(7,o,m,u),o.lanes=h,o}function f0(o,u,h){return o=yr(6,o,null,u),o.lanes=h,o}function LC(o){var u=yr(18,null,null,0);return u.stateNode=o,u}function h0(o,u,h){return u=yr(4,o.children!==null?o.children:[],o.key,u),u.lanes=h,u.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},u}var jC=new WeakMap;function Br(o,u){if(typeof o=="object"&&o!==null){var h=jC.get(o);return h!==void 0?h:(u={value:o,source:u,stack:ha(u)},jC.set(o,u),u)}return{value:o,source:u,stack:ha(u)}}var js=[],Is=0,Rd=null,zc=0,zr=[],$r=0,fl=null,Mi=1,Pi="";function va(o,u){js[Is++]=zc,js[Is++]=Rd,Rd=o,zc=u}function IC(o,u,h){zr[$r++]=Mi,zr[$r++]=Pi,zr[$r++]=fl,fl=o;var m=Mi;o=Pi;var b=32-gr(m)-1;m&=~(1<<b),h+=1;var S=32-gr(u)+b;if(30<S){var E=b-b%5;S=(m&(1<<E)-1).toString(32),m>>=E,b-=E,Mi=1<<32-gr(u)+b|h<<b|m,Pi=S+o}else Mi=1<<S|h<<b|m,Pi=o}function d0(o){o.return!==null&&(va(o,1),IC(o,1,0))}function p0(o){for(;o===Rd;)Rd=js[--Is],js[Is]=null,zc=js[--Is],js[Is]=null;for(;o===fl;)fl=zr[--$r],zr[$r]=null,Pi=zr[--$r],zr[$r]=null,Mi=zr[--$r],zr[$r]=null}function BC(o,u){zr[$r++]=Mi,zr[$r++]=Pi,zr[$r++]=fl,Mi=u.id,Pi=u.overflow,fl=o}var gn=null,yt=null,Fe=!1,hl=null,Ur=!1,m0=Error(r(519));function dl(o){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw $c(Br(u,o)),m0}function zC(o){var u=o.stateNode,h=o.type,m=o.memoizedProps;switch(u[mn]=o,u[Zn]=m,h){case"dialog":ze("cancel",u),ze("close",u);break;case"iframe":case"object":case"embed":ze("load",u);break;case"video":case"audio":for(h=0;h<uf.length;h++)ze(uf[h],u);break;case"source":ze("error",u);break;case"img":case"image":case"link":ze("error",u),ze("load",u);break;case"details":ze("toggle",u);break;case"input":ze("invalid",u),Zk(u,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":ze("invalid",u);break;case"textarea":ze("invalid",u),eC(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||n2(u.textContent,h)?(m.popover!=null&&(ze("beforetoggle",u),ze("toggle",u)),m.onScroll!=null&&ze("scroll",u),m.onScrollEnd!=null&&ze("scrollend",u),m.onClick!=null&&(u.onclick=pa),u=!0):u=!1,u||dl(o,!0)}function $C(o){for(gn=o.return;gn;)switch(gn.tag){case 5:case 31:case 13:Ur=!1;return;case 27:case 3:Ur=!0;return;default:gn=gn.return}}function Bs(o){if(o!==gn)return!1;if(!Fe)return $C(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")||Nb(o.type,o.memoizedProps)),h=!h),h&&yt&&dl(o),$C(o),u===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));yt=f2(o)}else if(u===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));yt=f2(o)}else u===27?(u=yt,El(o.type)?(o=Bb,Bb=null,yt=o):yt=u):yt=gn?Fr(o.stateNode.nextSibling):null;return!0}function go(){yt=gn=null,Fe=!1}function g0(){var o=hl;return o!==null&&(rr===null?rr=o:rr.push.apply(rr,o),hl=null),o}function $c(o){hl===null?hl=[o]:hl.push(o)}var v0=R(null),vo=null,ya=null;function pl(o,u,h){ee(v0,u._currentValue),u._currentValue=h}function ba(o){o._currentValue=v0.current,F(v0)}function y0(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 b0(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 L=0;L<u.length;L++)if(_.context===u[L]){S.lanes|=h,_=S.alternate,_!==null&&(_.lanes|=h),y0(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),y0(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 zs(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;vr(b.pendingProps.value,E.value)||(o!==null?o.push(_):o=[_])}}else if(b===Pe.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&&b0(u,o,h,m),u.flags|=262144}function Ld(o){for(o=o.firstContext;o!==null;){if(!vr(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function yo(o){vo=o,ya=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function vn(o){return UC(vo,o)}function jd(o,u){return vo===null&&yo(o),UC(o,u)}function UC(o,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},ya===null){if(o===null)throw Error(r(308));ya=u,o.dependencies={lanes:0,firstContext:u},o.flags|=524288}else ya=ya.next=u;return h}var YU=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()})}},GU=e.unstable_scheduleCallback,ZU=e.unstable_NormalPriority,Ut={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function x0(){return{controller:new YU,data:new Map,refCount:0}}function Uc(o){o.refCount--,o.refCount===0&&GU(ZU,function(){o.controller.abort()})}var Hc=null,S0=0,$s=0,Us=null;function JU(o,u){if(Hc===null){var h=Hc=[];S0=0,$s=Ab(),Us={status:"pending",value:void 0,then:function(m){h.push(m)}}}return S0++,u.then(HC,HC),u}function HC(){if(--S0===0&&Hc!==null){Us!==null&&(Us.status="fulfilled");var o=Hc;Hc=null,$s=0,Us=null;for(var u=0;u<o.length;u++)(0,o[u])()}}function eH(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 FC=z.S;z.S=function(o,u){CT=pr(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&JU(o,u),FC!==null&&FC(o,u)};var bo=R(null);function w0(){var o=bo.current;return o!==null?o:ct.pooledCache}function Id(o,u){u===null?ee(bo,bo.current):ee(bo,u.pool)}function qC(){var o=w0();return o===null?null:{parent:Ut._currentValue,pool:o}}var Hs=Error(r(460)),O0=Error(r(474)),Bd=Error(r(542)),zd={then:function(){}};function WC(o){return o=o.status,o==="fulfilled"||o==="rejected"}function KC(o,u,h){switch(h=o[h],h===void 0?o.push(u):h!==u&&(u.then(pa,pa),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,QC(o),o;default:if(typeof u.status=="string")u.then(pa,pa);else{if(o=ct,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,QC(o),o}throw So=u,Hs}}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,Hs):h}}var So=null;function VC(){if(So===null)throw Error(r(459));var o=So;return So=null,o}function QC(o){if(o===Hs||o===Bd)throw Error(r(483))}var Fs=null,Fc=0;function $d(o){var u=Fc;return Fc+=1,Fs===null&&(Fs=[]),KC(Fs,o,u)}function qc(o,u){u=u.props.ref,o.ref=u!==void 0?u:null}function Ud(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 XC(o){function u($,I){if(o){var H=$.deletions;H===null?($.deletions=[I],$.flags|=16):H.push(I)}}function h($,I){if(!o)return null;for(;I!==null;)u($,I),I=I.sibling;return null}function m($){for(var I=new Map;$!==null;)$.key!==null?I.set($.key,$):I.set($.index,$),$=$.sibling;return I}function b($,I){return $=ga($,I),$.index=0,$.sibling=null,$}function S($,I,H){return $.index=H,o?(H=$.alternate,H!==null?(H=H.index,H<I?($.flags|=67108866,I):H):($.flags|=67108866,I)):($.flags|=1048576,I)}function E($){return o&&$.alternate===null&&($.flags|=67108866),$}function _($,I,H,ne){return I===null||I.tag!==6?(I=f0(H,$.mode,ne),I.return=$,I):(I=b(I,H),I.return=$,I)}function L($,I,H,ne){var Ae=H.type;return Ae===x?J($,I,H.props.children,ne,H.key):I!==null&&(I.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===j&&xo(Ae)===I.type)?(I=b(I,H.props),qc(I,H),I.return=$,I):(I=Nd(H.type,H.key,H.props,null,$.mode,ne),qc(I,H),I.return=$,I)}function q($,I,H,ne){return I===null||I.tag!==4||I.stateNode.containerInfo!==H.containerInfo||I.stateNode.implementation!==H.implementation?(I=h0(H,$.mode,ne),I.return=$,I):(I=b(I,H.children||[]),I.return=$,I)}function J($,I,H,ne,Ae){return I===null||I.tag!==7?(I=mo(H,$.mode,ne,Ae),I.return=$,I):(I=b(I,H),I.return=$,I)}function re($,I,H){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=f0(""+I,$.mode,H),I.return=$,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case v:return H=Nd(I.type,I.key,I.props,null,$.mode,H),qc(H,I),H.return=$,H;case y:return I=h0(I,$.mode,H),I.return=$,I;case j:return I=xo(I),re($,I,H)}if(ue(I)||B(I))return I=mo(I,$.mode,H,null),I.return=$,I;if(typeof I.then=="function")return re($,$d(I),H);if(I.$$typeof===k)return re($,jd($,I),H);Ud($,I)}return null}function X($,I,H,ne){var Ae=I!==null?I.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Ae!==null?null:_($,I,""+H,ne);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case v:return H.key===Ae?L($,I,H,ne):null;case y:return H.key===Ae?q($,I,H,ne):null;case j:return H=xo(H),X($,I,H,ne)}if(ue(H)||B(H))return Ae!==null?null:J($,I,H,ne,null);if(typeof H.then=="function")return X($,I,$d(H),ne);if(H.$$typeof===k)return X($,I,jd($,H),ne);Ud($,H)}return null}function Y($,I,H,ne,Ae){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return $=$.get(H)||null,_(I,$,""+ne,Ae);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return $=$.get(ne.key===null?H:ne.key)||null,L(I,$,ne,Ae);case y:return $=$.get(ne.key===null?H:ne.key)||null,q(I,$,ne,Ae);case j:return ne=xo(ne),Y($,I,H,ne,Ae)}if(ue(ne)||B(ne))return $=$.get(H)||null,J(I,$,ne,Ae,null);if(typeof ne.then=="function")return Y($,I,H,$d(ne),Ae);if(ne.$$typeof===k)return Y($,I,H,jd(I,ne),Ae);Ud(I,ne)}return null}function ye($,I,H,ne){for(var Ae=null,Qe=null,Se=I,je=I=0,He=null;Se!==null&&je<H.length;je++){Se.index>je?(He=Se,Se=null):He=Se.sibling;var Xe=X($,Se,H[je],ne);if(Xe===null){Se===null&&(Se=He);break}o&&Se&&Xe.alternate===null&&u($,Se),I=S(Xe,I,je),Qe===null?Ae=Xe:Qe.sibling=Xe,Qe=Xe,Se=He}if(je===H.length)return h($,Se),Fe&&va($,je),Ae;if(Se===null){for(;je<H.length;je++)Se=re($,H[je],ne),Se!==null&&(I=S(Se,I,je),Qe===null?Ae=Se:Qe.sibling=Se,Qe=Se);return Fe&&va($,je),Ae}for(Se=m(Se);je<H.length;je++)He=Y(Se,$,je,H[je],ne),He!==null&&(o&&He.alternate!==null&&Se.delete(He.key===null?je:He.key),I=S(He,I,je),Qe===null?Ae=He:Qe.sibling=He,Qe=He);return o&&Se.forEach(function(_l){return u($,_l)}),Fe&&va($,je),Ae}function Me($,I,H,ne){if(H==null)throw Error(r(151));for(var Ae=null,Qe=null,Se=I,je=I=0,He=null,Xe=H.next();Se!==null&&!Xe.done;je++,Xe=H.next()){Se.index>je?(He=Se,Se=null):He=Se.sibling;var _l=X($,Se,Xe.value,ne);if(_l===null){Se===null&&(Se=He);break}o&&Se&&_l.alternate===null&&u($,Se),I=S(_l,I,je),Qe===null?Ae=_l:Qe.sibling=_l,Qe=_l,Se=He}if(Xe.done)return h($,Se),Fe&&va($,je),Ae;if(Se===null){for(;!Xe.done;je++,Xe=H.next())Xe=re($,Xe.value,ne),Xe!==null&&(I=S(Xe,I,je),Qe===null?Ae=Xe:Qe.sibling=Xe,Qe=Xe);return Fe&&va($,je),Ae}for(Se=m(Se);!Xe.done;je++,Xe=H.next())Xe=Y(Se,$,je,Xe.value,ne),Xe!==null&&(o&&Xe.alternate!==null&&Se.delete(Xe.key===null?je:Xe.key),I=S(Xe,I,je),Qe===null?Ae=Xe:Qe.sibling=Xe,Qe=Xe);return o&&Se.forEach(function(f9){return u($,f9)}),Fe&&va($,je),Ae}function lt($,I,H,ne){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;I!==null;){if(I.key===Ae){if(Ae=H.type,Ae===x){if(I.tag===7){h($,I.sibling),ne=b(I,H.props.children),ne.return=$,$=ne;break e}}else if(I.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===j&&xo(Ae)===I.type){h($,I.sibling),ne=b(I,H.props),qc(ne,H),ne.return=$,$=ne;break e}h($,I);break}else u($,I);I=I.sibling}H.type===x?(ne=mo(H.props.children,$.mode,ne,H.key),ne.return=$,$=ne):(ne=Nd(H.type,H.key,H.props,null,$.mode,ne),qc(ne,H),ne.return=$,$=ne)}return E($);case y:e:{for(Ae=H.key;I!==null;){if(I.key===Ae)if(I.tag===4&&I.stateNode.containerInfo===H.containerInfo&&I.stateNode.implementation===H.implementation){h($,I.sibling),ne=b(I,H.children||[]),ne.return=$,$=ne;break e}else{h($,I);break}else u($,I);I=I.sibling}ne=h0(H,$.mode,ne),ne.return=$,$=ne}return E($);case j:return H=xo(H),lt($,I,H,ne)}if(ue(H))return ye($,I,H,ne);if(B(H)){if(Ae=B(H),typeof Ae!="function")throw Error(r(150));return H=Ae.call(H),Me($,I,H,ne)}if(typeof H.then=="function")return lt($,I,$d(H),ne);if(H.$$typeof===k)return lt($,I,jd($,H),ne);Ud($,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,I!==null&&I.tag===6?(h($,I.sibling),ne=b(I,H),ne.return=$,$=ne):(h($,I),ne=f0(H,$.mode,ne),ne.return=$,$=ne),E($)):h($,I)}return function($,I,H,ne){try{Fc=0;var Ae=lt($,I,H,ne);return Fs=null,Ae}catch(Se){if(Se===Hs||Se===Bd)throw Se;var Qe=yr(29,Se,null,$.mode);return Qe.lanes=ne,Qe.return=$,Qe}}}var wo=XC(!0),YC=XC(!1),ml=!1;function A0(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function k0(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 gl(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function vl(o,u,h){var m=o.updateQueue;if(m===null)return null;if(m=m.shared,(Je&2)!==0){var b=m.pending;return b===null?u.next=u:(u.next=b.next,b.next=u),m.pending=u,u=_d(o),NC(o,null,h),u}return Dd(o,m,u,h),_d(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,Uk(o,h)}}function C0(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 E0=!1;function Kc(){if(E0){var o=Us;if(o!==null)throw o}}function Vc(o,u,h,m){E0=!1;var b=o.updateQueue;ml=!1;var S=b.firstBaseUpdate,E=b.lastBaseUpdate,_=b.shared.pending;if(_!==null){b.shared.pending=null;var L=_,q=L.next;L.next=null,E===null?S=q:E.next=q,E=L;var J=o.alternate;J!==null&&(J=J.updateQueue,_=J.lastBaseUpdate,_!==E&&(_===null?J.firstBaseUpdate=q:_.next=q,J.lastBaseUpdate=L))}if(S!==null){var re=b.baseState;E=0,J=q=L=null,_=S;do{var X=_.lane&-536870913,Y=X!==_.lane;if(Y?(Ue&X)===X:(m&X)===X){X!==0&&X===$s&&(E0=!0),J!==null&&(J=J.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ye=o,Me=_;X=u;var lt=h;switch(Me.tag){case 1:if(ye=Me.payload,typeof ye=="function"){re=ye.call(lt,re,X);break e}re=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Me.payload,X=typeof ye=="function"?ye.call(lt,re,X):ye,X==null)break e;re=p({},re,X);break e;case 2:ml=!0}}X=_.callback,X!==null&&(o.flags|=64,Y&&(o.flags|=8192),Y=b.callbacks,Y===null?b.callbacks=[X]:Y.push(X))}else Y={lane:X,tag:_.tag,payload:_.payload,callback:_.callback,next:null},J===null?(q=J=Y,L=re):J=J.next=Y,E|=X;if(_=_.next,_===null){if(_=b.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,b.lastBaseUpdate=Y,b.shared.pending=null}}while(!0);J===null&&(L=re),b.baseState=L,b.firstBaseUpdate=q,b.lastBaseUpdate=J,S===null&&(b.shared.lanes=0),wl|=E,o.lanes=E,o.memoizedState=re}}function GC(o,u){if(typeof o!="function")throw Error(r(191,o));o.call(u)}function ZC(o,u){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)GC(h[o],u)}var qs=R(null),Hd=R(0);function JC(o,u){o=Ta,ee(Hd,o),ee(qs,u),Ta=o|u.baseLanes}function T0(){ee(Hd,Ta),ee(qs,qs.current)}function M0(){Ta=Hd.current,F(qs),F(Hd)}var br=R(null),Hr=null;function yl(o){var u=o.alternate;ee(jt,jt.current&1),ee(br,o),Hr===null&&(u===null||qs.current!==null||u.memoizedState!==null)&&(Hr=o)}function P0(o){ee(jt,jt.current),ee(br,o),Hr===null&&(Hr=o)}function eE(o){o.tag===22?(ee(jt,jt.current),ee(br,o),Hr===null&&(Hr=o)):bl()}function bl(){ee(jt,jt.current),ee(br,br.current)}function xr(o){F(br),Hr===o&&(Hr=null),F(jt)}var jt=R(0);function Fd(o){for(var u=o;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||jb(h)||Ib(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 xa=0,Le=null,it=null,Ht=null,qd=!1,Ws=!1,Oo=!1,Wd=0,Qc=0,Ks=null,tH=0;function Mt(){throw Error(r(321))}function D0(o,u){if(u===null)return!1;for(var h=0;h<u.length&&h<o.length;h++)if(!vr(o[h],u[h]))return!1;return!0}function _0(o,u,h,m,b,S){return xa=S,Le=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,z.H=o===null||o.memoizedState===null?IE:V0,Oo=!1,S=h(m,b),Oo=!1,Ws&&(S=nE(u,h,m,b)),tE(o),S}function tE(o){z.H=Gc;var u=it!==null&&it.next!==null;if(xa=0,Ht=it=Le=null,qd=!1,Qc=0,Ks=null,u)throw Error(r(300));o===null||Ft||(o=o.dependencies,o!==null&&Ld(o)&&(Ft=!0))}function nE(o,u,h,m){Le=o;var b=0;do{if(Ws&&(Ks=null),Qc=0,Ws=!1,25<=b)throw Error(r(301));if(b+=1,Ht=it=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=BE,S=u(h,m)}while(Ws);return S}function nH(){var o=z.H,u=o.useState()[0];return u=typeof u.then=="function"?Xc(u):u,o=o.useState()[0],(it!==null?it.memoizedState:null)!==o&&(Le.flags|=1024),u}function N0(){var o=Wd!==0;return Wd=0,o}function R0(o,u,h){u.updateQueue=o.updateQueue,u.flags&=-2053,o.lanes&=~h}function L0(o){if(qd){for(o=o.memoizedState;o!==null;){var u=o.queue;u!==null&&(u.pending=null),o=o.next}qd=!1}xa=0,Ht=it=Le=null,Ws=!1,Qc=Wd=0,Ks=null}function Hn(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?Le.memoizedState=Ht=o:Ht=Ht.next=o,Ht}function It(){if(it===null){var o=Le.alternate;o=o!==null?o.memoizedState:null}else o=it.next;var u=Ht===null?Le.memoizedState:Ht.next;if(u!==null)Ht=u,it=o;else{if(o===null)throw Le.alternate===null?Error(r(467)):Error(r(310));it=o,o={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Ht===null?Le.memoizedState=Ht=o:Ht=Ht.next=o}return Ht}function Kd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xc(o){var u=Qc;return Qc+=1,Ks===null&&(Ks=[]),o=KC(Ks,o,u),u=Le,(Ht===null?u.memoizedState:Ht.next)===null&&(u=u.alternate,z.H=u===null||u.memoizedState===null?IE:V0),o}function Vd(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Xc(o);if(o.$$typeof===k)return vn(o)}throw Error(r(438,String(o)))}function j0(o){var u=null,h=Le.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var m=Le.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=Kd(),Le.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]=V;return u.index++,h}function Sa(o,u){return typeof u=="function"?u(o):u}function Qd(o){var u=It();return I0(u,it,o)}function I0(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,L=null,q=u,J=!1;do{var re=q.lane&-536870913;if(re!==q.lane?(Ue&re)===re:(xa&re)===re){var X=q.revertLane;if(X===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),re===$s&&(J=!0);else if((xa&X)===X){q=q.next,X===$s&&(J=!0);continue}else re={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},L===null?(_=L=re,E=S):L=L.next=re,Le.lanes|=X,wl|=X;re=q.action,Oo&&h(S,re),S=q.hasEagerState?q.eagerState:h(S,re)}else X={lane:re,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},L===null?(_=L=X,E=S):L=L.next=X,Le.lanes|=re,wl|=re;q=q.next}while(q!==null&&q!==u);if(L===null?E=S:L.next=_,!vr(S,o.memoizedState)&&(Ft=!0,J&&(h=Us,h!==null)))throw h;o.memoizedState=S,o.baseState=E,o.baseQueue=L,m.lastRenderedState=S}return b===null&&(m.lanes=0),[o.memoizedState,m.dispatch]}function B0(o){var u=It(),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);vr(S,u.memoizedState)||(Ft=!0),u.memoizedState=S,u.baseQueue===null&&(u.baseState=S),h.lastRenderedState=S}return[S,m]}function rE(o,u,h){var m=Le,b=It(),S=Fe;if(S){if(h===void 0)throw Error(r(407));h=h()}else h=u();var E=!vr((it||b).memoizedState,h);if(E&&(b.memoizedState=h,Ft=!0),b=b.queue,U0(lE.bind(null,m,b,o),[o]),b.getSnapshot!==u||E||Ht!==null&&Ht.memoizedState.tag&1){if(m.flags|=2048,Vs(9,{destroy:void 0},aE.bind(null,m,b,h,u),null),ct===null)throw Error(r(349));S||(xa&127)!==0||iE(m,u,h)}return h}function iE(o,u,h){o.flags|=16384,o={getSnapshot:u,value:h},u=Le.updateQueue,u===null?(u=Kd(),Le.updateQueue=u,u.stores=[o]):(h=u.stores,h===null?u.stores=[o]:h.push(o))}function aE(o,u,h,m){u.value=h,u.getSnapshot=m,oE(u)&&sE(o)}function lE(o,u,h){return h(function(){oE(u)&&sE(o)})}function oE(o){var u=o.getSnapshot;o=o.value;try{var h=u();return!vr(o,h)}catch{return!0}}function sE(o){var u=po(o,2);u!==null&&ir(u,o,2)}function z0(o){var u=Hn();if(typeof o=="function"){var h=o;if(o=h(),Oo){sl(!0);try{h()}finally{sl(!1)}}}return u.memoizedState=u.baseState=o,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:o},u}function uE(o,u,h,m){return o.baseState=h,I0(o,it,typeof m=="function"?m:Sa)}function rH(o,u,h,m,b){if(Gd(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,cE(u,S)):(S.next=h.next,u.pending=h.next=S)}}function cE(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),L=z.S;L!==null&&L(E,_),fE(o,u,_)}catch(q){$0(o,u,q)}finally{S!==null&&E.types!==null&&(S.types=E.types),z.T=S}}else try{S=h(b,m),fE(o,u,S)}catch(q){$0(o,u,q)}}function fE(o,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(m){hE(o,u,m)},function(m){return $0(o,u,m)}):hE(o,u,h)}function hE(o,u,h){u.status="fulfilled",u.value=h,dE(u),o.state=h,u=o.pending,u!==null&&(h=u.next,h===u?o.pending=null:(h=h.next,u.next=h,cE(o,h)))}function $0(o,u,h){var m=o.pending;if(o.pending=null,m!==null){m=m.next;do u.status="rejected",u.reason=h,dE(u),u=u.next;while(u!==m)}o.action=null}function dE(o){o=o.listeners;for(var u=0;u<o.length;u++)(0,o[u])()}function pE(o,u){return u}function mE(o,u){if(Fe){var h=ct.formState;if(h!==null){e:{var m=Le;if(Fe){if(yt){t:{for(var b=yt,S=Ur;b.nodeType!==8;){if(!S){b=null;break t}if(b=Fr(b.nextSibling),b===null){b=null;break t}}S=b.data,b=S==="F!"||S==="F"?b:null}if(b){yt=Fr(b.nextSibling),m=b.data==="F!";break e}}dl(m)}m=!1}m&&(u=h[0])}}return h=Hn(),h.memoizedState=h.baseState=u,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pE,lastRenderedState:u},h.queue=m,h=RE.bind(null,Le,m),m.dispatch=h,m=z0(!1),S=K0.bind(null,Le,!1,m.queue),m=Hn(),b={state:u,dispatch:null,action:o,pending:null},m.queue=b,h=rH.bind(null,Le,b,S,h),b.dispatch=h,m.memoizedState=o,[u,h,!1]}function gE(o){var u=It();return vE(u,it,o)}function vE(o,u,h){if(u=I0(o,u,pE)[0],o=Qd(Sa)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var m=Xc(u)}catch(E){throw E===Hs?Bd:E}else m=u;u=It();var b=u.queue,S=b.dispatch;return h!==u.memoizedState&&(Le.flags|=2048,Vs(9,{destroy:void 0},iH.bind(null,b,h),null)),[m,S,o]}function iH(o,u){o.action=u}function yE(o){var u=It(),h=it;if(h!==null)return vE(u,h,o);It(),u=u.memoizedState,h=It();var m=h.queue.dispatch;return h.memoizedState=o,[u,m,!1]}function Vs(o,u,h,m){return o={tag:o,create:h,deps:m,inst:u,next:null},u=Le.updateQueue,u===null&&(u=Kd(),Le.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 bE(){return It().memoizedState}function Xd(o,u,h,m){var b=Hn();Le.flags|=o,b.memoizedState=Vs(1|u,{destroy:void 0},h,m===void 0?null:m)}function Yd(o,u,h,m){var b=It();m=m===void 0?null:m;var S=b.memoizedState.inst;it!==null&&m!==null&&D0(m,it.memoizedState.deps)?b.memoizedState=Vs(u,S,h,m):(Le.flags|=o,b.memoizedState=Vs(1|u,S,h,m))}function xE(o,u){Xd(8390656,8,o,u)}function U0(o,u){Yd(2048,8,o,u)}function aH(o){Le.flags|=4;var u=Le.updateQueue;if(u===null)u=Kd(),Le.updateQueue=u,u.events=[o];else{var h=u.events;h===null?u.events=[o]:h.push(o)}}function SE(o){var u=It().memoizedState;return aH({ref:u,nextImpl:o}),function(){if((Je&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function wE(o,u){return Yd(4,2,o,u)}function OE(o,u){return Yd(4,4,o,u)}function AE(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 kE(o,u,h){h=h!=null?h.concat([o]):null,Yd(4,4,AE.bind(null,u,o),h)}function H0(){}function CE(o,u){var h=It();u=u===void 0?null:u;var m=h.memoizedState;return u!==null&&D0(u,m[1])?m[0]:(h.memoizedState=[o,u],o)}function EE(o,u){var h=It();u=u===void 0?null:u;var m=h.memoizedState;if(u!==null&&D0(u,m[1]))return m[0];if(m=o(),Oo){sl(!0);try{o()}finally{sl(!1)}}return h.memoizedState=[m,u],m}function F0(o,u,h){return h===void 0||(xa&1073741824)!==0&&(Ue&261930)===0?o.memoizedState=u:(o.memoizedState=h,o=TT(),Le.lanes|=o,wl|=o,h)}function TE(o,u,h,m){return vr(h,u)?h:qs.current!==null?(o=F0(o,h,m),vr(o,u)||(Ft=!0),o):(xa&42)===0||(xa&1073741824)!==0&&(Ue&261930)===0?(Ft=!0,o.memoizedState=h):(o=TT(),Le.lanes|=o,wl|=o,u)}function ME(o,u,h,m,b){var S=Z.p;Z.p=S!==0&&8>S?S:8;var E=z.T,_={};z.T=_,K0(o,!1,u,h);try{var L=b(),q=z.S;if(q!==null&&q(_,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var J=eH(L,m);Yc(o,u,J,Or(o))}else Yc(o,u,m,Or(o))}catch(re){Yc(o,u,{then:function(){},status:"rejected",reason:re},Or())}finally{Z.p=S,E!==null&&_.types!==null&&(E.types=_.types),z.T=E}}function lH(){}function q0(o,u,h,m){if(o.tag!==5)throw Error(r(476));var b=PE(o).queue;ME(o,b,u,ae,h===null?lH:function(){return DE(o),h(m)})}function PE(o){var u=o.memoizedState;if(u!==null)return u;u={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:ae},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:h},next:null},o.memoizedState=u,o=o.alternate,o!==null&&(o.memoizedState=u),u}function DE(o){var u=PE(o);u.next===null&&(u=o.alternate.memoizedState),Yc(o,u.next.queue,{},Or())}function W0(){return vn(pf)}function _E(){return It().memoizedState}function NE(){return It().memoizedState}function oH(o){for(var u=o.return;u!==null;){switch(u.tag){case 24:case 3:var h=Or();o=gl(h);var m=vl(u,o,h);m!==null&&(ir(m,u,h),Wc(m,u,h)),u={cache:x0()},o.payload=u;return}u=u.return}}function sH(o,u,h){var m=Or();h={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Gd(o)?LE(u,h):(h=u0(o,u,h,m),h!==null&&(ir(h,o,m),jE(h,u,m)))}function RE(o,u,h){var m=Or();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(Gd(o))LE(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=_,vr(_,E))return Dd(o,u,b,0),ct===null&&Pd(),!1}catch{}if(h=u0(o,u,b,m),h!==null)return ir(h,o,m),jE(h,u,m),!0}return!1}function K0(o,u,h,m){if(m={lane:2,revertLane:Ab(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Gd(o)){if(u)throw Error(r(479))}else u=u0(o,h,m,2),u!==null&&ir(u,o,2)}function Gd(o){var u=o.alternate;return o===Le||u!==null&&u===Le}function LE(o,u){Ws=qd=!0;var h=o.pending;h===null?u.next=u:(u.next=h.next,h.next=u),o.pending=u}function jE(o,u,h){if((h&4194048)!==0){var m=u.lanes;m&=o.pendingLanes,h|=m,u.lanes=h,Uk(o,h)}}var Gc={readContext:vn,use:Vd,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt};Gc.useEffectEvent=Mt;var IE={readContext:vn,use:Vd,useCallback:function(o,u){return Hn().memoizedState=[o,u===void 0?null:u],o},useContext:vn,useEffect:xE,useImperativeHandle:function(o,u,h){h=h!=null?h.concat([o]):null,Xd(4194308,4,AE.bind(null,u,o),h)},useLayoutEffect:function(o,u){return Xd(4194308,4,o,u)},useInsertionEffect:function(o,u){Xd(4,2,o,u)},useMemo:function(o,u){var h=Hn();u=u===void 0?null:u;var m=o();if(Oo){sl(!0);try{o()}finally{sl(!1)}}return h.memoizedState=[m,u],m},useReducer:function(o,u,h){var m=Hn();if(h!==void 0){var b=h(u);if(Oo){sl(!0);try{h(u)}finally{sl(!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=sH.bind(null,Le,o),[m.memoizedState,o]},useRef:function(o){var u=Hn();return o={current:o},u.memoizedState=o},useState:function(o){o=z0(o);var u=o.queue,h=RE.bind(null,Le,u);return u.dispatch=h,[o.memoizedState,h]},useDebugValue:H0,useDeferredValue:function(o,u){var h=Hn();return F0(h,o,u)},useTransition:function(){var o=z0(!1);return o=ME.bind(null,Le,o.queue,!0,!1),Hn().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,u,h){var m=Le,b=Hn();if(Fe){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),ct===null)throw Error(r(349));(Ue&127)!==0||iE(m,u,h)}b.memoizedState=h;var S={value:h,getSnapshot:u};return b.queue=S,xE(lE.bind(null,m,S,o),[o]),m.flags|=2048,Vs(9,{destroy:void 0},aE.bind(null,m,S,h,u),null),h},useId:function(){var o=Hn(),u=ct.identifierPrefix;if(Fe){var h=Pi,m=Mi;h=(m&~(1<<32-gr(m)-1)).toString(32)+h,u="_"+u+"R_"+h,h=Wd++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=tH++,u="_"+u+"r_"+h.toString(32)+"_";return o.memoizedState=u},useHostTransitionStatus:W0,useFormState:mE,useActionState:mE,useOptimistic:function(o){var u=Hn();u.memoizedState=u.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=K0.bind(null,Le,!0,h),h.dispatch=u,[o,u]},useMemoCache:j0,useCacheRefresh:function(){return Hn().memoizedState=oH.bind(null,Le)},useEffectEvent:function(o){var u=Hn(),h={impl:o};return u.memoizedState=h,function(){if((Je&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},V0={readContext:vn,use:Vd,useCallback:CE,useContext:vn,useEffect:U0,useImperativeHandle:kE,useInsertionEffect:wE,useLayoutEffect:OE,useMemo:EE,useReducer:Qd,useRef:bE,useState:function(){return Qd(Sa)},useDebugValue:H0,useDeferredValue:function(o,u){var h=It();return TE(h,it.memoizedState,o,u)},useTransition:function(){var o=Qd(Sa)[0],u=It().memoizedState;return[typeof o=="boolean"?o:Xc(o),u]},useSyncExternalStore:rE,useId:_E,useHostTransitionStatus:W0,useFormState:gE,useActionState:gE,useOptimistic:function(o,u){var h=It();return uE(h,it,o,u)},useMemoCache:j0,useCacheRefresh:NE};V0.useEffectEvent=SE;var BE={readContext:vn,use:Vd,useCallback:CE,useContext:vn,useEffect:U0,useImperativeHandle:kE,useInsertionEffect:wE,useLayoutEffect:OE,useMemo:EE,useReducer:B0,useRef:bE,useState:function(){return B0(Sa)},useDebugValue:H0,useDeferredValue:function(o,u){var h=It();return it===null?F0(h,o,u):TE(h,it.memoizedState,o,u)},useTransition:function(){var o=B0(Sa)[0],u=It().memoizedState;return[typeof o=="boolean"?o:Xc(o),u]},useSyncExternalStore:rE,useId:_E,useHostTransitionStatus:W0,useFormState:yE,useActionState:yE,useOptimistic:function(o,u){var h=It();return it!==null?uE(h,it,o,u):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:j0,useCacheRefresh:NE};BE.useEffectEvent=SE;function Q0(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 X0={enqueueSetState:function(o,u,h){o=o._reactInternals;var m=Or(),b=gl(m);b.payload=u,h!=null&&(b.callback=h),u=vl(o,b,m),u!==null&&(ir(u,o,m),Wc(u,o,m))},enqueueReplaceState:function(o,u,h){o=o._reactInternals;var m=Or(),b=gl(m);b.tag=1,b.payload=u,h!=null&&(b.callback=h),u=vl(o,b,m),u!==null&&(ir(u,o,m),Wc(u,o,m))},enqueueForceUpdate:function(o,u){o=o._reactInternals;var h=Or(),m=gl(h);m.tag=2,u!=null&&(m.callback=u),u=vl(o,m,h),u!==null&&(ir(u,o,h),Wc(u,o,h))}};function zE(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?!Ic(h,m)||!Ic(b,S):!0}function $E(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&&X0.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 UE(o){Md(o)}function HE(o){console.error(o)}function FE(o){Md(o)}function Zd(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 Y0(o,u,h){return h=gl(h),h.tag=3,h.payload={element:null},h.callback=function(){Zd(o,u)},h}function WE(o){return o=gl(o),o.tag=3,o}function KE(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"&&(Ol===null?Ol=new Set([this]):Ol.add(this));var _=m.stack;this.componentDidCatch(m.value,{componentStack:_!==null?_:""})})}function uH(o,u,h,m,b){if(h.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(u=h.alternate,u!==null&&zs(u,h,b,!0),h=br.current,h!==null){switch(h.tag){case 31:case 13:return Hr===null?cp():h.alternate===null&&Pt===0&&(Pt=3),h.flags&=-257,h.flags|=65536,h.lanes=b,m===zd?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([m]):u.add(m),Sb(o,m,b)),!1;case 22:return h.flags|=65536,m===zd?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)),Sb(o,m,b)),!1}throw Error(r(435,h.tag))}return Sb(o,m,b),cp(),!1}if(Fe)return u=br.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=b,m!==m0&&(o=Error(r(422),{cause:m}),$c(Br(o,h)))):(m!==m0&&(u=Error(r(423),{cause:m}),$c(Br(u,h))),o=o.current.alternate,o.flags|=65536,b&=-b,o.lanes|=b,m=Br(m,h),b=Y0(o.stateNode,m,b),C0(o,b),Pt!==4&&(Pt=2)),!1;var S=Error(r(520),{cause:m});if(S=Br(S,h),lf===null?lf=[S]:lf.push(S),Pt!==4&&(Pt=2),u===null)return!0;m=Br(m,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,o=b&-b,h.lanes|=o,o=Y0(h.stateNode,m,o),C0(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"&&(Ol===null||!Ol.has(S))))return h.flags|=65536,b&=-b,h.lanes|=b,b=WE(b),KE(b,o,h,m),C0(h,b),!1}h=h.return}while(h!==null);return!1}var G0=Error(r(461)),Ft=!1;function yn(o,u,h,m){u.child=o===null?YC(u,null,h,m):wo(u,o.child,h,m)}function VE(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=_0(o,u,h,E,S,b),_=N0(),o!==null&&!Ft?(R0(o,u,b),wa(o,u,b)):(Fe&&_&&d0(u),u.flags|=1,yn(o,u,m,b),u.child)}function QE(o,u,h,m,b){if(o===null){var S=h.type;return typeof S=="function"&&!c0(S)&&S.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=S,XE(o,u,S,m,b)):(o=Nd(h.type,null,m,u,u.mode,b),o.ref=u.ref,o.return=u,u.child=o)}if(S=o.child,!ab(o,b)){var E=S.memoizedProps;if(h=h.compare,h=h!==null?h:Ic,h(E,m)&&o.ref===u.ref)return wa(o,u,b)}return u.flags|=1,o=ga(S,m),o.ref=u.ref,o.return=u,u.child=o}function XE(o,u,h,m,b){if(o!==null){var S=o.memoizedProps;if(Ic(S,m)&&o.ref===u.ref)if(Ft=!1,u.pendingProps=m=S,ab(o,b))(o.flags&131072)!==0&&(Ft=!0);else return u.lanes=o.lanes,wa(o,u,b)}return Z0(o,u,h,m,b)}function YE(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 GE(o,u,S,h,m)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},o!==null&&Id(u,S!==null?S.cachePool:null),S!==null?JC(u,S):T0(),eE(u);else return m=u.lanes=536870912,GE(o,u,S!==null?S.baseLanes|h:h,h,m)}else S!==null?(Id(u,S.cachePool),JC(u,S),bl(),u.memoizedState=null):(o!==null&&Id(u,null),T0(),bl());return yn(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 GE(o,u,h,m,b){var S=w0();return S=S===null?null:{parent:Ut._currentValue,pool:S},u.memoizedState={baseLanes:h,cachePool:S},o!==null&&Id(u,null),T0(),eE(u),o!==null&&zs(o,u,m,!0),u.childLanes=b,null}function Jd(o,u){return u=tp({mode:u.mode,children:u.children},o.mode),u.ref=o.ref,o.child=u,u.return=o,u}function ZE(o,u,h){return wo(u,o.child,null,h),o=Jd(u,u.pendingProps),o.flags|=2,xr(u),u.memoizedState=null,o}function cH(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=Jd(u,m),u.lanes=536870912,Zc(null,o);if(P0(u),(o=yt)?(o=c2(o,Ur),o=o!==null&&o.data==="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:fl!==null?{id:Mi,overflow:Pi}:null,retryLane:536870912,hydrationErrors:null},h=LC(o),h.return=u,u.child=h,gn=u,yt=null)):o=null,o===null)throw dl(u);return u.lanes=536870912,null}return Jd(u,m)}var S=o.memoizedState;if(S!==null){var E=S.dehydrated;if(P0(u),b)if(u.flags&256)u.flags&=-257,u=ZE(o,u,h);else if(u.memoizedState!==null)u.child=o.child,u.flags|=128,u=null;else throw Error(r(558));else if(Ft||zs(o,u,h,!1),b=(h&o.childLanes)!==0,Ft||b){if(m=ct,m!==null&&(E=Hk(m,h),E!==0&&E!==S.retryLane))throw S.retryLane=E,po(o,E),ir(m,o,E),G0;cp(),u=ZE(o,u,h)}else o=S.treeContext,yt=Fr(E.nextSibling),gn=u,Fe=!0,hl=null,Ur=!1,o!==null&&BC(u,o),u=Jd(u,m),u.flags|=4096;return u}return o=ga(o.child,{mode:m.mode,children:m.children}),o.ref=u.ref,u.child=o,o.return=u,o}function ep(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 Z0(o,u,h,m,b){return yo(u),h=_0(o,u,h,m,void 0,b),m=N0(),o!==null&&!Ft?(R0(o,u,b),wa(o,u,b)):(Fe&&m&&d0(u),u.flags|=1,yn(o,u,h,b),u.child)}function JE(o,u,h,m,b,S){return yo(u),u.updateQueue=null,h=nE(u,m,h,b),tE(o),m=N0(),o!==null&&!Ft?(R0(o,u,S),wa(o,u,S)):(Fe&&m&&d0(u),u.flags|=1,yn(o,u,h,S),u.child)}function eT(o,u,h,m,b){if(yo(u),u.stateNode===null){var S=Ls,E=h.contextType;typeof E=="object"&&E!==null&&(S=vn(E)),S=new h(m,S),u.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=X0,u.stateNode=S,S._reactInternals=u,S=u.stateNode,S.props=m,S.state=u.memoizedState,S.refs={},A0(u),E=h.contextType,S.context=typeof E=="object"&&E!==null?vn(E):Ls,S.state=u.memoizedState,E=h.getDerivedStateFromProps,typeof E=="function"&&(Q0(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&&X0.enqueueReplaceState(S,S.state,null),Vc(u,m,S,b),Kc(),S.state=u.memoizedState),typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!0}else if(o===null){S=u.stateNode;var _=u.memoizedProps,L=Ao(h,_);S.props=L;var q=S.context,J=h.contextType;E=Ls,typeof J=="object"&&J!==null&&(E=vn(J));var re=h.getDerivedStateFromProps;J=typeof re=="function"||typeof S.getSnapshotBeforeUpdate=="function",_=u.pendingProps!==_,J||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(_||q!==E)&&$E(u,S,m,E),ml=!1;var X=u.memoizedState;S.state=X,Vc(u,m,S,b),Kc(),q=u.memoizedState,_||X!==q||ml?(typeof re=="function"&&(Q0(u,h,re,m),q=u.memoizedState),(L=ml||zE(u,h,L,m,X,q,E))?(J||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=q),S.props=m,S.state=q,S.context=E,m=L):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!1)}else{S=u.stateNode,k0(o,u),E=u.memoizedProps,J=Ao(h,E),S.props=J,re=u.pendingProps,X=S.context,q=h.contextType,L=Ls,typeof q=="object"&&q!==null&&(L=vn(q)),_=h.getDerivedStateFromProps,(q=typeof _=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(E!==re||X!==L)&&$E(u,S,m,L),ml=!1,X=u.memoizedState,S.state=X,Vc(u,m,S,b),Kc();var Y=u.memoizedState;E!==re||X!==Y||ml||o!==null&&o.dependencies!==null&&Ld(o.dependencies)?(typeof _=="function"&&(Q0(u,h,_,m),Y=u.memoizedState),(J=ml||zE(u,h,J,m,X,Y,L)||o!==null&&o.dependencies!==null&&Ld(o.dependencies))?(q||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(m,Y,L),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(m,Y,L)),typeof S.componentDidUpdate=="function"&&(u.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof S.componentDidUpdate!="function"||E===o.memoizedProps&&X===o.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||E===o.memoizedProps&&X===o.memoizedState||(u.flags|=1024),u.memoizedProps=m,u.memoizedState=Y),S.props=m,S.state=Y,S.context=L,m=J):(typeof S.componentDidUpdate!="function"||E===o.memoizedProps&&X===o.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||E===o.memoizedProps&&X===o.memoizedState||(u.flags|=1024),m=!1)}return S=m,ep(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)):yn(o,u,h,b),u.memoizedState=S.state,o=u.child):o=wa(o,u,b),o}function tT(o,u,h,m){return go(),u.flags|=256,yn(o,u,h,m),u.child}var J0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function eb(o){return{baseLanes:o,cachePool:qC()}}function tb(o,u,h){return o=o!==null?o.childLanes&~h:0,u&&(o|=wr),o}function nT(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:(jt.current&2)!==0),E&&(b=!0,u.flags&=-129),E=(u.flags&32)!==0,u.flags&=-33,o===null){if(Fe){if(b?yl(u):bl(),(o=yt)?(o=c2(o,Ur),o=o!==null&&o.data!=="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:fl!==null?{id:Mi,overflow:Pi}:null,retryLane:536870912,hydrationErrors:null},h=LC(o),h.return=u,u.child=h,gn=u,yt=null)):o=null,o===null)throw dl(u);return Ib(o)?u.lanes=32:u.lanes=536870912,null}var _=m.children;return m=m.fallback,b?(bl(),b=u.mode,_=tp({mode:"hidden",children:_},b),m=mo(m,b,h,null),_.return=u,m.return=u,_.sibling=m,u.child=_,m=u.child,m.memoizedState=eb(h),m.childLanes=tb(o,E,h),u.memoizedState=J0,Zc(null,m)):(yl(u),nb(u,_))}var L=o.memoizedState;if(L!==null&&(_=L.dehydrated,_!==null)){if(S)u.flags&256?(yl(u),u.flags&=-257,u=rb(o,u,h)):u.memoizedState!==null?(bl(),u.child=o.child,u.flags|=128,u=null):(bl(),_=m.fallback,b=u.mode,m=tp({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=eb(h),m.childLanes=tb(o,E,h),u.memoizedState=J0,u=Zc(null,m));else if(yl(u),Ib(_)){if(E=_.nextSibling&&_.nextSibling.dataset,E)var q=E.dgst;E=q,m=Error(r(419)),m.stack="",m.digest=E,$c({value:m,source:null,stack:null}),u=rb(o,u,h)}else if(Ft||zs(o,u,h,!1),E=(h&o.childLanes)!==0,Ft||E){if(E=ct,E!==null&&(m=Hk(E,h),m!==0&&m!==L.retryLane))throw L.retryLane=m,po(o,m),ir(E,o,m),G0;jb(_)||cp(),u=rb(o,u,h)}else jb(_)?(u.flags|=192,u.child=o.child,u=null):(o=L.treeContext,yt=Fr(_.nextSibling),gn=u,Fe=!0,hl=null,Ur=!1,o!==null&&BC(u,o),u=nb(u,m.children),u.flags|=4096);return u}return b?(bl(),_=m.fallback,b=u.mode,L=o.child,q=L.sibling,m=ga(L,{mode:"hidden",children:m.children}),m.subtreeFlags=L.subtreeFlags&65011712,q!==null?_=ga(q,_):(_=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?_=eb(h):(b=_.cachePool,b!==null?(L=Ut._currentValue,b=b.parent!==L?{parent:L,pool:L}:b):b=qC(),_={baseLanes:_.baseLanes|h,cachePool:b}),m.memoizedState=_,m.childLanes=tb(o,E,h),u.memoizedState=J0,Zc(o.child,m)):(yl(u),h=o.child,o=h.sibling,h=ga(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 nb(o,u){return u=tp({mode:"visible",children:u},o.mode),u.return=o,o.child=u}function tp(o,u){return o=yr(22,o,null,u),o.lanes=0,o}function rb(o,u,h){return wo(u,o.child,null,h),o=nb(u,u.pendingProps.children),o.flags|=2,u.memoizedState=null,o}function rT(o,u,h){o.lanes|=u;var m=o.alternate;m!==null&&(m.lanes|=u),y0(o.return,u,h)}function ib(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 iT(o,u,h){var m=u.pendingProps,b=m.revealOrder,S=m.tail;m=m.children;var E=jt.current,_=(E&2)!==0;if(_?(E=E&1|2,u.flags|=128):E&=1,ee(jt,E),yn(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&&rT(o,h,u);else if(o.tag===19)rT(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&&Fd(o)===null&&(b=h),h=h.sibling;h=b,h===null?(b=u.child,u.child=null):(b=h.sibling,h.sibling=null),ib(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&&Fd(o)===null){u.child=b;break}o=b.sibling,b.sibling=h,h=b,b=o}ib(u,!0,h,null,S,m);break;case"together":ib(u,!1,null,null,void 0,m);break;default:u.memoizedState=null}return u.child}function wa(o,u,h){if(o!==null&&(u.dependencies=o.dependencies),wl|=u.lanes,(h&u.childLanes)===0)if(o!==null){if(zs(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=ga(o,o.pendingProps),u.child=h,h.return=u;o.sibling!==null;)o=o.sibling,h=h.sibling=ga(o,o.pendingProps),h.return=u;h.sibling=null}return u.child}function ab(o,u){return(o.lanes&u)!==0?!0:(o=o.dependencies,!!(o!==null&&Ld(o)))}function fH(o,u,h){switch(u.tag){case 3:gt(u,u.stateNode.containerInfo),pl(u,Ut,o.memoizedState.cache),go();break;case 27:case 5:Te(u);break;case 4:gt(u,u.stateNode.containerInfo);break;case 10:pl(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,P0(u),null;break;case 13:var m=u.memoizedState;if(m!==null)return m.dehydrated!==null?(yl(u),u.flags|=128,null):(h&u.child.childLanes)!==0?nT(o,u,h):(yl(u),o=wa(o,u,h),o!==null?o.sibling:null);yl(u);break;case 19:var b=(o.flags&128)!==0;if(m=(h&u.childLanes)!==0,m||(zs(o,u,h,!1),m=(h&u.childLanes)!==0),b){if(m)return iT(o,u,h);u.flags|=128}if(b=u.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),ee(jt,jt.current),m)break;return null;case 22:return u.lanes=0,YE(o,u,h,u.pendingProps);case 24:pl(u,Ut,o.memoizedState.cache)}return wa(o,u,h)}function aT(o,u,h){if(o!==null)if(o.memoizedProps!==u.pendingProps)Ft=!0;else{if(!ab(o,h)&&(u.flags&128)===0)return Ft=!1,fH(o,u,h);Ft=(o.flags&131072)!==0}else Ft=!1,Fe&&(u.flags&1048576)!==0&&IC(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")c0(o)?(m=Ao(o,m),u.tag=1,u=eT(null,u,o,m,h)):(u.tag=0,u=Z0(null,u,o,m,h));else{if(o!=null){var b=o.$$typeof;if(b===M){u.tag=11,u=VE(null,u,o,m,h);break e}else if(b===N){u.tag=14,u=QE(null,u,o,m,h);break e}}throw u=ie(o)||o,Error(r(306,u,""))}}return u;case 0:return Z0(o,u,u.type,u.pendingProps,h);case 1:return m=u.type,b=Ao(m,u.pendingProps),eT(o,u,m,b,h);case 3:e:{if(gt(u,u.stateNode.containerInfo),o===null)throw Error(r(387));m=u.pendingProps;var S=u.memoizedState;b=S.element,k0(o,u),Vc(u,m,null,h);var E=u.memoizedState;if(m=E.cache,pl(u,Ut,m),m!==S.cache&&b0(u,[Ut],h,!0),Kc(),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=tT(o,u,m,h);break e}else if(m!==b){b=Br(Error(r(424)),u),$c(b),u=tT(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,yt=Fr(o.firstChild),gn=u,Fe=!0,hl=null,Ur=!0,h=YC(u,null,m,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(go(),m===b){u=wa(o,u,h);break e}yn(o,u,m,h)}u=u.child}return u;case 26:return ep(o,u),o===null?(h=g2(u.type,null,u.pendingProps,null))?u.memoizedState=h:Fe||(h=u.type,o=u.pendingProps,m=vp(Oe.current).createElement(h),m[mn]=u,m[Zn]=o,bn(m,h,o),nn(m),u.stateNode=m):u.memoizedState=g2(u.type,o.memoizedProps,u.pendingProps,o.memoizedState),null;case 27:return Te(u),o===null&&Fe&&(m=u.stateNode=d2(u.type,u.pendingProps,Oe.current),gn=u,Ur=!0,b=yt,El(u.type)?(Bb=b,yt=Fr(m.firstChild)):yt=b),yn(o,u,u.pendingProps.children,h),ep(o,u),o===null&&(u.flags|=4194304),u.child;case 5:return o===null&&Fe&&((b=m=yt)&&(m=UH(m,u.type,u.pendingProps,Ur),m!==null?(u.stateNode=m,gn=u,yt=Fr(m.firstChild),Ur=!1,b=!0):b=!1),b||dl(u)),Te(u),b=u.type,S=u.pendingProps,E=o!==null?o.memoizedProps:null,m=S.children,Nb(b,S)?m=null:E!==null&&Nb(b,E)&&(u.flags|=32),u.memoizedState!==null&&(b=_0(o,u,nH,null,null,h),pf._currentValue=b),ep(o,u),yn(o,u,m,h),u.child;case 6:return o===null&&Fe&&((o=h=yt)&&(h=HH(h,u.pendingProps,Ur),h!==null?(u.stateNode=h,gn=u,yt=null,o=!0):o=!1),o||dl(u)),null;case 13:return nT(o,u,h);case 4:return gt(u,u.stateNode.containerInfo),m=u.pendingProps,o===null?u.child=wo(u,null,m,h):yn(o,u,m,h),u.child;case 11:return VE(o,u,u.type,u.pendingProps,h);case 7:return yn(o,u,u.pendingProps,h),u.child;case 8:return yn(o,u,u.pendingProps.children,h),u.child;case 12:return yn(o,u,u.pendingProps.children,h),u.child;case 10:return m=u.pendingProps,pl(u,u.type,m.value),yn(o,u,m.children,h),u.child;case 9:return b=u.type._context,m=u.pendingProps.children,yo(u),b=vn(b),m=m(b),u.flags|=1,yn(o,u,m,h),u.child;case 14:return QE(o,u,u.type,u.pendingProps,h);case 15:return XE(o,u,u.type,u.pendingProps,h);case 19:return iT(o,u,h);case 31:return cH(o,u,h);case 22:return YE(o,u,h,u.pendingProps);case 24:return yo(u),m=vn(Ut),o===null?(b=w0(),b===null&&(b=ct,S=x0(),b.pooledCache=S,S.refCount++,S!==null&&(b.pooledCacheLanes|=h),b=S),u.memoizedState={parent:m,cache:b},A0(u),pl(u,Ut,b)):((o.lanes&h)!==0&&(k0(o,u),Vc(u,null,null,h),Kc()),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),pl(u,Ut,m)):(m=S.cache,pl(u,Ut,m),m!==b.cache&&b0(u,[Ut],h,!0))),yn(o,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Oa(o){o.flags|=4}function lb(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(_T())o.flags|=8192;else throw So=zd,O0}else o.flags&=-16777217}function lT(o,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!S2(u))if(_T())o.flags|=8192;else throw So=zd,O0}function np(o,u){u!==null&&(o.flags|=4),o.flags&16384&&(u=o.tag!==22?zk():536870912,o.lanes|=u,Gs|=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 bt(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 hH(o,u,h){var m=u.pendingProps;switch(p0(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(u),null;case 1:return bt(u),null;case 3:return h=u.stateNode,m=null,o!==null&&(m=o.memoizedState.cache),u.memoizedState.cache!==m&&(u.flags|=2048),ba(Ut),ce(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(Bs(u)?Oa(u):o===null||o.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,g0())),bt(u),null;case 26:var b=u.type,S=u.memoizedState;return o===null?(Oa(u),S!==null?(bt(u),lT(u,S)):(bt(u),lb(u,b,null,m,h))):S?S!==o.memoizedState?(Oa(u),bt(u),lT(u,S)):(bt(u),u.flags&=-16777217):(o=o.memoizedProps,o!==m&&Oa(u),bt(u),lb(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&&Oa(u);else{if(!m){if(u.stateNode===null)throw Error(r(166));return bt(u),null}o=se.current,Bs(u)?zC(u):(o=d2(b,m,h),u.stateNode=o,Oa(u))}return bt(u),null;case 5:if(Ee(u),b=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==m&&Oa(u);else{if(!m){if(u.stateNode===null)throw Error(r(166));return bt(u),null}if(S=se.current,Bs(u))zC(u);else{var E=vp(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[mn]=u,S[Zn]=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(bn(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&&Oa(u)}}return bt(u),lb(u,u.type,o===null?null:o.memoizedProps,u.pendingProps,h),null;case 6:if(o&&u.stateNode!=null)o.memoizedProps!==m&&Oa(u);else{if(typeof m!="string"&&u.stateNode===null)throw Error(r(166));if(o=Oe.current,Bs(u)){if(o=u.stateNode,h=u.memoizedProps,m=null,b=gn,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}o[mn]=u,o=!!(o.nodeValue===h||m!==null&&m.suppressHydrationWarning===!0||n2(o.nodeValue,h)),o||dl(u,!0)}else o=vp(o).createTextNode(m),o[mn]=u,u.stateNode=o}return bt(u),null;case 31:if(h=u.memoizedState,o===null||o.memoizedState!==null){if(m=Bs(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[mn]=u}else go(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;bt(u),o=!1}else h=g0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return u.flags&256?(xr(u),u):(xr(u),null);if((u.flags&128)!==0)throw Error(r(558))}return bt(u),null;case 13:if(m=u.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(b=Bs(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[mn]=u}else go(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;bt(u),b=!1}else b=g0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=b),b=!0;if(!b)return u.flags&256?(xr(u),u):(xr(u),null)}return xr(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),np(u,u.updateQueue),bt(u),null);case 4:return ce(),o===null&&Tb(u.stateNode.containerInfo),bt(u),null;case 10:return ba(u.type),bt(u),null;case 19:if(F(jt),m=u.memoizedState,m===null)return bt(u),null;if(b=(u.flags&128)!==0,S=m.rendering,S===null)if(b)Jc(m,!1);else{if(Pt!==0||o!==null&&(o.flags&128)!==0)for(o=u.child;o!==null;){if(S=Fd(o),S!==null){for(u.flags|=128,Jc(m,!1),o=S.updateQueue,u.updateQueue=o,np(u,o),u.subtreeFlags=0,o=h,h=u.child;h!==null;)RC(h,o),h=h.sibling;return ee(jt,jt.current&1|2),Fe&&va(u,m.treeForkCount),u.child}o=o.sibling}m.tail!==null&&pr()>op&&(u.flags|=128,b=!0,Jc(m,!1),u.lanes=4194304)}else{if(!b)if(o=Fd(S),o!==null){if(u.flags|=128,b=!0,o=o.updateQueue,u.updateQueue=o,np(u,o),Jc(m,!0),m.tail===null&&m.tailMode==="hidden"&&!S.alternate&&!Fe)return bt(u),null}else 2*pr()-m.renderingStartTime>op&&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=pr(),o.sibling=null,h=jt.current,ee(jt,b?h&1|2:h&1),Fe&&va(u,m.treeForkCount),o):(bt(u),null);case 22:case 23:return xr(u),M0(),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&&(bt(u),u.subtreeFlags&6&&(u.flags|=8192)):bt(u),h=u.updateQueue,h!==null&&np(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&&F(bo),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),ba(Ut),bt(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function dH(o,u){switch(p0(u),u.tag){case 1:return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 3:return ba(Ut),ce(),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(xr(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(xr(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 F(jt),null;case 4:return ce(),null;case 10:return ba(u.type),null;case 22:case 23:return xr(u),M0(),o!==null&&F(bo),o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 24:return ba(Ut),null;case 25:return null;default:return null}}function oT(o,u){switch(p0(u),u.tag){case 3:ba(Ut),ce();break;case 26:case 27:case 5:Ee(u);break;case 4:ce();break;case 31:u.memoizedState!==null&&xr(u);break;case 13:xr(u);break;case 19:F(jt);break;case 10:ba(u.type);break;case 22:case 23:xr(u),M0(),o!==null&&F(bo);break;case 24:ba(Ut)}}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(_){nt(u,u.return,_)}}function xl(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 L=h,q=_;try{q()}catch(J){nt(b,L,J)}}}m=m.next}while(m!==S)}}catch(J){nt(u,u.return,J)}}function sT(o){var u=o.updateQueue;if(u!==null){var h=o.stateNode;try{ZC(u,h)}catch(m){nt(o,o.return,m)}}}function uT(o,u,h){h.props=Ao(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(m){nt(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){nt(o,u,b)}}function Di(o,u){var h=o.ref,m=o.refCleanup;if(h!==null)if(typeof m=="function")try{m()}catch(b){nt(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){nt(o,u,b)}else h.current=null}function cT(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){nt(o,o.return,b)}}function ob(o,u,h){try{var m=o.stateNode;LH(m,o.type,h,u),m[Zn]=u}catch(b){nt(o,o.return,b)}}function fT(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&El(o.type)||o.tag===4}function sb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||fT(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&&El(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 ub(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=pa));else if(m!==4&&(m===27&&El(o.type)&&(h=o.stateNode,u=null),o=o.child,o!==null))for(ub(o,u,h),o=o.sibling;o!==null;)ub(o,u,h),o=o.sibling}function rp(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&&El(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(rp(o,u,h),o=o.sibling;o!==null;)rp(o,u,h),o=o.sibling}function hT(o){var u=o.stateNode,h=o.memoizedProps;try{for(var m=o.type,b=u.attributes;b.length;)u.removeAttributeNode(b[0]);bn(u,m,h),u[mn]=o,u[Zn]=h}catch(S){nt(o,o.return,S)}}var Aa=!1,qt=!1,cb=!1,dT=typeof WeakSet=="function"?WeakSet:Set,rn=null;function pH(o,u){if(o=o.containerInfo,Db=Ap,o=kC(o),r0(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,L=-1,q=0,J=0,re=o,X=null;t:for(;;){for(var Y;re!==h||b!==0&&re.nodeType!==3||(_=E+b),re!==S||m!==0&&re.nodeType!==3||(L=E+m),re.nodeType===3&&(E+=re.nodeValue.length),(Y=re.firstChild)!==null;)X=re,re=Y;for(;;){if(re===o)break t;if(X===h&&++q===b&&(_=E),X===S&&++J===m&&(L=E),(Y=re.nextSibling)!==null)break;re=X,X=re.parentNode}re=Y}h=_===-1||L===-1?null:{start:_,end:L}}else h=null}h=h||{start:0,end:0}}else h=null;for(_b={focusedElem:o,selectionRange:h},Ap=!1,rn=u;rn!==null;)if(u=rn,o=u.child,(u.subtreeFlags&1028)!==0&&o!==null)o.return=u,rn=o;else for(;rn!==null;){switch(u=rn,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){nt(h,h.return,Me)}}break;case 3:if((o&1024)!==0){if(o=u.stateNode.containerInfo,h=o.nodeType,h===9)Lb(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Lb(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,rn=o;break}rn=u.return}}function pT(o,u,h){var m=h.flags;switch(h.tag){case 0:case 11:case 15:Ca(o,h),m&4&&ef(5,h);break;case 1:if(Ca(o,h),m&4)if(o=h.stateNode,u===null)try{o.componentDidMount()}catch(E){nt(h,h.return,E)}else{var b=Ao(h.type,u.memoizedProps);u=u.memoizedState;try{o.componentDidUpdate(b,u,o.__reactInternalSnapshotBeforeUpdate)}catch(E){nt(h,h.return,E)}}m&64&&sT(h),m&512&&tf(h,h.return);break;case 3:if(Ca(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{ZC(o,u)}catch(E){nt(h,h.return,E)}}break;case 27:u===null&&m&4&&hT(h);case 26:case 5:Ca(o,h),u===null&&m&4&&cT(h),m&512&&tf(h,h.return);break;case 12:Ca(o,h);break;case 31:Ca(o,h),m&4&&vT(o,h);break;case 13:Ca(o,h),m&4&&yT(o,h),m&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=OH.bind(null,h),FH(o,h))));break;case 22:if(m=h.memoizedState!==null||Aa,!m){u=u!==null&&u.memoizedState!==null||qt,b=Aa;var S=qt;Aa=m,(qt=u)&&!S?Ea(o,h,(h.subtreeFlags&8772)!==0):Ca(o,h),Aa=b,qt=S}break;case 30:break;default:Ca(o,h)}}function mT(o){var u=o.alternate;u!==null&&(o.alternate=null,mT(u)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(u=o.stateNode,u!==null&&$y(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 Ot=null,er=!1;function ka(o,u,h){for(h=h.child;h!==null;)gT(o,u,h),h=h.sibling}function gT(o,u,h){if(mr&&typeof mr.onCommitFiberUnmount=="function")try{mr.onCommitFiberUnmount(kc,h)}catch{}switch(h.tag){case 26:qt||Di(h,u),ka(o,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:qt||Di(h,u);var m=Ot,b=er;El(h.type)&&(Ot=h.stateNode,er=!1),ka(o,u,h),ff(h.stateNode),Ot=m,er=b;break;case 5:qt||Di(h,u);case 6:if(m=Ot,b=er,Ot=null,ka(o,u,h),Ot=m,er=b,Ot!==null)if(er)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(h.stateNode)}catch(S){nt(h,u,S)}else try{Ot.removeChild(h.stateNode)}catch(S){nt(h,u,S)}break;case 18:Ot!==null&&(er?(o=Ot,s2(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),au(o)):s2(Ot,h.stateNode));break;case 4:m=Ot,b=er,Ot=h.stateNode.containerInfo,er=!0,ka(o,u,h),Ot=m,er=b;break;case 0:case 11:case 14:case 15:xl(2,h,u),qt||xl(4,h,u),ka(o,u,h);break;case 1:qt||(Di(h,u),m=h.stateNode,typeof m.componentWillUnmount=="function"&&uT(h,u,m)),ka(o,u,h);break;case 21:ka(o,u,h);break;case 22:qt=(m=qt)||h.memoizedState!==null,ka(o,u,h),qt=m;break;default:ka(o,u,h)}}function vT(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{au(o)}catch(h){nt(u,u.return,h)}}}function yT(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{au(o)}catch(h){nt(u,u.return,h)}}function mH(o){switch(o.tag){case 31:case 13:case 19:var u=o.stateNode;return u===null&&(u=o.stateNode=new dT),u;case 22:return o=o.stateNode,u=o._retryCache,u===null&&(u=o._retryCache=new dT),u;default:throw Error(r(435,o.tag))}}function ip(o,u){var h=mH(o);u.forEach(function(m){if(!h.has(m)){h.add(m);var b=AH.bind(null,o,m);m.then(b,b)}})}function tr(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(El(_.type)){Ot=_.stateNode,er=!1;break e}break;case 5:Ot=_.stateNode,er=!1;break e;case 3:case 4:Ot=_.stateNode.containerInfo,er=!0;break e}_=_.return}if(Ot===null)throw Error(r(160));gT(S,E,b),Ot=null,er=!1,S=b.alternate,S!==null&&(S.return=null),b.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)bT(u,o),u=u.sibling}var ui=null;function bT(o,u){var h=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:tr(u,o),nr(o),m&4&&(xl(3,o,o.return),ef(3,o),xl(5,o,o.return));break;case 1:tr(u,o),nr(o),m&512&&(qt||h===null||Di(h,h.return)),m&64&&Aa&&(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=ui;if(tr(u,o),nr(o),m&512&&(qt||h===null||Di(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[mn]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=b.createElement(m),b.head.insertBefore(S,b.querySelector("head > title"))),bn(S,m,h),S[mn]=o,nn(S),m=S;break e;case"link":var E=b2("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),bn(S,m,h),b.head.appendChild(S);break;case"meta":if(E=b2("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),bn(S,m,h),b.head.appendChild(S);break;default:throw Error(r(468,m))}S[mn]=o,nn(S),m=S}o.stateNode=m}else x2(b,o.type,o.stateNode);else o.stateNode=y2(b,m,o.memoizedProps);else S!==m?(S===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):S.count--,m===null?x2(b,o.type,o.stateNode):y2(b,m,o.memoizedProps)):m===null&&o.stateNode!==null&&ob(o,o.memoizedProps,h.memoizedProps)}break;case 27:tr(u,o),nr(o),m&512&&(qt||h===null||Di(h,h.return)),h!==null&&m&4&&ob(o,o.memoizedProps,h.memoizedProps);break;case 5:if(tr(u,o),nr(o),m&512&&(qt||h===null||Di(h,h.return)),o.flags&32){b=o.stateNode;try{Ts(b,"")}catch(ye){nt(o,o.return,ye)}}m&4&&o.stateNode!=null&&(b=o.memoizedProps,ob(o,b,h!==null?h.memoizedProps:b)),m&1024&&(cb=!0);break;case 6:if(tr(u,o),nr(o),m&4){if(o.stateNode===null)throw Error(r(162));m=o.memoizedProps,h=o.stateNode;try{h.nodeValue=m}catch(ye){nt(o,o.return,ye)}}break;case 3:if(xp=null,b=ui,ui=yp(u.containerInfo),tr(u,o),ui=b,nr(o),m&4&&h!==null&&h.memoizedState.isDehydrated)try{au(u.containerInfo)}catch(ye){nt(o,o.return,ye)}cb&&(cb=!1,xT(o));break;case 4:m=ui,ui=yp(o.stateNode.containerInfo),tr(u,o),nr(o),ui=m;break;case 12:tr(u,o),nr(o);break;case 31:tr(u,o),nr(o),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,ip(o,m)));break;case 13:tr(u,o),nr(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(lp=pr()),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,ip(o,m)));break;case 22:b=o.memoizedState!==null;var L=h!==null&&h.memoizedState!==null,q=Aa,J=qt;if(Aa=q||b,qt=J||L,tr(u,o),qt=J,Aa=q,nr(o),m&8192)e:for(u=o.stateNode,u._visibility=b?u._visibility&-2:u._visibility|1,b&&(h===null||L||Aa||qt||ko(o)),h=null,u=o;;){if(u.tag===5||u.tag===26){if(h===null){L=h=u;try{if(S=L.stateNode,b)E=S.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{_=L.stateNode;var re=L.memoizedProps.style,X=re!=null&&re.hasOwnProperty("display")?re.display:null;_.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(ye){nt(L,L.return,ye)}}}else if(u.tag===6){if(h===null){L=u;try{L.stateNode.nodeValue=b?"":L.memoizedProps}catch(ye){nt(L,L.return,ye)}}}else if(u.tag===18){if(h===null){L=u;try{var Y=L.stateNode;b?u2(Y,!0):u2(L.stateNode,!1)}catch(ye){nt(L,L.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,ip(o,h))));break;case 19:tr(u,o),nr(o),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,ip(o,m)));break;case 30:break;case 21:break;default:tr(u,o),nr(o)}}function nr(o){var u=o.flags;if(u&2){try{for(var h,m=o.return;m!==null;){if(fT(m)){h=m;break}m=m.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var b=h.stateNode,S=sb(o);rp(o,S,b);break;case 5:var E=h.stateNode;h.flags&32&&(Ts(E,""),h.flags&=-33);var _=sb(o);rp(o,_,E);break;case 3:case 4:var L=h.stateNode.containerInfo,q=sb(o);ub(o,q,L);break;default:throw Error(r(161))}}catch(J){nt(o,o.return,J)}o.flags&=-3}u&4096&&(o.flags&=-4097)}function xT(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var u=o;xT(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),o=o.sibling}}function Ca(o,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)pT(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:xl(4,u,u.return),ko(u);break;case 1:Di(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&uT(u,u.return,h),ko(u);break;case 27:ff(u.stateNode);case 26:case 5:Di(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 Ea(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:Ea(b,S,h),ef(4,S);break;case 1:if(Ea(b,S,h),m=S,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(q){nt(m,m.return,q)}if(m=S,b=m.updateQueue,b!==null){var _=m.stateNode;try{var L=b.shared.hiddenCallbacks;if(L!==null)for(b.shared.hiddenCallbacks=null,b=0;b<L.length;b++)GC(L[b],_)}catch(q){nt(m,m.return,q)}}h&&E&64&&sT(S),tf(S,S.return);break;case 27:hT(S);case 26:case 5:Ea(b,S,h),h&&m===null&&E&4&&cT(S),tf(S,S.return);break;case 12:Ea(b,S,h);break;case 31:Ea(b,S,h),h&&E&4&&vT(b,S);break;case 13:Ea(b,S,h),h&&E&4&&yT(b,S);break;case 22:S.memoizedState===null&&Ea(b,S,h),tf(S,S.return);break;case 30:break;default:Ea(b,S,h)}u=u.sibling}}function fb(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 hb(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 ci(o,u,h,m){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)ST(o,u,h,m),u=u.sibling}function ST(o,u,h,m){var b=u.flags;switch(u.tag){case 0:case 11:case 15:ci(o,u,h,m),b&2048&&ef(9,u);break;case 1:ci(o,u,h,m);break;case 3:ci(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){ci(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(L){nt(u,u.return,L)}}else ci(o,u,h,m);break;case 31:ci(o,u,h,m);break;case 13:ci(o,u,h,m);break;case 23:break;case 22:S=u.stateNode,E=u.alternate,u.memoizedState!==null?S._visibility&2?ci(o,u,h,m):nf(o,u):S._visibility&2?ci(o,u,h,m):(S._visibility|=2,Qs(o,u,h,m,(u.subtreeFlags&10256)!==0||!1)),b&2048&&fb(E,u);break;case 24:ci(o,u,h,m),b&2048&&hb(u.alternate,u);break;default:ci(o,u,h,m)}}function Qs(o,u,h,m,b){for(b=b&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var S=o,E=u,_=h,L=m,q=E.flags;switch(E.tag){case 0:case 11:case 15:Qs(S,E,_,L,b),ef(8,E);break;case 23:break;case 22:var J=E.stateNode;E.memoizedState!==null?J._visibility&2?Qs(S,E,_,L,b):nf(S,E):(J._visibility|=2,Qs(S,E,_,L,b)),b&&q&2048&&fb(E.alternate,E);break;case 24:Qs(S,E,_,L,b),b&&q&2048&&hb(E.alternate,E);break;default:Qs(S,E,_,L,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&&fb(m.alternate,m);break;case 24:nf(h,m),b&2048&&hb(m.alternate,m);break;default:nf(h,m)}u=u.sibling}}var rf=8192;function Xs(o,u,h){if(o.subtreeFlags&rf)for(o=o.child;o!==null;)wT(o,u,h),o=o.sibling}function wT(o,u,h){switch(o.tag){case 26:Xs(o,u,h),o.flags&rf&&o.memoizedState!==null&&t9(h,ui,o.memoizedState,o.memoizedProps);break;case 5:Xs(o,u,h);break;case 3:case 4:var m=ui;ui=yp(o.stateNode.containerInfo),Xs(o,u,h),ui=m;break;case 22:o.memoizedState===null&&(m=o.alternate,m!==null&&m.memoizedState!==null?(m=rf,rf=16777216,Xs(o,u,h),rf=m):Xs(o,u,h));break;default:Xs(o,u,h)}}function OT(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];rn=m,kT(m,o)}OT(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)AT(o),o=o.sibling}function AT(o){switch(o.tag){case 0:case 11:case 15:af(o),o.flags&2048&&xl(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,ap(o)):af(o);break;default:af(o)}}function ap(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];rn=m,kT(m,o)}OT(o)}for(o=o.child;o!==null;){switch(u=o,u.tag){case 0:case 11:case 15:xl(8,u,u.return),ap(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,ap(u));break;default:ap(u)}o=o.sibling}}function kT(o,u){for(;rn!==null;){var h=rn;switch(h.tag){case 0:case 11:case 15:xl(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,rn=m;else e:for(h=o;rn!==null;){m=rn;var b=m.sibling,S=m.return;if(mT(m),m===h){rn=null;break e}if(b!==null){b.return=S,rn=b;break e}rn=S}}}var gH={getCacheForType:function(o){var u=vn(Ut),h=u.data.get(o);return h===void 0&&(h=o(),u.data.set(o,h)),h},cacheSignal:function(){return vn(Ut).controller.signal}},vH=typeof WeakMap=="function"?WeakMap:Map,Je=0,ct=null,Be=null,Ue=0,tt=0,Sr=null,Sl=!1,Ys=!1,db=!1,Ta=0,Pt=0,wl=0,Co=0,pb=0,wr=0,Gs=0,lf=null,rr=null,mb=!1,lp=0,CT=0,op=1/0,sp=null,Ol=null,Vt=0,Al=null,Zs=null,Ma=0,gb=0,vb=null,ET=null,of=0,yb=null;function Or(){return(Je&2)!==0&&Ue!==0?Ue&-Ue:z.T!==null?Ab():Fk()}function TT(){if(wr===0)if((Ue&536870912)===0||Fe){var o=gd;gd<<=1,(gd&3932160)===0&&(gd=262144),wr=o}else wr=536870912;return o=br.current,o!==null&&(o.flags|=32),wr}function ir(o,u,h){(o===ct&&(tt===2||tt===9)||o.cancelPendingCommit!==null)&&(Js(o,0),kl(o,Ue,wr,!1)),Ec(o,h),((Je&2)===0||o!==ct)&&(o===ct&&((Je&2)===0&&(Co|=h),Pt===4&&kl(o,Ue,wr,!1)),_i(o))}function MT(o,u,h){if((Je&6)!==0)throw Error(r(327));var m=!h&&(u&127)===0&&(u&o.expiredLanes)===0||Cc(o,u),b=m?xH(o,u):xb(o,u,!0),S=m;do{if(b===0){Ys&&!m&&kl(o,u,0,!1);break}else{if(h=o.current.alternate,S&&!yH(h)){b=xb(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 L=_.current.memoizedState.isDehydrated;if(L&&(Js(_,E).flags|=256),E=xb(_,E,!1),E!==2){if(db&&!L){_.errorRecoveryDisabledLanes|=S,Co|=S,b=4;break e}S=rr,rr=b,S!==null&&(rr===null?rr=S:rr.push.apply(rr,S))}b=E}if(S=!1,b!==2)continue}}if(b===1){Js(o,0),kl(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:kl(m,u,wr,!Sl);break e;case 2:rr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(b=lp+300-pr(),10<b)){if(kl(m,u,wr,!Sl),yd(m,0,!0)!==0)break e;Ma=u,m.timeoutHandle=l2(PT.bind(null,m,h,rr,sp,mb,u,wr,Co,Gs,Sl,S,"Throttled",-0,0),b);break e}PT(m,h,rr,sp,mb,u,wr,Co,Gs,Sl,S,null,-0,0)}}break}while(!0);_i(o)}function PT(o,u,h,m,b,S,E,_,L,q,J,re,X,Y){if(o.timeoutHandle=-1,re=u.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pa},wT(u,S,re);var ye=(S&62914560)===S?lp-pr():(S&4194048)===S?CT-pr():0;if(ye=n9(re,ye),ye!==null){Ma=S,o.cancelPendingCommit=ye(BT.bind(null,o,u,S,h,m,b,E,_,L,J,re,null,X,Y)),kl(o,S,E,!q);return}}BT(o,u,S,h,m,b,E,_,L)}function yH(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(!vr(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 kl(o,u,h,m){u&=~pb,u&=~Co,o.suspendedLanes|=u,o.pingedLanes&=~u,m&&(o.warmLanes|=u),m=o.expirationTimes;for(var b=u;0<b;){var S=31-gr(b),E=1<<S;m[S]=-1,b&=~E}h!==0&&$k(o,h,u)}function up(){return(Je&6)===0?(sf(0),!1):!0}function bb(){if(Be!==null){if(tt===0)var o=Be.return;else o=Be,ya=vo=null,L0(o),Fs=null,Fc=0,o=Be;for(;o!==null;)oT(o.alternate,o),o=o.return;Be=null}}function Js(o,u){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,BH(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),Ma=0,bb(),ct=o,Be=h=ga(o.current,null),Ue=u,tt=0,Sr=null,Sl=!1,Ys=Cc(o,u),db=!1,Gs=wr=pb=Co=wl=Pt=0,rr=lf=null,mb=!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-gr(m),S=1<<b;u|=o[b],m&=~S}return Ta=u,Pd(),h}function DT(o,u){Le=null,z.H=Gc,u===Hs||u===Bd?(u=VC(),tt=3):u===O0?(u=VC(),tt=4):tt=u===G0?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Sr=u,Be===null&&(Pt=1,Zd(o,Br(u,o.current)))}function _T(){var o=br.current;return o===null?!0:(Ue&4194048)===Ue?Hr===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?o===Hr:!1}function NT(){var o=z.H;return z.H=Gc,o===null?Gc:o}function RT(){var o=z.A;return z.A=gH,o}function cp(){Pt=4,Sl||(Ue&4194048)!==Ue&&br.current!==null||(Ys=!0),(wl&134217727)===0&&(Co&134217727)===0||ct===null||kl(ct,Ue,wr,!1)}function xb(o,u,h){var m=Je;Je|=2;var b=NT(),S=RT();(ct!==o||Ue!==u)&&(sp=null,Js(o,u)),u=!1;var E=Pt;e:do try{if(tt!==0&&Be!==null){var _=Be,L=Sr;switch(tt){case 8:bb(),E=6;break e;case 3:case 2:case 9:case 6:br.current===null&&(u=!0);var q=tt;if(tt=0,Sr=null,eu(o,_,L,q),h&&Ys){E=0;break e}break;default:q=tt,tt=0,Sr=null,eu(o,_,L,q)}}bH(),E=Pt;break}catch(J){DT(o,J)}while(!0);return u&&o.shellSuspendCounter++,ya=vo=null,Je=m,z.H=b,z.A=S,Be===null&&(ct=null,Ue=0,Pd()),E}function bH(){for(;Be!==null;)LT(Be)}function xH(o,u){var h=Je;Je|=2;var m=NT(),b=RT();ct!==o||Ue!==u?(sp=null,op=pr()+500,Js(o,u)):Ys=Cc(o,u);e:do try{if(tt!==0&&Be!==null){u=Be;var S=Sr;t:switch(tt){case 1:tt=0,Sr=null,eu(o,u,S,1);break;case 2:case 9:if(WC(S)){tt=0,Sr=null,jT(u);break}u=function(){tt!==2&&tt!==9||ct!==o||(tt=7),_i(o)},S.then(u,u);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:WC(S)?(tt=0,Sr=null,jT(u)):(tt=0,Sr=null,eu(o,u,S,7));break;case 5:var E=null;switch(Be.tag){case 26:E=Be.memoizedState;case 5:case 27:var _=Be;if(E?S2(E):_.stateNode.complete){tt=0,Sr=null;var L=_.sibling;if(L!==null)Be=L;else{var q=_.return;q!==null?(Be=q,fp(q)):Be=null}break t}}tt=0,Sr=null,eu(o,u,S,5);break;case 6:tt=0,Sr=null,eu(o,u,S,6);break;case 8:bb(),Pt=6;break e;default:throw Error(r(462))}}SH();break}catch(J){DT(o,J)}while(!0);return ya=vo=null,z.H=m,z.A=b,Je=h,Be!==null?0:(ct=null,Ue=0,Pd(),Pt)}function SH(){for(;Be!==null&&!q6();)LT(Be)}function LT(o){var u=aT(o.alternate,o,Ta);o.memoizedProps=o.pendingProps,u===null?fp(o):Be=u}function jT(o){var u=o,h=u.alternate;switch(u.tag){case 15:case 0:u=JE(h,u,u.pendingProps,u.type,void 0,Ue);break;case 11:u=JE(h,u,u.pendingProps,u.type.render,u.ref,Ue);break;case 5:L0(u);default:oT(h,u),u=Be=RC(u,Ta),u=aT(h,u,Ta)}o.memoizedProps=o.pendingProps,u===null?fp(o):Be=u}function eu(o,u,h,m){ya=vo=null,L0(u),Fs=null,Fc=0;var b=u.return;try{if(uH(o,b,u,h,Ue)){Pt=1,Zd(o,Br(h,o.current)),Be=null;return}}catch(S){if(b!==null)throw Be=b,S;Pt=1,Zd(o,Br(h,o.current)),Be=null;return}u.flags&32768?(Fe||m===1?o=!0:Ys||(Ue&536870912)!==0?o=!1:(Sl=o=!0,(m===2||m===9||m===3||m===6)&&(m=br.current,m!==null&&m.tag===13&&(m.flags|=16384))),IT(u,o)):fp(u)}function fp(o){var u=o;do{if((u.flags&32768)!==0){IT(u,Sl);return}o=u.return;var h=hH(u.alternate,u,Ta);if(h!==null){Be=h;return}if(u=u.sibling,u!==null){Be=u;return}Be=u=o}while(u!==null);Pt===0&&(Pt=5)}function IT(o,u){do{var h=dH(o.alternate,o);if(h!==null){h.flags&=32767,Be=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(o=o.sibling,o!==null)){Be=o;return}Be=o=h}while(o!==null);Pt=6,Be=null}function BT(o,u,h,m,b,S,E,_,L){o.cancelPendingCommit=null;do hp();while(Vt!==0);if((Je&6)!==0)throw Error(r(327));if(u!==null){if(u===o.current)throw Error(r(177));if(S=u.lanes|u.childLanes,S|=s0,eU(o,h,S,E,_,L),o===ct&&(Be=ct=null,Ue=0),Zs=u,Al=o,Ma=h,gb=S,vb=b,ET=m,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,kH(pd,function(){return FT(),null})):(o.callbackNode=null,o.callbackPriority=0),m=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||m){m=z.T,z.T=null,b=Z.p,Z.p=2,E=Je,Je|=4;try{pH(o,u,h)}finally{Je=E,Z.p=b,z.T=m}}Vt=1,zT(),$T(),UT()}}function zT(){if(Vt===1){Vt=0;var o=Al,u=Zs,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=z.T,z.T=null;var m=Z.p;Z.p=2;var b=Je;Je|=4;try{bT(u,o);var S=_b,E=kC(o.containerInfo),_=S.focusedElem,L=S.selectionRange;if(E!==_&&_&&_.ownerDocument&&AC(_.ownerDocument.documentElement,_)){if(L!==null&&r0(_)){var q=L.start,J=L.end;if(J===void 0&&(J=q),"selectionStart"in _)_.selectionStart=q,_.selectionEnd=Math.min(J,_.value.length);else{var re=_.ownerDocument||document,X=re&&re.defaultView||window;if(X.getSelection){var Y=X.getSelection(),ye=_.textContent.length,Me=Math.min(L.start,ye),lt=L.end===void 0?Me:Math.min(L.end,ye);!Y.extend&&Me>lt&&(E=lt,lt=Me,Me=E);var $=OC(_,Me),I=OC(_,lt);if($&&I&&(Y.rangeCount!==1||Y.anchorNode!==$.node||Y.anchorOffset!==$.offset||Y.focusNode!==I.node||Y.focusOffset!==I.offset)){var H=re.createRange();H.setStart($.node,$.offset),Y.removeAllRanges(),Me>lt?(Y.addRange(H),Y.extend(I.node,I.offset)):(H.setEnd(I.node,I.offset),Y.addRange(H))}}}}for(re=[],Y=_;Y=Y.parentNode;)Y.nodeType===1&&re.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<re.length;_++){var ne=re[_];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Ap=!!Db,_b=Db=null}finally{Je=b,Z.p=m,z.T=h}}o.current=u,Vt=2}}function $T(){if(Vt===2){Vt=0;var o=Al,u=Zs,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=z.T,z.T=null;var m=Z.p;Z.p=2;var b=Je;Je|=4;try{pT(o,u.alternate,u)}finally{Je=b,Z.p=m,z.T=h}}Vt=3}}function UT(){if(Vt===4||Vt===3){Vt=0,W6();var o=Al,u=Zs,h=Ma,m=ET;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Vt=5:(Vt=0,Zs=Al=null,HT(o,o.pendingLanes));var b=o.pendingLanes;if(b===0&&(Ol=null),By(h),u=u.stateNode,mr&&typeof mr.onCommitFiberRoot=="function")try{mr.onCommitFiberRoot(kc,u,void 0,(u.current.flags&128)===128)}catch{}if(m!==null){u=z.T,b=Z.p,Z.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,Z.p=b}}(Ma&3)!==0&&hp(),_i(o),b=o.pendingLanes,(h&261930)!==0&&(b&42)!==0?o===yb?of++:(of=0,yb=o):of=0,sf(0)}}function HT(o,u){(o.pooledCacheLanes&=u)===0&&(u=o.pooledCache,u!=null&&(o.pooledCache=null,Uc(u)))}function hp(){return zT(),$T(),UT(),FT()}function FT(){if(Vt!==5)return!1;var o=Al,u=gb;gb=0;var h=By(Ma),m=z.T,b=Z.p;try{Z.p=32>h?32:h,z.T=null,h=vb,vb=null;var S=Al,E=Ma;if(Vt=0,Zs=Al=null,Ma=0,(Je&6)!==0)throw Error(r(331));var _=Je;if(Je|=4,AT(S.current),ST(S,S.current,E,h),Je=_,sf(0,!1),mr&&typeof mr.onPostCommitFiberRoot=="function")try{mr.onPostCommitFiberRoot(kc,S)}catch{}return!0}finally{Z.p=b,z.T=m,HT(o,u)}}function qT(o,u,h){u=Br(h,u),u=Y0(o.stateNode,u,2),o=vl(o,u,2),o!==null&&(Ec(o,2),_i(o))}function nt(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"&&(Ol===null||!Ol.has(m))){o=Br(h,o),h=WE(2),m=vl(u,h,2),m!==null&&(KE(h,m,u,o),Ec(m,2),_i(m));break}}u=u.return}}function Sb(o,u,h){var m=o.pingCache;if(m===null){m=o.pingCache=new vH;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)||(db=!0,b.add(h),o=wH.bind(null,o,u,h),u.then(o,o))}function wH(o,u,h){var m=o.pingCache;m!==null&&m.delete(u),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,ct===o&&(Ue&h)===h&&(Pt===4||Pt===3&&(Ue&62914560)===Ue&&300>pr()-lp?(Je&2)===0&&Js(o,0):pb|=h,Gs===Ue&&(Gs=0)),_i(o)}function WT(o,u){u===0&&(u=zk()),o=po(o,u),o!==null&&(Ec(o,u),_i(o))}function OH(o){var u=o.memoizedState,h=0;u!==null&&(h=u.retryLane),WT(o,h)}function AH(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),WT(o,h)}function kH(o,u){return Ry(o,u)}var dp=null,tu=null,wb=!1,pp=!1,Ob=!1,Cl=0;function _i(o){o!==tu&&o.next===null&&(tu===null?dp=tu=o:tu=tu.next=o),pp=!0,wb||(wb=!0,EH())}function sf(o,u){if(!Ob&&pp){Ob=!0;do for(var h=!1,m=dp;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-gr(42|o)+1)-1,S&=b&~(E&~_),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(h=!0,XT(m,S))}else S=Ue,S=yd(m,m===ct?S:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(S&3)===0||Cc(m,S)||(h=!0,XT(m,S));m=m.next}while(h);Ob=!1}}function CH(){KT()}function KT(){pp=wb=!1;var o=0;Cl!==0&&IH()&&(o=Cl);for(var u=pr(),h=null,m=dp;m!==null;){var b=m.next,S=VT(m,u);S===0?(m.next=null,h===null?dp=b:h.next=b,b===null&&(tu=h)):(h=m,(o!==0||(S&3)!==0)&&(pp=!0)),m=b}Vt!==0&&Vt!==5||sf(o),Cl!==0&&(Cl=0)}function VT(o,u){for(var h=o.suspendedLanes,m=o.pingedLanes,b=o.expirationTimes,S=o.pendingLanes&-62914561;0<S;){var E=31-gr(S),_=1<<E,L=b[E];L===-1?((_&h)===0||(_&m)!==0)&&(b[E]=J6(_,u)):L<=u&&(o.expiredLanes|=_),S&=~_}if(u=ct,h=Ue,h=yd(o,o===u?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),m=o.callbackNode,h===0||o===u&&(tt===2||tt===9)||o.cancelPendingCommit!==null)return m!==null&&m!==null&&Ly(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&&Ly(m),By(h)){case 2:case 8:h=Ik;break;case 32:h=pd;break;case 268435456:h=Bk;break;default:h=pd}return m=QT.bind(null,o),h=Ry(h,m),o.callbackPriority=u,o.callbackNode=h,u}return m!==null&&m!==null&&Ly(m),o.callbackPriority=2,o.callbackNode=null,2}function QT(o,u){if(Vt!==0&&Vt!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(hp()&&o.callbackNode!==h)return null;var m=Ue;return m=yd(o,o===ct?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),m===0?null:(MT(o,m,u),VT(o,pr()),o.callbackNode!=null&&o.callbackNode===h?QT.bind(null,o):null)}function XT(o,u){if(hp())return null;MT(o,u,!0)}function EH(){zH(function(){(Je&6)!==0?Ry(jk,CH):KT()})}function Ab(){if(Cl===0){var o=$s;o===0&&(o=md,md<<=1,(md&261888)===0&&(md=256)),Cl=o}return Cl}function YT(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:wd(""+o)}function GT(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 TH(o,u,h,m,b){if(u==="submit"&&h&&h.stateNode===b){var S=YT((b[Zn]||null).action),E=m.submitter;E&&(u=(u=E[Zn]||null)?YT(u.formAction):E.getAttribute("formAction"),u!==null&&(S=u,E=null));var _=new Cd("action","action",null,m,b);o.push({event:_,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Cl!==0){var L=E?GT(b,E):new FormData(b);q0(h,{pending:!0,data:L,method:b.method,action:S},null,L)}}else typeof S=="function"&&(_.preventDefault(),L=E?GT(b,E):new FormData(b),q0(h,{pending:!0,data:L,method:b.method,action:S},S,L))},currentTarget:b}]})}}for(var kb=0;kb<o0.length;kb++){var Cb=o0[kb],MH=Cb.toLowerCase(),PH=Cb[0].toUpperCase()+Cb.slice(1);si(MH,"on"+PH)}si(TC,"onAnimationEnd"),si(MC,"onAnimationIteration"),si(PC,"onAnimationStart"),si("dblclick","onDoubleClick"),si("focusin","onFocus"),si("focusout","onBlur"),si(KU,"onTransitionRun"),si(VU,"onTransitionStart"),si(QU,"onTransitionCancel"),si(DC,"onTransitionEnd"),Cs("onMouseEnter",["mouseout","mouseover"]),Cs("onMouseLeave",["mouseout","mouseover"]),Cs("onPointerEnter",["pointerout","pointerover"]),Cs("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(" "),DH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(uf));function ZT(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],L=_.instance,q=_.currentTarget;if(_=_.listener,L!==S&&b.isPropagationStopped())break e;S=_,b.currentTarget=q;try{S(b)}catch(J){Md(J)}b.currentTarget=null,S=L}else for(E=0;E<m.length;E++){if(_=m[E],L=_.instance,q=_.currentTarget,_=_.listener,L!==S&&b.isPropagationStopped())break e;S=_,b.currentTarget=q;try{S(b)}catch(J){Md(J)}b.currentTarget=null,S=L}}}}function ze(o,u){var h=u[zy];h===void 0&&(h=u[zy]=new Set);var m=o+"__bubble";h.has(m)||(JT(u,o,2,!1),h.add(m))}function Eb(o,u,h){var m=0;u&&(m|=4),JT(h,o,m,u)}var mp="_reactListening"+Math.random().toString(36).slice(2);function Tb(o){if(!o[mp]){o[mp]=!0,Kk.forEach(function(h){h!=="selectionchange"&&(DH.has(h)||Eb(h,!1,o),Eb(h,!0,o))});var u=o.nodeType===9?o:o.ownerDocument;u===null||u[mp]||(u[mp]=!0,Eb("selectionchange",!1,u))}}function JT(o,u,h,m){switch(T2(u)){case 2:var b=a9;break;case 8:b=l9;break;default:b=Fb}h=b.bind(null,u,h,o),b=void 0,!Qy||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 Mb(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 L=E.tag;if((L===3||L===4)&&E.stateNode.containerInfo===b)return;E=E.return}for(;_!==null;){if(E=Os(_),E===null)return;if(L=E.tag,L===5||L===6||L===26||L===27){m=S=E;continue e}_=_.parentNode}}m=m.return}iC(function(){var q=S,J=Ky(h),re=[];e:{var X=_C.get(o);if(X!==void 0){var Y=Cd,ye=o;switch(o){case"keypress":if(Ad(h)===0)break e;case"keydown":case"keyup":Y=AU;break;case"focusin":ye="focus",Y=Zy;break;case"focusout":ye="blur",Y=Zy;break;case"beforeblur":case"afterblur":Y=Zy;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":Y=oC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=hU;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=EU;break;case TC:case MC:case PC:Y=mU;break;case DC:Y=MU;break;case"scroll":case"scrollend":Y=cU;break;case"wheel":Y=DU;break;case"copy":case"cut":case"paste":Y=vU;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=uC;break;case"toggle":case"beforetoggle":Y=NU}var Me=(u&4)!==0,lt=!Me&&(o==="scroll"||o==="scrollend"),$=Me?X!==null?X+"Capture":null:X;Me=[];for(var I=q,H;I!==null;){var ne=I;if(H=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||H===null||$===null||(ne=Pc(I,$),ne!=null&&Me.push(cf(I,ne,H))),lt)break;I=I.return}0<Me.length&&(X=new Y(X,ye,null,h,J),re.push({event:X,listeners:Me}))}}if((u&7)===0){e:{if(X=o==="mouseover"||o==="pointerover",Y=o==="mouseout"||o==="pointerout",X&&h!==Wy&&(ye=h.relatedTarget||h.fromElement)&&(Os(ye)||ye[ws]))break e;if((Y||X)&&(X=J.window===J?J:(X=J.ownerDocument)?X.defaultView||X.parentWindow:window,Y?(ye=h.relatedTarget||h.toElement,Y=q,ye=ye?Os(ye):null,ye!==null&&(lt=a(ye),Me=ye.tag,ye!==lt||Me!==5&&Me!==27&&Me!==6)&&(ye=null)):(Y=null,ye=q),Y!==ye)){if(Me=oC,ne="onMouseLeave",$="onMouseEnter",I="mouse",(o==="pointerout"||o==="pointerover")&&(Me=uC,ne="onPointerLeave",$="onPointerEnter",I="pointer"),lt=Y==null?X:Mc(Y),H=ye==null?X:Mc(ye),X=new Me(ne,I+"leave",Y,h,J),X.target=lt,X.relatedTarget=H,ne=null,Os(J)===q&&(Me=new Me($,I+"enter",ye,h,J),Me.target=H,Me.relatedTarget=lt,ne=Me),lt=ne,Y&&ye)t:{for(Me=_H,$=Y,I=ye,H=0,ne=$;ne;ne=Me(ne))H++;ne=0;for(var Ae=I;Ae;Ae=Me(Ae))ne++;for(;0<H-ne;)$=Me($),H--;for(;0<ne-H;)I=Me(I),ne--;for(;H--;){if($===I||I!==null&&$===I.alternate){Me=$;break t}$=Me($),I=Me(I)}Me=null}else Me=null;Y!==null&&e2(re,X,Y,Me,!1),ye!==null&<!==null&&e2(re,lt,ye,Me,!0)}}e:{if(X=q?Mc(q):window,Y=X.nodeName&&X.nodeName.toLowerCase(),Y==="select"||Y==="input"&&X.type==="file")var Qe=vC;else if(mC(X))if(yC)Qe=FU;else{Qe=UU;var Se=$U}else Y=X.nodeName,!Y||Y.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?q&&qy(q.elementType)&&(Qe=vC):Qe=HU;if(Qe&&(Qe=Qe(o,q))){gC(re,Qe,h,J);break e}Se&&Se(o,X,q),o==="focusout"&&q&&X.type==="number"&&q.memoizedProps.value!=null&&Fy(X,"number",X.value)}switch(Se=q?Mc(q):window,o){case"focusin":(mC(Se)||Se.contentEditable==="true")&&(_s=Se,i0=q,Bc=null);break;case"focusout":Bc=i0=_s=null;break;case"mousedown":a0=!0;break;case"contextmenu":case"mouseup":case"dragend":a0=!1,CC(re,h,J);break;case"selectionchange":if(WU)break;case"keydown":case"keyup":CC(re,h,J)}var je;if(e0)e:{switch(o){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Ds?dC(o,h)&&(He="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(He="onCompositionStart");He&&(cC&&h.locale!=="ko"&&(Ds||He!=="onCompositionStart"?He==="onCompositionEnd"&&Ds&&(je=aC()):(cl=J,Xy="value"in cl?cl.value:cl.textContent,Ds=!0)),Se=gp(q,He),0<Se.length&&(He=new sC(He,o,null,h,J),re.push({event:He,listeners:Se}),je?He.data=je:(je=pC(h),je!==null&&(He.data=je)))),(je=LU?jU(o,h):IU(o,h))&&(He=gp(q,"onBeforeInput"),0<He.length&&(Se=new sC("onBeforeInput","beforeinput",null,h,J),re.push({event:Se,listeners:He}),Se.data=je)),TH(re,o,q,h,J)}ZT(re,u)})}function cf(o,u,h){return{instance:o,listener:u,currentTarget:h}}function gp(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=Pc(o,h),b!=null&&m.unshift(cf(o,b,S)),b=Pc(o,u),b!=null&&m.push(cf(o,b,S))),o.tag===3)return m;o=o.return}return[]}function _H(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function e2(o,u,h,m,b){for(var S=u._reactName,E=[];h!==null&&h!==m;){var _=h,L=_.alternate,q=_.stateNode;if(_=_.tag,L!==null&&L===m)break;_!==5&&_!==26&&_!==27||q===null||(L=q,b?(q=Pc(h,S),q!=null&&E.unshift(cf(h,q,L))):b||(q=Pc(h,S),q!=null&&E.push(cf(h,q,L)))),h=h.return}E.length!==0&&o.push({event:u,listeners:E})}var NH=/\r\n?/g,RH=/\u0000|\uFFFD/g;function t2(o){return(typeof o=="string"?o:""+o).replace(NH,`
|
|
9
|
+
`).replace(RH,"")}function n2(o,u){return u=t2(u),t2(o)===u}function at(o,u,h,m,b,S){switch(h){case"children":typeof m=="string"?u==="body"||u==="textarea"&&m===""||Ts(o,m):(typeof m=="number"||typeof m=="bigint")&&u!=="body"&&Ts(o,""+m);break;case"className":xd(o,"class",m);break;case"tabIndex":xd(o,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":xd(o,h,m);break;case"style":nC(o,m,S);break;case"data":if(u!=="object"){xd(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=wd(""+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"&&at(o,u,"name",b.name,b,null),at(o,u,"formEncType",b.formEncType,b,null),at(o,u,"formMethod",b.formMethod,b,null),at(o,u,"formTarget",b.formTarget,b,null)):(at(o,u,"encType",b.encType,b,null),at(o,u,"method",b.method,b,null),at(o,u,"target",b.target,b,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){o.removeAttribute(h);break}m=wd(""+m),o.setAttribute(h,m);break;case"onClick":m!=null&&(o.onclick=pa);break;case"onScroll":m!=null&&ze("scroll",o);break;case"onScrollEnd":m!=null&&ze("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=wd(""+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":ze("beforetoggle",o),ze("toggle",o),bd(o,"popover",m);break;case"xlinkActuate":da(o,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":da(o,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":da(o,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":da(o,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":da(o,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":da(o,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":da(o,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":da(o,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":da(o,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":bd(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=sU.get(h)||h,bd(o,h,m))}}function Pb(o,u,h,m,b,S){switch(h){case"style":nC(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"?Ts(o,m):(typeof m=="number"||typeof m=="bigint")&&Ts(o,""+m);break;case"onScroll":m!=null&&ze("scroll",o);break;case"onScrollEnd":m!=null&&ze("scrollend",o);break;case"onClick":m!=null&&(o.onclick=pa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vk.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[Zn]||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,""):bd(o,h,m)}}}function bn(o,u,h){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",o),ze("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:at(o,u,S,E,h,null)}}b&&at(o,u,"srcSet",h.srcSet,h,null),m&&at(o,u,"src",h.src,h,null);return;case"input":ze("invalid",o);var _=S=E=b=null,L=null,q=null;for(m in h)if(h.hasOwnProperty(m)){var J=h[m];if(J!=null)switch(m){case"name":b=J;break;case"type":E=J;break;case"checked":L=J;break;case"defaultChecked":q=J;break;case"value":S=J;break;case"defaultValue":_=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,u));break;default:at(o,u,m,J,h,null)}}Zk(o,S,_,L,q,E,b,!1);return;case"select":ze("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:at(o,u,b,_,h,null)}u=S,h=E,o.multiple=!!m,u!=null?Es(o,!!m,u,!1):h!=null&&Es(o,!!m,h,!0);return;case"textarea":ze("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:at(o,u,E,_,h,null)}eC(o,m,b,S);return;case"option":for(L in h)h.hasOwnProperty(L)&&(m=h[L],m!=null)&&(L==="selected"?o.selected=m&&typeof m!="function"&&typeof m!="symbol":at(o,u,L,m,h,null));return;case"dialog":ze("beforetoggle",o),ze("toggle",o),ze("cancel",o),ze("close",o);break;case"iframe":case"object":ze("load",o);break;case"video":case"audio":for(m=0;m<uf.length;m++)ze(uf[m],o);break;case"image":ze("error",o),ze("load",o);break;case"details":ze("toggle",o);break;case"embed":case"source":case"link":ze("error",o),ze("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(q in h)if(h.hasOwnProperty(q)&&(m=h[q],m!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:at(o,u,q,m,h,null)}return;default:if(qy(u)){for(J in h)h.hasOwnProperty(J)&&(m=h[J],m!==void 0&&Pb(o,u,J,m,h,void 0));return}}for(_ in h)h.hasOwnProperty(_)&&(m=h[_],m!=null&&at(o,u,_,m,h,null))}function LH(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,L=null,q=null,J=null;for(Y in h){var re=h[Y];if(h.hasOwnProperty(Y)&&re!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":L=re;default:m.hasOwnProperty(Y)||at(o,u,Y,null,m,re)}}for(var X in m){var Y=m[X];if(re=h[X],m.hasOwnProperty(X)&&(Y!=null||re!=null))switch(X){case"type":S=Y;break;case"name":b=Y;break;case"checked":q=Y;break;case"defaultChecked":J=Y;break;case"value":E=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,u));break;default:Y!==re&&at(o,u,X,Y,m,re)}}Hy(o,E,_,L,q,J,S,b);return;case"select":Y=E=_=X=null;for(S in h)if(L=h[S],h.hasOwnProperty(S)&&L!=null)switch(S){case"value":break;case"multiple":Y=L;default:m.hasOwnProperty(S)||at(o,u,S,null,m,L)}for(b in m)if(S=m[b],L=h[b],m.hasOwnProperty(b)&&(S!=null||L!=null))switch(b){case"value":X=S;break;case"defaultValue":_=S;break;case"multiple":E=S;default:S!==L&&at(o,u,b,S,m,L)}u=_,h=E,m=Y,X!=null?Es(o,!!h,X,!1):!!m!=!!h&&(u!=null?Es(o,!!h,u,!0):Es(o,!!h,h?[]:"",!1));return;case"textarea":Y=X=null;for(_ in h)if(b=h[_],h.hasOwnProperty(_)&&b!=null&&!m.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:at(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":X=b;break;case"defaultValue":Y=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==S&&at(o,u,E,b,m,S)}Jk(o,X,Y);return;case"option":for(var ye in h)X=h[ye],h.hasOwnProperty(ye)&&X!=null&&!m.hasOwnProperty(ye)&&(ye==="selected"?o.selected=!1:at(o,u,ye,null,m,X));for(L in m)X=m[L],Y=h[L],m.hasOwnProperty(L)&&X!==Y&&(X!=null||Y!=null)&&(L==="selected"?o.selected=X&&typeof X!="function"&&typeof X!="symbol":at(o,u,L,X,m,Y));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)X=h[Me],h.hasOwnProperty(Me)&&X!=null&&!m.hasOwnProperty(Me)&&at(o,u,Me,null,m,X);for(q in m)if(X=m[q],Y=h[q],m.hasOwnProperty(q)&&X!==Y&&(X!=null||Y!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,u));break;default:at(o,u,q,X,m,Y)}return;default:if(qy(u)){for(var lt in h)X=h[lt],h.hasOwnProperty(lt)&&X!==void 0&&!m.hasOwnProperty(lt)&&Pb(o,u,lt,void 0,m,X);for(J in m)X=m[J],Y=h[J],!m.hasOwnProperty(J)||X===Y||X===void 0&&Y===void 0||Pb(o,u,J,X,m,Y);return}}for(var $ in h)X=h[$],h.hasOwnProperty($)&&X!=null&&!m.hasOwnProperty($)&&at(o,u,$,null,m,X);for(re in m)X=m[re],Y=h[re],!m.hasOwnProperty(re)||X===Y||X==null&&Y==null||at(o,u,re,X,m,Y)}function r2(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jH(){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&&_&&r2(E)){for(E=0,_=b.responseEnd,m+=1;m<h.length;m++){var L=h[m],q=L.startTime;if(q>_)break;var J=L.transferSize,re=L.initiatorType;J&&r2(re)&&(L=L.responseEnd,E+=J*(L<_?1:(_-q)/(L-q)))}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 Db=null,_b=null;function vp(o){return o.nodeType===9?o:o.ownerDocument}function i2(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 a2(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 Nb(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 Rb=null;function IH(){var o=window.event;return o&&o.type==="popstate"?o===Rb?!1:(Rb=o,!0):(Rb=null,!1)}var l2=typeof setTimeout=="function"?setTimeout:void 0,BH=typeof clearTimeout=="function"?clearTimeout:void 0,o2=typeof Promise=="function"?Promise:void 0,zH=typeof queueMicrotask=="function"?queueMicrotask:typeof o2<"u"?function(o){return o2.resolve(null).then(o).catch($H)}:l2;function $H(o){setTimeout(function(){throw o})}function El(o){return o==="head"}function s2(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),au(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);au(u)}function u2(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 Lb(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":Lb(h),$y(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function UH(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=Fr(o.nextSibling),o===null)break}return null}function HH(o,u,h){if(u==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=Fr(o.nextSibling),o===null))return null;return o}function c2(o,u){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=Fr(o.nextSibling),o===null))return null;return o}function jb(o){return o.data==="$?"||o.data==="$~"}function Ib(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function FH(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 Fr(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 Bb=null;function f2(o){o=o.nextSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(u===0)return Fr(o.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}o=o.nextSibling}return null}function h2(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 d2(o,u,h){switch(u=vp(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]);$y(o)}var qr=new Map,p2=new Set;function yp(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Pa=Z.d;Z.d={f:qH,r:WH,D:KH,C:VH,L:QH,m:XH,X:GH,S:YH,M:ZH};function qH(){var o=Pa.f(),u=up();return o||u}function WH(o){var u=As(o);u!==null&&u.tag===5&&u.type==="form"?DE(u):Pa.r(o)}var nu=typeof document>"u"?null:document;function m2(o,u,h){var m=nu;if(m&&typeof u=="string"&&u){var b=jr(u);b='link[rel="'+o+'"][href="'+b+'"]',typeof h=="string"&&(b+='[crossorigin="'+h+'"]'),p2.has(b)||(p2.add(b),o={rel:o,crossOrigin:h,href:u},m.querySelector(b)===null&&(u=m.createElement("link"),bn(u,"link",o),nn(u),m.head.appendChild(u)))}}function KH(o){Pa.D(o),m2("dns-prefetch",o,null)}function VH(o,u){Pa.C(o,u),m2("preconnect",o,u)}function QH(o,u,h){Pa.L(o,u,h);var m=nu;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=ru(o);break;case"script":S=iu(o)}qr.has(S)||(o=p({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:o,as:u},h),qr.set(S,o),m.querySelector(b)!==null||u==="style"&&m.querySelector(hf(S))||u==="script"&&m.querySelector(df(S))||(u=m.createElement("link"),bn(u,"link",o),nn(u),m.head.appendChild(u)))}}function XH(o,u){Pa.m(o,u);var h=nu;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=iu(o)}if(!qr.has(S)&&(o=p({rel:"modulepreload",href:o},u),qr.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"),bn(m,"link",o),nn(m),h.head.appendChild(m)}}}function YH(o,u,h){Pa.S(o,u,h);var m=nu;if(m&&o){var b=ks(m).hoistableStyles,S=ru(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=qr.get(S))&&zb(o,h);var L=E=m.createElement("link");nn(L),bn(L,"link",o),L._p=new Promise(function(q,J){L.onload=q,L.onerror=J}),L.addEventListener("load",function(){_.loading|=1}),L.addEventListener("error",function(){_.loading|=2}),_.loading|=4,bp(E,u,m)}E={type:"stylesheet",instance:E,count:1,state:_},b.set(S,E)}}}function GH(o,u){Pa.X(o,u);var h=nu;if(h&&o){var m=ks(h).hoistableScripts,b=iu(o),S=m.get(b);S||(S=h.querySelector(df(b)),S||(o=p({src:o,async:!0},u),(u=qr.get(b))&&$b(o,u),S=h.createElement("script"),nn(S),bn(S,"link",o),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(b,S))}}function ZH(o,u){Pa.M(o,u);var h=nu;if(h&&o){var m=ks(h).hoistableScripts,b=iu(o),S=m.get(b);S||(S=h.querySelector(df(b)),S||(o=p({src:o,async:!0,type:"module"},u),(u=qr.get(b))&&$b(o,u),S=h.createElement("script"),nn(S),bn(S,"link",o),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(b,S))}}function g2(o,u,h,m){var b=(b=Oe.current)?yp(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=ru(h.href),h=ks(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=ru(h.href);var S=ks(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),qr.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},qr.set(o,h),S||JH(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=iu(h),h=ks(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 ru(o){return'href="'+jr(o)+'"'}function hf(o){return'link[rel="stylesheet"]['+o+"]"}function v2(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function JH(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}),bn(u,"link",h),nn(u),o.head.appendChild(u))}function iu(o){return'[src="'+jr(o)+'"]'}function df(o){return"script[async]"+o}function y2(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,nn(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"),nn(m),bn(m,"style",b),bp(m,h.precedence,o),u.instance=m;case"stylesheet":b=ru(h.href);var S=o.querySelector(hf(b));if(S)return u.state.loading|=4,u.instance=S,nn(S),S;m=v2(h),(b=qr.get(b))&&zb(m,b),S=(o.ownerDocument||o).createElement("link"),nn(S);var E=S;return E._p=new Promise(function(_,L){E.onload=_,E.onerror=L}),bn(S,"link",m),u.state.loading|=4,bp(S,h.precedence,o),u.instance=S;case"script":return S=iu(h.src),(b=o.querySelector(df(S)))?(u.instance=b,nn(b),b):(m=h,(b=qr.get(S))&&(m=p({},h),$b(m,b)),o=o.ownerDocument||o,b=o.createElement("script"),nn(b),bn(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,bp(m,h.precedence,o));return u.instance}function bp(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 zb(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.title==null&&(o.title=u.title)}function $b(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.integrity==null&&(o.integrity=u.integrity)}var xp=null;function b2(o,u,h){if(xp===null){var m=new Map,b=xp=new Map;b.set(h,m)}else b=xp,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[mn]||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 x2(o,u,h){o=o.ownerDocument||o,o.head.insertBefore(h,u==="title"?o.querySelector("head > title"):null)}function e9(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 S2(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function t9(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=ru(m.href),S=u.querySelector(hf(b));if(S){u=S._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(o.count++,o=Sp.bind(o),u.then(o,o)),h.state.loading|=4,h.instance=S,nn(S);return}S=u.ownerDocument||u,m=v2(m),(b=qr.get(b))&&zb(m,b),S=S.createElement("link"),nn(S);var E=S;E._p=new Promise(function(_,L){E.onload=_,E.onerror=L}),bn(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=Sp.bind(o),u.addEventListener("load",h),u.addEventListener("error",h))}}var Ub=0;function n9(o,u){return o.stylesheets&&o.count===0&&Op(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var m=setTimeout(function(){if(o.stylesheets&&Op(o,o.stylesheets),o.unsuspend){var S=o.unsuspend;o.unsuspend=null,S()}},6e4+u);0<o.imgBytes&&Ub===0&&(Ub=62500*jH());var b=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Op(o,o.stylesheets),o.unsuspend)){var S=o.unsuspend;o.unsuspend=null,S()}},(o.imgBytes>Ub?50:800)+u);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function Sp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Op(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var wp=null;function Op(o,u){o.stylesheets=null,o.unsuspend!==null&&(o.count++,wp=new Map,u.forEach(r9,o),wp=null,Sp.call(o))}function r9(o,u){if(!(u.state.loading&4)){var h=wp.get(o);if(h)var m=h.get(null);else{h=new Map,wp.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=Sp.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:ae,_currentValue2:ae,_threadCount:0};function i9(o,u,h,m,b,S,E,_,L){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=jy(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jy(0),this.hiddenUpdates=jy(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=S,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function w2(o,u,h,m,b,S,E,_,L,q,J,re){return o=new i9(o,u,h,E,L,q,J,re,_),u=1,S===!0&&(u|=24),S=yr(3,null,null,u),o.current=S,S.stateNode=o,u=x0(),u.refCount++,o.pooledCache=u,u.refCount++,S.memoizedState={element:m,isDehydrated:h,cache:u},A0(S),o}function O2(o){return o?(o=Ls,o):Ls}function A2(o,u,h,m,b,S){b=O2(b),m.context===null?m.context=b:m.pendingContext=b,m=gl(u),m.payload={element:h},S=S===void 0?null:S,S!==null&&(m.callback=S),h=vl(o,m,u),h!==null&&(ir(h,o,u),Wc(h,o,u))}function k2(o,u){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<u?h:u}}function Hb(o,u){k2(o,u),(o=o.alternate)&&k2(o,u)}function C2(o){if(o.tag===13||o.tag===31){var u=po(o,67108864);u!==null&&ir(u,o,67108864),Hb(o,67108864)}}function E2(o){if(o.tag===13||o.tag===31){var u=Or();u=Iy(u);var h=po(o,u);h!==null&&ir(h,o,u),Hb(o,u)}}var Ap=!0;function a9(o,u,h,m){var b=z.T;z.T=null;var S=Z.p;try{Z.p=2,Fb(o,u,h,m)}finally{Z.p=S,z.T=b}}function l9(o,u,h,m){var b=z.T;z.T=null;var S=Z.p;try{Z.p=8,Fb(o,u,h,m)}finally{Z.p=S,z.T=b}}function Fb(o,u,h,m){if(Ap){var b=qb(m);if(b===null)Mb(o,u,m,kp,h),M2(o,m);else if(s9(b,o,u,h,m))m.stopPropagation();else if(M2(o,m),u&4&&-1<o9.indexOf(o)){for(;b!==null;){var S=As(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 L=1<<31-gr(E);_.entanglements[1]|=L,E&=~L}_i(S),(Je&6)===0&&(op=pr()+500,sf(0))}}break;case 31:case 13:_=po(S,2),_!==null&&ir(_,S,2),up(),Hb(S,2)}if(S=qb(m),S===null&&Mb(o,u,m,kp,h),S===b)break;b=S}b!==null&&m.stopPropagation()}else Mb(o,u,m,null,h)}}function qb(o){return o=Ky(o),Wb(o)}var kp=null;function Wb(o){if(kp=null,o=Os(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 kp=o,null}function T2(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(K6()){case jk:return 2;case Ik:return 8;case pd:case V6:return 32;case Bk:return 268435456;default:return 32}default:return 32}}var Kb=!1,Tl=null,Ml=null,Pl=null,mf=new Map,gf=new Map,Dl=[],o9="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 M2(o,u){switch(o){case"focusin":case"focusout":Tl=null;break;case"dragenter":case"dragleave":Ml=null;break;case"mouseover":case"mouseout":Pl=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=As(u),u!==null&&C2(u)),o):(o.eventSystemFlags|=m,u=o.targetContainers,b!==null&&u.indexOf(b)===-1&&u.push(b),o)}function s9(o,u,h,m,b){switch(u){case"focusin":return Tl=vf(Tl,o,u,h,m,b),!0;case"dragenter":return Ml=vf(Ml,o,u,h,m,b),!0;case"mouseover":return Pl=vf(Pl,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 P2(o){var u=Os(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(){E2(h)});return}}else if(u===31){if(u=s(h),u!==null){o.blockedOn=u,qk(o.priority,function(){E2(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 Cp(o){if(o.blockedOn!==null)return!1;for(var u=o.targetContainers;0<u.length;){var h=qb(o.nativeEvent);if(h===null){h=o.nativeEvent;var m=new h.constructor(h.type,h);Wy=m,h.target.dispatchEvent(m),Wy=null}else return u=As(h),u!==null&&C2(u),o.blockedOn=h,!1;u.shift()}return!0}function D2(o,u,h){Cp(o)&&h.delete(u)}function u9(){Kb=!1,Tl!==null&&Cp(Tl)&&(Tl=null),Ml!==null&&Cp(Ml)&&(Ml=null),Pl!==null&&Cp(Pl)&&(Pl=null),mf.forEach(D2),gf.forEach(D2)}function Ep(o,u){o.blockedOn===u&&(o.blockedOn=null,Kb||(Kb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,u9)))}var Tp=null;function _2(o){Tp!==o&&(Tp=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tp===o&&(Tp=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(Wb(m||h)===null)continue;break}var S=As(h);S!==null&&(o.splice(u,3),u-=3,q0(S,{pending:!0,data:b,method:h.method,action:m},m,b))}}))}function au(o){function u(L){return Ep(L,o)}Tl!==null&&Ep(Tl,o),Ml!==null&&Ep(Ml,o),Pl!==null&&Ep(Pl,o),mf.forEach(u),gf.forEach(u);for(var h=0;h<Dl.length;h++){var m=Dl[h];m.blockedOn===o&&(m.blockedOn=null)}for(;0<Dl.length&&(h=Dl[0],h.blockedOn===null);)P2(h),h.blockedOn===null&&Dl.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[Zn]||null;if(typeof S=="function")E||_2(h);else if(E){var _=null;if(S&&S.hasAttribute("formAction")){if(b=S,E=S[Zn]||null)_=E.formAction;else if(Wb(b)!==null)continue}else _=E.action;typeof _=="function"?h[m+1]=_:(h.splice(m,3),m-=3),_2(h)}}}function N2(){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 Vb(o){this._internalRoot=o}Mp.prototype.render=Vb.prototype.render=function(o){var u=this._internalRoot;if(u===null)throw Error(r(409));var h=u.current,m=Or();A2(h,m,o,u,null,null)},Mp.prototype.unmount=Vb.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var u=o.containerInfo;A2(o.current,2,null,o,null,null),up(),u[ws]=null}};function Mp(o){this._internalRoot=o}Mp.prototype.unstable_scheduleHydration=function(o){if(o){var u=Fk();o={blockedOn:null,target:o,priority:u};for(var h=0;h<Dl.length&&u!==0&&u<Dl[h].priority;h++);Dl.splice(h,0,o),h===0&&P2(o)}};var R2=t.version;if(R2!=="19.2.7")throw Error(r(527,R2,"19.2.7"));Z.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 c9={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pp.isDisabled&&Pp.supportsFiber)try{kc=Pp.inject(c9),mr=Pp}catch{}}return bf.createRoot=function(o,u){if(!i(o))throw Error(r(299));var h=!1,m="",b=UE,S=HE,E=FE;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=w2(o,1,!1,null,null,h,m,null,b,S,E,N2),o[ws]=u.current,Tb(o),new Vb(u)},bf.hydrateRoot=function(o,u,h){if(!i(o))throw Error(r(299));var m=!1,b="",S=UE,E=HE,_=FE,L=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&&(L=h.formState)),u=w2(o,1,!0,u,h??null,m,b,L,S,E,_,N2),u.context=O2(null),h=u.current,m=Or(),m=Iy(m),b=gl(m),b.callback=null,vl(h,b,m),h=m,u.current.lanes=h,Ec(u,h),_i(u),o[ws]=u.current,Tb(o),new Mp(u)},bf.version="19.2.7",bf}var q2;function S9(){if(q2)return Yb.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(),Yb.exports=x9(),Yb.exports}var w9=S9();const O9=yv(w9);var lc=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(){}},A9=class extends lc{#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"}},Hw=new A9,k9={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},C9=class{#e=k9;#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)}},zo=new C9;function E9(e){setTimeout(e,0)}var T9=typeof window>"u"||"Deno"in globalThis;function qn(){}function M9(e,t){return typeof e=="function"?e(t):e}function T1(e){return typeof e=="number"&&e>=0&&e!==1/0}function QL(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Fl(e,t){return typeof e=="function"?e(t):e}function Er(e,t){return typeof e=="function"?e(t):e}function W2(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:s}=e;if(l){if(r){if(t.queryHash!==Fw(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 K2(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ts(t.options.mutationKey)!==ts(a))return!1}else if(!ih(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Fw(e,t){return(t?.queryKeyHashFn||ts)(e)}function ts(e){return JSON.stringify(e,(t,n)=>M1(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 P9=Object.prototype.hasOwnProperty;function XL(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=V2(e)&&V2(t);if(!r&&!(M1(e)&&M1(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:P9.call(e,p))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){c[p]=v;continue}const y=XL(g,v,n+1);c[p]=y,y===g&&f++}return a===s&&f===a?e:c}function Hm(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 V2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function M1(e){if(!Q2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Q2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Q2(e){return Object.prototype.toString.call(e)==="[object Object]"}function D9(e){return new Promise(t=>{zo.setTimeout(t,e)})}function P1(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?XL(e,t):t}function _9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function N9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var qw=Symbol();function YL(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===qw?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ww(e,t){return typeof e=="function"?e(...t):!!e}function R9(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=()=>T9;return{isServer(){return e()},setIsServer(t){e=t}}})();function D1(){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 L9=E9;function j9(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=L9;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 Zt=j9(),I9=class extends lc{#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}},Fm=new I9;function B9(e){return Math.min(1e3*2**e,3e4)}function GL(e){return(e??"online")==="online"?Fm.isOnline():!0}var _1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ZL(e){let t=!1,n=0,r;const i=D1(),a=()=>i.status!=="pending",l=x=>{if(!a()){const w=new _1(x);g(w),e.onCancel?.(w)}},s=()=>{t=!0},c=()=>{t=!1},f=()=>Hw.isFocused()&&(e.networkMode==="always"||Fm.isOnline())&&e.canRun(),d=()=>GL(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??B9,M=typeof k=="function"?k(n,A):k,D=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,A);if(t||!D){g(A);return}n++,e.onFail?.(n,A),D9(M).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 JL=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),T1(this.gcTime)&&(this.#e=zo.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&&(zo.clearTimeout(this.#e),this.#e=void 0)}};function z9(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=>{R9(y,()=>t.signal,()=>d=!0)},g=YL(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 P={client:t.client,queryKey:t.queryKey,pageParam:x,direction:w?"backward":"forward",meta:t.options.meta};return p(P),P})(),k=await g(C),{maxPages:M}=t.options,D=w?N9:_9;return{pages:D(y.pages,k,M),pageParams:D(y.pageParams,x,M)}};if(i&&a.length){const y=i==="backward",x=y?$9:X2,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:X2(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 X2(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 $9(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var U9=class extends JL{#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=G2(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=G2(this.options);t.data!==void 0&&(this.setState(Y2(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=P1(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(qn).catch(qn):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=>Er(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===qw||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Fl(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:!QL(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=YL(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"?z9(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=ZL({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:c=>{c instanceof _1&&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 _1){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,...ej(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Y2(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),Zt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function ej(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:GL(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Y2(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function G2(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 H9=class extends lc{constructor(e,t){super(),this.options=t,this.#e=e,this.#l=null,this.#o=D1(),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),Z2(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return N1(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return N1(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 Er(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&&!Hm(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&J2(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Er(this.options.enabled,this.#t)!==Er(t.enabled,this.#t)||Fl(this.options.staleTime,this.#t)!==Fl(t.staleTime,this.#t))&&this.#g();const i=this.#v();r&&(this.#t!==n||Er(this.options.enabled,this.#t)!==Er(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 q9(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(qn)),t}#g(){this.#x();const e=Fl(this.options.staleTime,this.#t);if(ah.isServer()||this.#r.isStale||!T1(e))return;const n=QL(this.#r.dataUpdatedAt,e)+1;this.#f=zo.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()||Er(this.options.enabled,this.#t)===!1||!T1(this.#u)||this.#u===0)&&(this.#h=zo.setInterval(()=>{(this.options.refetchIntervalInBackground||Hw.isFocused())&&this.#d()},this.#u))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#f!==void 0&&(zo.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#h!==void 0&&(zo.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 j=this.hasListeners(),U=!j&&Z2(e,t),V=j&&J2(e,n,t,r);(U||V)&&(d={...d,...ej(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 j;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(j=i.data,w=!0):j=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,j!==void 0&&(x="success",g=P1(i?.data,j,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=P1(i?.data,g,t),this.#s=g,this.#l=null}catch(j){this.#l=j}this.#l&&(v=this.#l,g=this.#s,y=Date.now(),x="error");const A=d.fetchStatus==="fetching",C=x==="pending",k=x==="error",M=C&&A,D=g!==void 0,N={status:x,fetchStatus:d.fetchStatus,isPending:C,isSuccess:x==="success",isError:k,isInitialLoading:M,isLoading:M,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&&!D,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:k&&D,isStale:Kw(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Er(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const j=N.data!==void 0,U=N.status==="error"&&!j,V=oe=>{U?oe.reject(N.error):j&&oe.resolve(N.data)},K=()=>{const oe=this.#o=N.promise=D1();V(oe)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&V(B);break;case"fulfilled":(U||N.data!==B.value)&&K();break;case"rejected":(!U||N.error!==B.reason)&&K();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),Hm(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){Zt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function F9(e,t){return Er(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Er(t.retryOnMount,e)===!1)}function Z2(e,t){return F9(e,t)||e.state.data!==void 0&&N1(e,t,t.refetchOnMount)}function N1(e,t,n){if(Er(t.enabled,e)!==!1&&Fl(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Kw(e,t)}return!1}function J2(e,t,n,r){return(e!==t||Er(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Kw(e,n)}function Kw(e,t){return Er(t.enabled,e)!==!1&&e.isStaleByTime(Fl(t.staleTime,e))}function q9(e,t){return!Hm(e.getCurrentResult(),t)}var W9=class extends JL{#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||tj(),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=ZL({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),Zt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function tj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var K9=class extends lc{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 W9({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=Dp(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=Dp(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=Dp(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=Dp(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Zt.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=>K2(t,n))}findAll(e={}){return this.getAll().filter(t=>K2(e,t))}notify(e){Zt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Zt.batch(()=>Promise.all(e.map(t=>t.continue().catch(qn))))}};function Dp(e){return e.options.scope?.id}var V9=class extends lc{#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),Hm(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ts(n.mutationKey)!==ts(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??tj();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){Zt.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)})})}},Q9=class extends lc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Fw(r,t);let a=this.get(i);return a||(a=new U9({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(){Zt.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=>W2(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>W2(e,n)):t}notify(e){Zt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Zt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},X9=class{#e;#t;#n;#r;#a;#i;#o;#l;constructor(e={}){this.#e=e.queryCache||new Q9,this.#t=e.mutationCache||new K9,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=Hw.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=Fm.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(Fl(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=M9(t,a);if(l!==void 0)return this.#e.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Zt.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;Zt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Zt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Zt.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(qn).catch(qn)}invalidateQueries(e,t={}){return Zt.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=Zt.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(qn)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(qn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Fl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(qn).catch(qn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qn).catch(qn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Fm.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(ts(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(ts(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=Fw(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===qw&&(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()}},nj=O.createContext(void 0),io=e=>{const t=O.useContext(nj);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Y9=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),T.jsx(nj.Provider,{value:e,children:t})),rj=O.createContext(!1),G9=()=>O.useContext(rj);rj.Provider;function Z9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var J9=O.createContext(Z9()),eF=()=>O.useContext(J9),tF=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Ww(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},nF=e=>{O.useEffect(()=>{e.clearReset()},[e])},rF=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Ww(n,[e.error,r])),iF=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))}},aF=(e,t)=>e.isLoading&&e.isFetching&&!t,lF=(e,t)=>e?.suspense&&t.isPending,eM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function oF(e,t,n){const r=G9(),i=eF(),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,iF(l),tF(l,i,s),nF(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(Zt.batchCalls(v)):qn;return d.updateResult(),y},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),O.useEffect(()=>{d.setOptions(l)},[l,d]),lF(l,p))throw eM(l,d,i);if(rF({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()&&aF(p,r)&&(f?eM(l,d,i):s?.promise)?.catch(qn).finally(()=>{d.updateResult()}),l.notifyOnChangeProps?p:d.trackResult(p)}function Ki(e,t){return oF(e,H9)}function Ih(e,t){const n=io(),[r]=O.useState(()=>new V9(n,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);const i=O.useSyncExternalStore(O.useCallback(l=>r.subscribe(Zt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=O.useCallback((l,s)=>{r.mutate(l,s).catch(qn)},[r]);if(i.error&&Ww(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Vw=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,ij=/^[\\/]{2}/;function sF(e,t){return t+e.replace(/\\/g,"/")}var tM="popstate";function nM(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function uF(e={}){function t(r,i){let a=i.state?.masked,{pathname:l,search:s,hash:c}=a||r.location;return R1("",{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 fF(t,n,null,e)}function Tt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function na(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function cF(){return Math.random().toString(36).substring(2,10)}function rM(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 R1(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?oc(t):t,state:n,key:t&&t.key||r||cF(),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 oc(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 fF(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=nM(w)?w:R1(x.location,w,A);f=d()+1;let k=rM(C,f),M=x.createHref(C.mask||C);try{l.pushState(k,"",M)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(M)}a&&c&&c({action:s,location:x.location,delta:1})}function v(w,A){s="REPLACE";let C=nM(w)?w:R1(x.location,w,A);f=d();let k=rM(C,f),M=x.createHref(C.mask||C);l.replaceState(k,"",M),a&&c&&c({action:s,location:x.location,delta:0})}function y(w){return hF(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(tM,p),c=w,()=>{i.removeEventListener(tM,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 hF(e,t,n=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),Tt(r,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:lh(t);return i=i.replace(/ $/,"%20"),!n&&ij.test(i)&&(i=r+i),new URL(i,r)}function aj(e,t,n="/"){return dF(e,t,n,!1)}function dF(e,t,n,r,i){let a=typeof t=="string"?oc(t):t,l=Fa(a.pathname||"/",n);if(l==null)return null;let s=pF(e),c=null,f=kF(l);for(let d=0;c==null&&d<s.length;++d)c=AF(s[d],f,r);return c}function pF(e){let t=lj(e);return mF(t),t}function lj(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;Tt(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=vi([r,d.relativePath]),g=n.concat(d);l.children&&l.children.length>0&&(Tt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),lj(l.children,t,g,p,c)),!(l.path==null&&!l.index)&&t.push({path:p,score:wF(p,l.index),routesMeta:g.map((v,y)=>{let[x,w]=uj(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 oj(l.path))a(l,s,!0,c)}),t}function oj(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=oj(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 mF(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:OF(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var gF=/^:[\w-]+$/,vF=3,yF=2,bF=1,xF=10,SF=-2,iM=e=>e==="*";function wF(e,t){let n=e.split("/"),r=n.length;return n.some(iM)&&(r+=SF),t&&(r+=yF),n.filter(i=>!iM(i)).reduce((i,a)=>i+(gF.test(a)?vF:a===""?bF:xF),r)}function OF(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 AF(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?sj(p,d,c.matcher,c.compiledParams):qm(p,d),v=c.route;if(!g&&f&&n&&!r[r.length-1].route.index&&(g=qm({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!g)return null;Object.assign(i,g.params),l.push({params:i,pathname:vi([a,g.pathname]),pathnameBase:TF(vi([a,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(a=vi([a,g.pathnameBase]))}return l}function qm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=uj(e.path,e.caseSensitive,e.end);return sj(e,t,n,r)}function sj(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 uj(e,t=!1,n=!0){na(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 kF(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return na(!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 Fa(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 CF(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?oc(e):e,a;return n?(n=fj(n),n.startsWith("/")?a=aM(n.substring(1),"/"):a=aM(n,t)):a=t,{pathname:a,search:MF(r),hash:PF(i)}}function aM(e,t){let n=Wm(t).split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function ex(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 EF(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function cj(e){let t=EF(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Qw(e,t,n,r=!1){let i;typeof e=="string"?i=oc(e):(i={...e},Tt(!i.pathname||!i.pathname.includes("?"),ex("?","pathname","search",i)),Tt(!i.pathname||!i.pathname.includes("#"),ex("#","pathname","hash",i)),Tt(!i.search||!i.search.includes("#"),ex("#","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=CF(i,s),f=l&&l!=="/"&&l.endsWith("/"),d=(a||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||d)&&(c.pathname+="/"),c}var fj=e=>e.replace(/[\\/]{2,}/g,"/"),vi=e=>fj(e.join("/")),Wm=e=>e.replace(/\/+$/,""),TF=e=>Wm(e).replace(/^\/*/,"/"),MF=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,PF=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,DF=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 _F(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function NF(e){let t=e.map(n=>n.route.path).filter(Boolean);return vi(t)||"/"}var hj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function dj(e,t){let n=e;if(typeof n!="string"||!Vw.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(hj)try{let a=new URL(window.location.href),l=ij.test(n)?new URL(sF(n,a.protocol)):new URL(n),s=Fa(l.pathname,t);l.origin===a.origin&&s!=null?n=s+l.search+l.hash:i=!0}catch{na(!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 pj=["POST","PUT","PATCH","DELETE"];new Set(pj);var RF=["GET",...pj];new Set(RF);var LF=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function jF(e){try{return LF.includes(new URL(e).protocol)}catch{return!1}}var sc=O.createContext(null);sc.displayName="DataRouter";var bv=O.createContext(null);bv.displayName="DataRouterState";var mj=O.createContext(!1);function IF(){return O.useContext(mj)}var gj=O.createContext({isTransitioning:!1});gj.displayName="ViewTransition";var BF=O.createContext(new Map);BF.displayName="Fetchers";var zF=O.createContext(null);zF.displayName="Await";var ri=O.createContext(null);ri.displayName="Navigation";var Bh=O.createContext(null);Bh.displayName="Location";var oa=O.createContext({outlet:null,matches:[],isDataRoute:!1});oa.displayName="Route";var Xw=O.createContext(null);Xw.displayName="RouteError";var vj="REACT_ROUTER_ERROR",$F="REDIRECT",UF="ROUTE_ERROR_RESPONSE";function HF(e){if(e.startsWith(`${vj}:${$F}:{`))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 FF(e){if(e.startsWith(`${vj}:${UF}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new DF(t.status,t.statusText,t.data)}catch{}}function qF(e,{relative:t}={}){Tt(zh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=O.useContext(ri),{hash:i,pathname:a,search:l}=$h(e,{relative:t}),s=a;return n!=="/"&&(s=a==="/"?n:vi([n,a])),r.createHref({pathname:s,search:l,hash:i})}function zh(){return O.useContext(Bh)!=null}function el(){return Tt(zh(),"useLocation() may be used only in the context of a <Router> component."),O.useContext(Bh).location}var yj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bj(e){O.useContext(ri).static||O.useLayoutEffect(e)}function xv(){let{isDataRoute:e}=O.useContext(oa);return e?rq():WF()}function WF(){Tt(zh(),"useNavigate() may be used only in the context of a <Router> component.");let e=O.useContext(sc),{basename:t,navigator:n}=O.useContext(ri),{matches:r}=O.useContext(oa),{pathname:i}=el(),a=JSON.stringify(cj(r)),l=O.useRef(!1);return bj(()=>{l.current=!0}),O.useCallback((c,f={})=>{if(na(l.current,yj),!l.current)return;if(typeof c=="number"){n.go(c);return}let d=Qw(c,JSON.parse(a),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:vi([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,a,i,e])}O.createContext(null);function Yw(){let{matches:e}=O.useContext(oa);return e[e.length-1]?.params??{}}function $h(e,{relative:t}={}){let{matches:n}=O.useContext(oa),{pathname:r}=el(),i=JSON.stringify(cj(n));return O.useMemo(()=>Qw(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function KF(e,t){return xj(e,t)}function xj(e,t,n){Tt(zh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=O.useContext(ri),{matches:i}=O.useContext(oa),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||"";wj(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=el(),p;if(t){let w=typeof t=="string"?oc(t):t;Tt(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})):aj(e,{pathname:v});na(f||y!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),na(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=GF(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:vi([c,r.encodeLocation?r.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:vi([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(Bh.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},x):x}function VF(){let e=nq(),t=_F(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 QF=O.createElement(VF,null),Sj=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=FF(e.digest);n&&(e=n)}let t=e!==void 0?O.createElement(oa.Provider,{value:this.props.routeContext},O.createElement(Xw.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?O.createElement(XF,{error:e},t):t}};Sj.contextType=mj;var tx=new WeakMap;function XF({children:e,error:t}){let{basename:n}=O.useContext(ri);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=HF(t.digest);if(r){let i=tx.get(t);if(i)throw i;let a=dj(r.location,n),l=a.absoluteURL||a.to;if(jF(l))throw new Error("Invalid redirect location");if(hj&&!tx.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 tx.set(t,s),s}return O.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function YF({routeContext:e,match:t,children:n}){let r=O.useContext(sc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),O.createElement(oa.Provider,{value:e},n)}function GF(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);Tt(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:NF(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||QF,l&&(s<0&&g===0?(wj("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(YF,{match:p,routeContext:{outlet:d,matches:A,isDataRoute:r!=null},children:k})};return r&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?O.createElement(Sj,{location:r.location,revalidation:r.revalidation,component:x,error:v,children:C(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:f}):C()},null)}function Gw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ZF(e){let t=O.useContext(sc);return Tt(t,Gw(e)),t}function JF(e){let t=O.useContext(bv);return Tt(t,Gw(e)),t}function eq(e){let t=O.useContext(oa);return Tt(t,Gw(e)),t}function Zw(e){let t=eq(e),n=t.matches[t.matches.length-1];return Tt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function tq(){return Zw("useRouteId")}function nq(){let e=O.useContext(Xw),t=JF("useRouteError"),n=Zw("useRouteError");return e!==void 0?e:t.errors?.[n]}function rq(){let{router:e}=ZF("useNavigate"),t=Zw("useNavigate"),n=O.useRef(!1);return bj(()=>{n.current=!0}),O.useCallback(async(i,a={})=>{na(n.current,yj),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var lM={};function wj(e,t,n){!t&&!lM[e]&&(lM[e]=!0,na(!1,n))}O.memo(iq);function iq({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return xj(e,void 0,{manifest:t,state:r,isStatic:i,onError:a})}function zf(e){Tt(!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 aq({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,useTransitions:l}){Tt(!zh(),"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=oc(n));let{pathname:f="/",search:d="",hash:p="",state:g=null,key:v="default",mask:y}=n,x=O.useMemo(()=>{let w=Fa(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 na(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(ri.Provider,{value:c},O.createElement(Bh.Provider,{children:t,value:x}))}function lq({children:e,location:t}){return KF(L1(e),t)}function L1(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,L1(r.props.children,a));return}Tt(r.type===zf,`[${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>`),Tt(!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=L1(r.props.children,a)),n.push(l)}),n}var Am="get",km="application/x-www-form-urlencoded";function Sv(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function oq(e){return Sv(e)&&e.tagName.toLowerCase()==="button"}function sq(e){return Sv(e)&&e.tagName.toLowerCase()==="form"}function uq(e){return Sv(e)&&e.tagName.toLowerCase()==="input"}function cq(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fq(e,t){return e.button===0&&(!t||t==="_self")&&!cq(e)}var _p=null;function hq(){if(_p===null)try{new FormData(document.createElement("form"),0),_p=!1}catch{_p=!0}return _p}var dq=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nx(e){return e!=null&&!dq.has(e)?(na(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${km}"`),null):e}function pq(e,t){let n,r,i,a,l;if(sq(e)){let s=e.getAttribute("action");r=s?Fa(s,t):null,n=e.getAttribute("method")||Am,i=nx(e.getAttribute("enctype"))||km,a=new FormData(e)}else if(oq(e)||uq(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?Fa(c,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||Am,i=nx(e.getAttribute("formenctype"))||nx(s.getAttribute("enctype"))||km,a=new FormData(s,e),!hq()){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(Sv(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Am,r=null,i=km,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 Jw(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Oj(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&&Fa(i.pathname,t)==="/"?i.pathname=`${Wm(t)}/_root.${r}`:i.pathname=`${Wm(i.pathname)}.${r}`,i}async function mq(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 gq(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 vq(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let l=await mq(a,n);return l.links?l.links():[]}return[]}));return Sq(r.flat(1).filter(gq).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function oM(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 yq(e,t,{includeHydrateFallback:n}={}){return bq(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 bq(e){return[...new Set(e)]}function xq(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Sq(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(xq(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function eO(){let e=O.useContext(sc);return Jw(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function wq(){let e=O.useContext(bv);return Jw(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var tO=O.createContext(void 0);tO.displayName="FrameworkContext";function wv(){let e=O.useContext(tO);return Jw(e,"You must render this element inside a <HydratedRouter> element"),e}function Oq(e,t){let n=O.useContext(tO),[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 Aq({page:e,...t}){let n=IF(),{nonce:r}=wv(),{router:i}=eO(),a=O.useMemo(()=>aj(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?O.createElement(Cq,{page:e,matches:a,...t}):O.createElement(Eq,{page:e,matches:a,...t})):null}function kq(e){let{manifest:t,routeModules:n}=wv(),[r,i]=O.useState([]);return O.useEffect(()=>{let a=!1;return vq(e,t,n).then(l=>{a||i(l)}),()=>{a=!0}},[e,t,n]),r}function Cq({page:e,matches:t,...n}){let r=el(),{future:i}=wv(),{basename:a}=eO(),l=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let s=Oj(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 Eq({page:e,matches:t,...n}){let r=el(),{future:i,manifest:a,routeModules:l}=wv(),{basename:s}=eO(),{loaderData:c,matches:f}=wq(),d=O.useMemo(()=>oM(e,t,f,a,r,"data"),[e,t,f,a,r]),p=O.useMemo(()=>oM(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(M=>M.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=Oj(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(()=>yq(p,a),[p,a]),y=kq(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 Tq(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Mq=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Mq&&(window.__reactRouterVersion="7.18.2")}catch{}function Pq({basename:e,children:t,useTransitions:n,window:r}){let i=O.useRef();i.current==null&&(i.current=uF({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(aq,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:a,useTransitions:n})}var yi=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(ri),k=typeof d=="string"&&Vw.test(d),M=dj(d,w);d=M.to;let D=qF(d,{relative:i}),P=el(),N=null;if(s){let ue=Qw(s,[],P.mask?P.mask.pathname:"/",!0);w!=="/"&&(ue.pathname=ue.pathname==="/"?w:vi([w,ue.pathname])),N=A.createHref(ue)}let[j,U,V]=Oq(r,y),K=Rq(d,{replace:l,mask:s,state:c,target:f,preventScrollReset:p,relative:i,viewTransition:g,defaultShouldRevalidate:v,useTransitions:C});function B(ue){t&&t(ue),ue.defaultPrevented||K(ue)}let oe=!(M.isExternal||a),ie=O.createElement("a",{...y,...V,href:(oe?N:void 0)||M.absoluteURL||D,onClick:oe?B:t,ref:Tq(x,U),target:f,"data-discover":!k&&n==="render"?"true":void 0});return j&&!k?O.createElement(O.Fragment,null,ie,O.createElement(Aq,{page:D})):ie});yi.displayName="Link";var Dq=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=$h(l,{relative:f.relative}),g=el(),v=O.useContext(bv),{navigator:y,basename:x}=O.useContext(ri),w=v!=null&&zq(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=Fa(k,x)||k);const M=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let D=C===A||!i&&C.startsWith(A)&&C.charAt(M)==="/",P=k!=null&&(k===A||!i&&k.startsWith(A)&&k.charAt(A.length)==="/"),N={isActive:D,isPending:P,isTransitioning:w},j=D?t:void 0,U;typeof r=="function"?U=r(N):U=[r,D?"active":null,P?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let V=typeof a=="function"?a(N):a;return O.createElement(yi,{...f,"aria-current":j,className:U,ref:d,style:V,to:l,viewTransition:s},typeof c=="function"?c(N):c)});Dq.displayName="NavLink";var _q=O.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:l=Am,action:s,onSubmit:c,relative:f,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:g,...v},y)=>{let{useTransitions:x}=O.useContext(ri),w=Iq(),A=Bq(s,{relative:f}),C=l.toLowerCase()==="get"?"get":"post",k=typeof s=="string"&&Vw.test(s),M=D=>{if(c&&c(D),D.defaultPrevented)return;D.preventDefault();let P=D.nativeEvent.submitter,N=P?.getAttribute("formmethod")||l,j=()=>w(P||D.currentTarget,{fetcherKey:t,method:N,navigate:n,replace:i,state:a,relative:f,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:g});x&&n!==!1?O.startTransition(()=>j()):j()};return O.createElement("form",{ref:y,method:C,action:A,onSubmit:r?c:M,...v,"data-discover":!k&&e==="render"?"true":void 0})});_q.displayName="Form";function Nq(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Aj(e){let t=O.useContext(sc);return Tt(t,Nq(e)),t}function Rq(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:l,viewTransition:s,defaultShouldRevalidate:c,useTransitions:f}={}){let d=xv(),p=el(),g=$h(e,{relative:l});return O.useCallback(v=>{if(fq(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 Lq=0,jq=()=>`__${String(++Lq)}__`;function Iq(){let{router:e}=Aj("useSubmit"),{basename:t}=O.useContext(ri),n=tq(),r=e.fetch,i=e.navigate;return O.useCallback(async(a,l={})=>{let{action:s,method:c,encType:f,formData:d,body:p}=pq(a,t);if(l.navigate===!1){let g=l.fetcherKey||jq();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 Bq(e,{relative:t}={}){let{basename:n}=O.useContext(ri),r=O.useContext(oa);Tt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...$h(e||".",{relative:t})},l=el();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:vi([n,a.pathname])),lh(a)}function zq(e,{relative:t}={}){let n=O.useContext(gj);Tt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Aj("useViewTransitionState"),i=$h(e,{relative:t});if(!n.isTransitioning)return!1;let a=Fa(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Fa(n.nextLocation.pathname,r)||n.nextLocation.pathname;return qm(i.pathname,l)!=null||qm(i.pathname,a)!=null}var nO=VL();class oh extends Error{constructor(t,n){super(n),this.status=t}status}async function Fn(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 Et={health:()=>Fn("/api/health"),configs:()=>Fn("/api/configs"),config:e=>Fn(`/api/configs/${e}`),createConfig:(e,t)=>Fn("/api/configs",{method:"POST",body:JSON.stringify({filename:e,content:t})}),updateConfig:(e,t,n)=>Fn(`/api/configs/${e}`,{method:"PUT",body:JSON.stringify({content:t,baseHash:n})}),deleteConfig:e=>Fn(`/api/configs/${e}`,{method:"DELETE"}),validateConfig:e=>Fn("/api/configs/validate",{method:"POST",body:JSON.stringify({content:e})}),triggerRun:(e,t,n)=>Fn(`/api/configs/${e}/run`,{method:"POST",...t?.length?{body:JSON.stringify({sources:t,baseHash:n})}:{}}),configStats:(e,t)=>Fn(`/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),Fn(`/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)),Fn(`/api/runs?${t}`)},run:e=>Fn(`/api/runs/${e}`),runLogs:(e,t={})=>Fn(`/api/runs/${e}/logs?${sM(t)}`),runLogCounts:e=>Fn(`/api/runs/${e}/logs/counts`),runLogsDownloadUrl:(e,t={})=>{const n=sM(t);return`/api/runs/${e}/logs/download${n?`?${n}`:""}`},cancelRun:e=>Fn(`/api/runs/${e}/cancel`,{method:"POST"})};function sM(e){const t=new URLSearchParams;return e.afterSeq!==void 0&&t.set("afterSeq",String(e.afterSeq)),e.limit!==void 0&&t.set("limit",String(e.limit)),e.levels?.length&&t.set("levels",e.levels.join(",")),e.q&&t.set("q",e.q),t.toString()}var rx={exports:{}},uM;function $q(){return uM||(uM=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(D){var P=D.replace(/\D/,""),N=P;return v.dayOfWeekStartIndexZero?P=="7"&&(N="0"):N=(parseInt(P)-1).toString(),D.replace(P,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(D){var P=D.replace(/\D/,""),N=P;return v.monthStartIndexZero&&(N=(parseInt(P)+1).toString()),D.replace(P,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(D){return D!==""}).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 M=g[C].split("/");g[C]="".concat(M[0],"-").concat(k,"/").concat(M[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,M=x.dayOfWeekStartIndexZero,D=M===void 0?!0:M,P=x.monthStartIndexZero,N=P===void 0?!1:P,j=x.use24HourTimeFormat,U=x.trimHoursLeadingZero,V=U===void 0?!1:U,K=x.locale,B=K===void 0?null:K,oe=x.logicalAndDayFields,ie=oe===void 0?!1:oe,ue={throwExceptionOnParseError:A,verbose:k,dayOfWeekStartIndexZero:D,monthStartIndexZero:N,use24HourTimeFormat:j,trimHoursLeadingZero:V,locale:B,logicalAndDayFields:ie};ue.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var z=new g(v,ue);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(),M=this.getDayOfWeekDescription(),D=this.getYearDescription();x+=A+C+M+k+D,x=this.transformVerbosity(x,!!this.options.verbose),x=x.charAt(0).toLocaleUpperCase()+x.substr(1)}catch(P){if(!this.options.throwExceptionOnParseError)x=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(P)}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 M=this.getSecondsDescription(),D=this.getMinutesDescription(),P=this.getHoursDescription();if(w+=M,w&&D&&(w+=", "),w+=D,D===P)return w;w&&P&&(w+=", "),w+=P}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 M=k.split("-");M.length===2&&w.push({value:M[1],index:x+1}),x+=M.length});var A=0,C=this.getSegmentDescription(y,this.i18n.everyHour(),function(k){var M=w.find(function(P){return P.value===k&&P.index===A}),D=M&&v.expressionParts[1]!=="0";return A++,D?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),M=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(A)[k]:y[k];if(w.indexOf("#")>-1){var D=null,P=w.substring(w.indexOf("#")+1),N=w.substring(0,w.indexOf("#"));switch(P){case"1":D=v.i18n.first(N);break;case"2":D=v.i18n.second(N);break;case"3":D=v.i18n.third(N);break;case"4":D=v.i18n.fourth(N);break;case"5":D=v.i18n.fifth(N);break}M=D+" "+M}return M},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 M=v.expressionParts[3]!="*";M?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 M=k[1];y=f.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(M),M);break}else{if(x=="*"&&this.expressionParts[5]!="*")return"";y=this.getSegmentDescription(x,this.i18n.commaEveryDay(),function(D){return D=="L"?v.i18n.lastDay():v.i18n.dayX0?f.StringUtilities.format(v.i18n.dayX0(),D):D},function(D){return D=="1"?v.i18n.commaEveryDay():v.i18n.commaEveryX0Days(D)},function(D){return v.i18n.commaBetweenDayX0AndX1OfTheMonth(D)},function(D){return v.i18n.commaOnDayX0OfTheMonth(D)})}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,M=v.indexOf("/")>-1,D=v.indexOf("-")>-1,P=v.indexOf(",")>-1;if(!v)k="";else if(v==="*")k=y;else if(!M&&!D&&!P)k=f.StringUtilities.format(C(v),x(v));else if(P){for(var N=v.split(","),j="",U=this.i18n.spaceAnd(),V=0;V<N.length;V++)if(V>0&&N.length>2&&(j+=",",V<N.length-1&&(j+=" ")),V>0&&N.length>1&&(V==N.length-1||N.length==2)&&(j+=U==","&&N.length>2?" ":"".concat(U," ")),N[V].indexOf("/")>-1||N[V].indexOf("-")>-1){var K=N[V].indexOf("-")>-1&&N[V].indexOf("/")==-1,B=this.getSegmentDescription(N[V],y,x,w,K?this.i18n.commaX0ThroughX1:A,C);K&&(B=B.replace(", ","")),j+=B}else if(!M)j+=x(N[V]);else{var oe=this.getSegmentDescription(N[V],y,x,w,A,C);oe&&oe.startsWith(", ")&&(oe=oe.substring(2)),j+=oe}M?k=j:k=f.StringUtilities.format(C(v),j)}else if(M){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 ue=f.StringUtilities.format(C(N[0]),x(N[0]));ue=ue.replace(", ",""),k+=f.StringUtilities.format(this.i18n.commaStartingX0(),ue)}}else D&&(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),M=y(v);return w+=f.StringUtilities.format(M,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 M="",D=!1;this.options.use24HourTimeFormat||(D=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),M=D?"".concat(this.getPeriod(C)," "):" ".concat(this.getPeriod(C)),C>12&&(C-=12),C===0&&(C=12));var P="";x&&(P=":".concat(("00"+x).substring(x.length)));var N=C.toString(),j=("00"+N).substring(N.length),U=k.toString(),V=("00"+U).substring(U.length),K=this.options.trimHoursLeadingZero?N:j;return"".concat(D?M:"").concat(K,":").concat(V).concat(P).concat(D?"":M)},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})())})(rx)),rx.exports}var Uq=$q();const Hq=yv(Uq);function zu(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 rO(e,t){if(!e)return"—";const n=t?new Date(t).getTime():Date.now();return zu((n-new Date(e).getTime())/1e3)}function qa(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function j1(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 iO(e){if(!e)return"Manual only";try{return Hq.toString(e,{verbose:!1})}catch{return e}}const cM={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 Ov({status:e}){const t=cM[e]??cM.queued;return T.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:[T.jsx("span",{"aria-hidden":!0,children:t.symbol}),t.label]})}var Ve=Symbol("NOT_RESOLVED");function Ln(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,represent:t.represent??(n=>String(n)),representTagName:t.representTagName??(()=>e)}}function aO(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,represent:t.represent??(r=>r),representTagName:t.representTagName??(()=>e)}}function Av(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,represent:t.represent??(r=>r),representTagName:t.representTagName??(()=>e)}}var Fq=Ln("tag:yaml.org,2002:str",{resolve:e=>e,identify:e=>typeof e=="string"}),qq=["","~","null","Null","NULL"],Wq=Ln("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>qq.indexOf(e)!==-1?null:Ve,identify:e=>e===null,represent:()=>"null"}),Kq=Ln("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(e,t)=>e==="null"||t&&e===""?null:Ve,identify:e=>e===null,represent:()=>"null"}),Vq=["","~","null","Null","NULL"],Qq=Ln("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>Vq.indexOf(e)!==-1?null:Ve,identify:e=>e===null,represent:()=>"null"}),Xq=["true","True","TRUE"],Yq=["false","False","FALSE"],Gq=Ln("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:e=>Xq.indexOf(e)!==-1?!0:Yq.indexOf(e)!==-1?!1:Ve,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),Zq=["true"],Jq=["false"],eW=Ln("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:e=>Zq.indexOf(e)!==-1?!0:Jq.indexOf(e)!==-1?!1:Ve,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),tW=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],nW=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],rW=Ln("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:e=>tW.indexOf(e)!==-1?!0:nW.indexOf(e)!==-1?!1:Ve,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),iW=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),aW=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function lW(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 oW(e,t){if(t){if(!aW.test(e))return Ve}else if(!iW.test(e))return Ve;const n=lW(e);return Number.isFinite(n)?n:Ve}var kj=Ln("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:oW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),sW=new RegExp("^-?(?:0|[1-9][0-9]*)$"),uW=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function cW(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 fW(e,t){if(t){if(!uW.test(e))return Ve}else if(!sW.test(e))return Ve;const n=cW(e);return Number.isFinite(n)?n:Ve}var hW=Ln("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:fW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),dW=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 pW(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 mW(e){if(!dW.test(e))return Ve;const t=pW(e);return Number.isFinite(t)?t:Ve}var I1=Ln("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:mW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),gW=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),vW=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function yW(e){if(!gW.test(e))return Ve;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)||vW.test(e)?r:Ve}function bW(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 Cj=Ln("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:yW,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:bW}),xW=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),SW=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function wW(e,t){if(t){if(!SW.test(e))return Ve;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:Ve}if(!xW.test(e))return Ve;const n=Number(e);return Number.isFinite(n)?n:Ve}function OW(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 AW=Ln("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:wW,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:OW}),kW=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))$"),CW=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function EW(e){if(!kW.test(e))return Ve;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)||CW.test(e)?r:Ve}function TW(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 B1=Ln("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:EW,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:TW}),MW=Ln("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(e,t)=>e==="<<"||t&&e===""?"<<":Ve,identify:()=>!1}),PW=/^[A-Za-z0-9+/]*={0,2}$/;function DW(e){const t=e.replace(/\s/g,"");if(t.length%4!==0||!PW.test(t))return Ve;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 _W(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}var NW=Ln("tag:yaml.org,2002:binary",{resolve:DW,identify:e=>Object.prototype.toString.call(e)==="[object Uint8Array]",represent:_W}),RW=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),LW=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 fM(e,t,n,r=0,i=0,a=0,l=0){const s=new Date(Date.UTC(e,t,n,r,i,a,l));return s.setUTCFullYear(e,t,n),s}function jW(e){let t=RW.exec(e);if(t===null&&(t=LW.exec(e)),t===null)return Ve;const n=+t[1],r=+t[2]-1,i=+t[3];if(!t[4]){const d=fM(n,r,i);return d.getUTCFullYear()!==n||d.getUTCMonth()!==r||d.getUTCDate()!==i?Ve:d}const a=+t[4],l=+t[5],s=+t[6];let c=0;if(a>23||l>59||s>59)return Ve;if(t[7]){let d=t[7].slice(0,3);for(;d.length<3;)d+="0";c=+d}const f=fM(n,r,i,a,l,s,c);if(f.getUTCFullYear()!==n||f.getUTCMonth()!==r||f.getUTCDate()!==i)return Ve;if(t[9]){const d=+t[10],p=+(t[11]||0);if(d>23||p>59)return Ve;const g=(d*60+p)*6e4;f.setTime(f.getTime()-(t[9]==="-"?-g:g))}return f}var IW=Ln("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:jW,identify:e=>e instanceof Date,represent:e=>e.toISOString()}),BW=aO("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});function kv(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function z1(e,t){const n={};for(const r of t)e[r]!==void 0&&(n[r]=e[r]);return n}var zW=aO("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(kv(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,identify:()=>!1}),$W=aO("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]]]),"")},identify:()=>!1}),UW=Av("tag:yaml.org,2002:map",{create:()=>({}),identify:kv,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)=>{const n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}}),HW=Av("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 FW(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function qW(){return{scalar:[],sequence:[],mapping:[]}}function WW(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 Cv=class Ej{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(t){const n=WW(t),r=[],i=FW(),a=qW();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}}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}lookupScalarTag(t){const n=this.exact.scalar[t];if(n)return n;for(const r of this.prefix.scalar)if(t.startsWith(r.tagName))return r}lookupSequenceTag(t){const n=this.exact.sequence[t];if(n)return n;for(const r of this.prefix.sequence)if(t.startsWith(r.tagName))return r}lookupMappingTag(t){const n=this.exact.mapping[t];if(n)return n;for(const r of this.prefix.mapping)if(t.startsWith(r.tagName))return r}resolveImplicitScalarTag(t){const n=this.implicitScalarByFirstChar.get(t.charAt(0))??this.implicitScalarAnyFirstChar;for(const i of n){const a=i.resolve(t,!1,i.tagName);if(a!==Ve)return{value:a,tag:i}}const r=this.defaultScalarTag;return{value:r.resolve(t,!1,r.tagName),tag:r}}withTags(...t){let n=[];for(const r of t)n=n.concat(r);return new Ej([...this.tags,...n])}},lO=new Cv([Fq,BW,UW]);new Cv([...lO.tags,Kq,eW,hW,AW]);var KW=new Cv([...lO.tags,Wq,Gq,kj,Cj]),VW=new Cv([...lO.tags,Qq,rW,I1,B1,IW,MW,NW,zW,$W,HW]),QW=VW.withTags({...I1,resolve:(e,t,n)=>{const r=I1.resolve(e,t,n);return r===Ve?kj.resolve(e,t,n):r}},{...B1,resolve:(e,t,n)=>{const r=B1.resolve(e,t,n);return r===Ve?Cj.resolve(e,t,n):r}});Av("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||kv(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 hM(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)}Av("tag:yaml.org,2002:map",{create:()=>({}),identify:kv,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=hM(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=hM(t);return n!==null&&Object.prototype.hasOwnProperty.call(e,n)},keys:e=>Object.keys(e),get:(e,t)=>{const n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}});var XW={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function ix(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 ax(e,t){return" ".repeat(Math.max(t-e.length,0))+e}function YW(e,t){if(!e.buffer)return null;const n={...XW,...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=ix(e.buffer,i[s-g],a[s-g],e.position-(i[s]-i[s-g]),d);c=`${" ".repeat(n.indent)}${ax((e.line-g+1).toString(),f)} | ${v.str}
|
|
12
|
+
${c}`}const p=ix(e.buffer,i[s],a[s],e.position,d);c+=`${" ".repeat(n.indent)}${ax((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=ix(e.buffer,i[s+g],a[s+g],e.position-(i[s]-i[s+g]),d);c+=`${" ".repeat(n.indent)}${ax((e.line+g+1).toString(),f)} | ${v.str}
|
|
15
|
+
`}return c.replace(/\n$/,"")}function dM(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 Vl=class Tj extends Error{reason;mark;constructor(t,n){super(),this.name="YAMLException",this.reason=t,this.mark=n,this.message=dM(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(t){return`${this.name}: ${dM(this,t)}`}static throwAt(t,n,r,i=""){let a=0,l=0;for(let c=0;c<n;c++){const f=t.charCodeAt(c);f===10?(a++,l=c+1):f===13&&(a++,t.charCodeAt(c+1)===10&&c++,l=c+1)}const s={name:i,buffer:t,position:n,line:a,column:n-l};throw s.snippet=YW(s),new Tj(r,s)}},An={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},De={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},ti={BLOCK:1,FLOW:2},Vi={CLIP:1,STRIP:2,KEEP:3},GW=-1;function pM(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 Mj=new Array(256),Pj=new Array(256);for(let e=0;e<256;e++)Mj[e]=pM(e)?1:0,Pj[e]=pM(e);function ZW(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function JW(e){return e>=48&&e<=57?e-48:(e|32)-97+10}function eK(e){return e===120?2:e===117?4:8}function Km(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 oO(e){return e===1?" ":`
|
|
19
|
+
`.repeat(e-1)}function tK(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=Km(e,i,n);r+=oO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,l)}function nK(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=Km(e,i,n);r+=oO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,n)}function rK(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=Km(e,i,n).position;else if(c<256&&Mj[c])r+=Pj[c],i++;else{let f=eK(c),d=0;for(;f>0;f--){i++;const p=JW(e.charCodeAt(i));d=(d<<4)+p}r+=ZW(d),i++}a=l=i}else if(s===10||s===13){r+=e.slice(a,l);const c=Km(e,i,n);r+=oO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,n)}function mM(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===Vi.KEEP?f+=`
|
|
27
|
+
`.repeat(d?1+p:p):i!==Vi.STRIP&&d&&(f+=`
|
|
28
|
+
`),f}function iK(e,t){if(t.valueStart===GW)return"";const{valueStart:n,valueEnd:r}=t;if(t.fast)return e.slice(n,r);switch(t.style){case De.SINGLE_QUOTED:return nK(e,n,r);case De.DOUBLE_QUOTED:return rK(e,n,r);case De.LITERAL_BLOCK:return mM(e,n,r,t.indent,t.chomping,!1);case De.FOLDED_BLOCK:return mM(e,n,r,t.indent,t.chomping,!0);default:return tK(e,n,r)}}var aK=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"}),Dj="-#;/?:@&=+$_.~*'()",lK=Dj+"!,[]",gM="0123456789ABCDEF";function Ni(e){return"%"+gM[e>>4]+gM[e&15]}function lx(e,t){const n=t?Dj:lK;let r="";for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||n.includes(e[i])){r+=e[i];continue}a>=55296&&a<=56319&&(a=65536+((a&1023)<<10)+(e.charCodeAt(++i)&1023)),a<128?r+=Ni(a):a<2048?r+=Ni(192|a>>6)+Ni(128|a&63):a<65536?r+=Ni(224|a>>12)+Ni(128|a>>6&63)+Ni(128|a&63):r+=Ni(240|a>>18)+Ni(128|a>>12&63)+Ni(128|a>>6&63)+Ni(128|a&63)}return r}function ox(e){let t="",n=0;for(;n<e.length;){if(e.charCodeAt(n)!==37){t+=e[n++];continue}let r=parseInt(e.slice(n+1,n+3),16);if(n+=3,r>=192){let i=r<224?1:r<240?2:3;for(r&=(1<<6-i)-1;i-- >0;)r=r<<6|parseInt(e.slice(n+1,n+3),16)&63,n+=3}r<65536?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023))}return t}function _j(e,t){if(e.startsWith("!<")&&e.endsWith(">"))return ox(e.slice(2,-1));const n=e.indexOf("!",1),r=n===-1?"!":e.slice(0,n+1);return ox(t?.[r]??aK[r]??r)+ox(e.slice(r.length))}function Nj(e){let t=e;return t.charCodeAt(0)===33?(t=t.slice(1),`!${lx(t,!0)}`):t.slice(0,18)==="tag:yaml.org,2002:"?`!!${lx(t.slice(18),!0)}`:`!<${lx(t,!1)}>`}var ku=-1,oK="tag:yaml.org,2002:merge",sO={filename:"",schema:KW,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function sK(e){return"tagStart"in e&&e.tagStart!==ku?e.tagStart:"anchorStart"in e&&e.anchorStart!==ku?e.anchorStart:"valueStart"in e&&e.valueStart!==ku?e.valueStart:"start"in e?e.start:0}function kn(e,t){Vl.throwAt(e.source,e.position,t,e.filename)}function Rj(e,t,n,r){try{return n.finalize(r)}catch(i){if(i instanceof Vl)throw i;Vl.throwAt(e.source,t,i instanceof Error?i.message:String(i),e.filename)}}function uK(e,t){const n=iK(e.source,t),r=t.tagStart===ku?"":e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(r!==""){if(r==="!")return{value:n,tag:i};const a=_j(r,e.tagHandlers),l=e.schema.lookupScalarTag(a);if(l){const c=l.resolve(n,!0,a);return c===Ve&&kn(e,`cannot resolve a node with !<${a}> explicit tag`),{value:c,tag:l}}const s=e.schema.lookupMappingTag(a)??e.schema.lookupSequenceTag(a);if(s){n!==""&&kn(e,`cannot resolve a node with !<${a}> explicit tag`);const c=s.create(a);return{value:s.carrierIsResult?c:Rj(e,e.position,s,c),tag:s}}kn(e,`unknown scalar tag !<${a}>`)}return t.style===De.PLAIN?e.schema.resolveImplicitScalarTag(n):{value:i.resolve(n,!1,i.tagName),tag:i}}function vM(e,t,n){const r=t.tagStart===ku?"":e.source.slice(t.tagStart,t.tagEnd);return r===""||r==="!"?n:_j(r,e.tagHandlers)}function Lj(e){return e.nodeKind==="mapping"}function yM(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&kn(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function bM(e,t,n,r){yM(e);for(const i of r.keys(n)){if(yM(e),t.tag.has(t.value,i))continue;const a=t.tag.addPair(t.value,i,r.get(n,i));a&&kn(e,a),t.overridable??=new Set,t.overridable.add(i)}}function cK(e,t,n,r){if(e.position=t.keyPosition,Lj(r))bM(e,t,n,r);else if(r.nodeKind==="sequence"&&Array.isArray(n)){n.length>100&&kn(e,"abnormal merge sequence size");for(const i of n){const a=e.nodeTags.get(i);a||kn(e,"cannot merge mappings; the provided source object is unacceptable"),bM(e,t,i,a)}}else kn(e,"cannot merge mappings; the provided source object is unacceptable")}function fK(e,t,n,r,i){if(e.position=t.keyPosition,t.keyIsMerge){cK(e,t,r,i);return}!e.json&&t.tag.has(t.value,n)&&!t.overridable?.has(n)&&kn(e,"duplicated mapping key");const a=t.tag.addPair(t.value,n,r);a&&kn(e,a),t.overridable?.delete(n)}function sx(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"){Lj(n)&&e.nodeTags.set(t,n);const i=r.tag.addItem(r.value,t,r.index++);i&&kn(e,i)}else if(r.hasKey){const i=r.key;r.key=void 0,r.hasKey=!1,fK(e,r,i,t,n)}else r.key=t,r.keyPosition=e.position,r.hasKey=!0,r.keyIsMerge=n.tagName===oK}function ux(e,t,n,r,i){if(t.anchorStart!==ku){const a={value:n,tag:r,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),a),a}return null}function hK(e,t){const n={...sO,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags: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=sK(r),r.type){case An.DOCUMENT:n.anchors=new Map,n.nodeTags=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 An.SCALAR:{const{value:i,tag:a}=uK(n,r);ux(n,r,i,a,!0),sx(n,i,a);break}case An.SEQUENCE:{const i=vM(n,r,"tag:yaml.org,2002:seq"),a=n.schema.lookupSequenceTag(i);a||kn(n,`unknown sequence tag !<${i}>`);const l=a.create(i),s=ux(n,r,l,a,a.carrierIsResult);n.frames.push({kind:"sequence",position:n.position,value:l,tag:a,anchor:s,index:0});break}case An.MAPPING:{const i=vM(n,r,"tag:yaml.org,2002:map"),a=n.schema.lookupMappingTag(i);a||kn(n,`unknown mapping tag !<${i}>`);const l=a.create(i),s=ux(n,r,l,a,a.carrierIsResult);n.frames.push({kind:"mapping",position:n.position,value:l,tag:a,anchor:s,key:void 0,keyPosition:n.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case An.ALIAS:{n.maxAliases!==-1&&++n.aliasCount>n.maxAliases&&kn(n,`aliases exceeded maxAliases (${n.maxAliases})`);const i=n.source.slice(r.anchorStart,r.anchorEnd),a=n.anchors.get(i);a||kn(n,`unidentified alias "${i}"`),a.isValueFinal||kn(n,`recursive alias "${i}" is not supported for tag ${a.tag.tagName} because it uses finalize()`),sx(n,a.value,a.tag);break}case An.POP:{const i=n.frames.pop();if(i.kind==="mapping"&&i.hasKey&&(n.position=i.keyPosition,kn(n,"incomplete mapping pair in event stream")),i.kind==="document")n.documents.push(i.value);else{const a=i.tag.carrierIsResult?i.value:Rj(n,i.position,i.tag,i.value);i.anchor&&(i.anchor.value=a,i.anchor.isValueFinal=!0),sx(n,a,i.tag)}break}}}return n.documents}var Ye=-1,jj=Object.prototype.hasOwnProperty,$u=1,Ij=2,Bj=3,Vm=4,dK=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,pK=/[,\[\]{}]/,zj=/^(?:!|!!|![0-9A-Za-z-]+!)$/,$1=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,$j=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,mK=new RegExp(`^(?:${$1})*$`),gK=new RegExp(`^(?:${$j})+$`),vK=new RegExp(`^(?:!(?:${$1})*|${$j}(?:${$1})*)$`),uO={filename:"",maxDepth:100};function yK(e,t,n){e.events.push({type:An.DOCUMENT,explicitStart:t,explicitEnd:n,directives:e.directives})}function Uj(e,t,n,r,i,a,l){e.events.push({type:An.SEQUENCE,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:l})}function Hj(e,t,n,r,i,a,l){e.events.push({type:An.MAPPING,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:l})}function xM(e,t){e.events.splice(t.eventsLength,0,{type:An.MAPPING,start:t.position,anchorStart:Ye,anchorEnd:Ye,tagStart:Ye,tagEnd:Ye,style:ti.FLOW})}function uc(e,t,n,r,i,a,l,s,c=Vi.CLIP,f=-1,d=!1){e.events.push({type:An.SCALAR,valueStart:t,valueEnd:n,anchorStart:r,anchorEnd:i,tagStart:a,tagEnd:l,style:s,chomping:c,indent:f,fast:d})}function bK(e,t,n){e.events.push({type:An.ALIAS,anchorStart:t,anchorEnd:n})}function Cu(e){e.events.push({type:An.POP})}function Wn(e){uc(e,Ye,Ye,Ye,Ye,Ye,Ye,De.PLAIN)}function SM(){return{anchorStart:Ye,anchorEnd:Ye,tagStart:Ye,tagEnd:Ye}}function Eu(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function Tu(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){Vl.throwAt(e.input.slice(0,e.length),e.position,t,e.filename)}function ln(e){return e===10||e===13}function cc(e){return e===9||e===32}function bi(e){return cc(e)||ln(e)}function La(e){return e===0||bi(e)}function ns(e){return e===44||e===91||e===93||e===123||e===125}function xK(e){return e>=48&&e<=57?e-48:-1}function SK(e){if(e>=48&&e<=57)return e-48;const t=e|32;return t>=97&&t<=102?t-97+10:-1}function wK(e){return e===120?2:e===117?4:e===85?8:0}function OK(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 Qm(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 _n(e,t){let n=0,r=e.input.charCodeAt(e.position),i=e.position===e.lineStart||bi(e.input.charCodeAt(e.position-1));for(;r!==0;){for(;cc(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(!ln(r)&&r!==0);if(!ln(r))break;for(Qm(e),n++,i=!0,r=e.input.charCodeAt(e.position);r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return n}function Uu(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||bi(r)}return!1}function Fj(e){e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279&&(e.position++,e.lineStart=e.position)}function cO(e){if(e.position!==e.lineStart)return!1;if(Uu(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;const t=Eu(e);Fj(e),_n(e,!0);const n=e.input.charCodeAt(e.position),r=e.position===e.lineStart&&(n===37||n===45&&Uu(e));return Tu(e,t),r}function wM(e){let t=e.input.charCodeAt(e.position);for(;t!==0&&!ln(t);)t=e.input.charCodeAt(++e.position)}function qj(e,t,n){const r=dK.exec(e.input.slice(t,n));r!==null&&(e.position=t+r.index+r[0].length-1,ke(e,"the stream contains non-printable characters"))}function AK(e,t,n){if(e.input.charCodeAt(e.position)!==33)return!1;t.tagStart!==Ye&&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&&!bi(s)&&!(n&&ns(s));)s===33&&(a?ke(e,"tag suffix cannot contain exclamation marks"):(l=e.input.slice(c-1,e.position+1),zj.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),pK.test(f)&&ke(e,"tag suffix cannot contain flow indicator characters")}return f&&!(i?mK.test(f):gK.test(f))&&ke(e,`tag name cannot contain such characters: ${f}`),!i&&l!=="!"&&l!=="!!"&&!jj.call(e.tagHandlers,l)&&ke(e,`undeclared tag handle "${l}"`),t.tagStart=r,t.tagEnd=e.position,!0}function kK(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;t.anchorStart!==Ye&&ke(e,"duplication of an anchor property"),e.position++;const n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!bi(e.input.charCodeAt(e.position))&&!ns(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 CK(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;(t.anchorStart!==Ye||t.tagStart!==Ye)&&ke(e,"alias node should not have any properties"),e.position++;const n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!bi(e.input.charCodeAt(e.position))&&!ns(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&ke(e,"name of an alias node must contain at least one character"),bK(e,n,e.position),!0}function U1(e,t){_n(e,!1),e.lineIndent<t&&ke(e,"deficient indentation")}function EK(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++,uc(e,r,l,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,De.SINGLE_QUOTED,Vi.CLIP,-1,i),!0}ln(a)?(i=!1,U1(e,t)):e.position===e.lineStart&&Uu(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 TK(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++,uc(e,r,l,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,De.DOUBLE_QUOTED,Vi.CLIP,-1,i),!0}if(a===92){i=!1;const l=e.input.charCodeAt(++e.position);if(ln(l))U1(e,t);else if(OK(l))e.position++;else{let s=wK(l);for(s===0&&ke(e,"unknown escape sequence");s-- >0;)e.position++,SK(e.input.charCodeAt(e.position))<0&&ke(e,"expected hexadecimal character");e.position++}}else ln(a)?(i=!1,U1(e,t)):e.position===e.lineStart&&Uu(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 MK(e,t,n){const r=e.input.charCodeAt(e.position);let i=Vi.CLIP,a=-1,l=!1;if(r!==124&&r!==62)return!1;const s=r===124?De.LITERAL_BLOCK:De.FOLDED_BLOCK;for(e.position++;e.input.charCodeAt(e.position)!==0;){const v=e.input.charCodeAt(e.position),y=xK(v);if(v===43||v===45)i!==Vi.CLIP&&ke(e,"repeat of a chomping mode identifier"),i=v===43?Vi.KEEP:Vi.STRIP,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(;cc(e.input.charCodeAt(e.position));)c=!0,e.position++;c&&e.input.charCodeAt(e.position)===35&&wM(e),ln(e.input.charCodeAt(e.position))?Qm(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(cO(e))break;if(!l&&f===-1&&ln(x)&&(d=Math.max(d,y)),!l&&f===-1&&!ln(x)&&(x===9&&y<t&&(e.position=v+y,ke(e,"tab characters must not be used in indentation")),y>=t&&y<d&&(e.position=v+y,ke(e,"bad indentation of a mapping entry"))),f===-1&&x!==0&&!ln(x)&&y<t){e.lineIndent=y,e.position=v+y;break}!l&&x!==0&&!ln(x)&&f===-1&&(f=y);const w=f===-1?t+1:f;if(x!==0&&!ln(x)&&y<w){e.lineIndent=y,e.position=v+y;break}wM(e),g=e.position,ln(e.input.charCodeAt(e.position))&&(Qm(e),g=e.position)}return qj(e,p,g),uc(e,p,g,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,s,i,f),!0}function PK(e,t){const n=e.input.charCodeAt(e.position),r=t===$u;if(n===0||bi(n)||n===35||n===38||n===42||n===33||n===124||n===62||n===39||n===34||n===37||n===64||n===96||ns(n))return!1;if(n===63||n===45){const i=e.input.charCodeAt(e.position+1);if(La(i)||r&&ns(i))return!1}return!0}function DK(e,t,n,r){if(!PK(e,n))return!1;const i=e.position;let a=e.position,l=e.input.charCodeAt(e.position);const s=n===$u;let c=!1;for(;l!==0&&!cO(e);){if(l===58){const f=e.input.charCodeAt(e.position+1);if(La(f)||s&&ns(f))break}else if(l===35){if(bi(e.input.charCodeAt(e.position-1)))break}else{if(s&&ns(l))break;if(ln(l)){const f=e.position,d=e.line,p=e.lineStart,g=e.lineIndent;if(_n(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}}cc(l)||(a=e.position+1),l=e.input.charCodeAt(++e.position)}return a===i?!1:(qj(e,i,a),uc(e,i,a,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,De.PLAIN,Vi.CLIP,-1,!c),!0)}function Sf(e,t){const n=e.line;_n(e,!0),(e.line>n&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)&&ke(e,"deficient indentation")}function _K(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?Hj(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,ti.FLOW):Uj(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,ti.FLOW),e.position++;e.input.charCodeAt(e.position)!==0;){Sf(e,t);let c=e.input.charCodeAt(e.position);if(c===s)return e.position++,Cu(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&&bi(e.input.charCodeAt(e.position+1))&&(f=d=!0,e.position+=1,Sf(e,t));const p=e.line,g=Eu(e),v=Hu(e,t,$u,!1,!0);Sf(e,t),c=e.input.charCodeAt(e.position),(i||d||e.line===p)&&c===58?(f=!0,e.position++,Sf(e,t),i||xM(e,g),v||Wn(e),Hu(e,t,$u,!1,!0)||Wn(e),Sf(e,t),i||Cu(e)):i&&f?(v||Wn(e),Wn(e)):i?Wn(e):f&&(xM(e,g),v||Wn(e),Wn(e),Cu(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||!La(e.input.charCodeAt(e.position+1)))return!1;for(Uj(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,ti.BLOCK);e.input.charCodeAt(e.position)===45&&La(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=_n(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&La(e.input.charCodeAt(e.position+1))&&ke(e,"bad indentation of a sequence entry"),i&&e.lineIndent<=t?Wn(e):Hu(e,t,Bj,!1,!0),_n(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&&La(e.input.charCodeAt(e.position+1))&&ke(e,"bad indentation of a sequence entry")}return Cu(e),!0}function cx(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)&&La(f))l||(Hj(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,ti.BLOCK),l=!0),c===63?(i&&Wn(e),a=!0,i=!0):(i||(Wn(e),a=!0),i=!1),e.position+=1,s=!0;else{i&&(Wn(e),i=!1);const p=Eu(e);if(!Hu(e,n,Ij,!1,!0))break;if(e.line===d){for(c=e.input.charCodeAt(e.position);cc(c);)c=e.input.charCodeAt(++e.position);if(c===58)c=e.input.charCodeAt(++e.position),La(c)||ke(e,"a whitespace character is expected after the key-value separator within a block mapping"),l||(e.events.splice(p.eventsLength,0,{type:An.MAPPING,start:p.position,anchorStart:r.anchorStart,anchorEnd:r.anchorEnd,tagStart:r.tagStart,tagEnd:r.tagEnd,style:ti.BLOCK}),l=!0),a=!0,i=!1,s=!1;else if(a)ke(e,"expected ':' after a mapping key");else return r.anchorStart!==Ye||r.tagStart!==Ye?(Tu(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!==Ye||r.tagStart!==Ye?(Tu(e,p),!1):!0}if(Hu(e,t,Vm,!0,s)&&(s=!1),i||s&&(Wn(e),s=!1),_n(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&&Wn(e),l&&Cu(e),!0):!1}function Hu(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===Vm||n===Bj,g=p;const v=p;if(r&&_n(e,!0)&&(s=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:l=-1),l===1)for(;;){const y=e.input.charCodeAt(e.position),x=Eu(e);if(s&&l!==1&&(y===33||y===38))break;if(s&&v&&(d.tagStart!==Ye||d.anchorStart!==Ye)&&(y===33||y===38)){const w=Eu(e),A=t+1;if(cx(e,e.position-e.lineStart,A,d)&&e.events[w.eventsLength]?.type===An.MAPPING)return e.depth--,!0;Tu(e,w)}if(s&&(y===33&&d.tagStart!==Ye||y===38&&d.anchorStart!==Ye)||!AK(e,d,n===$u)&&!kK(e,d))break;f===null&&(f=x),_n(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===Vm){const y=n===$u||n===Ij?t:t+1,x=e.position-e.lineStart;if(l===1)if(g&&(OM(e,x,d)||cx(e,x,y,d))||_K(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=Eu(e),C=f.position-f.lineStart;Tu(e,f),cx(e,C,y,SM())&&e.events[A.eventsLength]?.type===An.MAPPING?c=!0:Tu(e,A)}!c&&(p&&MK(e,y,d)||EK(e,y,d)||TK(e,y,d)||CK(e,d)||DK(e,y,n,d))&&(c=!0)}else l===0&&(c=g&&OM(e,x,d))}return p=p&&!c,!c&&(d.anchorStart!==Ye||d.tagStart!==Ye||p)&&(uc(e,Ye,Ye,d.anchorStart,d.anchorEnd,d.tagStart,d.tagEnd,De.PLAIN),c=!0),e.depth--,c||d.anchorStart!==Ye||d.tagStart!==Ye}function NK(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&&!bi(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&&!ln(e.input.charCodeAt(e.position));){for(;cc(e.input.charCodeAt(e.position));)e.position++;if(e.input.charCodeAt(e.position)===35||ln(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;const i=e.position;for(;e.input.charCodeAt(e.position)!==0&&!bi(e.input.charCodeAt(e.position));)e.position++;r.push(e.input.slice(i,e.position))}if(ln(e.input.charCodeAt(e.position))&&Qm(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;zj.test(i)||ke(e,"ill-formed tag handle (first argument) of the TAG directive"),jj.call(e.tagHandlers,i)&&ke(e,`there is a previously declared suffix for "${i}" tag handle`),vK.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 RK(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;for(_n(e,!0);NK(e);)t=!0,_n(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&&La(e.input.charCodeAt(e.position+3))){n=!0;const s=e.line;e.position+=3,_n(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&&Uu(e)){e.position+=3,_n(e,!0);return}if(yK(e,n,!1),Hu(e,e.lineIndent-1,Vm,!1,i,i)||Wn(e),_n(e,!0),e.position===e.lineStart&&Uu(e)&&(r=e.input.charCodeAt(e.position)===46,r)){const s=e.line;e.position+=3,_n(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===An.DOCUMENT&&(l.explicitEnd=r),Cu(e),!r&&e.position<e.length&&!cO(e)&&ke(e,"end of the stream or a document separator is expected")}function LK(e,t){const n=e.length,r={...uO,...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&&Vl.throwAt(e,i,"null byte is not allowed in input",r.filename);r.position<r.length&&(Fj(r),_n(r,!0),!(r.position>=r.length));){const a=r.position;RK(r),r.position===a&&ke(r,"can not read a document")}return r.events}var jK={...uO,...sO};function IK(e,t={}){const n={...jK,...t},r=String(e),i=Object.keys(uO),a=Object.keys(sO);return hK(LK(r,z1(n,i)),{...z1(n,a),source:r})}function BK(e,t){const n=IK(e,t);if(n.length===0)throw new Vl("expected a document, but the input is empty");if(n.length===1)return n[0];throw new Vl("expected a single document in the stream, but found more")}var _o=Symbol("INVALID");function zK(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 $K(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(t)){let l;return i.matchByTagPrefix?l=i.representTagName(t):l=i.tagName,{tag:i,tagName:l,implicitTag:a}}}return null}function $f(e,t){if(!e.noRefs&&t!==null&&typeof t=="object"){const f=e.refs.get(t);if(f)return f.anchor===void 0&&(f.anchor=`ref_${e.refCounter++}`),{kind:"alias",anchor:f.anchor}}const n=$K(e,t);if(!n){if(t===void 0||e.skipInvalid)return _o;throw new Vl(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`)}const{tag:r,tagName:i,implicitTag:a}=n,l=a?i:Nj(i);if(r.nodeKind==="scalar")return{kind:"scalar",tag:l,tagged:!a,style:De.PLAIN,value:r.represent(t)};if(r.nodeKind==="sequence"){const f=r.represent(t),d={kind:"sequence",tag:l,tagged:!a,style:ti.BLOCK,items:[]};e.noRefs||e.refs.set(t,d);for(let p=0,g=f.length;p<g;p+=1){let v=$f(e,f[p]);v===_o&&f[p]===void 0&&(v=$f(e,null)),v!==_o&&d.items.push(v)}return d}const s=r.represent(t),c={kind:"mapping",tag:l,tagged:!a,style:ti.BLOCK,items:[]};e.noRefs||e.refs.set(t,c);for(const[f,d]of s){const p=$f(e,f);if(p===_o)continue;const g=$f(e,d);g!==_o&&c.items.push({key:p,value:g})}return c}function UK(e,t,n={}){const r=$f({representTypes:zK(t),noRefs:n.noRefs??!1,skipInvalid:n.skipInvalid??!1,refs:new Map,refCounter:0},e);return[{contents:r===_o?null:r,directives:[]}]}var HK=Symbol("visit:break"),Wj=Symbol("visit:skip");function Cm(e,t,n){const r=t(e,n);if(r===HK)return!0;if(r===Wj)return!1;const i=n.depth+1;switch(e.kind){case"sequence":for(const a of e.items)if(Cm(a,t,{depth:i,parent:e,isKey:!1}))return!0;break;case"mapping":for(const{key:a,value:l}of e.items)if(Cm(a,t,{depth:i,parent:e,isKey:!0})||Cm(l,t,{depth:i,parent:e,isKey:!1}))return!0}return!1}function AM(e,t){for(const n of e)if(n.contents&&Cm(n.contents,t,{depth:0,parent:null,isKey:!1}))return}function Ev(e,t){return(e&1<<t)!==0}var kM={applyQuoteFlowKeysOption:FK,doubleQuoteForInvisibles:qK,doubleQuoteWhitespaceOnly:WK,applyForceQuotesOption:KK,tryLongOrMultilineAsBlock:VK,quoteInvalidPlain:QK,fallbackToDoubleQuoted:XK};function Kj(e){return e.presenterOptions.quoteStyle==="single"&&Ev(e.allowedStylesMask,De.SINGLE_QUOTED)?De.SINGLE_QUOTED:De.DOUBLE_QUOTED}function FK(e){e.presenterOptions.quoteFlowKeys&&(!e.isKey||!e.flowOnly||e.style!==De.PLAIN||(e.style=De.DOUBLE_QUOTED))}function qK(e){e.style===De.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value)&&(e.style=De.DOUBLE_QUOTED)}function WK(e){e.style===De.PLAIN&&/^\s+$/.test(e.node.value)&&(e.style=De.DOUBLE_QUOTED)}function KK(e){e.presenterOptions.forceQuotes&&(e.isKey||e.style!==De.PLAIN||e.node.tag===e.presenterOptions.schema.defaultScalarTag.tagName&&(e.style=e.node.value.includes(`
|
|
29
|
+
`)?De.DOUBLE_QUOTED:Kj(e)))}function VK(e){if(e.style!==De.PLAIN||e.isKey)return;const t=e.node.value,n=t.indexOf(`
|
|
30
|
+
`)!==-1;if(!Ev(e.allowedStylesMask,De.LITERAL_BLOCK)){n&&(e.style=De.DOUBLE_QUOTED);return}const r=e.presenterOptions.lineWidth;if(r===-1){n&&(e.style=De.LITERAL_BLOCK);return}const i=Math.max(Math.min(r,40),r-e.shiftOfContent);let a=0,l=!1;for(;a<=t.length;){let s=t.length;const c=t.indexOf(`
|
|
31
|
+
`,a);c!==-1&&(s=c);const f=t.slice(a,s);if(f.length>i&&f[0]!==" "&&/ [^ \t]/.test(f)&&(l=!0),c===-1)break;a=c+1}l?e.style=De.FOLDED_BLOCK:n&&(e.style=De.LITERAL_BLOCK)}function QK(e){e.style===De.PLAIN&&!Ev(e.allowedStylesMask,De.PLAIN)&&(e.style=Kj(e))}function XK(e){Ev(e.allowedStylesMask,e.style)||(e.style=De.DOUBLE_QUOTED)}function wf(e,t){return e|1<<t}var YK="[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]",GK="[\\n\\r]",ZK="\\uFEFF",fO="[ \\t]",Vj=`(?:(?!(?:${GK}|${ZK}))${YK})`,Tv=`(?:(?!${fO})${Vj})`,Qj="[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]",Xj="[-?:,\\[\\]{}#&*!|>'\"%@`]",JK="[,\\[\\]{}]",H1=Tv,F1=`(?:(?!${JK})${Tv})`,eV=`(?:(?:(?!${Xj})${Tv})|[?:-](?=${H1}))`,tV=`(?:(?:(?!${Xj})${Tv})|[?:-](?=${F1}))`,Yj=`(?:(?:(?![:#])${H1})|:(?=${H1}))#*`,Gj=`(?:(?:(?![:#])${F1})|:(?=${F1}))#*`,Zj=`(?:${fO}*${Yj})*`,Jj=`(?:${fO}*${Gj})*`,eI=`${eV}#*${Zj}`,tI=`${tV}#*${Jj}`,nV=eI,rV=tI,iV=`\\n+${Yj}${Zj}`,aV=`\\n+${Gj}${Jj}`,lV=`${eI}(?:${iV})*`,oV=`${tI}(?:${aV})*`,sV=new RegExp(`^(?:${lV})$`,"u"),uV=new RegExp(`^(?:${oV})$`,"u"),cV=new RegExp(`^(?:${nV})$`,"u"),fV=new RegExp(`^(?:${rV})$`,"u"),hV=new RegExp(`^(?:${Qj})*$`,"u"),dV=new RegExp(`^(?:${Qj}|\\n)*$`,"u"),pV=new RegExp(`^(?:${Vj}|\\n)*$`,"u"),mV=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/,hO=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/m;function gV(e){const t=e.node.value;if(t!==""){if(!(e.isKey?e.flowOnly?fV:cV:e.flowOnly?uV:sV).test(t)||e.shiftOfFirstLine===0&&mV.test(t))return!1;if(e.shiftOfContent===0){const r=t.indexOf(`
|
|
32
|
+
`);if(r!==-1){const i=t.slice(r+1);if(hO.test(i))return!1}}}const n=e.presenterOptions.schema.resolveImplicitScalarTag(t).tag.tagName;return!(!e.node.tagged&&n!==e.node.tag||!e.node.tagged&&t==="="&&n===e.presenterOptions.schema.defaultScalarTag.tagName)}function vV(e){const t=e.node.value;if(!(e.isKey?hV:dV).test(t)||/[ \t]\n|\n[ \t]/.test(t))return!1;if(!e.isKey&&e.shiftOfContent===0){const n=t.indexOf(`
|
|
33
|
+
`);if(n!==-1&&hO.test(t.slice(n+1)))return!1}return!0}function yV(e){if(e.flowOnly||!pV.test(e.node.value))return!1;const t=e.shiftOfContent-e.shiftOfParent;return!(t<1||t>9&&/^\n* /.test(e.node.value)||e.shiftOfContent===0&&hO.test(e.node.value))}function bV(e){let t=wf(0,De.DOUBLE_QUOTED);gV(e)&&(t=wf(t,De.PLAIN)),vV(e)&&(t=wf(t,De.SINGLE_QUOTED)),yV(e)&&(t=wf(wf(t,De.LITERAL_BLOCK),De.FOLDED_BLOCK)),e.allowedStylesMask=t}function xV(e){switch(e.style){case De.PLAIN:return SV(e);case De.SINGLE_QUOTED:return wV(e);case De.LITERAL_BLOCK:return OV(e);case De.FOLDED_BLOCK:return AV(e);case De.DOUBLE_QUOTED:return kV(e)}}function SV(e){return nI(e.node.value,e.shiftOfContent)}function wV(e){return`'${nI(e.node.value,e.shiftOfContent).replace(/'/g,"''")}'`}function OV(e){const t=e.node.value;return"|"+iI(t,e.shiftOfParent,e.shiftOfContent)+aI(rI(t,e.shiftOfContent))}function AV(e){const t=e.node.value,n=e.presenterOptions.lineWidth;let r=1/0;return n!==-1&&(r=Math.max(Math.min(n,40),n-e.shiftOfContent)),">"+iI(t,e.shiftOfParent,e.shiftOfContent)+aI(rI(EV(t,r),e.shiftOfContent))}function kV(e){return`"${PV(e.node.value)}"`}function nI(e,t){let n=e.indexOf(`
|
|
34
|
+
`);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+=`
|
|
35
|
+
`.repeat(s+1)+r+c}return i}function rI(e,t){const n=" ".repeat(t);let r=0,i="";const a=e.length;for(;r<a;){let l;const s=e.indexOf(`
|
|
36
|
+
`,r);s===-1?(l=e.slice(r),r=a):(l=e.slice(r,s+1),r=s+1),l.length&&l!==`
|
|
37
|
+
`&&(i+=n),i+=l}return i}function CV(e){return/^\n* /.test(e)}function iI(e,t,n){const r=CV(e)?String(n-t):"",i=e[e.length-1]===`
|
|
38
|
+
`;return`${r}${i&&(e[e.length-2]===`
|
|
39
|
+
`||e===`
|
|
40
|
+
`)?"+":i?"":"-"}
|
|
41
|
+
`}function aI(e){return e[e.length-1]===`
|
|
42
|
+
`?e.slice(0,-1):e}function q1(e){return e===" "||e===" "}function CM(e,t){if(e===""||q1(e[0]))return e;const n=/ [^ \t]/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+=`
|
|
43
|
+
${e.slice(i,a)}`,i=a+1),l=s;return c+=`
|
|
44
|
+
`,e.length-i>t&&l>i?c+=`${e.slice(i,l)}
|
|
45
|
+
${e.slice(l+1)}`:c+=e.slice(i),c.slice(1)}function EV(e,t){const n=/(\n+)([^\n]*)/g;let r=e.indexOf(`
|
|
46
|
+
`);r===-1&&(r=e.length),n.lastIndex=r;let i=CM(e.slice(0,r),t),a=e[0]===`
|
|
47
|
+
`||q1(e[0]),l,s;for(;s=n.exec(e);){const c=s[1],f=s[2];l=f!==""&&q1(f[0]),i+=c+(!a&&!l&&f!==""?`
|
|
48
|
+
`:"")+CM(f,t),a=l}return i}var TV=/["\\\x00-\x1F\x7F-\xA0\u2028\u2029\uD800-\uDFFF\uFEFF\uFFFE\uFFFF]/gu;function MV(e){switch(e){case"\0":return"\\0";case"\x07":return"\\a";case"\b":return"\\b";case" ":return"\\t";case`
|
|
49
|
+
`:return"\\n";case"\v":return"\\v";case"\f":return"\\f";case"\r":return"\\r";case"\x1B":return"\\e";case'"':return'\\"';case"\\":return"\\\\";case"
":return"\\N";case" ":return"\\_";case"\u2028":return"\\L";case"\u2029":return"\\P"}const t=e.charCodeAt(0),n=t.toString(16).toUpperCase();return t<=255?`\\x${"0".repeat(2-n.length)}${n}`:`\\u${"0".repeat(4-n.length)}${n}`}function PV(e){return e.replace(TV,MV)}var Xm=10,dO={indent:2,seqNoIndent:!1,seqInlineFirst:!0,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,scalarStyleRules:Object.keys(kM).map(e=>Reflect.get(kM,e)),tagBeforeAnchor:!1};function DV(e){return e.tagged?e.tag:Nj(e.tag)}function _V(e){const t={...dO,...e};return t.flowSkipColonSpace&&(t.quoteFlowKeys=!0),{...t,defaultScalarTagName:t.schema.defaultScalarTag.tagName,openEnded:!1}}function W1(e,t){return`
|
|
50
|
+
${" ".repeat(e.indent*t)}`}function NV(e,t,n,r,i,a){return{node:t,parent:n,level:r,isKey:i,flowOnly:a,shiftOfParent:r===0?-1:e.indent*(r-1),shiftOfContent:e.indent*Math.max(1,r),shiftOfFirstLine:r===0?0:e.indent*r,presenterOptions:e,allowedStylesMask:0,style:t.style}}function RV(e,t,n){let r="";for(let a=0,l=n.items.length;a<l;a+=1){const s=za(e,t,n.items[a],n,{}).text;a>0&&(r+=`,${e.flowSkipCommaSpace?"":" "}`),r+=s}const i=e.flowBracketPadding&&n.items.length>0?" ":"";return`[${i}${r}${i}]`}function EM(e,t,n,r){let i="";for(let a=0,l=n.items.length;a<l;a+=1){const s=za(e,t+1,n.items[a],n,{block:!0,compact:e.seqInlineFirst,isblockseq:!0}).text;(!r||i!=="")&&(i+=W1(e,t)),s===""||Xm===s.charCodeAt(0)?i+="-":i+="- ",i+=s}return i}function LV(e,t,n){let r="";for(const{key:a,value:l}of n.items){let s="";r!==""&&(s+=`,${e.flowSkipCommaSpace?"":" "}`);const c=za(e,t,a,n,{iskey:!0}),f=c.text,d=za(e,t,l,n,{}).text,p=e.flowSkipColonSpace||d===""?"":" ",g=a.kind==="scalar"&&c.noBody&&(a.tagged||a.anchor!==void 0),v=a.kind==="alias"||g?" ":"";s+=`${f}${v}:${p}${d}`,r+=s}const i=e.flowBracketPadding&&r!==""?" ":"";return`{${i}${r}${i}}`}function jV(e,t,n,r){let i="";for(let a=0,l=n.items.length;a<l;a+=1){let s="";(!r||i!=="")&&(s+=W1(e,t));const{key:c,value:f}=n.items[a],d=(c.kind==="mapping"||c.kind==="sequence")&&c.style===ti.BLOCK&&c.items.length!==0||c.kind==="scalar"&&(c.style===De.LITERAL_BLOCK||c.style===De.FOLDED_BLOCK),p=d?za(e,t+1,c,n,{block:!0,compact:!0,isblockseq:!K1(e,c,t+1)}):za(e,t+1,c,n,{block:!0,compact:!0,iskey:!0}),g=p.text,v=c.kind==="scalar"&&c.value.indexOf(`
|
|
51
|
+
`)!==-1,y=g.length>1024&&/^[\s\S]{1025}/u.test(g),x=d||v||y;x&&(g&&Xm===g.charCodeAt(0)?s+="?":s+="? "),s+=g,x&&(s+=W1(e,t));const w=za(e,t+1,f,n,{block:!0,compact:x,isblockseq:x&&!K1(e,f,t+1)}).text,A=c.kind==="scalar"&&p.noBody&&(c.tagged||c.anchor!==void 0),C=!x&&(c.kind==="alias"||A)?" ":"";w===""||Xm===w.charCodeAt(0)?s+=`${C}:`:s+=`${C}: `,s+=w,i+=s}return i}function K1(e,t,n){return t.kind==="alias"?!0:t.tagged||t.anchor!==void 0||e.indent<2&&n>0}function za(e,t,n,r,i){if(n.kind==="alias")return e.openEnded=!1,{text:`*${n.anchor}`,noBody:!1};const{block:a=!1,iskey:l=!1,isblockseq:s=!1}=i;let c=i.compact??!1;const f=n.anchor!==void 0;K1(e,n,t)&&(c=!1);let d,p=n.tagged;const g=a&&(n.kind==="mapping"||n.kind==="sequence")&&n.style===ti.BLOCK&&n.items.length!==0;if(n.kind==="mapping")g?d=jV(e,t,n,c):d=LV(e,t,n);else if(n.kind==="sequence")g?e.seqNoIndent&&!s&&t>0?d=EM(e,t-1,n,c):d=EM(e,t,n,c):d=RV(e,t,n);else{const x=NV(e,n,r,t,l,!a);bV(x);for(const w of e.scalarStyleRules)w(x);d=xV(x),e.openEnded=(x.style===De.LITERAL_BLOCK||x.style===De.FOLDED_BLOCK)&&(n.value===`
|
|
52
|
+
`||n.value.endsWith(`
|
|
53
|
+
|
|
54
|
+
`)),p=n.tagged||d===""&&x.flowOnly&&r?.kind==="sequence"&&!f||x.style!==De.PLAIN&&n.tag!==e.defaultScalarTagName}(n.kind==="mapping"||n.kind==="sequence")&&!g&&(e.openEnded=!1),g&&c&&t>0&&e.indent>2&&(d=`${" ".repeat(e.indent-2)}${d}`);const v=d==="";let y=d;if(p||f){const x=[],w=p?DV(n):null,A=f?`&${n.anchor}`:null;e.tagBeforeAnchor?(w!==null&&x.push(w),A!==null&&x.push(A)):(A!==null&&x.push(A),w!==null&&x.push(w));const C=d===""||d.charCodeAt(0)===Xm?"":" ";y=`${x.join(" ")}${C}${d}`}return{text:y,noBody:v}}function IV(e){return(e.kind==="sequence"||e.kind==="mapping")&&e.style===ti.BLOCK&&e.items.length!==0&&!e.tagged&&e.anchor===void 0}function BV(e){let t="";for(const n of e.directives){if(n.kind==="yaml"){t+=`%YAML ${n.version}
|
|
55
|
+
`;continue}const{handle:r,prefix:i}=n;t+=`%TAG ${r} ${i}
|
|
56
|
+
`}return t}function zV(e,t){const n=_V(t);let r="",i=!1;for(let a=0;a<e.length;a+=1){const l=e[a];n.openEnded=!1;const s=BV(l),c=s!=="",f=l.explicitStart||c||a>0&&!i;if(r+=s,l.contents===null)f&&(r+=`---
|
|
57
|
+
`);else if(f){const d=za(n,0,l.contents,null,{block:!0,compact:!0}).text,p=d===""?"":c||IV(l.contents)?`
|
|
58
|
+
`:" ";r+=`---${p}${d}
|
|
59
|
+
`}else r+=za(n,0,l.contents,null,{block:!0,compact:!0}).text+`
|
|
60
|
+
`;i=l.explicitEnd||n.openEnded,i&&(r+=`...
|
|
61
|
+
`)}return r}var $V={...dO,schema:QW,skipInvalid:!1,noRefs:!1,flowLevel:-1,sortKeys:!1,transform:()=>{}};function UV(e,t){const n=String(e),r=String(t);return n<r?-1:n>r?1:0}function HV(e,t={}){const n={...$V,...t},r=UK(e,n.schema,{noRefs:n.noRefs,skipInvalid:n.skipInvalid});if(n.flowLevel>=0&&AM(r,(i,a)=>{if(!(a.depth<n.flowLevel))return(i.kind==="sequence"||i.kind==="mapping")&&(i.style=ti.FLOW),Wj}),n.sortKeys){const i=n.sortKeys===!0?UV:n.sortKeys;AM(r,a=>{a.kind==="mapping"&&a.items.sort((l,s)=>i(l.key.kind==="scalar"?l.key.value:"",s.key.kind==="scalar"?s.key.value:""))})}return n.transform(r),zV(r,{...z1(n,Object.keys(dO)),schema:n.schema})}const TM=[{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"}],Np={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:"exclude_paths",label:"Exclude paths",type:"string_list",placeholder:"vendor/**, **/*_test.go",help:"Glob patterns relative to the source root"},{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"}]}},fx={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"},{key:"keyword_index",label:"Keyword index (BM25)",type:"boolean",help:"Stores a BM25 keyword vector per chunk so the MCP server can run hybrid search (HYBRID_SEARCH=true). Needs Qdrant 1.18 or later; existing chunks are backfilled on the next sync"}]}},MM={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"}]}},FV=[{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 Rp(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 qV(e,t){return t.reduce((n,r)=>n?.[r],e)}function lI(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]=lI(a[r],i,n),a}const $o="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 du({field:e,value:t,onChange:n}){const[r,i]=O.useState(null);return e.type==="boolean"?T.jsxs("label",{className:"flex items-center gap-2 py-1.5 text-sm text-ink-secondary",children:[T.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&&T.jsxs("span",{className:"text-xs text-ink-muted",children:["— ",e.help]})]}):T.jsxs("label",{className:"block",children:[T.jsxs("span",{className:"mb-1 flex items-baseline gap-2 text-xs font-medium text-ink-secondary",children:[e.label,e.required&&T.jsx("span",{className:"text-critical",children:"*"}),e.secret&&T.jsxs("span",{className:"text-ink-muted",children:["use a ",T.jsx("code",{children:"${ENV_VAR}"})," placeholder"]})]}),e.type==="select"?T.jsxs("select",{value:t??"",onChange:a=>n(a.target.value||void 0),className:$o,children:[T.jsx("option",{value:"",children:"—"}),e.options.map(a=>T.jsx("option",{value:a,children:a},a))]}):e.type==="string_list"?T.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:$o}):T.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:$o}),e.help&&T.jsx("span",{className:"mt-1 block text-xs text-ink-muted",children:e.help})]})}function hx({fields:e,doc:t,basePath:n,onSet:r}){return T.jsx("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:e.map(i=>T.jsx("div",{className:i.type==="boolean"?"sm:col-span-2":"",children:T.jsx(du,{field:i,value:qV(t,[...n,i.key]),onChange:a=>r([...n,i.key],a)})},i.key))})}function Lp({title:e,subtitle:t,action:n,children:r}){return T.jsxs("section",{className:"rounded-lg border border-edge bg-surface p-4",children:[T.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[T.jsx("h3",{className:"text-sm font-semibold",children:e}),t&&T.jsx("span",{className:"text-xs text-ink-muted",children:t}),T.jsx("div",{className:"ml-auto",children:n})]}),r]})}function oI(e){const t=io(),n=O.useMemo(()=>{if(e.mode==="edit"&&e.config)try{const A=BK(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:[Rp("website")]},parseError:null}},[e.mode,e.config]),[r,i]=O.useState(n.doc),[a,l]=O.useState(""),[s,c]=O.useState(null),f=Ih({mutationFn:async()=>{const A=HV(r,{lineWidth:120,noRefs:!0}),C=await Et.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 Et.createConfig(k,A)}return Et.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 T.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=>lI(k,A,C)),p=Array.isArray(r.sources)?r.sources:[],g=[];p.forEach((A,C)=>{const k=Np[A?.type];for(const M of[...TM,...k?.fields??[]]){if(!M.required||A?.type==="code"&&M.key==="version")continue;const D=A?.[M.key];(D===void 0||D==="")&&g.push(`source ${C+1}: ${M.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 T.jsxs("div",{className:"space-y-4",children:[x&&T.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&&T.jsx("div",{className:"rounded-md border border-critical/50 bg-surface px-3 py-2 text-sm text-critical",children:s}),T.jsx(Lp,{title:"General",children:T.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[e.mode==="create"&&T.jsxs("label",{className:"block",children:[T.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Filename"}),T.jsx("input",{value:a,onChange:A=>l(A.target.value),placeholder:`${(r.name||"my-config").toString().replace(/[^A-Za-z0-9._-]+/g,"-")}.yaml`,className:`${$o} font-mono`})]}),T.jsx(du,{field:{key:"name",label:"Display name",type:"string",placeholder:"product-docs"},value:r.name,onChange:A=>d(["name"],A)}),T.jsxs("div",{children:[T.jsx(du,{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&&T.jsx("p",{className:"mt-1 text-xs text-accent",children:iO(w)})]})]})}),p.map((A,C)=>{const k=Np[A?.type]??Np.website,M=A?.database_config?.type??"sqlite",D=fx[M]??fx.sqlite;return T.jsx(Lp,{title:`Source ${C+1}`,subtitle:A?.product_name||void 0,action:T.jsx("button",{onClick:()=>d(["sources"],p.filter((P,N)=>N!==C)),className:"text-xs text-ink-muted transition hover:text-critical",children:"Remove"}),children:T.jsxs("div",{className:"space-y-4",children:[T.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[T.jsxs("label",{className:"block",children:[T.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Type"}),T.jsx("select",{value:A?.type??"website",onChange:P=>{const N={...Rp(P.target.value),product_name:A?.product_name??"",...A?.version!==void 0&&P.target.value!=="code"&&{version:A.version},...A?.max_size!==void 0&&{max_size:A.max_size},database_config:A?.database_config??Rp(P.target.value).database_config};d(["sources",C],N)},className:$o,children:Object.entries(Np).map(([P,N])=>T.jsx("option",{value:P,children:N.label},P))})]}),TM.map(P=>T.jsx(du,{field:A?.type==="code"&&P.key==="version"?{...P,required:!1,help:"Defaults to the branch name"}:P,value:A?.[P.key],onChange:N=>d(["sources",C,P.key],N)},P.key))]}),T.jsxs("div",{children:[T.jsxs("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-ink-muted",children:[k.label," options"]}),T.jsx(hx,{fields:k.fields,doc:r,basePath:["sources",C],onSet:d})]}),T.jsxs("div",{children:[T.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-ink-muted",children:"Vector database"}),T.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[T.jsxs("label",{className:"block",children:[T.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Type"}),T.jsx("select",{value:M,onChange:P=>d(["sources",C,"database_config"],{type:P.target.value,params:{}}),className:$o,children:Object.entries(fx).map(([P,N])=>T.jsx("option",{value:P,children:N.label},P))})]}),D.fields.map(P=>T.jsx(du,{field:P,value:A?.database_config?.params?.[P.key],onChange:N=>d(["sources",C,"database_config","params",P.key],N)},P.key))]})]})]})},C)}),T.jsx("button",{onClick:()=>d(["sources"],[...p,Rp("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"}),T.jsx(Lp,{title:"Embedding",subtitle:"optional — defaults to OpenAI text-embedding-3-large",action:T.jsxs("label",{className:"flex items-center gap-2 text-xs text-ink-secondary",children:[T.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?T.jsxs("div",{className:"space-y-3",children:[T.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[T.jsxs("label",{className:"block",children:[T.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Provider"}),T.jsx("select",{value:r.embedding?.provider??"openai",onChange:A=>d(["embedding"],{provider:A.target.value}),className:$o,children:Object.entries(MM).map(([A,C])=>T.jsx("option",{value:A,children:C.label},A))})]}),T.jsx(du,{field:{key:"dimension",label:"Dimension",type:"number",placeholder:"3072"},value:r.embedding?.dimension,onChange:A=>d(["embedding","dimension"],A)})]}),T.jsx(hx,{fields:MM[r.embedding?.provider??"openai"].fields,doc:r,basePath:["embedding",r.embedding?.provider??"openai"],onSet:d})]}):T.jsx("p",{className:"text-xs text-ink-muted",children:"Using defaults (OPENAI_API_KEY env var, text-embedding-3-large, 3072 dimensions)."})}),T.jsx(Lp,{title:"Markdown store",subtitle:"optional — store crawled markdown in Postgres",action:T.jsxs("label",{className:"flex items-center gap-2 text-xs text-ink-secondary",children:[T.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?T.jsx(hx,{fields:FV,doc:r,basePath:["markdown_store"],onSet:d}):T.jsx("p",{className:"text-xs text-ink-muted",children:"Disabled."})}),T.jsxs("div",{className:"flex items-center gap-3",children:[T.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&&T.jsx("button",{onClick:e.onCancel,className:"text-sm text-ink-muted hover:text-ink-secondary",children:"Cancel"}),g.length>0&&T.jsxs("span",{className:"text-xs text-warning",children:["missing: ",g.slice(0,3).join(", "),g.length>3?"…":""]}),p.length===0&&T.jsx("span",{className:"text-xs text-warning",children:"add at least one source"}),e.mode==="edit"&&T.jsx("span",{className:"ml-auto text-xs text-ink-muted",children:"Saving rewrites the YAML file (comments are not preserved)."})]})]})}function sI({config:e,variant:t="subtle"}){const n=io(),[r,i]=O.useState(!1),[a,l]=O.useState(new Set),[s,c]=O.useState(""),f=Ih({mutationFn:k=>Et.triggerRun(e.id,k,e.content_hash),onSuccess:()=>{i(!1),l(new Set),c("")},onSettled:()=>n.invalidateQueries({queryKey:["configs"]})}),d=O.useMemo(()=>e.source_summary.map((k,M)=>({...k,index:M})),[e.source_summary]),p=O.useMemo(()=>{const k=s.trim().toLowerCase();return k?d.filter(M=>M.product_name.toLowerCase().includes(k)||M.type.toLowerCase().includes(k)):d},[d,s]),g=e.busy||!!e.parse_error||f.isPending,v=k=>{k.preventDefault(),k.stopPropagation()},y=k=>{l(M=>{const D=new Set(M);return D.has(k)?D.delete(k):D.add(k),D})},x=p.length>0&&p.every(k=>a.has(k.index)),w=()=>{l(k=>{const M=new Set(k);return x?p.forEach(D=>M.delete(D.index)):p.forEach(D=>M.add(D.index)),M})},A=t==="primary"?"bg-accent text-white transition hover:opacity-90 px-3.5 py-1.5 text-sm font-medium":"border border-edge bg-surface text-ink-secondary transition hover:border-accent hover:text-accent px-3 py-1 text-xs font-medium",C=t==="primary"?"bg-accent text-white transition hover:opacity-90 border-l border-white/25 px-2 py-1.5 text-sm":"border border-l-0 border-edge bg-surface text-ink-secondary transition hover:border-accent hover:text-accent px-1.5 py-1 text-xs";return T.jsxs("div",{className:"relative inline-flex items-center gap-2",onClick:v,children:[T.jsxs("span",{className:"inline-flex",children:[T.jsx("button",{onClick:k=>{v(k),f.mutate(void 0)},disabled:g,className:`${d.length>1?"rounded-l-md":"rounded-md"} ${A} disabled:cursor-not-allowed disabled:opacity-40`,children:e.busy?"Running…":"Run now"}),d.length>1&&T.jsx("button",{onClick:k=>{v(k),i(M=>!M)},disabled:g,"aria-label":"Choose sources to run",title:"Choose sources to run",className:`rounded-r-md ${C} disabled:cursor-not-allowed disabled:opacity-40`,children:"▾"})]}),f.error&&T.jsx("span",{className:"text-xs text-critical",children:f.error.message}),r&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"fixed inset-0 z-10",onClick:k=>{v(k),i(!1)}}),T.jsxs("div",{className:"absolute right-0 top-full z-20 mt-1.5 w-80 rounded-md border border-edge bg-surface shadow-lg",children:[T.jsxs("div",{className:"flex items-center justify-between border-b border-edge px-3 py-2",children:[T.jsxs("span",{className:"text-xs font-semibold uppercase tracking-wide text-ink-muted",children:["Run sources",a.size>0&&` (${a.size}/${d.length})`]}),T.jsxs("button",{onClick:k=>{v(k),w()},className:"text-xs text-accent hover:underline",children:[x?"Clear":"Select all",s.trim()&&" shown"]})]}),d.length>8&&T.jsx("div",{className:"border-b border-edge px-3 py-2",children:T.jsx("input",{type:"text",value:s,onChange:k=>c(k.target.value),onClick:k=>k.stopPropagation(),placeholder:"Filter sources…",className:"w-full rounded-md border border-edge bg-page px-2 py-1 text-xs text-ink-secondary placeholder:text-ink-muted focus:border-accent focus:outline-none"})}),T.jsxs("ul",{className:"max-h-64 overflow-y-auto py-1",children:[p.map(k=>T.jsx("li",{children:T.jsxs("label",{className:"flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm text-ink-secondary hover:bg-edge/20",onClick:M=>M.stopPropagation(),children:[T.jsx("input",{type:"checkbox",checked:a.has(k.index),onChange:()=>y(k.index),className:"accent-accent"}),T.jsx("span",{className:"truncate",children:k.product_name}),T.jsxs("span",{className:"ml-auto shrink-0 text-xs text-ink-muted",children:[k.type,k.version?` · ${k.version}`:""]})]})},k.index)),p.length===0&&T.jsxs("li",{className:"px-3 py-2 text-xs text-ink-muted",children:["No sources match “",s,"”."]})]}),T.jsx("div",{className:"border-t border-edge px-3 py-2",children:T.jsxs("button",{onClick:k=>{v(k),f.mutate([...a])},disabled:a.size===0||g,className:"w-full rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-white transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:["Run ",a.size>0?`${a.size} selected`:"selected"," source",a.size===1?"":"s"]})})]})]})]})}const WV={website:"🌐",github:"🐙",zendesk:"🎫",local_directory:"📁",code:"⌨️",s3:"🪣"};function uI({sources:e,max:t}){const[n,r]=O.useState(!1);if(e.length===0)return T.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 T.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.map((s,c)=>T.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:[T.jsx("span",{"aria-hidden":!0,className:"text-[10px]",children:WV[s.type]??"•"}),s.product_name,T.jsx("span",{className:"text-ink-muted",children:s.type})]},`${s.product_name}-${s.type}-${c}`)),l>0&&T.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 KV(){const e=xv(),{data:t,isLoading:n,error:r}=Ki({queryKey:["configs"],queryFn:Et.configs}),{data:i}=Ki({queryKey:["health"],queryFn:Et.health}),[a,l]=O.useState(!1),s=t?.filter(c=>c.last_run?.status==="running"||c.last_run?.status==="queued")??[];return n?T.jsx("p",{className:"text-ink-muted",children:"Loading…"}):r?T.jsxs("p",{className:"text-critical",children:["Failed to load configs: ",String(r.message)]}):T.jsxs("div",{className:"space-y-6",children:[s.length>0&&T.jsx("div",{className:"rounded-lg border border-accent/30 bg-surface px-4 py-3",children:T.jsxs("p",{className:"text-sm text-ink-secondary",children:[T.jsxs("span",{className:"font-medium text-accent",children:["● ",s.length," config",s.length>1?"s":""," syncing now"]})," — ",s.map((c,f)=>T.jsxs("span",{children:[f>0&&", ",T.jsx(yi,{to:`/runs/${c.last_run.id}`,className:"text-accent hover:underline",children:c.name})]},c.id))]})}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Configurations"}),i?.mode==="rw"&&T.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&&T.jsxs("div",{className:"rounded-lg border border-edge bg-page p-4",children:[T.jsx("h2",{className:"mb-4 text-sm font-semibold",children:"Create a new config"}),T.jsx(oI,{mode:"create",onSaved:c=>{l(!1),e(`/configs/${c.id}`)},onCancel:()=>l(!1)})]}),t&&t.length===0&&T.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 ",T.jsx("code",{className:"text-ink-secondary",children:"doc2vec controller"}),i?.mode==="rw"&&" or create one with the button above","."]}),T.jsx("div",{className:"grid gap-4",children:t?.map(c=>T.jsx(yi,{to:`/configs/${c.id}`,className:"block rounded-lg border border-edge bg-surface p-4 transition hover:border-accent/50",children:T.jsxs("div",{className:"flex flex-col gap-3 md:grid md:grid-cols-[minmax(9rem,1fr)_12rem_15rem_8rem_auto] md:items-start md:gap-x-6",children:[T.jsxs("div",{className:"min-w-0",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("h2",{className:"truncate font-semibold",children:c.name}),c.parse_error&&T.jsx("span",{className:"shrink-0 rounded-full border border-critical/40 px-2 py-0.5 text-xs text-critical",title:c.parse_error,children:"invalid"})]}),T.jsx("div",{className:"mt-1.5",children:T.jsx(uI,{sources:c.source_summary,max:4})})]}),T.jsxs("div",{className:"text-sm",children:[T.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Schedule"}),T.jsx("p",{className:"mt-0.5 text-ink-secondary",title:c.schedule??void 0,children:iO(c.schedule)})]}),T.jsxs("div",{className:"text-sm",children:[T.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Last run"}),T.jsx("div",{className:"mt-0.5 flex flex-wrap items-center gap-2",children:c.last_run?T.jsxs(T.Fragment,{children:[T.jsx(Ov,{status:c.last_run.status}),T.jsxs("span",{className:"text-xs text-ink-muted",title:qa(c.last_run.queued_at),children:[j1(c.last_run.finished_at??c.last_run.queued_at),c.last_run.finished_at&&c.last_run.started_at&&` · ${rO(c.last_run.started_at,c.last_run.finished_at)}`]})]}):T.jsx("span",{className:"text-xs text-ink-muted",children:"never"})})]}),T.jsxs("div",{className:"text-sm",children:[T.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Next run"}),T.jsx("p",{className:"mt-0.5 text-ink-secondary",title:c.next_run?qa(c.next_run):void 0,children:c.next_run?j1(c.next_run):"—"})]}),T.jsx("div",{className:"md:self-center",children:T.jsx(sI,{config:c})})]})},c.id))})]})}function V1(){return V1=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},V1.apply(null,arguments)}function VV(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 Q1=[],cI=[];(()=>{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?cI:Q1).push(n=n+e[t])})();function QV(e){if(e<768)return!1;for(let t=0,n=Q1.length;;){let r=t+n>>1;if(e<Q1[r])n=r;else if(e>=cI[r])t=r+1;else return!0;if(t==n)return!1}}function PM(e){return e>=127462&&e<=127487}const DM=8205;function XV(e,t,n=!0,r=!0){return(n?fI:YV)(e,t,r)}function fI(e,t,n){if(t==e.length)return t;t&&hI(e.charCodeAt(t))&&dI(e.charCodeAt(t-1))&&t--;let r=dx(e,t);for(t+=_M(r);t<e.length;){let i=dx(e,t);if(r==DM||i==DM||n&&QV(i))t+=_M(i),r=i;else if(PM(i)){let a=0,l=t-2;for(;l>=0&&PM(dx(e,l));)a++,l-=2;if(a%2==0)break;t+=2}else break}return t}function YV(e,t,n){for(;t>1;){let r=fI(e,t-2,n);if(r<t)return r;t--}return 0}function dx(e,t){let n=e.charCodeAt(t);if(!dI(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return hI(r)?(n-55296<<10)+(r-56320)+65536:n}function hI(e){return e>=56320&&e<57344}function dI(e){return e>=55296&&e<56320}function _M(e){return e<65536?1:2}let et=class pI{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]=Fu(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),Fi.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]=Fu(this,t,n);let r=[];return this.decompose(t,n,r,0),Fi.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 Vf(this),a=new Vf(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 Vf(this,t)}iterRange(t,n=this.length){return new mI(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 gI(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]?pI.empty:t.length<=32?new Bt(t):Fi.from(Bt.split(t,[]))}};class Bt extends et{constructor(t,n=GV(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 ZV(i,s,r,l);i=s+1,r++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new Bt(NM(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let l=r.pop(),s=Em(a.text,l.text.slice(),0,a.length);if(s.length<=32)r.push(new Bt(s,l.length+a.length));else{let c=s.length>>1;r.push(new Bt(s.slice(0,c)),new Bt(s.slice(c)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof Bt))return super.replace(t,n,r);[t,n]=Fu(this,t,n);let i=Em(this.text,Em(r.text,NM(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new Bt(i,a):Fi.from(Bt.split(i,[]),a)}sliceString(t,n=this.length,r=`
|
|
62
|
+
`){[t,n]=Fu(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 Bt(r,i)),r=[],i=-1);return i>-1&&n.push(new Bt(r,i)),n}}class Fi extends et{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]=Fu(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 Fi(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=`
|
|
63
|
+
`){[t,n]=Fu(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 Fi))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 Bt(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 Fi)for(let x of v.children)p(x);else v.lines>l&&(c>l||!c)?(g(),s.push(v)):v instanceof Bt&&c&&(y=d[d.length-1])instanceof Bt&&v.lines+y.lines<=32?(c+=v.lines,f+=v.length+1,d[d.length-1]=new Bt(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]:Fi.from(d,f)),f=-1,c=d.length=0)}for(let v of t)p(v);return g(),s.length==1?s[0]:new Fi(s,n)}}et.empty=new Bt([""],0);function GV(e){let t=-1;for(let n of e)t+=n.length+1;return t}function Em(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 NM(e,t,n){return Em(e,[""],t,n)}class Vf{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 Bt?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 Bt?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=`
|
|
64
|
+
`,this;t--}else if(i instanceof Bt){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 Bt?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 mI{constructor(t,n,r){this.value="",this.done=!1,this.cursor=new Vf(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 gI{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"&&(et.prototype[Symbol.iterator]=function(){return this.iter()},Vf.prototype[Symbol.iterator]=mI.prototype[Symbol.iterator]=gI.prototype[Symbol.iterator]=function(){return this});let ZV=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 Fu(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function sn(e,t,n=!0,r=!0){return XV(e,t,n,r)}function JV(e){return e>=56320&&e<57344}function e7(e){return e>=55296&&e<56320}function ar(e,t){let n=e.charCodeAt(t);if(!e7(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return JV(r)?(n-55296<<10)+(r-56320)+65536:n}function pO(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function qi(e){return e<65536?1:2}const X1=/\r\n?|\n/;var Vn=(function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e})(Vn||(Vn={}));class Ji{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){Y1(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 Ji(t)}composeDesc(t){return this.empty?t:t.empty?this:vI(this,t)}mapDesc(t,n=!1){return t.empty?this:G1(this,t,n)}mapPos(t,n=-1,r=Vn.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!=Vn.Simple&&f>=t&&(r==Vn.TrackDel&&i<t&&f>t||r==Vn.TrackBefore&&i<t||r==Vn.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 Ji(t)}static create(t){return new Ji(t)}}class Gt extends Ji{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 Y1(this,(n,r,i,a,l)=>t=t.replace(i,i+(r-n),l),!1),t}mapDesc(t,n=!1){return G1(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(et.empty);r.push(l?t.slice(a,a+l):et.empty)}a+=l}return new Gt(n,r)}compose(t){return this.empty?t:t.empty?this:vI(this,t,!0)}map(t,n=!1){return t.empty?this:G1(this,t,n,!0)}iterChanges(t,n=!1){Y1(this,t,n)}get desc(){return Ji.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new sh(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);Dn(i,d,-1);let p=a.ins==-1?-1:a.off==0?a.ins:0;Dn(n,d,p),p>0&&Ul(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);Dn(n,d,-1),Dn(i,d,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(d),s+=d}}return{changes:new Gt(n,r),filtered:Ji.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&&Dn(i,n-l,-1);let p=new Gt(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 Gt){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"?et.of(v.split(r||X1)):v:et.empty,x=y.length;if(p==g&&x==0)return;p<l&&c(),p>l&&Dn(i,p-l,-1),Dn(i,g-p,x),Ul(a,i,y),l=g}}return f(t),c(!s),s}static empty(t){return new Gt(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(et.empty);r[i]=et.of(a.slice(1)),n.push(a[0],r[i].length)}}}return new Gt(n,r)}static createSet(t,n){return new Gt(t,n)}}function Dn(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 Ul(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(et.empty);e.push(n)}}function Y1(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=et.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 G1(e,t,n,r=!1){let i=[],a=r?[]:null,l=new sh(e),s=new sh(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);Dn(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(Dn(i,s.ins,-1);f;){let d=Math.min(l.len,f);l.ins>=0&&c<l.i&&l.len<=d&&(Dn(i,0,l.ins),a&&Ul(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;Dn(i,f,c<l.i?l.ins:0),a&&c<l.i&&Ul(a,i,l.text),c=l.i,l.forward(l.len-d)}else{if(l.done&&s.done)return a?Gt.createSet(i,a):Ji.create(i);throw new Error("Mismatched change set lengths")}}}function vI(e,t,n=!1){let r=[],i=n?[]:null,a=new sh(e),l=new sh(t);for(let s=!1;;){if(a.done&&l.done)return i?Gt.createSet(r,i):Ji.create(r);if(a.ins==0)Dn(r,a.len,0,s),a.next();else if(l.len==0&&!l.done)Dn(r,0,l.ins,s),i&&Ul(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;Dn(r,c,d,s),i&&d&&Ul(i,r,l.text)}else l.ins==-1?(Dn(r,a.off?0:a.len,c,s),i&&Ul(i,r,a.textBit(c))):(Dn(r,a.off?0:a.len,l.off?0:l.ins,s),i&&!l.off&&Ul(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 sh{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?et.empty:t[n]}textBit(t){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!t?et.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 Bl{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 Bl(r,i,this.flags,this.goalColumn)}extend(t,n=t,r=0){if(t<=this.anchor&&n>=this.anchor)return te.range(t,n,void 0,void 0,r);let i=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return te.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 te.range(t.anchor,t.head)}static create(t,n,r,i){return new Bl(t,n,r,i)}}class te{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:te.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 te([this.main],0)}addRange(t,n=!0){return te.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,te.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 te(t.ranges.map(n=>Bl.fromJSON(n)),t.main)}static single(t,n=t){return new te([te.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 te.normalized(t.slice(),n);r=a.to}return new te(t,n)}static cursor(t,n=0,r,i){return Bl.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?Bl.create(n,t,l|32,r):Bl.create(t,n,l,r)}static undirectionalRange(t,n){return Bl.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?te.range(c,s):te.range(s,c))}}return new te(t,n)}}function yI(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let mO=0;class me{constructor(t,n,r,i,a){this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=mO++,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:gO),!!t.static,t.enables)}of(t){return new Tm([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Tm(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Tm(t,this,2,n)}from(t,n){return n||(n=r=>r),this.compute([t],r=>n(r.field(t)))}}function gO(e,t){return e==t||e.length==t.length&&e.every((n,r)=>n===t[r])}class Tm{constructor(t,n,r,i){this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=mO++}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)||Z1(p,d)){let v=r(p);if(s?!RM(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=Gm(g,y);if(this.dependencies.every(w=>w instanceof me?g.facet(w)===p.facet(w):w instanceof jn?g.field(w,!1)==p.field(w,!1):!0)||(s?RM(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 RM(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 Z1(e,t){let n=!1;for(let r of t)Qf(e,r)&1&&(n=!0);return n}function t7(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=Gm(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)Qf(c,f);return c.values[l]=s(c),1},update(c,f){if(!Z1(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=Z1(c,r),p=f.config.facets[t.id],g=f.facet(t);if(p&&!d&&gO(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 jp=me.define({static:!0});class jn{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 jn(mO++,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(jp).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(jp),l=i.facet(jp),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,jp.of({field:this,create:t})]}get extension(){return this}}const jo={lowest:4,low:3,default:2,high:1,highest:0};function Of(e){return t=>new bI(t,e)}const ps={highest:Of(jo.highest),high:Of(jo.high),default:Of(jo.default),low:Of(jo.low),lowest:Of(jo.lowest)};class bI{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class Mv{of(t){return new J1(this,t)}reconfigure(t){return Mv.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class J1{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class Ym{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 n7(t,n,l))g instanceof jn?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,gO(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=>t7(w,y,v))}}let p=f.map(g=>g(s));return new Ym(t,l,p,s,c,a)}}function n7(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 J1&&n.delete(l.compartment)}if(i.set(l,s),Array.isArray(l))for(let f of l)a(f,s);else if(l instanceof J1){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 bI)a(l.inner,l.prec);else if(l instanceof jn)r[s].push(l),l.provides&&a(l.provides,s);else if(l instanceof Tm)r[s].push(l),l.facet.extensions&&a(l.facet.extensions,jo.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,jo.default),r.reduce((l,s)=>l.concat(s))}function Qf(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 Gm(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const xI=me.define(),eS=me.define({combine:e=>e.some(t=>t),static:!0}),SI=me.define({combine:e=>e.length?e[0]:void 0,static:!0}),wI=me.define(),OI=me.define(),AI=me.define(),kI=me.define({combine:e=>e.length?e[0]:!1});class sa{constructor(t,n){this.type=t,this.value=n}static define(){return new r7}}class r7{of(t){return new sa(this,t)}}class i7{constructor(t){this.map=t}of(t){return new Ne(this,t)}}class Ne{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 Ne(this.type,n)}is(t){return this.type==t}static define(t={}){return new i7(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}}Ne.reconfigure=Ne.define();Ne.appendConfig=Ne.define();class Jt{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&&yI(r,n.newLength),a.some(s=>s.type==Jt.time)||(this.annotations=a.concat(Jt.time.of(Date.now())))}static create(t,n,r,i,a,l){return new Jt(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(Jt.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Jt.time=sa.define();Jt.userEvent=sa.define();Jt.addToHistory=sa.define();Jt.remote=sa.define();function a7(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 CI(e,t,n){var r;let i,a,l;return n?(i=t.changes,a=Gt.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:Ne.mapEffects(e.effects,i).concat(Ne.mapEffects(t.effects,a)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function tS(e,t,n){let r=t.selection,i=Mu(t.annotations);return t.userEvent&&(i=i.concat(Jt.userEvent.of(t.userEvent))),{changes:t.changes instanceof Gt?t.changes:Gt.of(t.changes||[],n,e.facet(SI)),selection:r&&(r instanceof te?r:te.single(r.anchor,r.head)),effects:Mu(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function EI(e,t,n){let r=tS(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=CI(r,tS(e,t[a],l?r.changes.newLength:e.doc.length),l)}let i=Jt.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return o7(n?l7(i):i)}function l7(e){let t=e.startState,n=!0;for(let i of t.facet(wI)){let a=i(e);if(a===!1){n=!1;break}Array.isArray(a)&&(n=n===!0?a:a7(n,a))}if(n!==!0){let i,a;if(n===!1)a=e.changes.invertedDesc,i=Gt.empty(t.doc.length);else{let l=e.changes.filter(n);i=l.changes,a=l.filtered.mapDesc(l.changes).invertedDesc}e=Jt.create(t,i,e.selection&&e.selection.map(a),Ne.mapEffects(e.effects,a),e.annotations,e.scrollIntoView)}let r=t.facet(OI);for(let i=r.length-1;i>=0;i--){let a=r[i](e);a instanceof Jt?e=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Jt?e=a[0]:e=EI(t,Mu(a),!1)}return e}function o7(e){let t=e.startState,n=t.facet(AI),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=CI(r,tS(t,a,e.changes.newLength),!0))}return r==e?e:Jt.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}const s7=[];function Mu(e){return e==null?s7:Array.isArray(e)?e:[e]}var At=(function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e})(At||(At={}));const u7=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let nS;try{nS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function c7(e){if(nS)return nS.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||u7.test(n)))return!0}return!1}function f7(e){return t=>{if(!/\S/.test(t))return At.Space;if(c7(t))return At.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return At.Word;return At.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++)Qf(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 Qf(this,r),Gm(this,r)}update(...t){return EI(this,t,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let s of t.effects)s.is(Mv.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(Ne.reconfigure)?(n=null,r=s.value):s.is(Ne.appendConfig)&&(n=null,r=Mu(r).concat(s.value));let a;n?a=t.startState.values.slice():(n=Ym.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(eS)?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:te.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=Mu(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=Ne.mapEffects(l,d).concat(Ne.mapEffects(Mu(c.effects),p))}return{changes:i,selection:te.create(a,n.mainIndex),effects:l}}changes(t=[]){return t instanceof Gt?t:Gt.of(t,this.doc.length,this.facet(qe.lineSeparator))}toText(t){return et.of(t.split(this.facet(qe.lineSeparator)||X1))}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:(Qf(this,n),Gm(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 jn&&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:te.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=Ym.resolve(t.extensions||[],new Map),r=t.doc instanceof et?t.doc:et.of((t.doc||"").split(n.staticFacet(qe.lineSeparator)||X1)),i=t.selection?t.selection instanceof te?t.selection:te.single(t.selection.anchor,t.selection.head):te.single(0);return yI(i,r.length),n.staticFacet(eS)||(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)||`
|
|
65
|
+
`}get readOnly(){return this.facet(kI)}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(xI))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 f7(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=sn(n,l,!1);if(a(n.slice(c,l))!=At.Word)break;l=c}for(;s<i;){let c=sn(n,s);if(a(n.slice(s,c))!=At.Word)break;s=c}return l==s?null:te.range(l+r,s+r)}}qe.allowMultipleSelections=eS;qe.tabSize=me.define({combine:e=>e.length?e[0]:4});qe.lineSeparator=SI;qe.readOnly=kI;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=xI;qe.changeFilter=wI;qe.transactionFilter=OI;qe.transactionExtender=AI;Mv.reconfigure=Ne.define();function ua(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 Ql{eq(t){return this==t}range(t,n=t){return rS.create(t,n,this)}}Ql.prototype.startSide=Ql.prototype.endSide=0;Ql.prototype.point=!1;Ql.prototype.mapMode=Vn.TrackDel;function vO(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}let rS=class TI{constructor(t,n,r){this.from=t,this.to=n,this.value=r}static create(t,n,r){return new TI(t,n,r)}};function iS(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class yO{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 yO(i,a,r,s):null,pos:l}}}class $e{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 $e(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(iS)),this.isEmpty)return n.length?$e.of(n):this;let s=new MI(this,null,-1).goto(0),c=0,f=[],d=new Wa;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(rS.create(s.from,s.to,s.value))),s.next());return d.finishInner(this.nextLayer.isEmpty&&!f.length?$e.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 $e(r,n,a||$e.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 uh.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return uh.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=LM(l,s,r),f=new Af(l,c,a),d=new Af(s,c,a);r.iterGaps((p,g,v)=>jM(f,p,d,g,v,i)),r.empty&&r.length==0&&jM(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=LM(a,l),c=new Af(a,s,0).goto(r),f=new Af(l,s,0).goto(r);for(;;){if(c.to!=f.to||!aS(c.active,f.active)||c.point&&(!f.point||!vO(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 Af(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 Wa;for(let i of t instanceof rS?[t]:n?h7(t):t)r.add(i.from,i.to,i.value);return r.finish()}static join(t){if(!t.length)return $e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=$e.empty;i=i.nextLayer)n=new $e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}$e.empty=new $e([],[],null,-1);function h7(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(iS(t,r)>0)return e.slice().sort(iS);t=r}return e}$e.empty.nextLayer=$e.empty;class Wa{finishChunk(t){this.chunks.push(new yO(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 Wa)).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($e.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=$e.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function LM(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 MI{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 uh{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 MI(l,n,r,a));return i.length==1?i[0]:new uh(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--)px(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--)px(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(),px(this.heap,0)}}}function px(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 Af{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=uh.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){Ip(this.active,t),Ip(this.activeTo,t),Ip(this.activeRank,t),this.minActive=IM(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++;Bp(this.active,n,r),Bp(this.activeTo,n,i),Bp(this.activeRank,n,a),t&&Bp(t,n,this.cursor.from),this.minActive=IM(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&&Ip(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 jM(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&&vO(e.point,n.point)&&aS(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,y,e.point,n.point),d=!1):(d&&a.boundChange(s),y>s&&!aS(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 aS(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!vO(e[n],t[n]))return!1;return!0}function Ip(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function Bp(e,t,n){for(let r=e.length-1;r>=t;r--)e[r+1]=e[r];e[t]=n}function IM(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=sn(e,i));return r}function lS(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=sn(e,i)}return r===!0?-1:e.length}const oS="ͼ",BM=typeof Symbol>"u"?"__"+oS:Symbol.for(oS),sS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),zM=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Xl{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(`
|
|
66
|
+
`)}static newName(){let t=zM[BM]||1;return zM[BM]=t+1,oS+t.toString(36)}static mount(t,n,r){let i=t[sS],a=r&&r.nonce;i?a&&i.setNonce(a):i=new d7(t,a),i.mount(Array.isArray(n)?n:[n],t)}}let $M=new Map;class d7{constructor(t,n){let r=t.ownerDocument||t,i=r.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let a=$M.get(r);if(a)return t[sS]=a;this.sheet=new i.CSSStyleSheet,$M.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[sS]=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()+`
|
|
67
|
+
`;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:"'"},ch={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},p7=typeof navigator<"u"&&/Mac/.test(navigator.platform),m7=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Cn=0;Cn<10;Cn++)Yl[48+Cn]=Yl[96+Cn]=String(Cn);for(var Cn=1;Cn<=24;Cn++)Yl[Cn+111]="F"+Cn;for(var Cn=65;Cn<=90;Cn++)Yl[Cn]=String.fromCharCode(Cn+32),ch[Cn]=String.fromCharCode(Cn);for(var mx in Yl)ch.hasOwnProperty(mx)||(ch[mx]=Yl[mx]);function g7(e){var t=p7&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||m7&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?ch: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 st(){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++)PI(e,arguments[t]);return e}function PI(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++)PI(e,t[n]);else throw new RangeError("Unsupported child node: "+t)}let Kn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},uS=typeof document<"u"?document:{documentElement:{style:{}}};const cS=/Edge\/(\d+)/.exec(Kn.userAgent),DI=/MSIE \d/.test(Kn.userAgent),fS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Kn.userAgent),Pv=!!(DI||fS||cS),UM=!Pv&&/gecko\/(\d+)/i.test(Kn.userAgent),gx=!Pv&&/Chrome\/(\d+)/.exec(Kn.userAgent),HM="webkitFontSmoothing"in uS.documentElement.style,hS=!Pv&&/Apple Computer/.test(Kn.vendor),FM=hS&&(/Mobile\/\w+/.test(Kn.userAgent)||Kn.maxTouchPoints>2);var pe={mac:FM||/Mac/.test(Kn.platform),windows:/Win/.test(Kn.platform),linux:/Linux|X11/.test(Kn.platform),ie:Pv,ie_version:DI?uS.documentMode||6:fS?+fS[1]:cS?+cS[1]:0,gecko:UM,gecko_version:UM?+(/Firefox\/(\d+)/.exec(Kn.userAgent)||[0,0])[1]:0,chrome:!!gx,chrome_version:gx?+gx[1]:0,ios:FM,android:/Android\b/.test(Kn.userAgent),webkit:HM,webkit_version:HM?+(/\bAppleWebKit\/(\d+)/.exec(Kn.userAgent)||[0,0])[1]:0,safari:hS,safari_version:hS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Kn.userAgent)||[0,0])[1]:0,tabSize:uS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function bO(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 Zm=Object.create(null);function xO(e,t,n){if(e==t)return!0;e||(e=Zm),t||(t=Zm);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 v7(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 qM(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 y7(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 ca{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 Tn=(function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e})(Tn||(Tn={}));class Ce extends Ql{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 Uh(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 rs(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}=_I(t,n);r=(a?n?-3e8:-1:5e8)-1,i=(l?n?2e8:1:-6e8)+1}return new rs(t,r,i,n,t.widget||null,!0)}static line(t){return new Hh(t)}static set(t,n=!1){return $e.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ce.none=$e.empty;class Uh extends Ce{constructor(t){let{start:n,end:r}=_I(t);super(n?-1:5e8,r?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?bO(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||Zm}eq(t){return this==t||t instanceof Uh&&this.tagName==t.tagName&&xO(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)}}Uh.prototype.point=!1;class Hh extends Ce{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Hh&&this.spec.class==t.spec.class&&xO(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)}}Hh.prototype.mapMode=Vn.TrackBefore;Hh.prototype.point=!0;class rs 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?Vn.TrackBefore:Vn.TrackAfter:Vn.TrackDel}get type(){return this.startSide!=this.endSide?Tn.WidgetRange:this.startSide<=0?Tn.WidgetBefore:Tn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof rs&&b7(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)}}rs.prototype.point=!0;function _I(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 b7(e,t){return e==t||!!(e&&t&&e.compare(t))}function Pu(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 fh extends Ql{constructor(t,n,r){super(),this.tagName=t,this.attributes=n,this.rank=r}eq(t){return t==this||t instanceof fh&&this.tagName==t.tagName&&xO(this.attributes,t.attributes)}static create(t){return new fh(t.tagName,t.attributes||Zm,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return $e.of(t,n)}}fh.prototype.startSide=fh.prototype.endSide=-1;function hh(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function dS(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function Xf(e,t){if(!t.anchorNode)return!1;try{return dS(e,t.anchorNode)}catch{return!1}}function Yf(e){return e.nodeType==3?ph(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function Gf(e,t,n,r){return n?WM(e,t,n,r,-1)||WM(e,t,n,r,1):!1}function Gl(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function Jm(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function WM(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Ka(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?Ka(e):0}else return!1}}function Ka(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function dh(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 NI(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 S7(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}=NI(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 M=d.scrollTop;d.scrollTop+=A/x,k=(d.scrollTop-M)*x}if(w){let M=d.scrollLeft;d.scrollLeft+=w/y,C=(d.scrollLeft-M)*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 RI(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 w7{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?Ka(n):0),r,Math.min(t.focusOffset,r?Ka(r):0))}set(t,n,r,i){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let No=null;pe.safari&&pe.safari_version>=26&&(No=!1);function LI(e){if(e.setActive)return e.setActive();if(No)return e.focus(No);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(No==null?{get preventScroll(){return No={preventScroll:!0},!0}}:void 0),!No){No=!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 KM;function ph(e,t,n=t){let r=KM||(KM=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function Du(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 O7(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function A7(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,Ka(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Ka(n))}else{if(n==e)return!0;r=Gl(n),n=n.parentNode}}function jI(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 II(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=Ka(n)}else if(n.parentNode&&!Jm(n))r=Gl(n),n=n.parentNode;else return null}}function BI(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&&!Jm(n))r=Gl(n)+1,n=n.parentNode;else return null}}class mi{constructor(t,n,r=!0){this.node=t,this.offset=n,this.precise=r}static before(t,n){return new mi(t.parentNode,Gl(t),n)}static after(t,n){return new mi(t.parentNode,Gl(t)+1,n)}}var ht=(function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e})(ht||(ht={}));const is=ht.LTR,SO=ht.RTL;function zI(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const k7=zI("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),C7=zI("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),pS=Object.create(null),Ri=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);pS[t]=n,pS[n]=-t}function $I(e){return e<=247?k7[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?C7[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const E7=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Qi{get dir(){return this.level%2?SO:is}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 UI(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||!UI(r.inner,i.inner))return!1}return!0}const ft=[];function T7(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=$I(e.charCodeAt(f));g==512?g=d:g==8&&p==4&&(g=16),ft[f]=g==4?2:g,g&7&&(p=g),d=g}for(let f=l,d=c,p=c;f<s;f++){let g=ft[f];if(g==128)f<s-1&&d==ft[f+1]&&d&24?g=ft[f]=d:ft[f]=256;else if(g==64){let v=f+1;for(;v<s&&ft[v]==64;)v++;let y=f&&d==8||v<n&&ft[v]==8?p==1?1:8:256;for(let x=f;x<v;x++)ft[x]=y;f=v-1}else g==8&&p==1&&(ft[f]=1);d=g,g&7&&(p=g)}}}function M7(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=pS[g=e.charCodeAt(p)])if(v<0){for(let x=s-3;x>=0;x-=3)if(Ri[x+1]==-v){let w=Ri[x+2],A=w&2?i:w&4?w&1?a:i:0;A&&(ft[p]=ft[Ri[x]]=A),s=x;break}}else{if(Ri.length==189)break;Ri[s++]=p,Ri[s++]=g,Ri[s++]=c}else if((y=ft[p])==2||y==1){let x=y==i;c=x?0:1;for(let w=s-3;w>=0;w-=3){let A=Ri[w+2];if(A&2)break;if(x)Ri[w+2]|=2;else{if(A&4)break;Ri[w+2]|=4}}}}}function P7(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=ft[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(ft[d]==256)d++;else break;let p=a==1,g=(d<t?ft[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),ft[--y]=v;c=d}else a=f,c++}}}function mS(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=ft[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(ft[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==is!=!(v%2);gS(e,w?r+1:r,i,x.inner,x.from,x.to,l),c=x.to}y=x.to}else{if(y==n||(d?ft[y]!=s:ft[y]==s))break;y++}g?mS(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=ft[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(ft[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==is!=!(v%2);gS(e,w?r+1:r,i,x.inner,x.from,x.to,l),c=x.from}y=x.from}else{if(y==t||(d?ft[y-1]!=s:ft[y-1]==s))break;y--}g?mS(e,y,c,r+1,i,g,l):y<c&&l.push(new Qi(y,c,v)),c=y}}function gS(e,t,n,r,i,a,l){let s=t%2?2:1;T7(e,i,a,r,s),M7(e,i,a,r,s),P7(i,a,r,s),mS(e,i,a,t,n,r,l)}function D7(e,t,n){if(!e)return[new Qi(0,0,t==SO?1:0)];if(t==is&&!n.length&&!E7.test(e))return HI(e.length);if(n.length)for(;e.length>ft.length;)ft[ft.length]=256;let r=[],i=t==is?0:1;return gS(e,i,i,n,0,e.length,r),r}function HI(e){return[new Qi(0,e,0)]}let FI="";function _7(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=sn(e.text,l,c.forward(i,n));(d<c.from||d>c.to)&&(d=f),FI=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?te.cursor(p.side(!i,n)+e.from,p.forward(i,n)?1:-1,p.level):te.cursor(d+e.from,c.forward(i,n)?-1:1,c.level)}function N7(e,t,n){for(let r=t;r<n;r++){let i=$I(e.charCodeAt(r));if(i==1)return is;if(i==2||i==4)return SO}return is}const qI=me.define(),WI=me.define(),KI=me.define(),VI=me.define(),vS=me.define(),QI=me.define(),XI=me.define(),wO=me.define(),OO=me.define(),YI=me.define({combine:e=>e.some(t=>t)}),GI=me.define({combine:e=>e.some(t=>t)}),ZI=me.define();class _u{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 _u(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 _u(te.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const zp=Ne.define({map:(e,t)=>e.map(t)}),JI=Ne.define();function sr(e,t,n){let r=e.facet(VI);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 Na=me.define({combine:e=>e.length?e[0]:!0});let R7=0;const bu=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 Rt{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(bu.of({plugin:this,arg:void 0}))}of(t){return this.baseExtensions.concat(bu.of({plugin:this,arg:t}))}static define(t,n){const{eventHandlers:r,eventObservers:i,provide:a,decorations:l}=n||{};return new Rt(R7++,t,r,i,s=>{let c=[];return l&&c.push(Dv.of(f=>{let d=f.plugin(s);return d?l(d):Ce.none})),a&&c.push(a(s)),c})}static fromClass(t,n){return Rt.define((r,i)=>new t(r,i),n)}}class vx{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(sr(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){sr(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){sr(t.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const eB=me.define(),AO=me.define(),Dv=me.define(),tB=me.define(),kO=me.define(),Fh=me.define(),nB=me.define();function VM(e,t){let n=e.state.facet(nB);if(!n.length)return n;let r=n.map(a=>a instanceof Function?a(e):a),i=[];return $e.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=N7(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 rB=me.define();function CO(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(rB)){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 Uf=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 eg{constructor(t,n,r){this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=Gt.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 eg(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 L7=[];class Nt{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 L7}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&&v7(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 mi(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 Nv)return t;return null}static get(t){return t.cmTile}}class _v extends Nt{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=QM(i);else n.insertBefore(s.dom,i);r=s.dom}for(i=r?r.nextSibling:n.firstChild,a&&i&&(a.written=!0);i;)i=QM(i);this.length=l}}function QM(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Nv extends _v{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=Nt.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 $a)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 $a extends _v{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 $a(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class qu extends _v{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,r){let i=new qu(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&&I7(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):j7(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 mi(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 mi(c.dom,0);c==r.tile&&(s=!0)}}return new mi(this.dom,0)}}function j7(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=Yf(t);return n[n.length-1]||null}function I7(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}class or extends _v{constructor(t,n){super(t),this.mark=n}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new or(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class Uo extends Nt{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=ph(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:dh(f,(s?s>0:n<0)==r)}static of(t,n){let r=new Uo(n||document.createTextNode(t),t);return n||(r.flags|=2),r}}class as extends Nt{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 dh(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 dh(l,!s)}}get overrideDOMText(){if(!this.length)return et.empty;let{root:t}=this;if(!t)return et.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 as(a,r,t,i)}}class tg extends Nt{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 et.empty}coordsIn(t,n,r){let i=this.dom.getBoundingClientRect();return r==null?i:dh(i,n>0==r)}}class B7{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 z7{constructor(t,n,r,i){this.from=t,this.to=n,this.wrapper=r,this.rank=i}}class $7{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 Uo(s.dom,s.text+t);c.parent=l}else l.append(i||Uo.of(t,(a=this.cache.find(Uo))===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)?yx(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 or&&f.mark.eq(c.mark))f.dom!=c.dom&&f.setDOM(yx(c.dom)),i=f;else{if(this.cache.reused.get(c)){let p=Nt.get(c.dom);p&&p.setDOM(yx(c.dom))}let d=or.of(c.mark,c.dom);i.append(d),i=d}this.cache.reused.set(c,2)}let a=Nt.get(t.text);a&&this.cache.reused.set(a,2);let l=new Uo(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=iB);let i=qu.start(t,n||((r=this.cache.find(qu))===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 or&&s.mark.eq(l))i=s,n--;else{let c=or.of(l,(r=this.cache.find(or,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||!XM(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(pe.ios&&XM(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(bx,0,32)||new as(bx.toDOM(),0,bx,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 z7(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 $a&&i.wrapper.eq(r.wrapper))n=i;else{let a=$a.of(r.wrapper,(t=this.cache.find($a,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(tg,void 0,1);return r&&(r.flags=n),r||new tg(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class U7{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 ng=[as,qu,Uo,or,tg,$a,Nv];for(let e=0;e<ng.length;e++)ng[e].bucket=e;class H7{constructor(t){this.view=t,this.buckets=ng.map(()=>[]),this.index=ng.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 as(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 F7{constructor(t,n,r,i,a){this.view=t,this.decorations=i,this.disallowBlockEffectsFor=a,this.openWidget=!1,this.openMarks=0,this.cache=new H7(t),this.text=new U7(t.state.doc),this.builder=new $7(this.cache,new Nv(t,t.contentDOM),$e.iter(r)),this.cache.reused.set(n,2),this.old=new B7(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=K7(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?as.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 tg)this.cache.add(l);else if(l instanceof or)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 or&&i.unshift(l.mark)),this.openWidget=!1},leave:l=>{l.isLine()?i.length&&(i.length=a=0):l instanceof or&&(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=$e.spans(this.decorations,t,n,{point:(s,c,f,d,p,g)=>{if(f instanceof rs){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?Wu.block:Wu.inline),y=q7(f),x=this.cache.findWidget(v,c-s,y)||as.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=W7(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=Nt.get(i);if(i==this.view.contentDOM)break;a instanceof or?n.push(a):a?.isLine()?r=a:a instanceof $a||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new qu(i,iB):r||n.push(or.of(new Uh({tagName:i.nodeName.toLowerCase(),attributes:y7(i)}),i)))}return{line:r,marks:n}}}function XM(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 q7(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 iB={class:"cm-line"};function W7(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r||(e||(e={class:"cm-line"}),n&&bO(n,e),r&&(e.class+=" "+r)),e}function K7(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 or&&t.push(r.mark)}return t}function yx(e){let t=Nt.get(e);return t&&t.setDOM(e.cloneNode()),e}class Wu extends ca{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}}Wu.inline=new Wu("span");Wu.block=new Wu("div");const bx=new class extends ca{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class YM{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 Nv(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:!tQ(t.changes,this.hasComposition)&&!t.selectionSet&&(i=t.state.selection.main.head));let a=i>-1?Q7(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=G7(l,this.decorations,t.changes);c.length&&(r=Xr.extendWithRanges(r,c));let f=J7(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 F7(this.view,l,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Nt.get(n.text)&&s.cache.reused.set(Nt.get(n.text),2),this.tile=s.run(t,n),yS(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 xx&&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(JI)&&(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(Na)||r.tabIndex>-1)&&Xf(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&&V7(f)){let g=document.createTextNode("");this.view.observer.ignore(()=>f.node.insertBefore(g,f.node.childNodes[f.offset]||null)),f=d=new mi(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)&&eQ(p.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let g=hh(this.view.root);if(g)if(c.empty){if(pe.gecko){let v=X7(f.node,f.offset);if(v&&v!=3){let y=(v==1?II:BI)(f.node,f.offset);y&&(f=new mi(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 mi(p.anchorNode,p.anchorOffset),this.impreciseHead=d.precise?null:new mi(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=hh(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=Ka(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&&!Nt.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 xx?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=sn(a.text,l);if(s==l)return null;let c=ph(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==ht.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 $a)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,M=k?Yf(k):[];if(M.length){let D=M[M.length-1],P=c?D.right-A.left:A.right-D.left;P>s&&(s=P,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"?ht.RTL:ht.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 xx(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(Dv).map(a=>(this.dynamicDecorationMap[t++]=typeof a=="function")?a(this.view):a),r=!1,i=this.view.state.facet(kO).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($e.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(tB).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(ZI))try{if(f(this.view,t.range,t))return!0}catch(d){sr(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=CO(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(S7(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==ht.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(){yS(this.tile)}}function yS(e,t){let n=t?.get(e);if(n!=1){n==null&&e.destroy();for(let r of e.children)yS(r,t)}}function V7(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 aB(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=II(n.focusNode,n.focusOffset),i=BI(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let s=Nt.get(i.node);if(!s||s.isText()&&s.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let c=Nt.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 Q7(e,t,n){let r=aB(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 X7(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 Y7=class{constructor(){this.changes=[]}compareRange(t,n){Pu(t,n,this.changes)}comparePoint(t,n){Pu(t,n,this.changes)}boundChange(t){Pu(t,t,this.changes)}};function G7(e,t,n){let r=new Y7;return $e.compare(e,t,n,r),r.changes}class Z7{constructor(){this.changes=[]}compareRange(t,n){Pu(t,n,this.changes)}comparePoint(){}boundChange(t){Pu(t,t,this.changes)}}function J7(e,t,n){let r=new Z7;return $e.compare(e,t,n,r),r.changes}function eQ(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 tQ(e,t){let n=!1;return t&&e.iterChangedRanges((r,i)=>{r<t.to&&i>t.from&&(n=!0)}),n}class xx extends ca{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 nQ(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return te.cursor(t);a==0?n=1:a==i.length&&(n=-1);let l=a,s=a;n<0?l=sn(i.text,a,!1):s=sn(i.text,a);let c=r(i.text.slice(l,s));for(;l>0;){let f=sn(i.text,l,!1);if(r(i.text.slice(f,l))!=c)break;l=f}for(;s<i.length;){let f=sn(i.text,s);if(r(i.text.slice(s,f))!=c)break;s=f}return te.undirectionalRange(l+i.from,s+i.from)}function rQ(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+lS(l,a,e.state.tabSize)}function bS(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==Tn.Text&&(i.type!=a.type||(n<0?a.from<t:a.to>t)))&&(i=a)}}return i||r}return r}function iQ(e,t,n,r){let i=bS(e,t.head,t.assoc||-1),a=!r||i.type!=Tn.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==ht.LTR)?l.right-1:l.left+1,y:(a.top+a.bottom)/2});if(c!=null)return te.cursor(c,n?-1:1)}return te.cursor(n?i.to:i.from,n?-1:1)}function GM(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=_7(i,a,l,s,n),d=FI;if(!f){if(i.number==(n?e.state.doc.lines:1))return s;d=`
|
|
68
|
+
`,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 aQ(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return a=>{let l=r(a);return i==At.Space&&(i=l),i==l}}function lQ(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return te.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=xS(e,{x:p,y:x},!1,a);if(n?x>c.bottom:x<c.top)return te.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 te.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 lB(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=te.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=te.undirectionalRange(i.from,i.to):a=te.range(i.from==i.anchor?l:s,i.from==i.head?l:s))}a&&(n||(n=t.ranges.slice()),n[r]=a)}return n?te.create(n,t.mainIndex):t}function Sx(e,t,n){let r=Zf(e.state.facet(Fh).map(i=>i(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:te.cursor(r,r<n.from?1:-1)}class Wi{constructor(t,n){this.pos=t,this.assoc=n}}function xS(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 Wi(0,1);if(c>e.viewState.docHeight)return new Wi(e.state.doc.length,-1);if(f=e.elementAtHeight(c),r==null)break;if(f.type==Tn.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==Tn.Text){let p=rQ(e,i,f,l,s);return new Wi(p,p==f.from?1:-1)}}if(f.type!=Tn.Text)return c<(f.top+f.bottom)/2?new Wi(f.from,1):new Wi(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 oQ(e,l,s,e.textDirectionAt(f.from)).scanTile(d,f.from)}class oQ{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 M=C.left>this.x?this.x-C.left:C.right<this.x?this.x-C.right:0,D=Math.abs(M);D<p&&(d=x,p=D,g=C),M&&(k=M<0==(this.baseDir==ht.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)==ht.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=sn(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 ph(t.dom,l,s).getClientRects()});return i.after?new Wi(r[i.i+1],-1):new Wi(r[i.i],1)}scanTile(t,n){if(!t.length)return new Wi(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:ph(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 Wi(r[i.i+1],-1):new Wi(l,1)}}const pu="";class sQ{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+=pu}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=Nt.get(i),s=i.nextSibling;if(s==n){l?.breakAfter&&!s&&r!=this.view.contentDOM&&this.lineBreak();break}let c=Nt.get(s);(l&&c?l.breakAfter:(l?l.breakAfter:Jm(i))||Jm(s)&&(i.nodeName!="BR"||l?.isWidget())&&this.text.length>a)&&!cQ(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=Nt.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+(uQ(t,r.node,r.offset)?n:0))}}function uQ(e,t,n){for(;;){if(!t||n<Ka(t))return!1;if(t==e)return!0;n=Gl(t)+1,t=t.parentNode}}function cQ(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let r=Nt.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 ZM{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class fQ{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=oB(t.docView.tile,n,r,0))){let c=a||l?[]:dQ(t),f=new sQ(c,t);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=pQ(c,this.bounds.from)}else{let c=t.observer.selectionRange,f=a&&a.node==c.focusNode&&a.offset==c.focusOffset||!dS(t.contentDOM,c.focusNode)?s.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=l&&l.node==c.anchorNode&&l.offset==c.anchorOffset||!dS(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(te.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=te.create([te.cursor(f,v)])}else this.newSel=te.single(d,f)}}}function oB(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 oB(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 sB(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,pu),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:et.of(t.text.slice(a.from-s,g).split(pu))}:(v=uB(p,t.text,f-s,d))&&(pe.chrome&&l==13&&v.toB==v.from+2&&t.text.slice(v.from,v.toB)==pu+pu&&v.toB--,n={from:s+v.from,to:s+v.toA,insert:et.of(t.text.slice(v.from,v.toB).split(pu))})}else r&&(!e.hasFocus&&i.facet(Na)||rg(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=te.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:et.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()==`
|
|
69
|
+
`&&e.lineWrapping&&(r&&(r=te.single(r.main.anchor-1,r.main.head-1)),n={from:a.from,to:a.to,insert:et.of([" "])}),n)return EO(e,n,r,l);if(r&&!rg(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=lB(i.facet(Fh).map(f=>f(e)),r))),e.dispatch({selection:r,scrollIntoView:s,userEvent:c}),!0}else return!1}function EO(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&&Du(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)&&Du(e.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&Du(e.contentDOM,"Delete",46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let l,s=()=>l||(l=hQ(e,t,n));return e.state.facet(QI).some(c=>c(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function hQ(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(Fh).map(p=>p(e)),f,c);t.from==d&&(l=d)}if(l>-1)r={changes:t,selection:te.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&&aB(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?te.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 uB(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 dQ(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 ZM(n,r)),(i!=n||a!=r)&&t.push(new ZM(i,a))),t}function pQ(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?te.single(n+t,r+t):null}function rg(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class mQ{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&&DQ(t.contentDOM.ownerDocument)}handleEvent(t){!AQ(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=vQ(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&&fB.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&&(cB.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||yQ.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)&&gQ(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,Du(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 gQ(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function JM(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(i){sr(n.state,i)}}}function vQ(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(JM(r.value,c))}if(l)for(let s in l){let c=l[s];c&&n(s).observers.push(JM(r.value,c))}}for(let r in xi)n(r).handlers.push(xi[r]);for(let r in Yn)n(r).observers.push(Yn[r]);return t}const cB=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],yQ="dthko",fB=[16,17,18,20,91,92,224,225],$p=6;function Up(e){return Math.max(0,e)*.7+8}function bQ(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class xQ{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=RI(t.contentDOM),this.atoms=t.state.facet(Fh).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)&&SQ(t,n),this.dragging=OQ(t,n)&&pB(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&&bQ(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=CO(this.view);t.clientX-c.left<=i+$p?n=-Up(i-t.clientX):t.clientX+c.right>=l-$p&&(n=Up(t.clientX-l)),t.clientY-c.top<=a+$p?r=-Up(a-t.clientY):t.clientY+c.bottom>=s-$p&&(r=Up(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=lB(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 SQ(e,t){let n=e.state.facet(qI);return n.length?n[0](t):pe.mac?t.metaKey:t.ctrlKey}function wQ(e,t){let n=e.state.facet(WI);return n.length?n[0](t):pe.mac?!t.altKey:!t.ctrlKey}function OQ(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=hh(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 AQ(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=Nt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}const xi=Object.create(null),Yn=Object.create(null),hB=pe.ie&&pe.ie_version<15||pe.ios&&pe.webkit_version<604;function kQ(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(),dB(e,n.value)},50)}function Rv(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function dB(e,t){t=Rv(e.state,wO,t);let{state:n}=e,r,i=1,a=n.toText(t),l=a.lines==n.selection.ranges.length;if(SS!=null&&n.selection.ranges.every(c=>c.empty)&&SS==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:te.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:te.cursor(c.from+f.length)}}):r=n.replaceSelection(a);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Yn.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,pe.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};Yn.wheel=Yn.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};xi.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Yn.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")};Yn.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Yn.touchend=(e,t)=>{e.inputState.touchActive=!1};xi.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(KI))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=EQ(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new xQ(e,t,n,r)),r&&e.observer.ignore(()=>{LI(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 eP(e,t,n,r){if(r==1)return te.cursor(t,n);if(r==2)return nQ(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++,te.undirectionalRange(l,s)}}const CQ=pe.ie&&pe.ie_version<=11;let tP=null,nP=0,rP=0;function pB(e){if(!CQ)return e.detail;let t=tP,n=rP;return tP=e,rP=Date.now(),nP=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(nP+1)%3:1}function EQ(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=pB(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=eP(e,c.pos,c.assoc,r);if(n.pos!=c.pos&&!l){let p=eP(e,n.pos,n.assoc,r),g=Math.min(p.from,d.from),v=Math.max(p.to,d.to);d=g<d.from?te.range(g,v,d.assoc):te.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=TQ(i,c.pos))?f:s?i.addRange(d):te.create([d])}}}function TQ(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 te.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}xi.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=te.undirectionalRange(a,l))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",Rv(e.state,OO,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};xi.dragend=e=>(e.inputState.draggedContent=null,!1);function iP(e,t,n,r){if(n=Rv(e.state,wO,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,l=r&&a&&wQ(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}xi.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&&iP(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 iP(e,t,r,!0),!0}return!1};xi.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=hB?null:t.clipboardData;return n?(dB(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(kQ(e),!1)};function MQ(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 PQ(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:Rv(e,OO,t.join(e.lineBreak)),ranges:n,linewise:r}}let SS=null;xi.copy=xi.cut=(e,t)=>{if(!Xf(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=PQ(e.state);if(!n&&!i)return!1;SS=i?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let a=hB?null:t.clipboardData;return a?(a.clearData(),a.setData("text/plain",n),!0):(MQ(e,n),!1)};const mB=sa.define();function gB(e,t){let n=[];for(let r of e.facet(XI)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:mB.of(!0)}):null}function vB(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=gB(e.state,t);n?e.dispatch(n):e.update([])}},10)}Yn.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),vB(e)};Yn.blur=e=>{e.observer.clearSelectionRange(),vB(e)};Yn.compositionstart=Yn.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Yn.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))};Yn.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};xi.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 EO(e,{from:c,to:f,insert:e.state.toText(a)},null),!0}}let i;if(pe.chrome&&pe.android&&(i=cB.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(()=>Yn.compositionend(e,t),20),!1};const aP=new Set;function DQ(e){aP.has(e)||(aP.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const lP=["pre-wrap","normal","pre-line","break-spaces"];let Ku=!1;function oP(){Ku=!1}class _Q{constructor(t){this.lineWrapping=t,this.doc=et.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 lP.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=lP.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 NQ{constructor(t,n){this.from=t,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class hi{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"?Tn.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 rs?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 hi(this.from,this.length+t.length,this.top,this.height+t.height,n)}}var mt=(function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e})(mt||(mt={}));const Mm=.001;class Xn{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)>Mm&&(Ku=!0),this.height=t)}replace(t,n,r){return Xn.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,mt.ByPosNoHeight,r.setDoc(n),0,0),v=g.to>=f?g:a.lineAt(f,mt.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,mt.ByPosNoHeight,r,0,0));d+=g.from-c,c=g.from;let y=TO.build(r.setDoc(l),t,d,p);a=ig(a,a.replace(c,f,y))}return a.updateHeight(r,0)}static empty(){return new Cr(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 LQ(Xn.of(t.slice(0,n)),l,Xn.of(t.slice(r)))}}function ig(e,t){return e==t?e:(e.constructor!=t.constructor&&(Ku=!0),t)}Xn.prototype.size=1;const RQ=Ce.replace({});class yB extends Xn{constructor(t,n,r){super(t,n),this.deco=r,this.spaceAbove=0}mainBlock(t,n){return new hi(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 hi(i,0,r,this.spaceAbove,RQ):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,mt.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 Cr extends yB{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 hi(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 Cr||i instanceof Sn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Sn?i=new Cr(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Xn.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 Sn extends Xn{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 hi(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 hi(d,p,r+s*f,s,0)}}lineAt(t,n,r,i,a){if(n==mt.ByHeight)return this.blockAt(t,r,i,a);if(n==mt.ByPosNoHeight){let{from:v,to:y}=r.doc.lineAt(t);return new hi(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 hi(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 hi(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 Sn?r[r.length-1]=new Sn(a.length+i):r.push(null,new Sn(i-1))}if(t>0){let a=r[0];a instanceof Sn?r[0]=new Sn(t+a.length):r.unshift(new Sn(t-1),null)}return Xn.of(r)}decomposeLeft(t,n){n.push(new Sn(t-1),null)}decomposeRight(t,n){n.push(null,new Sn(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 Sn(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)>=Mm&&(c=-2);let v=new Cr(d,p,g);v.outdated=!1,l.push(v),s+=d+1}s<=a&&l.push(null,new Sn(a-s).updateHeight(t,s));let f=Xn.of(l);return(c<0||Math.abs(f.height-this.height)>=Mm||Math.abs(c-this.heightMetrics(t,n).perLine)>=Mm)&&(Ku=!0),ig(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 LQ extends Xn{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==mt.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==mt.ByPosNoHeight?mt.ByPosNoHeight:mt.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,mt.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&&sP(a,l-1),n<this.length){let s=a.length;this.decomposeRight(n,a),sP(a,s)}return Xn.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?Xn.of(this.break?[t,null,n]:[t,n]):(this.left=ig(this.left,t),this.right=ig(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 sP(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof Sn&&(r=e[t+1])instanceof Sn&&e.splice(t-1,3,new Sn(n.length+1+r.length))}const jQ=5;class TO{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 Cr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Cr(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 yB(l,i,r)):(l||a||i>=jQ)&&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 Cr(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let r=new Sn(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 Cr)return t;let n=new Cr(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 Cr)&&!this.isCovered?this.nodes.push(new Cr(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 Cr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(t,n,r,i){let a=new TO(r,t);return $e.spans(n,r,i,a,0),a.finish(r)}}function IQ(e,t,n){let r=new BQ;return $e.compare(e,t,n,r,0),r.changes}class BQ{constructor(){this.changes=[]}compareRange(){}comparePoint(t,n,r,i){(t<n||r&&r.heightRelevant||i&&i.heightRelevant)&&Pu(t,n,this.changes,5)}}function zQ(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 $Q(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 UQ(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class wx{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 HQ(this.displaySize*(n?t.scaleY:t.scaleX),n)}).range(this.from,this.to)}}class HQ extends ca{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 uP{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=cP,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ht.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(AO).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new _Q(r),this.stateDeco=fP(n),this.heightMap=Xn.empty().applyChanges(this.stateDeco,et.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 Hp(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?cP:new MO(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(Hf(t,this.scaler))})}update(t,n=null){this.state=t.state;let r=this.stateDeco;this.stateDeco=fP(this.state);let i=t.changedRanges,a=Xr.extendWithRanges(i,IQ(r,this.stateDeco,t?t.changes:Gt.empty(this.state.doc.length))),l=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);oP(),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(GI)&&(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"?ht.RTL:ht.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:D,scaleY:P}=NI(n,s);(D>.005&&Math.abs(this.scaleX-D)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=D,this.scaleY=P,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=RI(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=jI(this.scrollParent||t.win);let x=(this.printing?UQ:zQ)(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&&!$Q(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 D=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(D)&&(l=!0),l||i.lineWrapping&&Math.abs(k-this.contentDOMWidth)>i.charWidth){let{lineHeight:P,charWidth:N,textHeight:j}=t.docView.measureTextSize();l=P>0&&i.refresh(a,P,N,j,Math.max(5,k/N),D),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)),oP();for(let P of this.viewports){let N=P.from==this.viewport.from?D:t.docView.measureVisibleLineHeights(P);this.heightMap=(l?Xn.empty().applyChanges(this.stateDeco,et.empty,this.heightOracle,[new Xr(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,l,new NQ(P.from,N))}Ku&&(f|=2)}let M=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(f&2&&(f|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),f|=this.updateForViewport()),(f&2||M)&&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 Hp(i.lineAt(l-r*1e3,mt.ByHeight,a,0,0).from,i.lineAt(s+(1-r)*1e3,mt.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,mt.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 Hp(i.lineAt(g-1e3/2,mt.ByHeight,a,0,0).from,i.lineAt(g+d+1e3/2,mt.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 Hp(this.heightMap.lineAt(r,mt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,mt.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,mt.ByPos,this.heightOracle,0,0),{bottom:a}=this.heightMap.lineAt(n,mt.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 wx(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!=ht.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=qQ(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(te.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 wx(d,p,A,C)}s.push(w)},f=d=>{if(d.length<l||d.type!=Tn.Text)return;let p=FQ(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=Fp(p,w),y=Fp(p,A)}else{let x=p.total*this.heightOracle.charWidth,w=i*this.heightOracle.charWidth,A=0;if(x>2e6)for(let P of t)P.from>=d.from&&P.from<d.to&&P.size!=P.displaySize&&P.from*this.heightOracle.charWidth+A<this.pixelViewport.left&&(A=P.size-P.displaySize);let C=this.pixelViewport.left+A,k=this.pixelViewport.right+A,M,D;if(g!=null){let P=qp(p,g),N=((k-C)/2+w)/x;M=P-N,D=P+N}else M=(C-w)/x,D=(k+w)/x;v=Fp(p,M),y=Fp(p,D)}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){wx.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=[];$e.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)||Hf(this.heightMap.lineAt(t,mt.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)||Hf(this.heightMap.lineAt(this.scaler.fromDOM(t),mt.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 Hf(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 Hp{constructor(t,n){this.from=t,this.to=n}}function FQ(e,t,n){let r=[],i=e,a=0;return $e.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 Fp({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 qQ(e,t){for(let n of e)if(t(n))return n}const cP={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function fP(e){let t=e.facet(Dv).filter(r=>typeof r!="function"),n=e.facet(kO).filter(r=>typeof r!="function");return n.length&&t.push($e.join(n)),t}class MO{constructor(t,n,r){let i=0,a=0,l=0;this.viewports=r.map(({from:s,to:c})=>{let f=n.lineAt(s,mt.ByPos,t,0,0).top,d=n.lineAt(c,mt.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 MO?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 Hf(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new hi(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(i=>Hf(i,t)):e._content)}const Wp=me.define({combine:e=>e.join(" ")}),wS=me.define({combine:e=>e.indexOf(!0)>-1}),OS=Xl.newName(),bB=Xl.newName(),xB=Xl.newName(),SB={"&light":"."+bB,"&dark":"."+xB};function AS(e,t,n){return new Xl(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 WQ=AS("."+OS,{"&":{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"}},SB),KQ={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Ox=pe.ie&&pe.ie_version<=11;class VQ{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new w7,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 XQ(t),t.state.facet(Na)&&(t.contentDOM.editContext=this.editContext.editContext)),Ox&&(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(Na)?r.root.activeElement!=this.dom:!Xf(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=hh(t.root);if(!n)return!1;let r=pe.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&QQ(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=Xf(this.dom,r);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&A7(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,KQ),Ox&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Ox&&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&&Du(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&&Xf(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 fQ(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=sB(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!rg(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=hP(n,t.previousSibling||t.target.previousSibling,-1),i=hP(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(Na)!=t.state.facet(Na)&&(t.view.contentDOM.editContext=t.state.facet(Na)?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 hP(e,t,n){for(;t;){let r=Nt.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 dP(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 QQ(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return dP(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?dP(e,n):null}class XQ{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=uB(t.state.sliceDoc(s,c),r.text,(f?i.from:i.to)-s,f?"end":null);if(!d){let g=te.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));rg(g,i)||t.dispatch({selection:g,userEvent:"select"});return}let p={from:d.from+s,to:d.toA+s,insert:et.of(r.text.slice(d.from,d.toB).split(`
|
|
70
|
+
`))};if((pe.mac||pe.android)&&p.from==l-1&&/^\. ?$/.test(r.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:s,to:c,insert:et.of([r.text.replace("."," ")])}),this.pendingContextChange=p,!t.state.readOnly){let g=this.to-this.from+(p.to-p.from+p.insert.length);EO(t,p,te.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:JI.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=hh(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||O7(t.parent)||document,this.viewState=new uP(this,t.state||qe.create(t)),t.scrollTo&&t.scrollTo.is(zp)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(bu).map(i=>new vx(i));for(let i of this.plugins)i.update(this);this.observer=new VQ(this),this.inputState=new mQ(this),this.inputState.ensureHandlers(this.plugins),this.docView=new YM(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 Jt?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(mB))?(this.inputState.notifiedFocused=l,s=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,c=gB(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=eg.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 _u(v.empty?v:te.cursor(v.head,v.head>v.anchor?-1:1),"nearest","nearest",x,y)}for(let v of g.effects)v.is(zp)&&(p=v.value.clip(this.state))}this.viewState.update(i,p),this.bidiCache=ag.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Uf)!=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(Wp)!=i.state.facet(Wp)&&(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(vS))try{g(i)}catch(v){sr(this.state,v,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!sB(this,d)&&f.force&&Du(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 uP(this,t),this.plugins=t.facet(bu).map(r=>new vx(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new YM(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(bu),r=t.state.facet(bu);if(n!=r){let i=[];for(let a of r){let l=n.indexOf(a);if(l<0)i.push(new vx(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){sr(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(jI(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 sr(this.state,y),pP}}),p=eg.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]!=pP)try{let y=f[v];y.write&&y.write(d[v],this)}catch(y){sr(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(vS))s(n)}get themeClasses(){return OS+" "+(this.state.facet(wS)?xB:bB)+" "+this.state.facet(Wp)}updateAttrs(){let t=mP(this,eB,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Na)?"true":"false",class:"cm-content",style:`${pe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),mP(this,AO,n);let r=this.observer.ignore(()=>{let i=qM(this.contentDOM,this.contentAttrs,n),a=qM(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(Uf);let t=this.state.facet(de.cspNonce);Xl.mount(this.root,this.styleModules.concat(WQ).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 Sx(this,t,GM(this,t,n,r))}moveByGroup(t,n){return Sx(this,t,GM(this,t,n,r=>aQ(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 te.cursor(a.side(n,i)+t.from,a.forward(!n,i)?1:-1)}moveToLineBoundary(t,n,r=!0){return iQ(this,t,n,r)}moveVertically(t,n,r){return Sx(this,t,lQ(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=xS(this,t,n);return r&&r.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),xS(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==ht.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(YI)||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>YQ)return HI(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||UI(a.isolates,r=VM(this,t))))return a.order;r||(r=VM(this,t));let i=D7(t.text,n,r);return this.bidiCache.push(new ag(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(()=>{LI(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 zp.of(new _u(typeof t=="number"?te.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 zp.of(new _u(te.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 Rt.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Rt.define(()=>({}),{eventObservers:t})}static theme(t,n){let r=Xl.newName(),i=[Wp.of(r),Uf.of(AS(`.${r}`,t))];return n&&n.dark&&i.push(wS.of(!0)),i}static baseTheme(t){return ps.lowest(Uf.of(AS("."+OS,t,SB)))}static findFromDOM(t){var n;let r=t.querySelector(".cm-content"),i=r&&Nt.get(r)||Nt.get(t);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}de.styleModule=Uf;de.inputHandler=QI;de.clipboardInputFilter=wO;de.clipboardOutputFilter=OO;de.scrollHandler=ZI;de.focusChangeEffect=XI;de.perLineTextDirection=YI;de.exceptionSink=VI;de.updateListener=vS;de.editable=Na;de.mouseSelectionStyle=KI;de.dragMovesSelection=WI;de.clickAddsSelectionRange=qI;de.decorations=Dv;de.blockWrappers=tB;de.outerDecorations=kO;de.atomicRanges=Fh;de.bidiIsolatedRanges=nB;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=rB;de.darkTheme=wS;de.cspNonce=me.define({combine:e=>e.length?e[0]:""});de.contentAttributes=AO;de.editorAttributes=eB;de.lineWrapping=de.contentAttributes.of({class:"cm-lineWrapping"});de.announce=Ne.define();const YQ=4096,pP={};class ag{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:ht.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 ag(n.mapPos(l.from,1),n.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return r}}function mP(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&&bO(l,n)}return n}const GQ=pe.mac?"mac":pe.windows?"win":pe.linux?"linux":"key";function ZQ(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 Kp(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 JQ=ps.default(de.domEventHandlers({keydown(e,t){return OB(wB(t.state),e,t,"editor")}})),Lv=me.define({enables:JQ}),gP=new WeakMap;function wB(e){let t=e.facet(Lv),n=gP.get(t);return n||gP.set(t,n=nX(t.reduce((r,i)=>r.concat(i),[]))),n}function eX(e,t,n){return OB(wB(e.state),t,e,n)}let zl=null;const tX=4e3;function nX(e,t=GQ){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=>ZQ(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 M=zl={view:k,prefix:C,scope:l};return setTimeout(()=>{zl==M&&(zl=null)},tX),!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,kS))}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 kS=null;function OB(e,t,n,r){kS=t;let i=g7(t),a=ar(i,0),l=qi(a)==i.length&&i!=" ",s="",c=!1,f=!1,d=!1;zl&&zl.view==n&&zl.scope==r&&(s=zl.prefix+" ",fB.indexOf(t.keyCode)<0&&(f=!0,zl=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+Kp(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+Kp(y,t,!0)])||t.shiftKey&&(x=ch[t.keyCode])!=i&&x!=y&&g(v[s+Kp(x,t,!1)]))&&(c=!0):l&&t.shiftKey&&g(v[s+Kp(i,t,!0)])&&(c=!0),!c&&g(v._any)&&(c=!0)),f&&(c=!0),c&&d&&t.stopPropagation(),kS=null,c}class Xo{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=AB(t);return[new Xo(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return rX(t,n,r)}}function AB(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==ht.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function vP(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 rX(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==ht.LTR,l=e.contentDOM,s=l.getBoundingClientRect(),c=AB(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=bS(e,r,1),y=bS(e,i,-1),x=v.type==Tn.Text?v:null,w=y.type==Tn.Text?y:null;if(x&&(e.lineWrapping||v.widgetLineBreaks)&&(x=vP(e,r,1,x)),w&&(e.lineWrapping||y.widgetLineBreaks)&&(w=vP(e,i,-1,w)),x&&w&&x.from==w.from&&x.to==w.to)return C(k(n.from,n.to,x));{let D=x?k(n.from,null,x):M(v,!1),P=w?k(null,n.to,w):M(y,!0),N=[];return(x||v).to<(w||y).from-(x&&w?1:0)||v.widgetLineBreaks>1&&D.bottom+e.defaultLineHeight/2<P.top?N.push(A(p,D.bottom,g,P.top)):D.bottom<P.top&&e.elementAtHeight((D.bottom+P.top)/2).type==Tn.Text&&(D.bottom=P.top=(D.bottom+P.top)/2),C(D).concat(N).concat(C(P))}function A(D,P,N,j){return new Xo(t,D-c.left,P-c.top,Math.max(0,N-D),j-P)}function C({top:D,bottom:P,horizontal:N}){let j=[];for(let U=0;U<N.length;U+=2)j.push(A(N[U],D,N[U+1],P));return j}function k(D,P,N){let j=1e9,U=-1e9,V=[];function K(ie,ue,z,Z,ae){let Q=e.coordsAtPos(ie,ie==N.to?-2:2),le=e.coordsAtPos(z,z==N.from?2:-2);!Q||!le||(j=Math.min(Q.top,le.top,j),U=Math.max(Q.bottom,le.bottom,U),ae==ht.LTR?V.push(a&&ue?p:Q.left,a&&Z?g:le.right):V.push(!a&&Z?p:le.left,!a&&ue?g:Q.right))}let B=D??N.from,oe=P??N.to;for(let ie of e.visibleRanges)if(ie.to>B&&ie.from<oe)for(let ue=Math.max(ie.from,B),z=Math.min(ie.to,oe);;){let Z=e.state.doc.lineAt(ue);for(let ae of e.bidiSpans(Z)){let Q=ae.from+Z.from,le=ae.to+Z.from;if(Q>=z)break;le>ue&&K(Math.max(Q,ue),D==null&&Q<=B,Math.min(le,z),P==null&&le>=oe,ae.dir)}if(ue=Z.to+1,ue>=z)break}return V.length==0&&K(B,D==null,oe,P==null,e.textDirection),{top:j,bottom:U,horizontal:V}}function M(D,P){let N=s.top+(P?D.top:D.bottom);return{top:N,bottom:N,horizontal:[]}}}function iX(e,t){return e.constructor==t.constructor&&e.eq(t)}class aX{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(Pm)!=t.state.facet(Pm)&&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(Pm);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)=>!iX(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 Pm=me.define();function kB(e){return[Rt.define(t=>new aX(t,e)),Pm.of(e)]}const Vu=me.define({combine(e){return ua(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function lX(e={}){return[Vu.of(e),oX,sX,uX,GI.of(!0)]}function CB(e){return e.startState.facet(Vu)!=e.state.facet(Vu)}const oX=kB({above:!0,markers(e){let{state:t}=e,n=t.facet(Vu),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:te.cursor(i.head,i.assoc);for(let c of Xo.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=CB(e);return n&&yP(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){yP(t.state,e)},class:"cm-cursorLayer"});function yP(e,t){t.style.animationDuration=e.facet(Vu).cursorBlinkRate+"ms"}const sX=kB({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 Xo.forRange(e,"cm-selectionBackground",i))t.push(a);if(pe.ios&&!n.empty&&e.state.facet(Vu).iosSelectionHandles){for(let i of Xo.forRange(e,"cm-selectionHandle cm-selectionHandle-start",te.cursor(n.from,1)))t.push(i);for(let i of Xo.forRange(e,"cm-selectionHandle cm-selectionHandle-end",te.cursor(n.to,1)))t.push(i)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||CB(e)},class:"cm-selectionLayer"}),uX=ps.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"}}}})),EB=Ne.define({map(e,t){return e==null?null:t.mapPos(e)}}),Ff=jn.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,r)=>r.is(EB)?r.value:n,e)}}),cX=Rt.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(Ff);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(Ff)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Ff),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(Ff)!=e&&this.view.dispatch({effects:EB.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 fX(){return[Ff,cX]}function bP(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 hX(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 dX{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 Wa,r=n.add.bind(n);for(let{from:i,to:a}of hX(t,this.maxLength))bP(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 bP(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 CS=/x/.unicode!=null?"gu":"g",pX=new RegExp(`[\0-\b
|
|
71
|
+
--\u2028\u2029\uFEFF-]`,CS),mX={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 Ax=null;function gX(){var e;if(Ax==null&&typeof document<"u"&&document.body){let t=document.body.style;Ax=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return Ax||!1}const Dm=me.define({combine(e){let t=ua(e,{render:null,specialChars:pX,addSpecialChars:null});return(t.replaceTabs=!gX())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,CS)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,CS)),t}});function vX(e={}){return[Dm.of(e),yX()]}let xP=null;function yX(){return xP||(xP=Rt.fromClass(class{constructor(e){this.view=e,this.decorations=Ce.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Dm)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new dX({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=ar(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 wX((s-c%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Ce.replace({widget:new SX(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Dm);e.startState.facet(Dm)!=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 bX="•";function xX(e){return e>=32?bX:e==10?"":String.fromCharCode(9216+e)}class SX extends ca{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")+" "+(mX[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 wX extends ca{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 OX(){return kX}const AX=Ce.line({class:"cm-activeLine"}),kX=Rt.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(AX.range(i.from)),t=i.from)}return Ce.set(n)}},{decorations:e=>e.decorations});class CX extends ca{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=dh(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 EX(e){let t=Rt.fromClass(class{constructor(n){this.view=n,this.placeholder=e?Ce.set([Ce.widget({widget:new CX(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 ES=2e3;function TX(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>ES||n.off>ES||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(te.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=lS(f.text,l,e.tabSize,!0);if(d<0)a.push(te.cursor(f.to));else{let p=lS(f.text,s,e.tabSize);a.push(te.range(f.from+d,f.from+p))}}}return a}function MX(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function SP(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>ES?-1:i==r.length?MX(e,t.clientX):fc(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function PX(e,t){let n=SP(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=SP(e,i);if(!s)return r;let c=TX(e.state,n,s);return c.length?l?te.create(c.concat(r.ranges)):te.create(c):r}}:null}function DX(e){let t=(n=>n.altKey&&n.button==0);return de.mouseSelectionStyle.of((n,r)=>t(r)?PX(n,r):null)}const _X={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},NX={style:"cursor: crosshair"};function RX(e={}){let[t,n]=_X[e.key||"Alt"],r=Rt.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?NX:null})]}const Vp="-10000px";class TB{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 LX(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const kx=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)||LX}}}),wP=new WeakMap,PO=Rt.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(kx);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 TB(e,DO,(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(kx);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=Vp,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=CO(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(kx).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=Vp;continue}let v=c.arrow?f.dom.querySelector(".cm-tooltip-arrow"):null,y=v?7:0,x=g.right-g.left,w=(t=wP.get(f))!==null&&t!==void 0?t:g.bottom-g.top,A=f.offset||IX,C=this.view.textDirection==ht.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),M=this.above[s];!c.strictSide&&(M?p.top-w-y-A.y<r.top:p.bottom+w+y+A.y>r.bottom)&&M==r.bottom-p.bottom>p.top-r.top&&(M=this.above[s]=!M);let D=(M?p.top-r.top:r.bottom-p.bottom)-y;if(D<w&&f.resize!==!1){if(D<this.view.defaultLineHeight){d.style.top=Vp;continue}wP.set(f,w),d.style.height=(w=D)/a+"px"}else d.style.height&&(d.style.height="");let P=M?p.top-w-y-A.y:p.bottom+y+A.y,N=k+x;if(f.overlap!==!0)for(let j of l)j.left<N&&j.right>k&&j.top<P+w&&j.bottom>P&&(P=M?j.top-w-2-y:j.bottom+y+2);if(this.position=="absolute"?(d.style.top=(P-e.parent.top)/a+"px",OP(d,(k-e.parent.left)/i)):(d.style.top=P/a+"px",OP(d,k/i)),v){let j=p.left+(C?A.x:-A.x)-(k+14-7);v.style.left=j/i+"px"}f.overlap!==!0&&l.push({left:k,top:P,right:N,bottom:P+w}),d.classList.toggle("cm-tooltip-above",M),d.classList.toggle("cm-tooltip-below",!M),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=Vp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function OP(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const jX=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"}}}),IX={x:0,y:0},DO=me.define({enables:[PO,jX]}),lg=me.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class jv{static create(t){return new jv(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new TB(t,lg,(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 BX=DO.compute([lg],e=>{let t=e.facet(lg);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:jv.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),MB=me.define();class zX{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==ht.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=>sr(t.state,c,"hover tooltip"))}else l(a)}get tooltip(){let t=this.view.plugin(PO),n=t?t.manager.tooltips.findIndex(r=>r.create==jv.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&&!$X(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:!UX(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 Qp=4;function $X(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-Qp&&t.clientX<=r+Qp&&t.clientY>=i-Qp&&t.clientY<=a+Qp}function UX(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 HX(e,t={}){let n=Ne.define(),r=new WeakMap,i=jn.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,Vn.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(qX)&&!f.value||f.value==i)&&(l=[]);return l.length&&c&&r.set(l,c),l},provide:l=>lg.from(l)});const a=Rt.define(l=>new zX(l,e,i,r,n,t.hoverTime||300));return{active:i,extension:[i,a,MB.of(a),BX]}}function FX(e,t,n,r={}){var i;let a=e.state.facet(MB).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 PB(e,t){let n=e.plugin(PO);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const qX=Ne.define(),AP=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 _O(e,t){let n=e.plugin(DB),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const DB=Rt.fromClass(class{constructor(e){this.input=e.state.facet(mh),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(AP);this.top=new Xp(e,!0,t.topContainer),this.bottom=new Xp(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(AP);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Xp(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Xp(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(mh);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 Xp{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=kP(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=kP(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 kP(e){let t=e.nextSibling;return e.remove(),t}const mh=me.define({enables:DB});function WX(e,t){let n,r=new Promise(l=>n=l),i=l=>KX(l,t,n);e.state.field(Cx,!1)?e.dispatch({effects:_B.of(i)}):e.dispatch({effects:Ne.appendConfig.of(Cx.init(()=>[i]))});let a=NB.of(i);return{close:a,result:r.then(l=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(Cx).indexOf(i)>-1&&e.dispatch({effects:a})}),l))}}const Cx=jn.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(_B)?e=[n.value].concat(e):n.is(NB)&&(e=e.filter(r=>r!=n.value));return e},provide:e=>mh.computeN([e],t=>t.field(e))}),_B=Ne.define(),NB=Ne.define();function KX(e,t,n){let r=t.content?t.content(e,()=>l(null)):null;if(!r){if(r=st("form"),t.input){let s=st("input",t.input);/^(text|password|number|email|tel|url)$/.test(s.type)&&s.classList.add("cm-textfield"),s.name||(s.name="input"),r.appendChild(st("label",(t.label||"")+": ",s))}else r.appendChild(document.createTextNode(t.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(st("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=st("div",r,st("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 Va extends Ql{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Va.prototype.elementClass="";Va.prototype.toDOM=void 0;Va.prototype.mapMode=Vn.TrackBefore;Va.prototype.startSide=Va.prototype.endSide=-1;Va.prototype.point=!0;const _m=me.define(),VX=me.define(),QX={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>$e.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Jf=me.define();function XX(e){return[RB(),Jf.of({...QX,...e})]}const CP=me.define({combine:e=>e.some(t=>t)});function RB(e){return[YX]}const YX=Rt.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 TP(e,t)),this.fixed=!e.state.facet(CP);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(CP)!=!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=$e.iter(this.view.state.facet(_m),this.view.viewport.from),r=[],i=this.gutters.map(a=>new GX(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==Tn.Text&&l){TS(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==Tn.Text){TS(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||!$e.eq(e.startState.facet(_m),e.state.facet(_m),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 TP(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==ht.LTR?{left:r,right:i}:{right:r,left:i}})});function EP(e){return Array.isArray(e)?e:[e]}function TS(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class GX{constructor(t,n,r){this.gutter=t,this.height=r,this.i=0,this.cursor=$e.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 LB(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=[];TS(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(VX)){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 TP{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=EP(n.markers(t)),n.initialSpacer&&(this.spacer=new LB(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=EP(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!$e.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 LB{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":""),ZX(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 ZX(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 JX=me.define(),eY=me.define(),xu=me.define({combine(e){return ua(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 Ex extends Va{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function Tx(e,t){return e.state.facet(xu).formatNumber(t,e.state)}const tY=Jf.compute([xu],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(JX)},lineMarker(t,n,r){return r.some(i=>i.toDOM)?null:new Ex(Tx(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,r)=>{for(let i of t.state.facet(eY)){let a=i(t,n,r);if(a)return a}return null},lineMarkerChange:t=>t.startState.facet(xu)!=t.state.facet(xu),initialSpacer(t){return new Ex(Tx(t,MP(t.state.doc.lines)))},updateSpacer(t,n){let r=Tx(n.view,MP(n.view.state.doc.lines));return r==t.number?t:new Ex(r)},domEventHandlers:e.facet(xu).domEventHandlers,side:"before"}));function nY(e={}){return[xu.of(e),RB(),tY]}function MP(e){let t=9;for(;t<e;)t=t*10+9;return t}const rY=new class extends Va{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},iY=_m.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(rY.range(i)))}return $e.of(t)});function aY(){return iY}const jB=1024;let lY=0;class Mx{constructor(t,n){this.from=t,this.to=n}}class Ie{constructor(t={}){this.id=lY++,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=dr.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 oY=Object.create(null);class dr{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):oY,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new dr(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}}}}dr.none=new dr("",Object.create(null),0,8);class NO{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 dr(r.name,i,r.id,r.flags):r)}return new NO(n)}}const Yp=new WeakMap,PP=new WeakMap;var _t;(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"})(_t||(_t={}));class zt{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 PS(this.topNode,t)}cursorAt(t,n=0,r=0){let i=Yp.get(this)||this.topNode,a=new PS(i);return a.moveTo(t,n),Yp.set(this,a._tree),a}get topNode(){return new ei(this,0,0,null)}resolve(t,n=0){let r=gh(Yp.get(this)||this.topNode,t,n,!1);return Yp.set(this,r),r}resolveInner(t,n=0){let r=gh(PP.get(this)||this.topNode,t,n,!0);return PP.set(this,r),r}resolveStack(t,n=0){return cY(this,t,n)}iterate(t){let{enter:n,leave:r,from:i=0,to:a=this.length}=t,l=t.mode||0,s=(l&_t.IncludeAnonymous)>0;for(let c=this.cursor(l|_t.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:jO(dr.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new zt(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new zt(dr.none,n,r,i)))}static build(t){return fY(t)}}zt.empty=new zt(dr.none,[],[],0);class RO{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 RO(this.buffer,this.index)}}class Zl{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return dr.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&&!(IB(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 IB(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 gh(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 ei&&e.index<0?null:e.parent;if(!l)return e;e=l}let a=r?0:_t.IgnoreOverlays;if(r)for(let l=e,s=l.parent;s;l=s,s=l.parent)l instanceof ei&&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 BB{cursor(t=0){return new PS(this,t)}getChild(t,n=null,r=null){let i=DP(this,t,n,r);return i.length?i[0]:null}getChildren(t,n=null,r=null){return DP(this,t,n,r)}resolve(t,n=0){return gh(this,t,n,!1)}resolveInner(t,n=0){return gh(this,t,n,!0)}matchContext(t){return MS(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 ei extends BB{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&_t.EnterBracketed&&d instanceof zt&&(g=eh.get(d))&&!g.overlay&&g.bracketed&&r>=p&&r<=p+d.length)&&!IB(i,r,p,p+d.length))){if(d instanceof Zl){if(a&_t.ExcludeBuffers)continue;let v=d.findChild(0,d.buffer.length,n,r-p,i);if(v>-1)return new Hl(new sY(l,d,t,p),null,v)}else if(a&_t.IncludeAnonymous||!d.type.isAnonymous||LO(d)){let v;if(!(a&_t.IgnoreMounts)&&(v=eh.get(d))&&!v.overlay)return new ei(v.tree,p,t,l);let y=new ei(d,p,t,l);return a&_t.IncludeAnonymous||!y.type.isAnonymous?y:y.nextChild(n<0?d.children.length-1:0,n,r,i,a)}}}if(a&_t.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&_t.IgnoreOverlays)&&(i=eh.get(this._tree))&&i.overlay){let a=t-this.from,l=r&_t.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 ei(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 DP(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 MS(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 sY{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class Hl extends BB{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 Hl(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&_t.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 Hl(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 Hl(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 Hl(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 zt(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function zB(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 ei&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new uY(i,n)}class uY{constructor(t,n){this.heads=t,this.node=n}get next(){return zB(this.heads)}}function cY(e,t,n){let r=e.resolveInner(t,n),i=null;for(let a=r instanceof ei?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 ei(l.tree,l.overlay[0].from+a.from,-1,a);(i||(i=[r])).push(gh(s,t,n,!1))}}return i?zB(i):r}class PS{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&~_t.EnterBracketed,t instanceof ei)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 ei?(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&_t.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&_t.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&_t.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&_t.IncludeAnonymous||s instanceof Zl||!s.type.isAnonymous||LO(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 Hl(this.buffer,n,this.stack[i]);return this.bufferNode=new Hl(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 MS(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 MS(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 LO(e){return e.children.some(t=>t instanceof Zl||!t.type.isAnonymous||LO(t))}function fY(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=jB,reused:a=[],minRepeatType:l=r.types.length}=e,s=Array.isArray(n)?new RO(n,n.length):n,c=r.types,f=0,d=0;function p(D,P,N,j,U,V){let{id:K,start:B,end:oe,size:ie}=s,ue=d,z=f;if(ie<0)if(s.next(),ie==-1){let R=a[K];N.push(R),j.push(B-D);return}else if(ie==-3){f=K;return}else if(ie==-4){d=K;return}else throw new RangeError(`Unrecognized record size: ${ie}`);let Z=c[K],ae,Q,le=B-D;if(oe-B<=i&&(Q=w(s.pos-P,U))){let R=new Uint16Array(Q.size-Q.skip),F=s.pos-Q.size,ee=R.length;for(;s.pos>F;)ee=A(Q.start,R,ee);ae=new Zl(R,oe-Q.start,r),le=Q.start-D}else{let R=s.pos-ie;s.next();let F=[],ee=[],se=K>=l?K:-1,ge=0,Oe=oe;for(;s.pos>R;)se>=0&&s.id==se&&s.size>=0?(s.end<=Oe-i&&(y(F,ee,B,ge,s.end,Oe,se,ue,z),ge=F.length,Oe=s.end),s.next()):V>2500?g(B,R,F,ee):p(B,R,F,ee,se,V+1);if(se>=0&&ge>0&&ge<F.length&&y(F,ee,B,ge,B,Oe,se,ue,z),F.reverse(),ee.reverse(),se>-1&&ge>0){let Pe=v(Z,z);ae=jO(Z,F,ee,0,F.length,0,oe-B,Pe,Pe)}else ae=x(Z,F,ee,oe-B,ue-oe,z)}N.push(ae),j.push(le)}function g(D,P,N,j){let U=[],V=0,K=-1;for(;s.pos>P;){let{id:B,start:oe,end:ie,size:ue}=s;if(ue>4)s.next();else{if(K>-1&&oe<K)break;K<0&&(K=ie-i),U.push(B,oe,ie),V++,s.next()}}if(V){let B=new Uint16Array(V*4),oe=U[U.length-2];for(let ie=U.length-3,ue=0;ie>=0;ie-=3)B[ue++]=U[ie],B[ue++]=U[ie+1]-oe,B[ue++]=U[ie+2]-oe,B[ue++]=ue;N.push(new Zl(B,U[2]-oe,r)),j.push(oe-D)}}function v(D,P){return(N,j,U)=>{let V=0,K=N.length-1,B,oe;if(K>=0&&(B=N[K])instanceof zt){if(!K&&B.type==D&&B.length==U)return B;(oe=B.prop(Ie.lookAhead))&&(V=j[K]+B.length+oe)}return x(D,N,j,U,V,P)}}function y(D,P,N,j,U,V,K,B,oe){let ie=[],ue=[];for(;D.length>j;)ie.push(D.pop()),ue.push(P.pop()+N-U);D.push(x(r.types[K],ie,ue,V-U,B-V,oe)),P.push(U-N)}function x(D,P,N,j,U,V,K){if(V){let B=[Ie.contextHash,V];K=K?[B].concat(K):[B]}if(U>25){let B=[Ie.lookAhead,U];K=K?[B].concat(K):[B]}return new zt(D,P,N,j,K)}function w(D,P){let N=s.fork(),j=0,U=0,V=0,K=N.end-i,B={size:0,start:0,skip:0};e:for(let oe=N.pos-D;N.pos>oe;){let ie=N.size;if(N.id==P&&ie>=0){B.size=j,B.start=U,B.skip=V,V+=4,j+=4,N.next();continue}let ue=N.pos-ie;if(ie<0||ue<oe||N.start<K)break;let z=N.id>=l?4:0,Z=N.start;for(N.next();N.pos>ue;){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=Z,j+=ie,V+=z}return(P<0||j==D)&&(B.size=j,B.start=U,B.skip=V),B.size>4?B:void 0}function A(D,P,N){let{id:j,start:U,end:V,size:K}=s;if(s.next(),K>=0&&j<l){let B=N;if(K>4){let oe=s.pos-(K-4);for(;s.pos>oe;)N=A(D,P,N)}P[--N]=B,P[--N]=V-D,P[--N]=U-D,P[--N]=j}else K==-3?f=j:K==-4&&(d=j);return N}let C=[],k=[];for(;s.pos>0;)p(e.start||0,e.bufferStart||0,C,k,-1,0);let M=(t=e.length)!==null&&t!==void 0?t:C.length?k[0]+C[0].length:0;return new zt(c[e.topID],C.reverse(),k.reverse(),M)}const _P=new WeakMap;function Nm(e,t){if(!e.isAnonymous||t instanceof Zl||t.type!=e)return 1;let n=_P.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof zt)){n=1;break}n+=Nm(e,r)}_P.set(t,n)}return n}function jO(e,t,n,r,i,a,l,s,c){let f=0;for(let y=r;y<i;y++)f+=Nm(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 M=k,D=x[k],P=Nm(e,y[k]);for(k++;k<A;k++){let N=Nm(e,y[k]);if(P+N>=d)break;P+=N}if(k==M+1){if(P>d){let N=y[M];v(N.children,N.positions,0,N.children.length,x[M]+C);continue}p.push(y[M])}else{let N=x[k-1]+y[k-1].length-D;p.push(jO(e,y,x,M,k,D,N,null,c))}g.push(D+C-a)}}return v(t,n,r,i,0),(s||c)(p,g,l)}class Yo{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 Yo(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 Yo(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 $B{startParse(t,n,r){return typeof t=="string"&&(t=new hY(t)),r=r?r.length?r.map(i=>new Mx(i.from,i.to)):[new Mx(0,0)]:[new Mx(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 hY{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 dY=0,Da=class DS{constructor(t,n,r,i){this.name=t,this.set=n,this.base=r,this.modified=i,this.id=dY++}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 DS&&(n=t),n?.base)throw new Error("Can not derive from a modified tag");let i=new DS(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 og(t);return r=>r.modified.indexOf(n)>-1?r:og.get(r.base||r,r.modified.concat(n).sort((i,a)=>i.id-a.id))}},pY=0;class og{constructor(t){this.name=t,this.instances=[],this.id=pY++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(s=>s.base==t&&mY(n,s.modified));if(r)return r;let i=[],a=new Da(t.name,i,t,n);for(let s of n)s.instances.push(a);let l=gY(n);for(let s of t.set)if(!s.modified.length)for(let c of l)i.push(og.get(s,c));return a}}function mY(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function gY(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 UB(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 vh(r,l,c>0?a.slice(0,c):null);t[f]=d.sort(t[f])}}return HB.add(t)}const HB=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 vh(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}});class vh{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}}vh.empty=new vh([],2,null);function FB(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 vY(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function yY(e,t,n,r=0,i=e.length){let a=new bY(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,"",a.highlighters),a.flush(i)}class bY{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=xY(t)||vh.empty,p=vY(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,M=Math.max(n,A),D=Math.min(r,k);if(M<D&&x)for(;t.from<D&&(this.highlightRange(t,M,D,i,a),this.startSpan(Math.min(D,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 xY(e){let t=e.type.prop(HB);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const he=Da.define,Gp=he(),Rl=he(),NP=he(Rl),RP=he(Rl),Ll=he(),Zp=he(Ll),Px=he(Ll),$i=he(),Eo=he($i),Li=he(),ji=he(),_S=he(),kf=he(_S),Jp=he(),G={comment:Gp,lineComment:he(Gp),blockComment:he(Gp),docComment:he(Gp),name:Rl,variableName:he(Rl),typeName:NP,tagName:he(NP),propertyName:RP,attributeName:he(RP),className:he(Rl),labelName:he(Rl),namespace:he(Rl),macroName:he(Rl),literal:Ll,string:Zp,docString:he(Zp),character:he(Zp),attributeValue:he(Zp),number:Px,integer:he(Px),float:he(Px),bool:he(Ll),regexp:he(Ll),escape:he(Ll),color:he(Ll),url:he(Ll),keyword:Li,self:he(Li),null:he(Li),atom:he(Li),unit:he(Li),modifier:he(Li),operatorKeyword:he(Li),controlKeyword:he(Li),definitionKeyword:he(Li),moduleKeyword:he(Li),operator:ji,derefOperator:he(ji),arithmeticOperator:he(ji),logicOperator:he(ji),bitwiseOperator:he(ji),compareOperator:he(ji),updateOperator:he(ji),definitionOperator:he(ji),typeOperator:he(ji),controlOperator:he(ji),punctuation:_S,separator:he(_S),bracket:kf,angleBracket:he(kf),squareBracket:he(kf),paren:he(kf),brace:he(kf),content:$i,heading:Eo,heading1:he(Eo),heading2:he(Eo),heading3:he(Eo),heading4:he(Eo),heading5:he(Eo),heading6:he(Eo),contentSeparator:he($i),list:he($i),quote:he($i),emphasis:he($i),strong:he($i),link:he($i),monospace:he($i),strikethrough:he($i),inserted:he(),deleted:he(),changed:he(),invalid:he(),meta:Jp,documentMeta:he(Jp),annotation:he(Jp),processingInstruction:he(Jp),definition:Da.defineModifier("definition"),constant:Da.defineModifier("constant"),function:Da.defineModifier("function"),standard:Da.defineModifier("standard"),local:Da.defineModifier("local"),special:Da.defineModifier("special")};for(let e in G){let t=G[e];t instanceof Da&&(t.name=e)}FB([{tag:G.link,class:"tok-link"},{tag:G.heading,class:"tok-heading"},{tag:G.emphasis,class:"tok-emphasis"},{tag:G.strong,class:"tok-strong"},{tag:G.keyword,class:"tok-keyword"},{tag:G.atom,class:"tok-atom"},{tag:G.bool,class:"tok-bool"},{tag:G.url,class:"tok-url"},{tag:G.labelName,class:"tok-labelName"},{tag:G.inserted,class:"tok-inserted"},{tag:G.deleted,class:"tok-deleted"},{tag:G.literal,class:"tok-literal"},{tag:G.string,class:"tok-string"},{tag:G.number,class:"tok-number"},{tag:[G.regexp,G.escape,G.special(G.string)],class:"tok-string2"},{tag:G.variableName,class:"tok-variableName"},{tag:G.local(G.variableName),class:"tok-variableName tok-local"},{tag:G.definition(G.variableName),class:"tok-variableName tok-definition"},{tag:G.special(G.variableName),class:"tok-variableName2"},{tag:G.definition(G.propertyName),class:"tok-propertyName tok-definition"},{tag:G.typeName,class:"tok-typeName"},{tag:G.namespace,class:"tok-namespace"},{tag:G.className,class:"tok-className"},{tag:G.macroName,class:"tok-macroName"},{tag:G.propertyName,class:"tok-propertyName"},{tag:G.operator,class:"tok-operator"},{tag:G.comment,class:"tok-comment"},{tag:G.meta,class:"tok-meta"},{tag:G.invalid,class:"tok-invalid"},{tag:G.punctuation,class:"tok-punctuation"}]);var Dx;const Su=new Ie;function SY(e){return me.define({combine:e?t=>t.concat(e):void 0})}const wY=new Ie;class gi{constructor(t,n,r=[],i=""){this.data=t,this.name=i,qe.prototype.hasOwnProperty("tree")||Object.defineProperty(qe.prototype,"tree",{get(){return Rn(this)}}),this.parser=n,this.extension=[Jl.of(this),qe.languageData.of((a,l,s)=>{let c=LP(a,l,s),f=c.type.prop(Su);if(!f)return[];let d=a.facet(f),p=c.type.prop(wY);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 LP(t,n,r).type.prop(Su)==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(Su)==this.data){r.push({from:l,to:l+a.length});return}let s=a.prop(Ie.mounted);if(s){if(s.tree.prop(Su)==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 zt&&i(f,a.positions[c]+l)}};return i(Rn(t),0),r}get allowsNesting(){return!0}}gi.setState=Ne.define();function LP(e,t,n){let r=e.facet(Jl),i=Rn(e).topNode;if(!r||r.allowsNesting)for(let a=i;a;a=a.enter(t,n,_t.ExcludeBuffers|_t.EnterBracketed))a.type.isTop&&(i=a);return i}class sg extends gi{constructor(t,n,r){super(t,n,[],r),this.parser=n}static define(t){let n=SY(t.languageData);return new sg(n,t.parser.configure({props:[Su.add(r=>r.isTop?n:void 0)]}),t.name)}configure(t,n){return new sg(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Rn(e){let t=e.field(gi.state,!1);return t?t.tree:zt.empty}class OY{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 Cf=null;class ug{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 ug(t,n,[],zt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new OY(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=zt.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(Yo.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(Yo.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=Cf;Cf=this;try{return t()}finally{Cf=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=jP(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=Yo.applyChanges(r,c),i=zt.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 ug(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=jP(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 $B{createParse(n,r,i){let a=i[0].from,l=i[i.length-1].to;return{parsedPos:a,advance(){let c=Cf;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 zt(dr.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 Cf}}function jP(e,t,n){return Yo.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=ug.create(t.facet(Jl).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Qu(r)}}gi.state=jn.define({create:Qu.init,update(e,t){for(let n of t.effects)if(n.is(gi.setState))return n.value;return t.startState.facet(Jl)!=t.state.facet(Jl)?Qu.init(t.state):e.apply(t)}});let qB=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(qB=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const _x=typeof navigator<"u"&&(!((Dx=navigator.scheduling)===null||Dx===void 0)&&Dx.isInputPending)?()=>navigator.scheduling.isInputPending():null,AY=Rt.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(gi.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(gi.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=qB(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(gi.state);if(a.tree==a.context.tree&&a.context.isDone(i+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,t&&!_x?Math.max(25,t.timeRemaining()-5):1e9),s=a.context.treeLen<i&&r.doc.length>i+1e3,c=a.context.work(()=>_x&&_x()||Date.now()>l,i+(s?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:gi.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=>sr(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=>[gi.state,AY,de.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class kY{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}const CY=me.define(),Iv=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 cg(e){let t=e.facet(Iv);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function yh(e,t){let n="",r=e.tabSize,i=e.facet(Iv)[0];if(i==" "){for(;t>=r;)n+=" ",t-=r;i=" "}for(let a=0;a<t;a++)n+=i;return n}function IO(e,t){e instanceof qe&&(e=new Bv(e));for(let r of e.state.facet(CY)){let i=r(e,t);if(i!==void 0)return i}let n=Rn(e.state);return n.length>=t?EY(e,n,t):null}class Bv{constructor(t,n={}){this.state=t,this.options=n,this.unit=cg(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 WB=new Ie;function EY(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 KB(r,e,n)}function KB(e,t,n){for(let r=e;r;r=r.next){let i=MY(r.node);if(i)return i(BO.create(t,n,r))}return 0}function TY(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function MY(e){let t=e.type.prop(WB);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=>VB(l,!0,1,void 0,a&&!TY(l)?i.from:void 0)}return e.parent==null?PY:null}function PY(){return 0}class BO extends Bv{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 BO(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(DY(r,t))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return KB(this.context.next,this.base,this.pos)}}function DY(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function _Y(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 IP({closing:e,align:t=!0,units:n=1}){return r=>VB(r,t,n,e)}function VB(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?_Y(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}const NY=200;function RY(){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+NY)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=IO(l,d.from);if(p==null)continue;let g=/^\s*/.exec(d.text)[0],v=yh(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 LY=me.define(),QB=new Ie;function jY(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 IY(e,t,n){let r=Rn(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(QB);if(c&&(s.to<r.length-50||r.length==e.doc.length||!BY(s))){let f=c(s,e);f&&f.from<=n&&f.from>=t&&f.to>n&&(a=f)}}return a}function BY(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function fg(e,t,n){for(let r of e.facet(LY)){let i=r(e,t,n);if(i)return i}return IY(e,t,n)}function XB(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 zv=Ne.define({map:XB}),qh=Ne.define({map:XB});function YB(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 ls=jn.define({create(){return Ce.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((r,i)=>e=BP(e,r,i)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(zv)&&!zY(e,r.value.from,r.value.to)?n.push(r.value):r.is(qh)&&(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(JB),i=n.map(a=>(r?Ce.replace({widget:new KY(r(t.state,a))}):zP).range(a.from,a.to));e=e.update({add:i})}return t.selection&&(e=BP(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(zP.range(r,i))}return Ce.set(t,!0)}});function BP(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 hg(e,t,n){var r;let i=null;return(r=e.field(ls,!1))===null||r===void 0||r.between(t,n,(a,l)=>{(!i||i.from>a)&&(i={from:a,to:l})}),i}function zY(e,t,n){let r=!1;return e.between(t,t,(i,a)=>{i==t&&a==n&&(r=!0)}),r}function GB(e,t){return e.field(ls,!1)?t:t.concat(Ne.appendConfig.of(e3()))}const $Y=e=>{for(let t of YB(e)){let n=fg(e.state,t.from,t.to);if(n)return e.dispatch({effects:GB(e.state,[zv.of(n),ZB(e,n)])}),!0}return!1},UY=e=>{if(!e.state.field(ls,!1))return!1;let t=[];for(let n of YB(e)){let r=hg(e.state,n.from,n.to);r&&t.push(qh.of(r),ZB(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function ZB(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 HY=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=fg(t,i.from,i.to);a&&n.push(zv.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:GB(e.state,n)}),!!n.length},FY=e=>{let t=e.state.field(ls,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(r,i)=>{n.push(qh.of({from:r,to:i}))}),e.dispatch({effects:n}),!0},qY=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:$Y},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:UY},{key:"Ctrl-Alt-[",run:HY},{key:"Ctrl-Alt-]",run:FY}],WY={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},JB=me.define({combine(e){return ua(e,WY)}});function e3(e){return[ls,XY]}function t3(e,t){let{state:n}=e,r=n.facet(JB),i=l=>{let s=e.lineBlockAt(e.posAtDOM(l.target)),c=hg(e.state,s.from,s.to);c&&e.dispatch({effects:qh.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 zP=Ce.replace({widget:new class extends ca{toDOM(e){return t3(e,null)}}});class KY extends ca{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return t3(t,this.value)}}const VY={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Nx extends Va{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 QY(e={}){let t={...VY,...e},n=new Nx(t,!0),r=new Nx(t,!1),i=Rt.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(ls,!1)!=l.state.field(ls,!1)||Rn(l.startState)!=Rn(l.state)||t.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let s=new Wa;for(let c of l.viewportLineBlocks){let f=hg(l.state,c.from,c.to)?r:fg(l.state,c.from,c.to)?n:null;f&&s.add(c.from,c.from,f)}return s.finish()}}),{domEventHandlers:a}=t;return[i,XX({class:"cm-foldGutter",markers(l){var s;return((s=l.plugin(i))===null||s===void 0?void 0:s.markers)||$e.empty},initialSpacer(){return new Nx(t,!1)},domEventHandlers:{...a,click:(l,s,c)=>{if(a.click&&a.click(l,s,c))return!0;let f=hg(l.state,s.from,s.to);if(f)return l.dispatch({effects:qh.of(f)}),!0;let d=fg(l.state,s.from,s.to);return d?(l.dispatch({effects:zv.of(d)}),!0):!1}}}),e3()]}const XY=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 Wh{constructor(t,n){this.specs=t;let r;function i(s){let c=Xl.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 gi?s=>s.prop(Su)==l.data:l?s=>s==l:void 0,this.style=FB(t.map(s=>({tag:s.tag,class:s.class||i(Object.assign({},s,{tag:null}))})),{all:a}).style,this.module=r?new Xl(r):null,this.themeType=n.themeType}static define(t,n){return new Wh(t,n||{})}}const NS=me.define(),n3=me.define({combine(e){return e.length?[e[0]]:null}});function Rx(e){let t=e.facet(NS);return t.length?t:e.facet(n3)}function r3(e,t){let n=[GY],r;return e instanceof Wh&&(e.module&&n.push(de.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(n3.of(e)):r?n.push(NS.computeN([de.darkTheme],i=>i.facet(de.darkTheme)==(r=="dark")?[e]:[])):n.push(NS.of(e)),n}class YY{constructor(t){this.markCache=Object.create(null),this.tree=Rn(t.state),this.decorations=this.buildDeco(t,Rx(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Rn(t.state),r=Rx(t.state),i=r!=Rx(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 Wa;for(let{from:i,to:a}of t.visibleRanges)yY(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 GY=ps.high(Rt.fromClass(YY,{decorations:e=>e.decorations})),ZY=Wh.define([{tag:G.meta,color:"#404740"},{tag:G.link,textDecoration:"underline"},{tag:G.heading,textDecoration:"underline",fontWeight:"bold"},{tag:G.emphasis,fontStyle:"italic"},{tag:G.strong,fontWeight:"bold"},{tag:G.strikethrough,textDecoration:"line-through"},{tag:G.keyword,color:"#708"},{tag:[G.atom,G.bool,G.url,G.contentSeparator,G.labelName],color:"#219"},{tag:[G.literal,G.inserted],color:"#164"},{tag:[G.string,G.deleted],color:"#a11"},{tag:[G.regexp,G.escape,G.special(G.string)],color:"#e40"},{tag:G.definition(G.variableName),color:"#00f"},{tag:G.local(G.variableName),color:"#30a"},{tag:[G.typeName,G.namespace],color:"#085"},{tag:G.className,color:"#167"},{tag:[G.special(G.variableName),G.macroName],color:"#256"},{tag:G.definition(G.propertyName),color:"#00c"},{tag:G.comment,color:"#940"},{tag:G.invalid,color:"#f00"}]),JY=de.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),i3=1e4,a3="()[]{}",l3=me.define({combine(e){return ua(e,{afterCursor:!0,brackets:a3,maxScanDistance:i3,renderMatch:nG})}}),eG=Ce.mark({class:"cm-matchingBracket"}),tG=Ce.mark({class:"cm-nonmatchingBracket"});function nG(e){let t=[],n=e.matched?eG:tG;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 $P(e){let t=[],n=e.facet(l3);for(let r of e.selection.ranges){if(!r.empty)continue;let i=Xi(e,r.head,-1,n)||r.head>0&&Xi(e,r.head-1,1,n)||n.afterCursor&&(Xi(e,r.head,1,n)||r.head<e.doc.length&&Xi(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return Ce.set(t,!0)}const rG=Rt.fromClass(class{constructor(e){this.paused=!1,this.decorations=$P(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=$P(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),iG=[rG,JY];function aG(e={}){return[l3.of(e),iG]}const lG=new Ie;function RS(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 LS(e){let t=e.type.prop(lG);return t?t(e.node):e}function Xi(e,t,n,r={}){let i=r.maxScanDistance||i3,a=r.brackets||a3,l=Rn(e),s=l.resolveInner(t,n);for(let c=s;c;c=c.parent){let f=RS(c.type,n,a);if(f&&c.from<c.to){let d=LS(c);if(d&&(n>0?t>=d.from&&t<d.to:t>d.from&&t<=d.to))return oG(e,t,n,c,d,f,a)}}return sG(e,t,n,l,s.type,i,a)}function oG(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=LS(d);return{start:c,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(RS(d.type,n,l))f++;else if(RS(d.type,-n,l)){if(f==0){let p=LS(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 sG(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 uG=Object.create(null),UP=[dr.none],HP=[],FP=Object.create(null),cG=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"]])cG[e]=fG(uG,t);function Lx(e,t){HP.indexOf(e)>-1||(HP.push(e),console.warn(t))}function fG(e,t){let n=[];for(let s of t.split(" ")){let c=[];for(let f of s.split(".")){let d=e[f]||G[f];d?typeof d=="function"?c.length?c=c.map(d):Lx(f,`Modifier ${f} used at start of tag`):c.length?Lx(f,`Tag ${f} used as modifier`):c=Array.isArray(d)?d:[d]:Lx(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=FP[i];if(a)return a.id;let l=FP[i]=dr.define({id:UP.length,name:r,props:[UB({[r]:n})]});return UP.push(l),l.id}ht.RTL,ht.LTR;const hG=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=$O(e.state,n.from);return r.line?dG(e):r.block?mG(e):!1};function zO(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 dG=zO(yG,0),pG=zO(o3,0),mG=zO((e,t)=>o3(e,t,vG(t)),0);function $O(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const Ef=50;function gG(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-Ef,r),l=e.sliceDoc(i,i+Ef),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*Ef?d=p=e.sliceDoc(r,i):(d=e.sliceDoc(r,r+Ef),p=e.sliceDoc(i-Ef,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 vG(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 o3(e,t,n=t.selection.ranges){let r=n.map(a=>$O(t,a.from).block);if(!r.every(a=>a))return null;let i=n.map((a,l)=>gG(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 yG(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=$O(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 jS=sa.define(),bG=sa.define(),xG=me.define(),s3=me.define({combine(e){return ua(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)})}}),u3=jn.define({create(){return Yi.empty},update(e,t){let n=t.state.facet(s3),r=t.annotation(jS);if(r){let c=ur.fromTransaction(t,r.selection),f=r.side,d=f==0?e.undone:e.done;return c?d=dg(d,d.length,n.minDepth,c):d=h3(d,t.startState.selection),new Yi(f==0?r.rest:d,f==0?d:r.rest)}let i=t.annotation(bG);if((i=="full"||i=="before")&&(e=e.isolate()),t.annotation(Jt.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=ur.fromTransaction(t),l=t.annotation(Jt.time),s=t.annotation(Jt.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 Yi(e.done.map(ur.fromJSON),e.undone.map(ur.fromJSON))}});function SG(e={}){return[u3,s3.of(e),de.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?c3:t.inputType=="historyRedo"?IS:null;return r?(t.preventDefault(),r(n)):!1}})]}function $v(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(u3,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}const c3=$v(0,!1),IS=$v(1,!1),wG=$v(0,!0),OG=$v(1,!0);class ur{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 ur(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 ur(t.changes&&Gt.fromJSON(t.changes),[],t.mapped&&Ji.fromJSON(t.mapped),t.startSelection&&te.fromJSON(t.startSelection),t.selectionsAfter.map(te.fromJSON))}static fromTransaction(t,n){let r=Yr;for(let i of t.startState.facet(xG)){let a=i(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new ur(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Yr)}static selection(t){return new ur(void 0,Yr,void 0,void 0,t)}}function dg(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 AG(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 kG(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function f3(e,t){return e.length?t.length?e.concat(t):e:t}const Yr=[],CG=200;function h3(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-CG));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),dg(e,e.length-1,1e9,n.setSelAfter(r)))}else return[ur.selection([t])]}function EG(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 jx(e,t){if(!e.length)return e;let n=e.length,r=Yr;for(;n;){let i=TG(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?[ur.selection(r)]:Yr}function TG(e,t,n){let r=f3(e.selectionsAfter.length?e.selectionsAfter.map(s=>s.map(t)):Yr,n);if(!e.changes)return ur.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(a):a;return new ur(i,Ne.mapEffects(e.effects,t),l,e.startSelection.map(a),r)}const MG=/^(input\.type|delete)($|\.)/;class Yi{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 Yi(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||MG.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,AG(s.changes,t.changes))||r=="input.type.compose")?l=dg(l,l.length-1,i.minDepth,new ur(t.changes.compose(s.changes),f3(Ne.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Yr)):l=dg(l,l.length,i.minDepth,t),new Yi(l,Yr,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Yr;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&kG(a[a.length-1],t)?this:new Yi(h3(this.done,t),this.undone,n,r)}addMapping(t){return new Yi(jx(this.done,t),jx(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:jS.of({side:t,rest:EG(i),selection:l}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let s=i.length==1?Yr:i.slice(0,i.length-1);return a.mapped&&(s=jx(s,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:jS.of({side:t,rest:s,selection:l}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Yi.empty=new Yi(Yr,Yr);const PG=[{key:"Mod-z",run:c3,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:IS,preventDefault:!0},{linux:"Ctrl-Shift-z",run:IS,preventDefault:!0},{key:"Mod-u",run:wG,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:OG,preventDefault:!0}];function hc(e,t){return te.create(e.ranges.map(t),e.mainIndex)}function ki(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Ci({state:e,dispatch:t},n){let r=hc(e.selection,n);return r.eq(e.selection,!0)?!1:(t(ki(e,r)),!0)}function Uv(e,t){return te.cursor(t?e.to:e.from)}function d3(e,t){return Ci(e,n=>n.empty?e.moveByChar(n,t):Uv(n,t))}function In(e){return e.textDirectionAt(e.state.selection.main.head)==ht.LTR}const p3=e=>d3(e,!In(e)),m3=e=>d3(e,In(e));function g3(e,t){return Ci(e,n=>n.empty?e.moveByGroup(n,t):Uv(n,t))}const DG=e=>g3(e,!In(e)),_G=e=>g3(e,In(e));function NG(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 Hv(e,t,n){let r=Rn(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;NG(e,f,i)?r=f:c=n?f.to:f.from}let a=r.type.prop(i),l,s;return a&&(l=n?Xi(e,r.from,1):Xi(e,r.to,-1))&&l.matched?s=n?l.end.to:l.end.from:s=n?r.to:r.from,te.cursor(s,n?-1:1)}const RG=e=>Ci(e,t=>Hv(e.state,t,!In(e))),LG=e=>Ci(e,t=>Hv(e.state,t,In(e)));function v3(e,t){return Ci(e,n=>{if(!n.empty)return Uv(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const y3=e=>v3(e,!1),b3=e=>v3(e,!0);function x3(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 S3(e,t){let n=x3(e),{state:r}=e,i=hc(r.selection,l=>l.empty?e.moveVertically(l,t,n.height):Uv(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(ki(r,i),{effects:a}),!0}const qP=e=>S3(e,!1),BS=e=>S3(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=te.cursor(r.from+a))}return i}const jG=e=>Ci(e,t=>ao(e,t,!0)),IG=e=>Ci(e,t=>ao(e,t,!1)),BG=e=>Ci(e,t=>ao(e,t,!In(e))),zG=e=>Ci(e,t=>ao(e,t,In(e))),$G=e=>Ci(e,t=>te.cursor(e.lineBlockAt(t.head).from,1)),UG=e=>Ci(e,t=>te.cursor(e.lineBlockAt(t.head).to,-1));function HG(e,t,n){let r=!1,i=hc(e.selection,a=>{let l=Xi(e,a.head,-1)||Xi(e,a.head,1)||a.head>0&&Xi(e,a.head-1,1)||a.head<e.doc.length&&Xi(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 te.cursor(s)});return r?(t(ki(e,i)),!0):!1}const FG=({state:e,dispatch:t})=>HG(e,t);function ii(e,t,n){let r=hc(e.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=t&&(i=te.range(i.head,i.anchor));let a=n(i);return te.range(i.anchor,a.head,a.goalColumn,a.bidiLevel||void 0,a.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(ki(e.state,r)),!0)}function w3(e,t){return ii(e,t,n=>e.moveByChar(n,t))}const O3=e=>w3(e,!In(e)),A3=e=>w3(e,In(e));function k3(e,t){return ii(e,t,n=>e.moveByGroup(n,t))}const qG=e=>k3(e,!In(e)),WG=e=>k3(e,In(e)),KG=e=>{let t=!In(e);return ii(e,t,n=>Hv(e.state,n,t))},VG=e=>{let t=In(e);return ii(e,t,n=>Hv(e.state,n,t))};function C3(e,t){return ii(e,t,n=>e.moveVertically(n,t))}const E3=e=>C3(e,!1),T3=e=>C3(e,!0);function M3(e,t){return ii(e,t,n=>e.moveVertically(n,t,x3(e).height))}const WP=e=>M3(e,!1),KP=e=>M3(e,!0),QG=e=>ii(e,!0,t=>ao(e,t,!0)),XG=e=>ii(e,!1,t=>ao(e,t,!1)),YG=e=>{let t=!In(e);return ii(e,t,n=>ao(e,n,t))},GG=e=>{let t=In(e);return ii(e,t,n=>ao(e,n,t))},ZG=e=>ii(e,!1,t=>te.cursor(e.lineBlockAt(t.head).from)),JG=e=>ii(e,!0,t=>te.cursor(e.lineBlockAt(t.head).to)),VP=({state:e,dispatch:t})=>(t(ki(e,{anchor:0})),!0),QP=({state:e,dispatch:t})=>(t(ki(e,{anchor:e.doc.length})),!0),XP=({state:e,dispatch:t})=>(t(ki(e,{anchor:e.selection.main.anchor,head:0})),!0),YP=({state:e,dispatch:t})=>(t(ki(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),eZ=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),tZ=({state:e,dispatch:t})=>{let n=Fv(e).map(({from:r,to:i})=>te.range(r,Math.min(i+1,e.doc.length)));return t(e.update({selection:te.create(n),userEvent:"select"})),!0},nZ=({state:e,dispatch:t})=>{let n=hc(e.selection,r=>{let i=Rn(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 te.range(s.to,s.from)}return r});return n.eq(e.selection)?!1:(t(ki(e,n)),!0)};function P3(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(ki(n,te.create(i,i.length-1))),!0)}const rZ=e=>P3(e,!1),iZ=e=>P3(e,!0),aZ=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=te.create([n.main]):n.main.empty||(r=te.create([te.cursor(n.main.head)])),r?(t(ki(e,r)),!0):!1};function Kh(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=em(e,c,!1)):c>l&&(n="delete.forward",c=em(e,c,!0)),l=Math.min(l,c),s=Math.max(s,c)}else l=em(e,l,!1),s=em(e,s,!0);return l==s?{range:a}:{changes:{from:l,to:s},range:te.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 em(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 D3=(e,t,n)=>Kh(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%cg(a)||cg(a);for(let p=0;p<d&&s[s.length-1-p]==" ";p++)i--;c=i}else c=sn(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=sn(l.text,c-l.from,!1,!1)+l.from);return c}),zS=e=>D3(e,!1,!0),_3=e=>D3(e,!0,!1),N3=(e,t)=>Kh(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=sn(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}),R3=e=>N3(e,!1),lZ=e=>N3(e,!0),oZ=e=>Kh(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),sZ=e=>Kh(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),uZ=e=>Kh(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),cZ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:et.of(["",""])},range:te.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},fZ=({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:sn(a.text,i-a.from,!1)+a.from,s=i==a.to?i+1:sn(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:te.cursor(s)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Fv(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 L3(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let a of Fv(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(te.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(te.range(c.anchor-s,c.head-s))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:te.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const hZ=({state:e,dispatch:t})=>L3(e,t,!1),dZ=({state:e,dispatch:t})=>L3(e,t,!0);function j3(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of Fv(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 pZ=({state:e,dispatch:t})=>j3(e,t,!1),mZ=({state:e,dispatch:t})=>j3(e,t,!0),gZ=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Fv(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 vZ(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Rn(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 GP=I3(!1),yZ=I3(!0);function I3(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&&vZ(t,a);e&&(a=l=(l<=s.to?s:t.doc.lineAt(l)).to);let f=new Bv(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=IO(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=["",yh(t,d)];return c&&p.push(yh(t,f.lineIndent(s.from,-1))),{changes:{from:a,to:l,insert:et.of(p)},range:te.cursor(a+1+p[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function UO(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:te.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const bZ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Bv(e,{overrideIndentation:a=>{let l=n[a];return l??-1}}),i=UO(e,(a,l,s)=>{let c=IO(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let f=/^\s*/.exec(a.text)[0],d=yh(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},B3=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(UO(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Iv)})}),{userEvent:"input.indent"})),!0),z3=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(UO(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let a=fc(i,e.tabSize),l=0,s=yh(e,Math.max(0,a-cg(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),xZ=e=>(e.setTabFocusMode(),!0),SZ=[{key:"Ctrl-b",run:p3,shift:O3,preventDefault:!0},{key:"Ctrl-f",run:m3,shift:A3},{key:"Ctrl-p",run:y3,shift:E3},{key:"Ctrl-n",run:b3,shift:T3},{key:"Ctrl-a",run:$G,shift:ZG},{key:"Ctrl-e",run:UG,shift:JG},{key:"Ctrl-d",run:_3},{key:"Ctrl-h",run:zS},{key:"Ctrl-k",run:oZ},{key:"Ctrl-Alt-h",run:R3},{key:"Ctrl-o",run:cZ},{key:"Ctrl-t",run:fZ},{key:"Ctrl-v",run:BS}],wZ=[{key:"ArrowLeft",run:p3,shift:O3,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:DG,shift:qG,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:BG,shift:YG,preventDefault:!0},{key:"ArrowRight",run:m3,shift:A3,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:_G,shift:WG,preventDefault:!0},{mac:"Cmd-ArrowRight",run:zG,shift:GG,preventDefault:!0},{key:"ArrowUp",run:y3,shift:E3,preventDefault:!0},{mac:"Cmd-ArrowUp",run:VP,shift:XP},{mac:"Ctrl-ArrowUp",run:qP,shift:WP},{key:"ArrowDown",run:b3,shift:T3,preventDefault:!0},{mac:"Cmd-ArrowDown",run:QP,shift:YP},{mac:"Ctrl-ArrowDown",run:BS,shift:KP},{key:"PageUp",run:qP,shift:WP},{key:"PageDown",run:BS,shift:KP},{key:"Home",run:IG,shift:XG,preventDefault:!0},{key:"Mod-Home",run:VP,shift:XP},{key:"End",run:jG,shift:QG,preventDefault:!0},{key:"Mod-End",run:QP,shift:YP},{key:"Enter",run:GP,shift:GP},{key:"Mod-a",run:eZ},{key:"Backspace",run:zS,shift:zS,preventDefault:!0},{key:"Delete",run:_3,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:R3,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:lZ,preventDefault:!0},{mac:"Mod-Backspace",run:sZ,preventDefault:!0},{mac:"Mod-Delete",run:uZ,preventDefault:!0}].concat(SZ.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),OZ=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:RG,shift:KG},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:LG,shift:VG},{key:"Alt-ArrowUp",run:hZ},{key:"Shift-Alt-ArrowUp",run:pZ},{key:"Alt-ArrowDown",run:dZ},{key:"Shift-Alt-ArrowDown",run:mZ},{key:"Mod-Alt-ArrowUp",run:rZ},{key:"Mod-Alt-ArrowDown",run:iZ},{key:"Escape",run:aZ},{key:"Mod-Enter",run:yZ},{key:"Alt-l",mac:"Ctrl-l",run:tZ},{key:"Mod-i",run:nZ,preventDefault:!0},{key:"Mod-[",run:z3},{key:"Mod-]",run:B3},{key:"Mod-Alt-\\",run:bZ},{key:"Shift-Mod-k",run:gZ},{key:"Shift-Mod-\\",run:FG},{key:"Mod-/",run:hG},{key:"Alt-A",run:pG},{key:"Ctrl-m",mac:"Shift-Alt-m",run:xZ}].concat(wZ),AZ={key:"Tab",run:B3,shift:z3},ZP=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Xu{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(ZP(s)):ZP,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 ar(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=pO(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=qi(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"&&(Xu.prototype[Symbol.iterator]=function(){return this});const $3={from:-1,to:-1,match:/.*/.exec(""),precise:!0},HO="gm"+(/x/.unicode==null?"":"u");class U3{constructor(t,n,r,i=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=$3,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new H3(t,n,r,i,a);this.re=new RegExp(n,HO+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let l=t.lineAt(i);this.curLineStart=l.from,this.matchPos=pg(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=pg(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 Ix=new WeakMap;class Nu{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let i=Ix.get(t);if(!i||i.from>=r||i.to<=n){let s=new Nu(n,t.sliceString(n,r));return Ix.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)),Ix.set(t,new Nu(l,a)),new Nu(n,a.slice(n-l,r-l))}}class H3{constructor(t,n,r,i,a){this.text=t,this.to=a,this.done=!1,this.value=$3,this.matchPos=pg(t,i),this.re=new RegExp(n,HO+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Nu.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=pg(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Nu.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(U3.prototype[Symbol.iterator]=H3.prototype[Symbol.iterator]=function(){return this});function kZ(e){try{return new RegExp(e,HO),!0}catch{return!1}}function pg(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 CZ=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=WX(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=te.cursor(y.from+Math.max(0,Math.min(g,y.length)));e.dispatch({effects:[r,de.scrollIntoView(x.from,{y:"center"})],selection:x})}),!0},EZ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},TZ=me.define({combine(e){return ua(e,EZ,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function MZ(e){return[RZ,NZ]}const PZ=Ce.mark({class:"cm-selectionMatch"}),DZ=Ce.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function JP(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=At.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=At.Word)}function _Z(e,t,n,r){return e(t.sliceDoc(n,n+1))==At.Word&&e(t.sliceDoc(r-1,r))==At.Word}const NZ=Rt.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(TZ),{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),!(JP(l,n,i.from,i.to)&&_Z(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 Xu(n.doc,a,c.from,c.to);for(;!f.next().done;){let{from:d,to:p}=f.value;if((!l||JP(l,n,d,p))&&(i.empty&&d<=i.from&&p>=i.to?s.push(DZ.range(d,p)):(d>=i.to||p<=i.from)&&s.push(PZ.range(d,p)),s.length>t.maxMatches))return Ce.none}}return Ce.set(s)}},{decorations:e=>e.decorations}),RZ=de.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),LZ=({state:e,dispatch:t})=>{let{selection:n}=e,r=te.create(n.ranges.map(i=>e.wordAt(i.head)||te.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function jZ(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 Xu(e.doc,t,r[r.length-1].to);;)if(s.next(),s.done){if(l)return null;s=new Xu(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 IZ=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return LZ({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=jZ(e,r);return i?(t(e.update({selection:e.selection.addRange(te.range(i.from,i.to),!1),effects:de.scrollIntoView(i.to)})),!0):!1},dc=me.define({combine(e){return ua(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new GZ(t),scrollToMatch:t=>de.scrollIntoView(t)})}});class F3{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||kZ(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"?`
|
|
72
|
+
`: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 FZ(this):new $Z(this)}getCursor(t,n=0,r){let i=t.doc?t:qe.create({doc:t});return r==null&&(r=i.doc.length),this.regexp?gu(this,i,n,r):mu(this,i,n,r)}}class q3{constructor(t){this.spec=t}}function BZ(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 mu(e,t,n,r){let i;return e.wholeWord&&(i=zZ(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=BZ(e.test,t,i)),new Xu(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:a=>a.toLowerCase(),i)}function zZ(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(mg(i,n-a))!=At.Word||t(gg(i,n-a))!=At.Word)&&(t(gg(i,r-a))!=At.Word||t(mg(i,r-a))!=At.Word))}class $Z extends q3{constructor(t){super(t)}nextMatch(t,n,r){let i=mu(this.spec,t,r,t.doc.length).nextOverlapping();if(i.done){let a=Math.min(t.doc.length,n+this.spec.unquoted.length);i=mu(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=mu(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=mu(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=mu(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 UZ(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function gu(e,t,n,r){let i;return e.wholeWord&&(i=HZ(t.charCategorizer(t.selection.main.head))),e.test&&(i=UZ(e.test,t,i)),new U3(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function mg(e,t){return e.slice(sn(e,t,!1),t)}function gg(e,t){return e.slice(t,sn(e,t))}function HZ(e){return(t,n,r)=>!r[0].length||(e(mg(r.input,r.index))!=At.Word||e(gg(r.input,r.index))!=At.Word)&&(e(gg(r.input,r.index+r[0].length))!=At.Word||e(mg(r.input,r.index+r[0].length))!=At.Word)}class FZ extends q3{nextMatch(t,n,r){let i=gu(this.spec,t,r,t.doc.length).next();return i.done&&(i=gu(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=gu(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=gu(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=gu(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 bh=Ne.define(),FO=Ne.define(),ql=jn.define({create(e){return new Bx($S(e).create(),null)},update(e,t){for(let n of t.effects)n.is(bh)?e=new Bx(n.value.create(),e.panel):n.is(FO)&&(e=new Bx(e.query,n.value?qO:null));return e},provide:e=>mh.from(e,t=>t.panel)});class Bx{constructor(t,n){this.query=t,this.panel=n}}const qZ=Ce.mark({class:"cm-searchMatch"}),WZ=Ce.mark({class:"cm-searchMatch cm-searchMatch-selected"}),KZ=Rt.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(ql))}update(e){let t=e.state.field(ql);(t!=e.startState.field(ql)||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 Wa;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?WZ:qZ)})}return r.finish()}},{decorations:e=>e.decorations});function Vh(e){return t=>{let n=t.state.field(ql,!1);return n&&n.query.spec.valid?e(t,n):V3(t)}}const vg=Vh((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=te.single(r.from,r.to),a=e.state.facet(dc);return e.dispatch({selection:i,effects:[WO(e,r),a.scrollToMatch(i.main,e)],userEvent:"select.search"}),K3(e),!0}),yg=Vh((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=te.single(i.from,i.to),l=e.state.facet(dc);return e.dispatch({selection:a,effects:[WO(e,i),l.scrollToMatch(a.main,e)],userEvent:"select.search"}),K3(e),!0}),VZ=Vh((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:te.create(n.map(r=>te.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),QZ=({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 Xu(e.doc,e.sliceDoc(r,i));!s.next().done;){if(a.length>1e3)return!1;s.value.from==r&&(l=a.length),a.push(te.range(s.value.from,s.value.to))}return t(e.update({selection:te.create(a,l),userEvent:"select.search.matches"})),!0},eD=Vh((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=te.single(l.from,l.to).map(p),d.push(WO(e,l)),d.push(n.facet(dc).scrollToMatch(c.main,e))),e.dispatch({changes:p,selection:c,effects:d,userEvent:"input.replace"}),!0}),XZ=Vh((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 $S(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 F3({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 W3(e){let t=_O(e,qO);return t&&t.dom.querySelector("[main-field]")}function K3(e){let t=W3(e);t&&t==e.root.activeElement&&t.select()}const V3=e=>{let t=e.state.field(ql,!1);if(t&&t.panel){let n=W3(e);if(n&&n!=e.root.activeElement){let r=$S(e.state,t.query.spec);r.valid&&e.dispatch({effects:bh.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[FO.of(!0),t?bh.of($S(e.state,t.query.spec)):Ne.appendConfig.of(JZ)]});return!0},Q3=e=>{let t=e.state.field(ql,!1);if(!t||!t.panel)return!1;let n=_O(e,qO);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:FO.of(!1)}),!0},YZ=[{key:"Mod-f",run:V3,scope:"editor search-panel"},{key:"F3",run:vg,shift:yg,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:vg,shift:yg,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Q3,scope:"editor search-panel"},{key:"Mod-Shift-l",run:QZ},{key:"Mod-Alt-g",run:CZ},{key:"Mod-d",run:IZ,preventDefault:!0}];class GZ{constructor(t){this.view=t;let n=this.query=t.state.field(ql).query.spec;this.commit=this.commit.bind(this),this.searchField=st("input",{value:n.search,placeholder:Ar(t,"Find"),"aria-label":Ar(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=st("input",{value:n.replace,placeholder:Ar(t,"Replace"),"aria-label":Ar(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=st("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=st("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=st("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,a,l){return st("button",{class:"cm-button",name:i,onclick:a,type:"button"},l)}this.dom=st("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>vg(t),[Ar(t,"next")]),r("prev",()=>yg(t),[Ar(t,"previous")]),r("select",()=>VZ(t),[Ar(t,"all")]),st("label",null,[this.caseField,Ar(t,"match case")]),st("label",null,[this.reField,Ar(t,"regexp")]),st("label",null,[this.wordField,Ar(t,"by word")]),...t.state.readOnly?[]:[st("br"),this.replaceField,r("replace",()=>eD(t),[Ar(t,"replace")]),r("replaceAll",()=>XZ(t),[Ar(t,"replace all")])],st("button",{name:"close",onclick:()=>Q3(t),"aria-label":Ar(t,"close"),type:"button"},["×"])])}commit(){let t=new F3({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:bh.of(t)}))}keydown(t){eX(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?yg:vg)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),eD(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(bh)&&!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 Ar(e,t){return e.state.phrase(t)}const tm=30,nm=/[\s\.,:;?!]/;function WO(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-tm),l=Math.min(i,n+tm),s=e.state.sliceDoc(a,l);if(a!=r.from){for(let c=0;c<tm;c++)if(!nm.test(s[c+1])&&nm.test(s[c])){s=s.slice(c);break}}if(l!=i){for(let c=s.length-1;c>s.length-tm;c--)if(!nm.test(s[c-1])&&nm.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 ZZ=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"}}),JZ=[ql,ps.low(KZ),ZZ];class X3{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=Rn(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(Y3(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 tD(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 eJ(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=tD(t)+tD(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function tJ(e){let t=e.map(i=>typeof i=="string"?{label:i}:i),[n,r]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:eJ(t);return i=>{let a=i.matchBefore(r);return a||i.explicit?{from:a?a.from:i.pos,options:t,validFor:n}:null}}class nD{constructor(t,n,r,i){this.completion=t,this.source=n,this.match=r,this.score=i}}function Go(e){return e.selection.main.from}function Y3(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 G3=sa.define();function nJ(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:te.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const rD=new WeakMap;function rJ(e){if(!Array.isArray(e))return e;let t=rD.get(e);return t||rD.set(e,t=tJ(e)),t}const bg=Ne.define(),xh=Ne.define();class iJ{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=ar(t,n),i=qi(r);this.chars.push(r);let a=t.slice(n,n+i),l=a.toUpperCase();this.folded.push(ar(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=ar(t,0),k=qi(C),M=k==t.length?0:-100;if(C!=n[0])if(C==r[0])M+=-200;else return null;return this.ret(M,[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 M=ar(t,C);(M==n[f]||M==r[f])&&(i[f++]=C),C+=qi(M)}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),M=0;C<k&&p<c;){let D=ar(t,C);s<0&&(d<c&&D==n[d]&&(a[d++]=C),v<c&&(D==n[v]||D==r[v]?(v==0&&(y=C),x=C+1,v++):v=0));let P,N=D<255?D>=48&&D<=57||D>=97&&D<=122?2:D>=65&&D<=90?1:0:(P=pO(D))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!C||N==1&&w||M==0&&N!=0)&&(n[p]==D||r[p]==D&&(g=!0)?l[p++]=C:l.length&&(A=!1)),M=N,C+=qi(D)}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?qi(ar(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 aJ{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 on=me.define({combine(e){return ua(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:lJ,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=>iD(t(r),n(r)),optionClass:(t,n)=>r=>iD(t(r),n(r)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function iD(e,t){return e?t?e+" "+t:e:t}function lJ(e,t,n,r,i,a){let l=e.textDirection==ht.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 KO=Ne.define();function oJ(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 zx(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 sJ{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(on);this.optionContent=oJ(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=zx(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:KO.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let f=t.state.field(this.stateField,!1);f&&f.tooltip&&t.state.facet(on).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:xh.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=zx(a.length,l,t.state.facet(on).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=zx(n.options.length,n.selected,this.view.state.facet(on).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=>sr(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&&cJ(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(on).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 uJ(e,t){return n=>new sJ(n,e,t)}function cJ(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 aD(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function fJ(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(on);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 nD(g,d.source,p?p(g):[],1e9-n.length));else{let g=t.sliceDoc(d.from,d.to),v,y=l.filterStrict?new aJ(g):new iJ(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 nD(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):aD(d.completion)>aD(c)&&(s[s.length-1]=d),c=d.completion}return s}class wu{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 wu(this.options,lD(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=fJ(t,n);if(!s.length)return i&&t.some(f=>f.isPending)?i.setDisabled():null;let c=n.facet(on).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 wu(s,lD(r,c),{pos:t.reduce((f,d)=>d.hasResult()?Math.min(f,d.from):f,1e8),create:vJ,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new wu(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new wu(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class xg{constructor(t,n,r){this.active=t,this.id=n,this.open=r}static start(){return new xg(mJ,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(on),a=(r.override||n.languageDataAt("autocomplete",Go(n)).map(rJ)).map(c=>(this.active.find(d=>d.source==c)||new Gr(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(VO));l&&t.docChanged&&(l=l.map(t.changes)),t.selection||a.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!hJ(a,this.active)||s?l=wu.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 Gr(c.source,0):c));for(let c of t.effects)c.is(KO)&&(l=l&&l.setSelected(c.value,this.id));return a==this.active&&l==this.open?this:new xg(a,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?dJ:pJ}}function hJ(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 dJ={"aria-autocomplete":"list"},pJ={};function lD(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const mJ=[];function Z3(e,t){if(e.isUserEvent("input.complete")){let r=e.annotation(G3);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 Gr{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=Z3(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new Gr(i.source,0)),r&4&&i.state==0&&(i=new Gr(this.source,1)),i=i.updateFor(t,r);for(let a of t.effects)if(a.is(bg))i=new Gr(i.source,1,a.value);else if(a.is(xh))i=new Gr(i.source,0);else if(a.is(VO))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(Go(t.state))}}class Ru extends Gr{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=Go(t.state);if(s>l||!i||n&2&&(Go(t.startState)==this.from||s<this.limit))return new Gr(this.source,n&4?1:0);let c=t.changes.mapPos(this.limit);return gJ(i.validFor,t.state,a,l)?new Ru(this.source,this.explicit,c,i,a,l):i.update&&(i=i.update(i,a,l,new X3(t.state,s,!1)))?new Ru(this.source,this.explicit,c,i,i.from,(r=i.to)!==null&&r!==void 0?r:Go(t.state)):new Gr(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 Ru(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new Gr(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function gJ(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e=="function"?e(i,n,r,t):Y3(e,!0).test(i)}const VO=Ne.define({map(e,t){return e.map(n=>n.map(t))}}),lr=jn.define({create(){return xg.start()},update(e,t){return e.update(t)},provide:e=>[DO.from(e,t=>t.tooltip),de.contentAttributes.from(e,t=>t.attrs)]});function QO(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(lr).active.find(i=>i.source==t.source);return r instanceof Ru?(typeof n=="string"?e.dispatch({...nJ(e.state,n,r.from,r.to),annotations:G3.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}const vJ=uJ(lr,QO);function rm(e,t="option"){return n=>{let r=n.state.field(lr,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(on).interactionDelay)return!1;let i=1,a;t=="page"&&(a=PB(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:KO.of(s)}),!0}}const yJ=e=>{let t=e.state.field(lr,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(on).interactionDelay?!1:QO(e,t.open.options[t.open.selected])},$x=e=>e.state.field(lr,!1)?(e.dispatch({effects:bg.of(!0)}),!0):!1,bJ=e=>{let t=e.state.field(lr,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:xh.of(null)}),!0)};class xJ{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const SJ=50,wJ=1e3,OJ=Rt.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(lr).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(lr),n=e.state.facet(on);if(!e.selectionSet&&!e.docChanged&&e.startState.field(lr)==t)return;let r=e.transactions.some(a=>{let l=Z3(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>SJ&&Date.now()-l.time>wJ){for(let s of l.context.abortListeners)try{s()}catch(c){sr(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(bg)))&&(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(lr);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(on).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Go(t),r=new X3(t,n,e.explicit,this.view),i=new xJ(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:xh.of(null)}),sr(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(on).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(on),r=this.view.state.field(lr);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=Go(a.updates.length?a.updates[0].startState:this.view.state),c=Math.min(s,a.done.from+(a.active.explicit?0:1)),f=new Ru(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 Gr(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:VO.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(lr,!1);if(t&&t.tooltip&&this.view.state.facet(on).closeOnBlur){let n=t.open&&PB(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:xh.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:bg.of(!1)}),20),this.composing=0}}}),AJ=typeof navigator=="object"&&/Win/.test(navigator.platform),kJ=ps.highest(de.domEventHandlers({keydown(e,t){let n=t.state.field(lr,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(AJ&&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&&QO(t,r),!1}})),CJ=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"}}}),Sh={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ho=Ne.define({map(e,t){let n=t.mapPos(e,-1,Vn.TrackAfter);return n??void 0}}),XO=new class extends Ql{};XO.startSide=1;XO.endSide=-1;const J3=jn.define({create(){return $e.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(Ho)&&(e=e.update({add:[XO.range(n.value,n.value+1)]}));return e}});function EJ(){return[MJ,J3]}const Ux="()[]{}<>«»»«[]{}";function ez(e){for(let t=0;t<Ux.length;t+=2)if(Ux.charCodeAt(t)==e)return Ux.charAt(t+1);return pO(e<128?e:e+1)}function tz(e,t){return e.languageDataAt("closeBrackets",t)[0]||Sh}const TJ=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),MJ=de.inputHandler.of((e,t,n,r)=>{if((TJ?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&qi(ar(r,0))==1||t!=i.from||n!=i.to)return!1;let a=_J(e.state,r);return a?(e.dispatch(a),!0):!1}),PJ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=tz(e,e.selection.main.head).brackets||Sh.brackets,i=null,a=e.changeByRange(l=>{if(l.empty){let s=NJ(e.doc,l.head);for(let c of r)if(c==s&&qv(e.doc,l.head)==ez(ar(c,0)))return{changes:{from:l.head-c.length,to:l.head+c.length},range:te.cursor(l.head-c.length)}}return{range:i=l}});return i||t(e.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},DJ=[{key:"Backspace",run:PJ}];function _J(e,t){let n=tz(e,e.selection.main.head),r=n.brackets||Sh.brackets;for(let i of r){let a=ez(ar(i,0));if(t==i)return a==i?jJ(e,i,r.indexOf(i+i+i)>-1,n):RJ(e,i,a,n.before||Sh.before);if(t==a&&nz(e,e.selection.main.from))return LJ(e,i,a)}return null}function nz(e,t){let n=!1;return e.field(J3).between(0,e.doc.length,r=>{r==t&&(n=!0)}),n}function qv(e,t){let n=e.sliceString(t,t+2);return n.slice(0,qi(ar(n,0)))}function NJ(e,t){let n=e.sliceString(t-2,t);return qi(ar(n,0))==n.length?n:n.slice(1)}function RJ(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:Ho.of(l.to+t.length),range:te.range(l.anchor+t.length,l.head+t.length)};let s=qv(e.doc,l.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:l.head},effects:Ho.of(l.head+t.length),range:te.cursor(l.head+t.length)}:{range:i=l}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function LJ(e,t,n){let r=null,i=e.changeByRange(a=>a.empty&&qv(e.doc,a.head)==n?{changes:{from:a.head,to:a.head+n.length,insert:n},range:te.cursor(a.head+n.length)}:r={range:a});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function jJ(e,t,n,r){let i=r.stringPrefixes||Sh.stringPrefixes,a=null,l=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:t,from:s.to}],effects:Ho.of(s.to+t.length),range:te.range(s.anchor+t.length,s.head+t.length)};let c=s.head,f=qv(e.doc,c),d;if(f==t){if(oD(e,c))return{changes:{insert:t+t,from:c},effects:Ho.of(c+t.length),range:te.cursor(c+t.length)};if(nz(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:te.cursor(c+g.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=sD(e,c-2*t.length,i))>-1&&oD(e,d))return{changes:{insert:t+t+t+t,from:c},effects:Ho.of(c+t.length),range:te.cursor(c+t.length)};if(e.charCategorizer(c)(f)!=At.Word&&sD(e,c,i)>-1&&!IJ(e,c,t,i))return{changes:{insert:t+t,from:c},effects:Ho.of(c+t.length),range:te.cursor(c+t.length)}}return{range:a=s}});return a?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function oD(e,t){let n=Rn(e).resolveInner(t+1);return n.parent&&n.from==t}function IJ(e,t,n,r){let i=Rn(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 sD(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=At.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))!=At.Word)return a}return-1}function BJ(e={}){return[kJ,lr,on.of(e),OJ,zJ,CJ]}const rz=[{key:"Ctrl-Space",run:$x},{mac:"Alt-`",run:$x},{mac:"Alt-i",run:$x},{key:"Escape",run:bJ},{key:"ArrowDown",run:rm(!0)},{key:"ArrowUp",run:rm(!1)},{key:"PageDown",run:rm(!0,"page")},{key:"PageUp",run:rm(!1,"page")},{key:"Enter",run:yJ}],zJ=ps.highest(Lv.computeN([on],e=>e.facet(on).defaultKeymap?[rz]:[]));class uD{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class Io{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let i=r.facet(wh).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((v,y)=>v.from-y.from||v.to-y.to),l=new Wa,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,M)=>Math.min(k,M.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 M=x;;){if(M>=w){A=!0;break}if(!f.lineBreak&&d+f.value.length>M)break;M=d+f.value.length,d+=f.value.length,f.next()}}let C=ZJ(s);if(A)l.add(x,x,Ce.widget({widget:new QJ(C),diagnostics:s.slice()}));else{let k=s.reduce((M,D)=>D.markClass?M+" "+D.markClass:M,"");l.add(x,w,Ce.mark({class:"cm-lintRange cm-lintRange-"+C+k,diagnostics:s.slice(),inclusiveEnd:s.some(M=>M.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 Io(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 uD(i,a,t||l.diagnostics[0]);else{if(l.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new uD(r.from,a,r.diagnostic)}}),r}function $J(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(wh).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(l=>l.is(iz))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function UJ(e,t){return e.field(Mr,!1)?t:t.concat(Ne.appendConfig.of(JJ))}const iz=Ne.define(),YO=Ne.define(),az=Ne.define(),Mr=jn.define({create(){return new Io(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(wh).autoPanel&&(i=null),e=new Io(n,i,r)}for(let n of t.effects)if(n.is(iz)){let r=t.state.facet(wh).autoPanel?n.value.length?Oh.open:null:e.panel;e=Io.init(n.value,r,t.state)}else n.is(YO)?e=new Io(e.diagnostics,n.value?Oh.open:null,e.selected):n.is(az)&&(e=new Io(e.diagnostics,e.panel,n.value));return e},provide:e=>[mh.from(e,t=>t.panel),de.decorations.from(e,t=>t.diagnostics)]}),HJ=Ce.mark({class:"cm-lintRange cm-lintRange-active"});function FJ(e,t,n){let{diagnostics:r}=e.state.field(Mr),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(wh).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:l,above:!0,create(){return{dom:qJ(e,i)}}}:null}function qJ(e,t){return st("ul",{class:"cm-tooltip-lint"},t.map(n=>oz(e,n,!1)))}const WJ=e=>{let t=e.state.field(Mr,!1);(!t||!t.panel)&&e.dispatch({effects:UJ(e.state,[YO.of(!0)])});let n=_O(e,Oh.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},cD=e=>{let t=e.state.field(Mr,!1);return!t||!t.panel?!1:(e.dispatch({effects:YO.of(!1)}),!0)},KJ=e=>{let t=e.state.field(Mr,!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}),FX(e,r.from,1,{tooltip:sz,until:i=>i.docChanged||i.newSelection.main.head<r.from||i.newSelection.main.head>r.to}),!0)},VJ=[{key:"Mod-Shift-m",run:WJ,preventDefault:!0},{key:"F8",run:KJ}],wh=me.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...ua(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:fD,tooltipFilter:fD,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 fD(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function lz(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 oz(e,t,n){var r;let i=n?lz(t.actions):[];return st("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},st("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(Mr).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),st("u",f.slice(d,d+1)),f.slice(d+1)],g=a.markClass?" "+a.markClass:"";return st("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${f}${d<0?"":` (access key "${i[l]})"`}.`},p)}),t.source&&st("div",{class:"cm-diagnosticSource"},t.source))}class QJ extends ca{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return st("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class hD{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=oz(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Oh{constructor(t){this.view=t,this.items=[];let n=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)cD(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=lz(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(Mr).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=st("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=st("div",{class:"cm-panel-lint"},this.list,st("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>cD(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Mr).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(Mr),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 hD(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 hD(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(Mr),r=eo(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:az.of(r)})}static open(t){return new Oh(t)}}function XJ(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 im(e){return XJ(`<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 YJ=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:im("#f11")},".cm-lintRange-warning":{backgroundImage:im("orange")},".cm-lintRange-info":{backgroundImage:im("#999")},".cm-lintRange-hint":{backgroundImage:im("#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 GJ(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function ZJ(e){let t="hint",n=1;for(let r of e){let i=GJ(r.severity);i>n&&(n=i,t=r.severity)}return t}const sz=HX(FJ,{hideOn:$J}),JJ=[Mr,de.decorations.compute([Mr],e=>{let{selected:t,panel:n}=e.field(Mr);return!t||!n||t.from==t.to?Ce.none:Ce.set([HJ.range(t.from,t.to)])}),sz,YJ];var dD=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(DJ)),t.defaultKeymap!==!1&&(a=a.concat(OZ)),t.searchKeymap!==!1&&(a=a.concat(YZ)),t.historyKeymap!==!1&&(a=a.concat(PG)),t.foldKeymap!==!1&&(a=a.concat(qY)),t.completionKeymap!==!1&&(a=a.concat(rz)),t.lintKeymap!==!1&&(a=a.concat(VJ));var l=[];return t.lineNumbers!==!1&&l.push(nY()),t.highlightActiveLineGutter!==!1&&l.push(aY()),t.highlightSpecialChars!==!1&&l.push(vX()),t.history!==!1&&l.push(SG()),t.foldGutter!==!1&&l.push(QY()),t.drawSelection!==!1&&l.push(lX()),t.dropCursor!==!1&&l.push(fX()),t.allowMultipleSelections!==!1&&l.push(qe.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&l.push(RY()),t.syntaxHighlighting!==!1&&l.push(r3(ZY,{fallback:!0})),t.bracketMatching!==!1&&l.push(aG()),t.closeBrackets!==!1&&l.push(EJ()),t.autocompletion!==!1&&l.push(BJ()),t.rectangularSelection!==!1&&l.push(DX()),i!==!1&&l.push(RX()),t.highlightActiveLine!==!1&&l.push(OX()),t.highlightSelectionMatches!==!1&&l.push(MZ()),t.tabSize&&typeof t.tabSize=="number"&&l.push(Iv.of(" ".repeat(t.tabSize))),l.concat([Lv.of(a.flat())]).filter(Boolean)};const eee="#e5c07b",pD="#e06c75",tee="#56b6c2",nee="#ffffff",Rm="#abb2bf",US="#7d8799",ree="#61afef",iee="#98c379",mD="#d19a66",aee="#c678dd",lee="#21252b",gD="#2c313a",vD="#282c34",Hx="#353a42",oee="#3E4451",yD="#528bff",see=de.theme({"&":{color:Rm,backgroundColor:vD},".cm-content":{caretColor:yD},".cm-cursor, .cm-dropCursor":{borderLeftColor:yD},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:oee},".cm-panels":{backgroundColor:lee,color:Rm},".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:vD,color:US,border:"none"},".cm-activeLineGutter":{backgroundColor:gD},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Hx},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Hx,borderBottomColor:Hx},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:gD,color:Rm}}},{dark:!0}),uee=Wh.define([{tag:G.keyword,color:aee},{tag:[G.name,G.deleted,G.character,G.propertyName,G.macroName],color:pD},{tag:[G.function(G.variableName),G.labelName],color:ree},{tag:[G.color,G.constant(G.name),G.standard(G.name)],color:mD},{tag:[G.definition(G.name),G.separator],color:Rm},{tag:[G.typeName,G.className,G.number,G.changed,G.annotation,G.modifier,G.self,G.namespace],color:eee},{tag:[G.operator,G.operatorKeyword,G.url,G.escape,G.regexp,G.link,G.special(G.string)],color:tee},{tag:[G.meta,G.comment],color:US},{tag:G.strong,fontWeight:"bold"},{tag:G.emphasis,fontStyle:"italic"},{tag:G.strikethrough,textDecoration:"line-through"},{tag:G.link,color:US,textDecoration:"underline"},{tag:G.heading,fontWeight:"bold",color:pD},{tag:[G.atom,G.bool,G.special(G.variableName)],color:mD},{tag:[G.processingInstruction,G.string,G.inserted],color:iee},{tag:G.invalid,color:nee}]),cee=[see,r3(uee)];var fee=de.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),hee=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(Lv.of([AZ])),y&&(typeof y=="boolean"?x.unshift(dD()):x.unshift(dD(y))),g&&x.unshift(EX(g)),d){case"light":x.push(fee);break;case"dark":x.push(cee);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]},dee=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 pee{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 bD{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 Fx=null,mee=()=>typeof window>"u"?new bD:(Fx||(Fx=new bD),Fx),xD=sa.define(),gee=200,vee=[];function yee(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?vee: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,M=e.minWidth,D=M===void 0?null:M,P=e.maxWidth,N=P===void 0?null:P,j=e.placeholder,U=j===void 0?"":j,V=e.editable,K=V===void 0?!0:V,B=e.readOnly,oe=B===void 0?!1:B,ie=e.indentWithTab,ue=ie===void 0?!0:ie,z=e.basicSetup,Z=z===void 0?!0:z,ae=e.root,Q=e.initialState,le=O.useState(),R=le[0],F=le[1],ee=O.useState(),se=ee[0],ge=ee[1],Oe=O.useState(),Pe=Oe[0],gt=Oe[1],ce=O.useState(()=>({current:null}))[0],Te=O.useState(()=>({current:null}))[0],Ee=de.theme({"&":{height:v,minHeight:x,maxHeight:A,width:k,minWidth:D,maxWidth:N},"& .cm-scroller":{height:"100% !important"}}),fe=de.updateListener.of(xe=>{if(xe.docChanged&&typeof r=="function"&&!xe.transactions.some(ha=>ha.annotation(xD))){ce.current?ce.current.reset():(ce.current=new pee(()=>{if(Te.current){var ha=Te.current;Te.current=null,ha()}ce.current=null},gee),mee().add(ce.current));var vt=xe.state.doc,pn=vt.toString();r(pn,xe)}i&&i(dee(xe))}),Lt=hee({theme:p,editable:K,readOnly:oe,placeholder:U,indentWithTab:ue,basicSetup:Z}),Re=[fe,Ee,...Lt];return l&&typeof l=="function"&&Re.push(de.updateListener.of(l)),Re=Re.concat(c),O.useLayoutEffect(()=>{if(R&&!Pe){var xe={doc:t,selection:n,extensions:Re},vt=Q?qe.fromJSON(Q.json,xe,Q.fields):qe.create(xe);if(gt(vt),!se){var pn=new de({state:vt,parent:R,root:ae});ge(pn),a&&a(pn,vt)}}return()=>{se&&(gt(void 0),ge(void 0))}},[R,Pe]),O.useEffect(()=>{e.container&&F(e.container)},[e.container]),O.useEffect(()=>()=>{se&&(se.destroy(),ge(void 0)),ce.current&&(ce.current.cancel(),ce.current=null)},[se]),O.useEffect(()=>{f&&se&&se.focus()},[f,se]),O.useEffect(()=>{se&&se.dispatch({effects:Ne.reconfigure.of(Re)})},[p,c,v,x,A,k,D,N,U,K,oe,ue,Z,r,l]),O.useEffect(()=>{if(t!==void 0){var xe=se?se.state.doc.toString():"";if(se&&t!==xe){var vt=ce.current&&!ce.current.isDone,pn=()=>{se&&t!==se.state.doc.toString()&&se.dispatch({changes:{from:0,to:se.state.doc.toString().length,insert:t||""},annotations:[xD.of(!0)]})};vt?Te.current=pn:pn()}}},[t,se]),{state:Pe,setState:gt,view:se,setView:ge,container:R,setContainer:F}}var bee=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],uz=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,M=e.maxWidth,D=e.basicSetup,P=e.placeholder,N=e.indentWithTab,j=e.editable,U=e.readOnly,V=e.root,K=e.initialState,B=VV(e,bee),oe=O.useRef(null),ie=yee({root:V,value:i,autoFocus:g,theme:y,height:x,minHeight:w,maxHeight:A,width:C,minWidth:k,maxWidth:M,basicSetup:D,placeholder:P,indentWithTab:N,editable:j,readOnly:U,selection:a,onChange:c,onStatistics:f,onCreateEditor:d,onUpdate:p,extensions:s,initialState:K}),ue=ie.state,z=ie.view,Z=ie.container,ae=ie.setContainer;O.useImperativeHandle(t,()=>({editor:oe.current,state:ue,view:z}),[oe,Z,ue,z]);var Q=O.useCallback(R=>{oe.current=R,ae(R)},[ae]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var le=typeof y=="string"?"cm-theme-"+y:"cm-theme";return T.jsx("div",V1({ref:Q,className:""+le+(n?" "+n:"")},B))});uz.displayName="CodeMirror";var SD={};class Sg{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 Sg(t,[],n,r,r,0,[],0,i?new wD(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 Sg(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 xee(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 wD(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 wD{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class xee{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 wg{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 wg(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 wg(this.stack,this.pos,this.index)}}function am(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 Lm{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const OD=new Lm;class See{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=OD,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=OD,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;wee(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 Wv{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function wee(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||Oee(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 AD(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function Oee(e,t,n,r){let i=AD(n,r,t);return i<0||AD(n,r,e)<i}const kr=typeof process<"u"&&SD&&/\bparse\b/.test(SD.LOG);let qx=null;function kD(e,t,n){let r=e.cursor(_t.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 Aee{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?kD(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?kD(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 zt){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 kee{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(r=>new Lm)}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 Lm,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 Lm,{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=_a(s,f+2);else{i==0&&s[f+1]==2&&(i=this.putAction(_a(s,f+2),n,r,i));break}s[f]==n&&(i=this.putAction(_a(s,f+1),n,r,i))}return i}}class Cee{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 See(n,i),this.tokens=new kee(t,this.stream),this.topTerm=t.top[1];let{from:a}=i[0];this.stacks=[Sg.start(this,t.top[0],a)],this.fragments=r.length&&this.stream.end-a>t.bufferLength*4?new Aee(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&&Mee(i);if(l)return kr&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw kr&&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 kr&&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=kr?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),kr&&console.log(l+this.stackID(t)+` (via reuse of ${a.getName(p.type.id)})`),!0;if(!(p instanceof zt)||p.children.length==0||p.positions[0]>0)break;let v=p.children[0];if(v instanceof zt&&p.positions[0]==0)p=v;else break}}let s=a.stateSlot(t.state,4);if(s>0)return t.reduce(s),kr&&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),kr&&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 CD(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=kr?this.stackID(s)+" -> ":"";if(s.deadEnd&&(a||(a=!0,s.restart(),kr&&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()&&(kr&&console.log(g+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,r));v++)kr&&(g=this.stackID(p)+" -> ");for(let v of s.recoverByInsert(c))kr&&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),kr&&console.log(d+this.stackID(s)+` (via recover-delete ${this.parser.getName(c)})`),CD(s,r)):(!i||i.score<p.score)&&(i=p)}return i}stackToTree(t){return t.close(),zt.build({buffer:wg.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=(qx||(qx=new WeakMap)).get(t);return n||qx.set(t,n=String.fromCodePoint(this.nextStackID++)),n+t}}function CD(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 Eee{constructor(t,n,r){this.source=t,this.flags=n,this.disabled=r}allows(t){return!this.disabled||this.disabled[t]==0}}const Wx=e=>e;class Tee{constructor(t){this.start=t.start,this.shift=t.shift||Wx,this.reduce=t.reduce||Wx,this.reuse=t.reuse||Wx,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class Og extends $B{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 NO(n.map((s,c)=>dr.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=jB;let l=am(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(ED),this.states=am(t.states,Uint32Array),this.data=am(t.stateData),this.goto=am(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 Cee(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=_a(r,a+2)];else{if(r[a+1]==2)return _a(r,a+2);break}if(l==n||l==0)return _a(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=_a(this.data,a+2);else break;i=n(_a(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=_a(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(Og.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]=ED(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 Eee(t,r,i)}static deserialize(t){return new Og(t)}}function _a(e,t){return e[t]|e[t+1]<<16}function Mee(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 ED(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}const vu=63,TD=64,Pee=1,Dee=2,cz=3,_ee=4,fz=5,Nee=6,Ree=7,hz=65,Lee=66,jee=8,Iee=9,Bee=10,zee=11,$ee=12,dz=13,Uee=19,Hee=20,Fee=29,qee=33,Wee=34,Kee=47,Vee=0,GO=1,HS=2,Ah=3,FS=4;class Bo{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}}Bo.top=new Bo(null,-1,Vee);function th(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let i=e.peek(r);if(Qa(i)||i==-1)return n}}function qS(e){return e==32||e==9}function Qa(e){return e==10||e==13}function pz(e){return qS(e)||Qa(e)}function Fo(e){return e<0||pz(e)}const Qee=new Tee({start:Bo.top,reduce(e,t){return e.type==Ah&&(t==Hee||t==Wee)?e.parent:e},shift(e,t,n,r){if(t==cz)return new Bo(e,th(r,r.pos),GO);if(t==hz||t==fz)return new Bo(e,th(r,r.pos),HS);if(t==vu)return e.parent;if(t==Uee||t==qee)return new Bo(e,0,Ah);if(t==dz&&e.type==FS)return e.parent;if(t==Kee){let i=/[1-9]/.exec(r.read(r.pos,n.pos));if(i)return new Bo(e,e.depth+ +i[0],FS)}return e},hash(e){return e.hash}});function Yu(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Fo(e.peek(n+3))}const Xee=new Wv((e,t)=>{if(e.next==-1&&t.canShift(TD))return e.acceptToken(TD);let n=e.peek(-1);if((Qa(n)||n<0)&&t.context.type!=Ah){if(Yu(e,45))if(t.canShift(vu))e.acceptToken(vu);else return e.acceptToken(Pee,3);if(Yu(e,46))if(t.canShift(vu))e.acceptToken(vu);else return e.acceptToken(Dee,3);let r=0;for(;e.next==32;)r++,e.advance();(r<t.context.depth||r==t.context.depth&&t.context.type==GO&&(e.next!=45||!Fo(e.peek(1))))&&e.next!=-1&&!Qa(e.next)&&e.next!=35&&e.acceptToken(vu,-r)}},{contextual:!0}),Yee=new Wv((e,t)=>{if(t.context.type==Ah){e.next==63&&(e.advance(),Fo(e.next)&&e.acceptToken(Ree));return}if(e.next==45)e.advance(),Fo(e.next)&&e.acceptToken(t.context.type==GO&&t.context.depth==th(e,e.pos-1)?_ee:cz);else if(e.next==63)e.advance(),Fo(e.next)&&e.acceptToken(t.context.type==HS&&t.context.depth==th(e,e.pos-1)?Nee:fz);else{let n=e.pos;for(;;)if(qS(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)mz(e);else if(e.next==38)WS(e);else if(e.next==42){WS(e);break}else if(e.next==39||e.next==34){if(ZO(e,!0))break;return}else if(e.next==91||e.next==123){if(!Zee(e))return;break}else{gz(e,!0,!1,0);break}for(;qS(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(Fee))return;let r=e.peek(1);Fo(r)&&e.acceptTokenTo(t.context.type==HS&&t.context.depth==th(e,n)?Lee:hz,n)}}},{contextual:!0});function Gee(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 MD(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function PD(e,t){return e.next==37?(e.advance(),MD(e.next)&&e.advance(),MD(e.next)&&e.advance(),!0):Gee(e.next)||t&&e.next==44?(e.advance(),!0):!1}function mz(e){if(e.advance(),e.next==60){for(e.advance();;)if(!PD(e,!0)){e.next==62&&e.advance();break}}else for(;PD(e,!1););}function WS(e){for(e.advance();!Fo(e.next)&&Ag(e.next)!="f";)e.advance()}function ZO(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(Qa(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function Zee(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(!ZO(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||Qa(e.next))return!1;e.advance()}}const Jee="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function Ag(e){return e<33?"u":e>125?"s":Jee[e-33]}function Kx(e,t){let n=Ag(e);return n!="u"&&!(t&&n=="f")}function gz(e,t,n,r){if(Ag(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&Kx(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,l=0,s=r+1;for(;pz(a);){if(Qa(a)){if(t)return!1;s=0}else s++;a=e.peek(++l)}if(!(a>=0&&(a==58?Kx(e.peek(l+1),n):a==35?e.peek(l-1)!=32:Kx(a,n)))||!n&&s<=r||s==0&&!n&&(Yu(e,45,l)||Yu(e,46,l)))break;if(t&&Ag(a)=="f")return!1;for(let f=l;f>=0;f--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}const ete=new Wv((e,t)=>{if(e.next==33)mz(e),e.acceptToken($ee);else if(e.next==38||e.next==42){let n=e.next==38?Bee:zee;WS(e),e.acceptToken(n)}else e.next==39||e.next==34?(ZO(e,!1),e.acceptToken(Iee)):gz(e,!1,t.context.type==Ah,t.context.depth)&&e.acceptToken(jee)}),tte=new Wv((e,t)=>{let n=t.context.type==FS?t.context.depth:-1,r=e.pos;e:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(Yu(e,45,i)||Yu(e,46,i))||!Qa(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break e;let l=Qa(e.next);if(e.advance(),l)continue e;r=e.pos}}e.acceptTokenTo(dz,r)}),nte=UB({DirectiveName:G.keyword,DirectiveContent:G.attributeValue,"DirectiveEnd DocEnd":G.meta,QuotedLiteral:G.string,BlockLiteralHeader:G.special(G.string),BlockLiteralContent:G.content,Literal:G.content,"Key/Literal Key/QuotedLiteral":G.definition(G.propertyName),"Anchor Alias":G.labelName,Tag:G.typeName,Comment:G.lineComment,": , -":G.separator,"?":G.punctuation,"[ ]":G.squareBracket,"{ }":G.brace}),rte=Og.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:Qee,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[nte],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:[Xee,Yee,ete,tte,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),ite=sg.define({name:"yaml",parser:rte.configure({props:[WB.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:IP({closing:"}"}),FlowSequence:IP({closing:"]"})}),QB.add({"FlowMapping FlowSequence":jY,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function ate(){return new kY(ite)}function DD(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=Ih({mutationFn:async()=>{const y=await Et.validateConfig(r);if(!y.valid)throw new oh(400,y.error??"invalid config");if(e.mode==="create")return Et.createConfig(a,r);if(e.mode==="edit")return Et.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 T.jsxs("div",{className:"space-y-3",children:[e.mode==="create"&&T.jsxs("label",{className:"block text-sm",children:[T.jsx("span",{className:"mb-1 block text-xs uppercase tracking-wide text-ink-muted",children:"Filename"}),T.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&&T.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&&T.jsx("div",{className:"rounded-md border border-critical/50 bg-surface px-3 py-2 text-sm text-critical",children:s}),T.jsx("div",{className:"overflow-hidden rounded-md border border-edge",children:T.jsx(uz,{value:r,onChange:i,extensions:[ate()],editable:!v,theme:d?"dark":"light",minHeight:"240px",maxHeight:"560px"})}),!v&&T.jsxs("div",{className:"flex items-center gap-3",children:[T.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"&&T.jsx("button",{onClick:()=>e.onCancel?.(),className:"text-sm text-ink-muted hover:text-ink-secondary",children:"Cancel"}),e.mode==="edit"&&f&&T.jsx("span",{className:"text-xs text-ink-muted",children:"unsaved changes"}),T.jsxs("span",{className:"ml-auto text-xs text-ink-muted",children:["Secrets stay as ",T.jsx("code",{children:"${ENV_VAR}"})," placeholders — they are resolved only inside sync jobs."]})]})]})}function lte({runs:e,showConfig:t=!1,configNames:n}){return e.length===0?T.jsx("p",{className:"py-8 text-center text-sm text-ink-muted",children:"No runs yet."}):T.jsx("div",{className:"overflow-x-auto",children:T.jsxs("table",{className:"w-full text-sm",children:[T.jsx("thead",{children:T.jsxs("tr",{className:"border-b border-edge text-left text-xs uppercase tracking-wide text-ink-muted",children:[T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Run"}),t&&T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Config"}),T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Status"}),T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Trigger"}),T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Started"}),T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Duration"}),T.jsx("th",{className:"py-2 font-medium",children:"Detail"})]})}),T.jsx("tbody",{children:e.map(r=>T.jsxs("tr",{className:"border-b border-edge/60 hover:bg-ink/[0.03]",children:[T.jsx("td",{className:"py-2.5 pr-4",children:T.jsxs(yi,{to:`/runs/${r.id}`,className:"font-medium text-accent hover:underline",children:["#",r.id]})}),t&&T.jsx("td",{className:"py-2.5 pr-4",children:T.jsx(yi,{to:`/configs/${r.config_id}`,className:"hover:underline",children:n?.get(r.config_id)??r.config_name??`config ${r.config_id}`})}),T.jsx("td",{className:"py-2.5 pr-4",children:T.jsx(Ov,{status:r.status})}),T.jsxs("td",{className:"py-2.5 pr-4 text-ink-secondary",children:[r.trigger,r.requested_sources&&r.requested_sources.length>0&&T.jsxs("span",{className:"ml-1.5 rounded-full border border-edge px-1.5 py-0.5 text-xs text-ink-muted",title:`Selected sources: ${r.requested_sources.map(i=>`${i.product_name} (${i.type})`).join(", ")}`,children:[r.requested_sources.length," source",r.requested_sources.length>1?"s":""]})]}),T.jsx("td",{className:"py-2.5 pr-4 text-ink-secondary",children:qa(r.started_at??r.queued_at)}),T.jsx("td",{className:"py-2.5 pr-4 text-ink-secondary",children:r.status==="running"||r.status==="queued"?"…":rO(r.started_at,r.finished_at)}),T.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 vz(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=vz(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ut(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vz(e))&&(r&&(r+=" "),r+=t);return r}var ote=["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 JO(e){if(typeof e!="string")return!1;var t=ote;return t.includes(e)}var ste=["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"],ute=new Set(ste);function yz(e){return typeof e!="string"?!1:ute.has(e)}function bz(e){return typeof e=="string"&&e.startsWith("data-")}function Si(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(yz(n)||bz(n))&&(t[n]=e[n]);return t}function Qh(e){if(e==null)return null;if(O.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Si(t)}return typeof e=="object"&&!Array.isArray(e)?Si(e):null}function _r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(yz(n)||bz(n)||JO(n))&&(t[n]=e[n]);return t}function cte(e){return e==null?null:O.isValidElement(e)?_r(e.props):typeof e=="object"&&!Array.isArray(e)?_r(e):null}var fte=["children","width","height","viewBox","className","style","title","desc"];function KS(){return KS=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},KS.apply(null,arguments)}function hte(e,t){if(e==null)return{};var n,r,i=dte(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 dte(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 eA=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=hte(e,fte),p=a||{width:r,height:i,x:0,y:0},g=ut("recharts-surface",l);return O.createElement("svg",KS({},_r(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)}),pte=["children","className"];function VS(){return VS=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},VS.apply(null,arguments)}function mte(e,t){if(e==null)return{};var n,r,i=gte(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 gte(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 Nr=O.forwardRef((e,t)=>{var n=e.children,r=e.className,i=mte(e,pte),a=ut("recharts-layer",r);return O.createElement("g",VS({className:a},_r(i),{ref:t}),n)}),xz=O.createContext(null),vte=()=>O.useContext(xz);function pt(e){return function(){return e}}const Sz=Math.cos,kg=Math.sin,Ei=Math.sqrt,Cg=Math.PI,Kv=2*Cg,QS=Math.PI,XS=2*QS,Ro=1e-6,yte=XS-Ro;function wz(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function bte(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return wz;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 xte{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?wz:bte(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>Ro)if(!(Math.abs(p*c-f*d)>Ro)||!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((QS-Math.acos((x+g-w)/(2*A*C)))/2),M=k/C,D=k/A;Math.abs(M-1)>Ro&&this._append`L${t+M*d},${n+M*p}`,this._append`A${a},${a},0,0,${+(p*v>d*y)},${this._x1=t+D*c},${this._y1=n+D*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)>Ro||Math.abs(this._y1-d)>Ro)&&this._append`L${f},${d}`,r&&(g<0&&(g=g%XS+XS),g>yte?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>Ro&&this._append`A${r},${r},0,${+(g>=QS)},${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 tA(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 xte(t)}function nA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Oz(e){this._context=e}Oz.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 Vv(e){return new Oz(e)}function Az(e){return e[0]}function kz(e){return e[1]}function Cz(e,t){var n=pt(!0),r=null,i=Vv,a=null,l=tA(s);e=typeof e=="function"?e:e===void 0?Az:pt(e),t=typeof t=="function"?t:t===void 0?kz:pt(t);function s(c){var f,d=(c=nA(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:pt(+c),s):e},s.y=function(c){return arguments.length?(t=typeof c=="function"?c:pt(+c),s):t},s.defined=function(c){return arguments.length?(n=typeof c=="function"?c:pt(!!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 lm(e,t,n){var r=null,i=pt(!0),a=null,l=Vv,s=null,c=tA(f);e=typeof e=="function"?e:e===void 0?Az:pt(+e),t=typeof t=="function"?t:pt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?kz:pt(+n);function f(p){var g,v,y,x=(p=nA(p)).length,w,A=!1,C,k=new Array(x),M=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],M[y]);s.lineEnd(),s.areaEnd()}A&&(k[g]=+e(w,g,p),M[g]=+t(w,g,p),s.point(r?+r(w,g,p):k[g],n?+n(w,g,p):M[g]))}if(C)return s=null,C+""||null}function d(){return Cz().defined(i).curve(l).context(a)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:pt(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:pt(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:pt(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:pt(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:pt(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:pt(+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:pt(!!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 Ez{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 Ste(e){return new Ez(e,!0)}function wte(e){return new Ez(e,!1)}const rA={draw(e,t){const n=Ei(t/Cg);e.moveTo(n,0),e.arc(0,0,n,0,Kv)}},Ote={draw(e,t){const n=Ei(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()}},Tz=Ei(1/3),Ate=Tz*2,kte={draw(e,t){const n=Ei(t/Ate),r=n*Tz;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Cte={draw(e,t){const n=Ei(t),r=-n/2;e.rect(r,r,n,n)}},Ete=.8908130915292852,Mz=kg(Cg/10)/kg(7*Cg/10),Tte=kg(Kv/10)*Mz,Mte=-Sz(Kv/10)*Mz,Pte={draw(e,t){const n=Ei(t*Ete),r=Tte*n,i=Mte*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=Kv*a/5,s=Sz(l),c=kg(l);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*i,c*r+s*i)}e.closePath()}},Vx=Ei(3),Dte={draw(e,t){const n=-Ei(t/(Vx*3));e.moveTo(0,n*2),e.lineTo(-Vx*n,-n),e.lineTo(Vx*n,-n),e.closePath()}},Wr=-.5,Kr=Ei(3)/2,YS=1/Ei(12),_te=(YS/2+1)*3,Nte={draw(e,t){const n=Ei(t/_te),r=n/2,i=n*YS,a=r,l=n*YS+n,s=-a,c=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(s,c),e.lineTo(Wr*r-Kr*i,Kr*r+Wr*i),e.lineTo(Wr*a-Kr*l,Kr*a+Wr*l),e.lineTo(Wr*s-Kr*c,Kr*s+Wr*c),e.lineTo(Wr*r+Kr*i,Wr*i-Kr*r),e.lineTo(Wr*a+Kr*l,Wr*l-Kr*a),e.lineTo(Wr*s+Kr*c,Wr*c-Kr*s),e.closePath()}};function Rte(e,t){let n=null,r=tA(i);e=typeof e=="function"?e:pt(e||rA),t=typeof t=="function"?t:pt(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:pt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:pt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Eg(){}function Tg(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 Pz(e){this._context=e}Pz.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:Tg(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:Tg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Lte(e){return new Pz(e)}function Dz(e){this._context=e}Dz.prototype={areaStart:Eg,areaEnd:Eg,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:Tg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jte(e){return new Dz(e)}function _z(e){this._context=e}_z.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:Tg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ite(e){return new _z(e)}function Nz(e){this._context=e}Nz.prototype={areaStart:Eg,areaEnd:Eg,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 Bte(e){return new Nz(e)}function _D(e){return e<0?-1:1}function ND(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(_D(a)+_D(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(s))||0}function RD(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Qx(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 Mg(e){this._context=e}Mg.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:Qx(this,this._t0,RD(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,Qx(this,RD(this,n=ND(this,e,t)),n);break;default:Qx(this,this._t0,n=ND(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Rz(e){this._context=new Lz(e)}(Rz.prototype=Object.create(Mg.prototype)).point=function(e,t){Mg.prototype.point.call(this,t,e)};function Lz(e){this._context=e}Lz.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 zte(e){return new Mg(e)}function $te(e){return new Rz(e)}function jz(e){this._context=e}jz.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=LD(e),i=LD(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 LD(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 Ute(e){return new jz(e)}function Qv(e,t){this._context=e,this._t=t}Qv.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 Hte(e){return new Qv(e,.5)}function Fte(e){return new Qv(e,0)}function qte(e){return new Qv(e,1)}function os(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 GS(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Wte(e,t){return e[t]}function Kte(e){const t=[];return t.key=e,t}function Vte(){var e=pt([]),t=GS,n=os,r=Wte;function i(a){var l=Array.from(e.apply(this,arguments),Kte),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=nA(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:pt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:pt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?GS:typeof a=="function"?a:pt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??os,i):n},i}function Qte(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}os(e,t)}}function Xte(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}os(e,t)}}function Yte(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,os(e,t)}}function ZS(e){return e==="__proto__"}function Iz(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function iA(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function Bz(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Bz).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function aA(e){if(Array.isArray(e))return e.map(iA);if(typeof e=="symbol")return[e];e=Bz(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 Xa(e,t,n){if(e==null)return n;switch(typeof t){case"string":{if(ZS(t))return n;const r=e[t];return r===void 0?Iz(t)&&!Object.hasOwn(e,t)?Xa(e,aA(t),n):n:r}case"number":case"symbol":{typeof t=="number"&&(t=iA(t));const r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Gte(e,t,n);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),ZS(t))return n;const r=e[t];return r===void 0?n:r}}}function Gte(e,t,n){if(t.length===0)return n;let r=e;for(let i=0;i<t.length;i++){if(r==null||ZS(t[i]))return n;r=r[t[i]]}return r===void 0?n:r}var Zte=4;function ja(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zte,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function wn(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+ja(s)+a:i+a},"")}var cr=e=>e===0?0:e>0?1:-1,ra=e=>typeof e=="number"&&e!=+e,ss=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,be=e=>(typeof e=="number"||e instanceof Number)&&!ra(e),ia=e=>be(e)||typeof e=="string",Jte=0,kh=e=>{var t=++Jte;return"".concat(e||"").concat(t)},wi=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(ss(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return ra(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},zz=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 Wt(e,t,n){return be(e)&&be(t)?ja(e+n*(t-e)):t}function $z(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Xa(r,t))===n)}var Ct=e=>e===null||typeof e>"u",Xh=e=>Ct(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function fr(e){return e!=null}function ms(){}var ene=["type","size","sizeType"];function JS(){return JS=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},JS.apply(null,arguments)}function jD(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 ID(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jD(Object(n),!0).forEach(function(r){tne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tne(e,t,n){return(t=nne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nne(e){var t=rne(e,"string");return typeof t=="symbol"?t:t+""}function rne(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 ine(e,t){if(e==null)return{};var n,r,i=ane(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 ane(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 Uz={symbolCircle:rA,symbolCross:Ote,symbolDiamond:kte,symbolSquare:Cte,symbolStar:Pte,symbolTriangle:Dte,symbolWye:Nte},lne=Math.PI/180,one=e=>{var t="symbol".concat(Xh(e));return Uz[t]||rA},sne=(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*lne;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}},une=(e,t)=>{Uz["symbol".concat(Xh(e))]=t},Hz=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=ine(e,ene),c=ID(ID({},s),{},{type:n,size:i,sizeType:l}),f="circle";typeof n=="string"&&(f=n);var d=()=>{var x=one(f),w=Rte().type(x).size(sne(i,l,f)),A=w();if(A!==null)return A},p=c.className,g=c.cx,v=c.cy,y=_r(c);return be(g)&&be(v)&&be(i)?O.createElement("path",JS({},y,{className:ut("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(v,")"),d:d()})):null};Hz.registerSymbol=une;var Fz=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,lA=(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=>{JO(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},cne=(e,t,n)=>r=>(e(t,n,r),null),Xv=(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];JO(i)&&typeof a=="function"&&(r||(r={}),r[i]=cne(a,t,n))}),r};function BD(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 fne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BD(Object(n),!0).forEach(function(r){hne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hne(e,t,n){return(t=dne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dne(e){var t=pne(e,"string");return typeof t=="symbol"?t:t+""}function pne(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 Bn(e,t){var n=fne({},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 Pg(){return Pg=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},Pg.apply(null,arguments)}function zD(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 qz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zD(Object(n),!0).forEach(function(r){mne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mne(e,t,n){return(t=gne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gne(e){var t=vne(e,"string");return typeof t=="symbol"?t:t+""}function vne(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 Qr=32,yne={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function bne(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function xne(e){var t=e.data,n=e.iconType,r=e.inactiveColor,i=Qr/2,a=Qr/6,l=Qr/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:bne(t.payload),x1:0,y1:i,x2:Qr,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,`
|
|
73
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(2*l,",").concat(i,`
|
|
74
|
+
H`).concat(Qr,"M").concat(2*l,",").concat(i,`
|
|
75
|
+
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(Qr/8,"h").concat(Qr,"v").concat(Qr*3/4,"h").concat(-Qr,"z"),className:"recharts-legend-icon"});if(O.isValidElement(t.legendIcon)){var f=qz({},t);return delete f.legendIcon,O.cloneElement(t.legendIcon,f)}return O.createElement(Hz,{fill:s,cx:i,cy:i,size:Qr,sizeType:"diameter",type:c})}function Sne(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:Qr,height:Qr},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=ut({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:p.inactive});if(p.type==="none")return null;var x=typeof s=="object"?qz({},s):{};x.color=p.inactive?a:x.color||p.color;var w=v?v(p.value,p,g):p.value;return O.createElement("li",Pg({className:y,style:f,key:"legend-item-".concat(g)},Xv(e,p,g)),O.createElement(eA,{width:n,height:n,viewBox:c,style:d,"aria-label":p.value==null?"legend icon":"".concat(p.value," legend icon")},O.createElement(xne,{data:p,iconType:l,inactiveColor:a})),O.createElement("span",{className:"recharts-legend-item-text",style:x},w))})}var wne=e=>{var t=Bn(e,yne),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(Sne,Pg({},t,{payload:n})))};function One(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 Ane(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function Wz(e){return e}function kne(e){return function(t){return Xa(t,e)}}function ew(e){return e==null||typeof e!="object"&&typeof e!="function"}function Cne(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ene(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function oA(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Tne="[object RegExp]",Kz="[object String]",Vz="[object Number]",Qz="[object Boolean]",Xz="[object Arguments]",Mne="[object Symbol]",Pne="[object Date]",Dne="[object Map]",_ne="[object Set]",Nne="[object Array]",Rne="[object ArrayBuffer]",Lne="[object Object]",jne="[object DataView]",Ine="[object Uint8Array]",Bne="[object Uint8ClampedArray]",zne="[object Uint16Array]",$ne="[object Uint32Array]",Une="[object Int8Array]",Hne="[object Int16Array]",Fne="[object Int32Array]",qne="[object Float32Array]",Wne="[object Float64Array]",$D=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Kne(e){return typeof $D.Buffer<"u"&&$D.Buffer.isBuffer(e)}function Vne(e,t){return qo(e,void 0,e,new Map,t)}function qo(e,t,n,r=new Map,i=void 0){const a=i?.(e,t,n,r);if(a!==void 0)return a;if(ew(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]=qo(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,qo(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(qo(s,void 0,n,r,i));return l}if(Kne(e))return e.subarray();if(Cne(e)){const l=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,l);for(let s=0;s<e.length;s++)l[s]=qo(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),fi(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),fi(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),fi(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,fi(l,e,n,r,i),l}if(e instanceof Boolean){const l=new Boolean(e.valueOf());return r.set(e,l),fi(l,e,n,r,i),l}if(e instanceof Number){const l=new Number(e.valueOf());return r.set(e,l),fi(l,e,n,r,i),l}if(e instanceof String){const l=new String(e.valueOf());return r.set(e,l),fi(l,e,n,r,i),l}if(typeof e=="object"&&Qne(e)){const l=Object.create(Object.getPrototypeOf(e));return r.set(e,l),fi(l,e,n,r,i),l}return e}function fi(e,t,n=e,r,i){const a=[...Object.keys(t),...Ene(t)];for(let l=0;l<a.length;l++){const s=a[l],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=qo(t[s],s,n,r,i))}}function Qne(e){switch(oA(e)){case Xz:case Nne:case Rne:case jne:case Qz:case Pne:case qne:case Wne:case Une:case Hne:case Fne:case Dne:case Vz:case Lne:case Tne:case _ne:case Kz:case Mne:case Ine:case Bne:case zne:case $ne:return!0;default:return!1}}function Xne(e){return qo(e,void 0,e,new Map,void 0)}function jm(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Yz(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function Gz(e,t,n){return typeof n!="function"?Gz(e,t,()=>{}):tw(e,t,function r(i,a,l,s,c,f){const d=n(i,a,l,s,c,f);return d!==void 0?!!d:tw(i,a,r,f,!1)},new Map,!0)}function tw(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case"object":return Yne(e,t,n,r);case"function":return Object.keys(t).length>0?tw(e,{...t},n,r,i):jm(e,t);default:return Yz(e)&&i?typeof t=="string"?t==="":!0:jm(e,t)}}function Yne(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return Zz(e,t,n,r);if(t instanceof Map)return Gne(e,t,n,r);if(t instanceof Set)return Zne(e,t,n,r);const i=Object.keys(t);if(e==null||ew(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(!ew(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 Gne(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 Zz(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 Zne(e,t,n,r){return t.size===0?!0:e instanceof Set?Zz([...e],[...t],n,r):!1}function Jz(e,t){return Gz(e,t,()=>{})}function Jne(e){return e=Xne(e),t=>Jz(t,e)}function ere(e,t){return Vne(e,(n,r,i,a)=>{if(typeof e=="object"){if(oA(e)==="[object Object]"&&typeof e.constructor!="function"){const l={};return a.set(e,l),fi(l,e,i,a),l}switch(Object.prototype.toString.call(e)){case Vz:case Kz:case Qz:{const l=new e.constructor(e?.valueOf());return fi(l,e),l}case Xz:{const l={};return fi(l,e),l.length=e.length,l[Symbol.iterator]=e[Symbol.iterator],l}default:return}}})}function tre(e){return ere(e)}const nre=/^(?:0|[1-9]\d*)$/;function e$(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 nre.test(e)}}function rre(e){return e!==null&&typeof e=="object"&&oA(e)==="[object Arguments]"}function ire(e,t){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&Iz(t)&&e?.[t]==null?n=aA(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)||rre(r))&&e$(a)&&a<r.length))return!1;r=r[a]}return!0}function are(e,t){switch(typeof e){case"object":Object.is(e?.valueOf(),-0)&&(e="-0");break;case"number":e=iA(e);break}return t=tre(t),function(n){const r=Xa(n,e);return r===void 0?ire(n,e):t===void 0?r===void 0:Jz(r,t)}}function lre(e){if(e==null)return Wz;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?are(e[0],e[1]):Jne(e);case"string":case"symbol":case"number":return kne(e)}}function ore(e){return Number.isSafeInteger(e)&&e>=0}function t$(e){return e!=null&&typeof e!="function"&&ore(e.length)}function sre(e){return typeof e=="object"&&e!==null}function ure(e){return sre(e)&&t$(e)}function UD(e,t=Wz){return ure(e)?One(Array.from(e),Ane(lre(t),1)):[]}function n$(e,t,n){return t===!0?UD(e,n):typeof t=="function"?UD(e,t):e}var Xx={exports:{}},Yx={},Gx={exports:{}},Zx={};var HD;function cre(){if(HD)return Zx;HD=1;var e=ac();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 Zx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Zx}var FD;function fre(){return FD||(FD=1,Gx.exports=cre()),Gx.exports}var qD;function hre(){if(qD)return Yx;qD=1;var e=ac(),t=fre();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 Yx.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(P){if(!C){if(C=!0,k=P,P=g(P),v!==void 0&&x.hasValue){var N=x.value;if(v(N,P))return M=N}return M=P}if(N=M,r(k,P))return N;var j=g(P);return v!==void 0&&v(N,j)?(k=P,N):(k=P,M=j)}var C=!1,k,M,D=p===void 0?null:p;return[function(){return A(d())},D===null?void 0:function(){return A(D())}]},[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},Yx}var WD;function dre(){return WD||(WD=1,Xx.exports=hre()),Xx.exports}var pre=dre(),sA=O.createContext(null),mre=e=>e,wt=()=>{var e=O.useContext(sA);return e?e.store.dispatch:mre},Im=()=>{},gre=()=>Im,vre=(e,t)=>e===t;function we(e){var t=O.useContext(sA),n=O.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Im,[t,e]);return pre.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:gre,t?t.store.getState:Im,t?t.store.getState:Im,n,vre)}function yre(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function bre(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 KD=e=>Array.isArray(e)?e:[e];function xre(e){const t=Array.isArray(e[0])?e[0]:e;return bre(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Sre(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var wre=class{constructor(e){this.value=e}deref(){return this.value}},Ore=()=>typeof WeakRef>"u"?wre:WeakRef,r$=Ore(),Are=0,VD=1;function om(){return{s:Are,v:void 0,o:null,p:null}}function kre(e){return e instanceof r$?e.deref():e}function i$(e,t={}){let n=om();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=om(),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=om(),y.set(v,s)):s=x}}const f=s;let d;if(s.s===VD)d=s.v;else if(d=e.apply(null,arguments),a++,r){const p=kre(i);p!=null&&r(p,d)&&(d=p,a!==0&&a--),i=typeof d=="object"&&d!==null||typeof d=="function"?new r$(d):d}return f.s=VD,f.v=d,d}return l.clearCache=()=>{n=om(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function Cre(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()),yre(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const d={...n,...c},{memoize:p,memoizeOptions:g=[],argsMemoize:v=i$,argsMemoizeOptions:y=[]}=d,x=KD(g),w=KD(y),A=xre(i),C=p(function(){return a++,f.apply(null,arguments)},...x),k=v(function(){l++;const D=Sre(A,arguments);return s=C.apply(null,D),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 W=Cre(i$);function Ere(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 nw(e,t,n){return Yz(n)&&(typeof t=="number"&&t$(n)&&e$(t)&&t<n.length||typeof t=="string"&&t in n)?jm(n[t],e):!1}function QD(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}const Tre=(e,t,n)=>{if(e!==t){const r=QD(e),i=QD(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 a$(e){return typeof e=="symbol"||e instanceof Symbol}const Mre=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pre=/^\w*$/;function Dre(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||a$(e)?!0:typeof e=="string"&&(Pre.test(e)||!Mre.test(e))||t!=null}function _re(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)||Dre(s)?s:{key:s,path:aA(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=Tre(s.criteria[f],c.criteria[f],n[f]);if(d!==0)return d}return 0}).map(s=>s.original)}function Yv(e,...t){const n=t.length;return n>1&&nw(e,t[0],t[1])?t=[]:n>2&&nw(t[0],t[1],t[2])&&(t=[t[0]]),_re(e,Ere(t),["asc"])}var l$=e=>e.legend.settings,Nre=e=>e.legend.size,Rre=e=>e.legend.payload,Lre=W([Rre,l$],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?Yv(r,n):r});function jre(){return we(Lre)}function Ire(e,t){return Ure(e)||$re(e,t)||zre(e,t)||Bre()}function Bre(){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 zre(e,t){if(e){if(typeof e=="string")return XD(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)?XD(e,t):void 0}}function XD(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 $re(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 Ure(e){if(Array.isArray(e))return e}var sm=1;function YD(e,t){return Math.abs(e.height-t.height)>sm||Math.abs(e.left-t.left)>sm||Math.abs(e.top-t.top)>sm||Math.abs(e.width-t.width)>sm}function GD(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function o$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=O.useState({height:0,left:0,top:0,width:0}),n=Ire(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=GD(c);if(YD(f,l.current)&&i(f),typeof ResizeObserver<"u"){var d=new ResizeObserver(()=>{var p=GD(c);YD(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 xn(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 Hre=typeof Symbol=="function"&&Symbol.observable||"@@observable",ZD=Hre,Jx=()=>Math.random().toString(36).substring(7).split("").join("."),Fre={INIT:`@@redux/INIT${Jx()}`,REPLACE:`@@redux/REPLACE${Jx()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Jx()}`},Dg=Fre;function uA(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 s$(e,t,n){if(typeof e!="function")throw new Error(xn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(xn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(xn(1));return n(s$)(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(xn(3));return i}function p(w){if(typeof w!="function")throw new Error(xn(4));if(c)throw new Error(xn(5));let A=!0;f();const C=s++;return l.set(C,w),function(){if(A){if(c)throw new Error(xn(6));A=!1,f(),l.delete(C),a=null}}}function g(w){if(!uA(w))throw new Error(xn(7));if(typeof w.type>"u")throw new Error(xn(8));if(typeof w.type!="string")throw new Error(xn(17));if(c)throw new Error(xn(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(xn(10));r=w,g({type:Dg.REPLACE})}function y(){const w=p;return{subscribe(A){if(typeof A!="object"||A===null)throw new Error(xn(11));function C(){const M=A;M.next&&M.next(d())}return C(),{unsubscribe:w(C)}},[ZD](){return this}}}return g({type:Dg.INIT}),{dispatch:g,subscribe:p,getState:d,replaceReducer:v,[ZD]:y}}function qre(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Dg.INIT})>"u")throw new Error(xn(12));if(typeof n(void 0,{type:Dg.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(xn(13))})}function u$(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{qre(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(xn(14));f[p]=y,c=c||y!==v}return c=c||r.length!==Object.keys(l).length,c?f:l}}function _g(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Wre(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(xn(15))};const l={getState:i.getState,dispatch:(c,...f)=>a(c,...f)},s=e.map(c=>c(l));return a=_g(...s)(i.dispatch),{...i,dispatch:a}}}function c$(e){return uA(e)&&"type"in e&&typeof e.type=="string"}var f$=Symbol.for("immer-nothing"),JD=Symbol.for("immer-draftable"),Gn=Symbol.for("immer-state");function di(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pr=Object,Gu=Pr.getPrototypeOf,Ng="constructor",Gv="prototype",rw="configurable",Rg="enumerable",Bm="writable",Ch="value",Ya=e=>!!e&&!!e[Gn];function Oi(e){return e?h$(e)||Jv(e)||!!e[JD]||!!e[Ng]?.[JD]||ey(e)||ty(e):!1}var Kre=Pr[Gv][Ng].toString(),e_=new WeakMap;function h$(e){if(!e||!cA(e))return!1;const t=Gu(e);if(t===null||t===Pr[Gv])return!0;const n=Pr.hasOwnProperty.call(t,Ng)&&t[Ng];if(n===Object)return!0;if(!yu(n))return!1;let r=e_.get(n);return r===void 0&&(r=Function.toString.call(n),e_.set(n,r)),r===Kre}function Zv(e,t,n=!0){Yh(e)===0?(n?Reflect.ownKeys(e):Pr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Yh(e){const t=e[Gn];return t?t.type_:Jv(e)?1:ey(e)?2:ty(e)?3:0}var e1=(e,t,n=Yh(e))=>n===2?e.has(t):Pr[Gv].hasOwnProperty.call(e,t),iw=(e,t,n=Yh(e))=>n===2?e.get(t):e[t],Lg=(e,t,n,r=Yh(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Vre(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Jv=Array.isArray,ey=e=>e instanceof Map,ty=e=>e instanceof Set,cA=e=>typeof e=="object",yu=e=>typeof e=="function",t1=e=>typeof e=="boolean";function Qre(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Ui=e=>e.copy_||e.base_,fA=e=>e.modified_?e.copy_:e.base_;function aw(e,t){if(ey(e))return new Map(e);if(ty(e))return new Set(e);if(Jv(e))return Array[Gv].slice.call(e);const n=h$(e);if(t===!0||t==="class_only"&&!n){const r=Pr.getOwnPropertyDescriptors(e);delete r[Gn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],s=r[l];s[Bm]===!1&&(s[Bm]=!0,s[rw]=!0),(s.get||s.set)&&(r[l]={[rw]:!0,[Bm]:!0,[Rg]:s[Rg],[Ch]:e[l]})}return Pr.create(Gu(e),r)}else{const r=Gu(e);if(r!==null&&n)return{...e};const i=Pr.create(r);return Pr.assign(i,e)}}function hA(e,t=!1){return ny(e)||Ya(e)||!Oi(e)||(Yh(e)>1&&Pr.defineProperties(e,{set:um,add:um,clear:um,delete:um}),Pr.freeze(e),t&&Zv(e,(n,r)=>{hA(r,!0)},!1)),e}function Xre(){di(2)}var um={[Ch]:Xre};function ny(e){return e===null||!cA(e)?!0:Pr.isFrozen(e)}var jg="MapSet",lw="Patches",t_="ArrayMethods",d$={};function us(e){const t=d$[e];return t||di(0,e),t}var n_=e=>!!d$[e],Eh,p$=()=>Eh,Yre=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:n_(jg)?us(jg):void 0,arrayMethodsPlugin_:n_(t_)?us(t_):void 0});function r_(e,t){t&&(e.patchPlugin_=us(lw),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ow(e){sw(e),e.drafts_.forEach(Gre),e.drafts_=null}function sw(e){e===Eh&&(Eh=e.parent_)}var i_=e=>Eh=Yre(Eh,e);function Gre(e){const t=e[Gn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function a_(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Gn].modified_&&(ow(t),di(4)),Oi(e)&&(e=l_(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Gn].base_,e,t)}else e=l_(t,n);return Zre(t,e,!0),ow(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==f$?e:void 0}function l_(e,t){if(ny(t))return t;const n=t[Gn];if(!n)return Ig(t,e.handledSet_,e);if(!ry(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);v$(n,e)}return n.copy_}function Zre(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&hA(t,n)}function m$(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var ry=(e,t)=>e.scope_===t,Jre=[];function g$(e,t,n,r){const i=Ui(e),a=e.type_;if(r!==void 0&&iw(i,r,a)===t){Lg(i,r,n,a);return}if(!e.draftLocations_){const s=e.draftLocations_=new Map;Zv(i,(c,f)=>{if(Ya(f)){const d=s.get(f)||[];d.push(c),s.set(f,d)}})}const l=e.draftLocations_.get(t)??Jre;for(const s of l)Lg(i,s,n,a)}function eie(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!ry(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const l=fA(a);g$(e,a.draft_??a,l,n),v$(a,i)})}function v$(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)}m$(e)}}function tie(e,t,n){const{scope_:r}=e;if(Ya(n)){const i=n[Gn];ry(i,r)&&i.callbacks_.push(function(){zm(e);const l=fA(i);g$(e,n,l,t)})}else Oi(n)&&e.callbacks_.push(function(){const a=Ui(e);e.type_===3?a.has(n)&&Ig(n,r.handledSet_,r):iw(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ig(iw(e.copy_,t,e.type_),r.handledSet_,r)})}function Ig(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ya(e)||t.has(e)||!Oi(e)||ny(e)||(t.add(e),Zv(e,(r,i)=>{if(Ya(i)){const a=i[Gn];if(ry(a,n)){const l=fA(a);Lg(e,r,l,e.type_),m$(a)}}else Oi(i)&&Ig(i,t,n)})),e}function nie(e,t){const n=Jv(e),r={type_:n?1:0,scope_:t?t.scope_:p$(),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=Bg;n&&(i=[r],a=Th);const{revoke:l,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=l,[s,r]}var Bg={get(e,t){if(t===Gn)return e;if(t==="constructor"||t==="__proto__"){const s=Ui(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=Ui(e);if(!e1(i,t,e.type_))return rie(e,i,t);const a=i[t];if(e.finalized_||!Oi(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Qre(t))return a;if(a===n1(e.base_,t)){zm(e);const l=e.type_===1?+t:t,s=cw(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 Ui(e)},ownKeys(e){return Reflect.ownKeys(Ui(e))},set(e,t,n){if(t==="constructor"||t==="__proto__"||t==="prototype")return!0;const r=y$(Ui(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=n1(Ui(e),t),a=i?.[Gn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Vre(n,i)&&(n!==void 0||e1(e.base_,t,e.type_)))return!0;zm(e),uw(e)}return e.copy_[t]===n&&(n!==void 0||e1(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),tie(e,t,n)),!0},deleteProperty(e,t){return zm(e),n1(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),uw(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ui(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Bm]:!0,[rw]:e.type_!==1||t!=="length",[Rg]:r[Rg],[Ch]:n[t]}},defineProperty(){di(11)},getPrototypeOf(e){return Gu(e.base_)},setPrototypeOf(){di(12)}},Th={};for(let e in Bg){let t=Bg[e];Th[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Th.deleteProperty=function(e,t){return Th.set.call(this,e,t,void 0)};Th.set=function(e,t,n){return Bg.set.call(this,e[0],t,n,e[0])};function n1(e,t){const n=e[Gn];return(n?Ui(n):e)[t]}function rie(e,t,n){const r=y$(t,n);return r?Ch in r?r[Ch]:r.get?.call(e.draft_):void 0}function y$(e,t){if(!(t in e))return;let n=Gu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Gu(n)}}function uw(e){e.modified_||(e.modified_=!0,e.parent_&&uw(e.parent_))}function zm(e){e.copy_||(e.assigned_=new Map,e.copy_=aw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var iie=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(yu(t)&&!yu(n)){const a=n;n=t;const l=this;return function(c=a,...f){return l.produce(c,d=>n.call(this,d,...f))}}yu(n)||di(6),r!==void 0&&!yu(r)&&di(7);let i;if(Oi(t)){const a=i_(this),l=cw(a,t,void 0);let s=!0;try{i=n(l),s=!1}finally{s?ow(a):sw(a)}return r_(a,r),a_(i,a)}else if(!t||!cA(t)){if(i=n(t),i===void 0&&(i=t),i===f$&&(i=void 0),this.autoFreeze_&&hA(i,!0),r){const a=[],l=[];us(lw).generateReplacementPatches_(t,i,{patches_:a,inversePatches_:l}),r(a,l)}return i}else di(1,t)},this.produceWithPatches=(t,n)=>{if(yu(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]},t1(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),t1(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),t1(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Oi(e)||di(8),Ya(e)&&(e=Zr(e));const t=i_(this),n=cw(t,e,void 0);return n[Gn].isManual_=!0,sw(t),n}finishDraft(e,t){const n=e&&e[Gn];(!n||!n.isManual_)&&di(9);const{scope_:r}=n;return r_(r,t),a_(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=us(lw).applyPatches_;return Ya(e)?r(e,t):this.produce(e,i=>r(i,t))}};function cw(e,t,n,r){const[i,a]=ey(t)?us(jg).proxyMap_(t,n):ty(t)?us(jg).proxySet_(t,n):nie(t,n);return(n?.scope_??p$()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?eie(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 Zr(e){return Ya(e)||di(10,e),b$(e)}function b$(e){if(!Oi(e)||ny(e))return e;const t=e[Gn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=aw(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=aw(e,!0);return Zv(n,(i,a)=>{Lg(n,i,b$(a))},r),t&&(t.finalized_=!1),n}var aie=new iie,x$=aie.produce,Ge=e=>e;function S$(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var lie=S$(),oie=S$,sie=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?_g:_g.apply(null,arguments)};function Rr(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=>c$(r)&&r.type===e,n}var w$=class qf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,qf.prototype)}static get[Symbol.species](){return qf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new qf(...t[0].concat(this)):new qf(...t.concat(this))}};function o_(e){return Oi(e)?x$(e,()=>{}):e}function cm(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function uie(e){return typeof e=="boolean"}var cie=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new w$;return n&&(uie(n)?l.push(lie):l.push(oie(n.extraArgument))),l},O$="RTK_autoBatch",xt=()=>e=>({payload:e,meta:{[O$]:!0}}),s_=e=>t=>{setTimeout(t,e)},fie=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(l),n())},a=e(i),l=setTimeout(i,t)},A$=(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?fie(window.requestAnimationFrame,100):s_(10):e.type==="callback"?e.queueNotification:s_(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?.[O$],a=!i,a&&(l||(l=!0,c(f))),r.dispatch(d)}finally{i=!0}}})},hie=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new w$(e);return r&&i.push(A$(typeof r=="object"?r:void 0)),i};function die(e){const t=cie(),{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(uA(n))s=u$(n);else throw new Error(Dr(1));let c;typeof r=="function"?c=r(t):c=t();let f=_g;i&&(f=sie({trace:!1,...typeof i=="object"&&i}));const d=Wre(...c),p=hie(d);let g=typeof l=="function"?l(p):p();const v=f(...g);return s$(s,a,v)}function k$(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 pie(e){return typeof e=="function"}function mie(e,t){let[n,r,i]=k$(t),a;if(pie(e))a=()=>o_(e());else{const s=o_(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(Ya(d)){const v=p(d,c);return v===void 0?d:v}else{if(Oi(d))return x$(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 gie="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",vie=(e=21)=>{let t="",n=e;for(;n--;)t+=gie[Math.random()*64|0];return t},yie=Symbol.for("rtk-slice-createasyncthunk");function bie(e,t){return`${e}/${t}`}function xie({creators:e}={}){const t=e?.asyncThunk?.[yie];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(wie()):r.reducers)||{},s=Object.keys(l),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(k,M){const D=typeof k=="string"?k:k.type;if(!D)throw new Error(Dr(12));if(D in c.sliceCaseReducersByType)throw new Error(Dr(13));return c.sliceCaseReducersByType[D]=M,f},addMatcher(k,M){return c.sliceMatchers.push({matcher:k,reducer:M}),f},exposeAction(k,M){return c.actionCreators[k]=M,f},exposeCaseReducer(k,M){return c.sliceCaseReducersByName[k]=M,f}};s.forEach(k=>{const M=l[k],D={reducerName:k,type:bie(i,k),createNotation:typeof r.reducers=="function"};Aie(M)?Cie(D,M,f,t):Oie(D,M,f)});function d(){const[k={},M=[],D=void 0]=typeof r.extraReducers=="function"?k$(r.extraReducers):[r.extraReducers],P={...k,...c.sliceCaseReducersByType};return mie(r.initialState,N=>{for(let j in P)N.addCase(j,P[j]);for(let j of c.sliceMatchers)N.addMatcher(j.matcher,j.reducer);for(let j of M)N.addMatcher(j.matcher,j.reducer);D&&N.addDefaultCase(D)})}const p=k=>k,g=new Map,v=new WeakMap;let y;function x(k,M){return y||(y=d()),y(k,M)}function w(){return y||(y=d()),y.getInitialState()}function A(k,M=!1){function D(N){let j=N[k];return typeof j>"u"&&M&&(j=cm(v,D,w)),j}function P(N=p){const j=cm(g,M,()=>new WeakMap);return cm(j,N,()=>{const U={};for(const[V,K]of Object.entries(r.selectors??{}))U[V]=Sie(K,N,()=>cm(v,N,w),M);return U})}return{reducerPath:k,getSelectors:P,get selectors(){return P(D)},selectSlice:D}}const C={name:i,reducer:x,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:w,...A(a),injectInto(k,{reducerPath:M,...D}={}){const P=M??a;return k.inject({reducerPath:P,reducer:x},D),{...C,...A(P,!0)}}};return C}}function Sie(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 zn=xie();function wie(){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 Oie({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!kie(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?Rr(e,l):Rr(e))}function Aie(e){return e._reducerDefinitionType==="asyncThunk"}function kie(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Cie({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||fm,pending:s||fm,rejected:c||fm,settled:f||fm})}function fm(){}var Eie="task",C$="listener",E$="completed",dA="cancelled",Tie=`task-${dA}`,Mie=`task-${E$}`,fw=`${C$}-${dA}`,Pie=`${C$}-${E$}`,iy=class{constructor(e){this.code=e,this.message=`${Eie} ${dA} (reason: ${e})`}code;name="TaskAbortError";message},pA=(e,t)=>{if(typeof e!="function")throw new TypeError(Dr(32))},zg=()=>{},T$=(e,t=zg)=>(e.catch(t),e),M$=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Zo=e=>{if(e.aborted)throw new iy(e.reason)};function P$(e,t){let n=zg;return new Promise((r,i)=>{const a=()=>i(new iy(e.reason));if(e.aborted){a();return}n=M$(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=zg})}var Die=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof iy?"cancelled":"rejected",error:n}}finally{t?.()}},$g=e=>t=>T$(P$(e,t).then(n=>(Zo(e),n))),D$=e=>{const t=$g(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:ju}=Object,u_={},ay="listenerMiddleware",_ie=(e,t)=>{const n=r=>M$(e,()=>r.abort(e.reason));return(r,i)=>{pA(r);const a=new AbortController;n(a);const l=Die(async()=>{Zo(e),Zo(a.signal);const s=await r({pause:$g(a.signal),delay:D$(a.signal),signal:a.signal});return Zo(a.signal),s},()=>a.abort(Mie));return i?.autoJoin&&t.push(l.catch(zg)),{result:$g(e)(l),cancel(){a.abort(Tie)}}}},Nie=(e,t)=>{const n=async(r,i)=>{Zo(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 P$(t,Promise.race(s));return Zo(t),c}finally{a()}};return((r,i)=>T$(n(r,i)))},_$=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Rr(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 pA(a),{predicate:i,type:t,effect:a}},N$=ju(e=>{const{type:t,predicate:n,effect:r}=_$(e);return{id:vie(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Dr(22))}}},{withTypes:()=>N$}),c_=(e,t)=>{const{type:n,effect:r,predicate:i}=_$(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},hw=e=>{e.pending.forEach(t=>{t.abort(fw)})},Rie=(e,t)=>()=>{for(const n of t.keys())hw(n);e.clear()},f_=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},R$=ju(Rr(`${ay}/add`),{withTypes:()=>R$}),Lie=Rr(`${ay}/removeAll`),L$=ju(Rr(`${ay}/remove`),{withTypes:()=>L$}),jie=(...e)=>{console.error(`${ay}/error`,...e)},Gh=(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=jie}=e;pA(l);const s=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),y=>{v.unsubscribe(),y?.cancelActive&&hw(v)}),c=(v=>{const y=c_(t,v)??N$(v);return s(y)});ju(c,{withTypes:()=>c});const f=v=>{const y=c_(t,v);return y&&(y.unsubscribe(),v.cancelActive&&hw(y)),!!y};ju(f,{withTypes:()=>f});const d=async(v,y,x,w)=>{const A=new AbortController,C=Nie(c,A.signal),k=[];try{v.pending.add(A),r(v),await Promise.resolve(v.effect(y,ju({},x,{getOriginalState:w,condition:(M,D)=>C(M,D).then(Boolean),take:C,delay:D$(A.signal),pause:$g(A.signal),extra:a,signal:A.signal,fork:_ie(A.signal,k),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((M,D,P)=>{M!==A&&(M.abort(fw),P.delete(M))})},cancel:()=>{A.abort(fw),v.pending.delete(A)},throwIfCancelled:()=>{Zo(A.signal)}})))}catch(M){M instanceof iy||f_(l,M,{raisedBy:"effect"})}finally{await Promise.all(k),A.abort(Pie),i(v),v.pending.delete(A)}},p=Rie(t,n);return{middleware:v=>y=>x=>{if(!c$(x))return y(x);if(R$.match(x))return c(x.payload);if(Lie.match(x)){p();return}if(L$.match(x))return f(x.payload);let w=v.getState();const A=()=>{if(w===u_)throw new Error(Dr(23));return w};let C;try{if(C=y(x),t.size>0){const k=v.getState(),M=Array.from(t.values());for(const D of M){let P=!1;try{P=D.predicate(x,k,w)}catch(N){P=!1,f_(l,N,{raisedBy:"predicate"})}P&&d(D,x,v,A)}}}finally{w=u_}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 Iie={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},j$=zn({name:"chartLayout",initialState:Iie,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}}}),ly=j$.actions,Bie=ly.setMargin,zie=ly.setLayout,$ie=ly.setChartSize,Uie=ly.setScale,Hie=j$.reducer;function I$(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Ke(e){return Number.isFinite(e)}function aa(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function h_(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 Ou(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h_(Object(n),!0).forEach(function(r){Fie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fie(e,t,n){return(t=qie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qie(e){var t=Wie(e,"string");return typeof t=="symbol"?t:t+""}function Wie(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 $t(e,t,n){return Ct(e)||Ct(t)?n:ia(t)?Xa(e,t,n):typeof t=="function"?t(e):n}var Kie=(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 Ou(Ou({},e),{},{[a]:e[a]+(r||0)});if((s==="horizontal"||s==="vertical"&&a==="center")&&l!=="middle"&&be(e[l]))return Ou(Ou({},e),{},{[l]:e[l]+(i||0)})}return e},tl=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",B$=(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},z$=(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?cr(a[0]-a[1])*2*x:x,p||g){var w=(p||g||[]).map((A,C)=>{var k=r?r.indexOf(A):A,M=l.map(k);return Ke(M)?{coordinate:M+x,value:A,offset:x,index:C}:null}).filter(fr);return w}return c&&f?f.map((A,C)=>{var k=l.map(A);return Ke(k)?{coordinate:k+x,value:A,index:C,offset:x}:null}).filter(fr):l.ticks&&d!=null?l.ticks(d).map((A,C)=>{var k=l.map(A);return Ke(k)?{coordinate:k+x,value:A,index:C,offset:x}:null}).filter(fr):l.domain().map((A,C)=>{var k=l.map(A);return Ke(k)?{coordinate:k+x,value:r?r[A]:A,index:C,offset:x}:null}).filter(fr)},Vie=(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},Qie=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=ra(d)?p:d;g>=0?(f[0]=a,a+=g,f[1]=a):(f[0]=l,l+=g,f[1]=l)}}}},Xie=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=ra(c[1])?c[0]:c[1];f>=0?(c[0]=a,a+=f,c[1]=a):(c[0]=0,c[1]=0)}}}},Yie={sign:Qie,expand:Qte,none:os,silhouette:Xte,wiggle:Yte,positive:Xie},Gie=(e,t,n)=>{var r,i=(r=Yie[n])!==null&&r!==void 0?r:os,a=Vte().keys(t).value((s,c)=>Number($t(s,c,0))).order(GS).offset(i),l=a(e);return l.forEach((s,c)=>{s.forEach((f,d)=>{var p=$t(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 Zie(e){return e==null?void 0:String(e)}function d_(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&&!Ct(i[t.dataKey])){var s=$z(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=$t(i,Ct(l)?t.dataKey:l),f=t.scale.map(c);return be(f)?f:null}var p_=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=$t(a,t.dataKey,t.scale.domain()[l]);if(Ct(s))return null;var c=t.scale.map(s);return be(c)?c-i/2+r:null},Jie=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]},eae=e=>{var t=e.flat(2).filter(be);return[Math.min(...t),Math.max(...t)]},tae=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],nae=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return tae(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=I$(f,t,n),p=eae(d);return!Ke(p[0])||!Ke(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]))},m_=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,g_=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Zu=(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=Yv(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 v_(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return Ou(Ou({},t),{},{dataKey:n,payload:r,value:i,name:a})}function oy(e,t){if(e!=null)return String(e);if(typeof t=="string")return t}var rae=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},iae=(e,t)=>t==="centric"?e.angle:e.radius,nl=e=>e.layout.width,rl=e=>e.layout.height,aae=e=>e.layout.scale,$$=e=>e.layout.margin,sy=W(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),uy=W(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),lae="data-recharts-item-index",oae="data-recharts-item-id",Zh=60;function y_(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 hm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y_(Object(n),!0).forEach(function(r){sae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sae(e,t,n){return(t=uae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uae(e){var t=cae(e,"string");return typeof t=="symbol"?t:t+""}function cae(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 fae=e=>e.brush.height;function hae(e){var t=uy(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Zh;return n+i}return n},0)}function dae(e){var t=uy(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Zh;return n+i}return n},0)}function pae(e){var t=sy(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function mae(e){var t=sy(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var cn=W([nl,rl,$$,fae,hae,dae,pae,mae,l$,Nre],(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=hm(hm({},p),d),v=g.bottom;g.bottom+=r,g=Kie(g,c,f);var y=e-g.left-g.right,x=t-g.top-g.bottom;return hm(hm({brushBottom:v},g),{},{width:Math.max(y,0),height:Math.max(x,0)})}),gae=W(cn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),mA=W(nl,rl,(e,t)=>({x:0,y:0,width:e,height:t})),vae=O.createContext(null),$n=()=>O.useContext(vae)!=null,cy=e=>e.brush,fy=W([cy,cn,$$],(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 yae(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 bae(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=yae(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 xae(e,t=0,n={}){const{leading:r=!0,trailing:i=!0}=n;return bae(e,t,{leading:r,maxWait:t,trailing:i})}var Ug=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++]))}},Gi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},U$=(e,t,n)=>{var r=n.width,i=r===void 0?Gi.width:r,a=n.height,l=a===void 0?Gi.height:a,s=n.aspect,c=n.maxHeight,f=ss(i)?e:Number(i),d=ss(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}},Sae={width:0,height:0,overflow:"visible"},wae={width:0,overflowX:"visible"},Oae={height:0,overflowY:"visible"},Aae={},kae=e=>{var t=e.width,n=e.height,r=ss(t),i=ss(n);return r&&i?Sae:r?wae:i?Oae:Aae};function Cae(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Gi.width,a=Gi.height):i===void 0?i=r&&r>0?void 0:Gi.width:a===void 0&&(a=r&&r>0?void 0:Gi.height),{width:i,height:a}}var Eae=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Hg(){return Hg=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},Hg.apply(null,arguments)}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 x_(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){Tae(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 Tae(e,t,n){return(t=Mae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mae(e){var t=Pae(e,"string");return typeof t=="symbol"?t:t+""}function Pae(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 Dae(e,t){return Lae(e)||Rae(e,t)||Nae(e,t)||_ae()}function _ae(){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 Nae(e,t){if(e){if(typeof e=="string")return S_(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)?S_(e,t):void 0}}function S_(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 Rae(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 Lae(e){if(Array.isArray(e))return e}function jae(e,t){if(e==null)return{};var n,r,i=Iae(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 Iae(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 H$=O.createContext(Gi.initialDimension);function Bae(e){return aa(e.width)&&aa(e.height)}function F$(e){var t=e.children,n=e.width,r=e.height,i=O.useMemo(()=>({width:n,height:r}),[n,r]);return Bae(i)?O.createElement(H$.Provider,{value:i},t):null}var gA=()=>O.useContext(H$),zae=O.forwardRef((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Gi.initialDimension:r,a=e.width,l=e.height,s=e.minWidth,c=s===void 0?Gi.minWidth:s,f=e.minHeight,d=e.maxHeight,p=e.children,g=e.debounce,v=g===void 0?Gi.debounce:g,y=e.id,x=e.className,w=e.onResize,A=e.style,C=A===void 0?{}:A,k=jae(e,Eae),M=O.useRef(null),D=O.useRef();D.current=w,O.useImperativeHandle(t,()=>M.current);var P=O.useState({containerWidth:i.width,containerHeight:i.height}),N=Dae(P,2),j=N[0],U=N[1],V=O.useCallback((z,Z)=>{U(ae=>{var Q=Math.round(z),le=Math.round(Z);return ae.containerWidth===Q&&ae.containerHeight===le?ae:{containerWidth:Q,containerHeight:le}})},[]);O.useEffect(()=>{if(M.current==null||typeof ResizeObserver>"u")return ms;var z=R=>{var F,ee=R[0];if(ee!=null){var se=ee.contentRect,ge=se.width,Oe=se.height;V(ge,Oe),(F=D.current)===null||F===void 0||F.call(D,ge,Oe)}};v>0&&(z=xae(z,v,{trailing:!0,leading:!1}));var Z=new ResizeObserver(z),ae=M.current.getBoundingClientRect(),Q=ae.width,le=ae.height;return V(Q,le),Z.observe(M.current),()=>{Z.disconnect()}},[V,v]);var K=j.containerWidth,B=j.containerHeight;Ug(!n||n>0,"The aspect(%s) must be greater than zero.",n);var oe=U$(K,B,{width:a,height:l,aspect:n,maxHeight:d}),ie=oe.calculatedWidth,ue=oe.calculatedHeight;return Ug(K<0||B<0||ie!=null&&ie>0||ue!=null&&ue>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
78
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
79
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
80
|
+
height and width.`,ie,ue,a,l,c,f,n),O.createElement("div",Hg({id:y?"".concat(y):void 0,className:ut("recharts-responsive-container",x),style:x_(x_({},C),{},{width:a,height:l,minWidth:c,minHeight:f,maxHeight:d}),ref:M},k),O.createElement("div",{style:kae({width:a,height:l})},O.createElement(F$,{width:ie,height:ue},p)))}),w_=O.forwardRef((e,t)=>{var n=gA();if(aa(n.width)&&aa(n.height))return e.children;var r=Cae({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,l=U$(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(F$,{width:s,height:c},e.children):O.createElement(zae,Hg({},e,{width:i,height:a,ref:t}))});function vA(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 hy=()=>{var e,t=$n(),n=we(gae),r=we(fy),i=(e=we(cy))===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}},$ae={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},q$=()=>{var e;return(e=we(cn))!==null&&e!==void 0?e:$ae},yA=()=>we(nl),bA=()=>we(rl),Uae=()=>we(e=>e.layout.margin),rt=e=>e.layout.layoutType,gs=()=>we(rt),W$=()=>{var e=gs();if(e==="horizontal"||e==="vertical")return e},K$=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Hae=()=>{var e=gs();return e!==void 0},Jh=e=>{var t=wt(),n=$n(),r=e.width,i=e.height,a=gA(),l=r,s=i;return a&&(l=a.width>0?a.width:r,s=a.height>0?a.height:i),O.useEffect(()=>{!n&&aa(l)&&aa(s)&&t($ie({width:l,height:s}))},[t,n,l,s]),null},Fae={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},V$=zn({name:"legend",initialState:Fae,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(Ge(t.payload))},prepare:xt()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Zr(e).payload.indexOf(Ge(r));a>-1&&(e.payload[a]=Ge(i))},prepare:xt()},removeLegendPayload:{reducer(e,t){var n=Zr(e).payload.indexOf(Ge(t.payload));n>-1&&e.payload.splice(n,1)},prepare:xt()}}}),ed=V$.actions,O_=ed.setLegendSize,qae=ed.setLegendSettings,Wae=ed.addLegendPayload,Kae=ed.replaceLegendPayload,Vae=ed.removeLegendPayload,Qae=V$.reducer,r1={exports:{}},i1={};var A_;function Xae(){if(A_)return i1;A_=1;var e=ac();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 i1.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(D){if(!A){if(A=!0,C=D,D=p(D),g!==void 0&&y.hasValue){var P=y.value;if(g(P,D))return k=P}return k=D}if(P=k,n(C,D))return P;var N=p(D);return g!==void 0&&g(P,N)?(C=D,P):(C=D,k=N)}var A=!1,C,k,M=d===void 0?null:d;return[function(){return w(f())},M===null?void 0:function(){return w(M())}]},[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},i1}var k_;function Yae(){return k_||(k_=1,r1.exports=Xae()),r1.exports}Yae();function Gae(e){e()}function Zae(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Gae(()=>{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 C_={notify(){},get:()=>[]};function Jae(e,t){let n,r=C_,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=Zae())}function p(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=C_)}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 ele=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tle=ele(),nle=()=>typeof navigator<"u"&&navigator.product==="ReactNative",rle=nle(),ile=()=>tle||rle?O.useLayoutEffect:O.useEffect,ale=ile();function E_(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function lle(e,t){if(E_(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])||!E_(e[n[i]],t[n[i]]))return!1;return!0}var ole=Symbol.for("react-redux-context"),sle=typeof globalThis<"u"?globalThis:{};function ule(){if(!O.createContext)return{};const e=sle[ole]??=new Map;let t=e.get(O.createContext);return t||(t=O.createContext(null),e.set(O.createContext,t)),t}var cle=ule();function fle(e){const{children:t,context:n,serverState:r,store:i}=e,a=O.useMemo(()=>{const c=Jae(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),l=O.useMemo(()=>i.getState(),[i]);ale(()=>{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||cle;return O.createElement(s.Provider,{value:a},t)}var hle=fle,dle=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function ple(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(dle.has(r)){if(e[r]==null&&t[r]==null)continue;if(!lle(e[r],t[r]))return!1}else if(!ple(e[r],t[r]))return!1;return!0}var mle=["contextPayload"];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 gle(e,t){return xle(e)||ble(e,t)||yle(e,t)||vle()}function vle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
81
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yle(e,t){if(e){if(typeof e=="string")return T_(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)?T_(e,t):void 0}}function T_(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 ble(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 xle(e){if(Array.isArray(e))return e}function M_(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 Ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M_(Object(n),!0).forEach(function(r){Sle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sle(e,t,n){return(t=wle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wle(e){var t=Ole(e,"string");return typeof t=="symbol"?t:t+""}function Ole(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 Ale(e,t){if(e==null)return{};var n,r,i=kle(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 kle(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 Cle(e){return e.value}function Ele(e){var t=e.contextPayload,n=Ale(e,mle),r=n$(t,e.payloadUniqBy,Cle),i=Ju(Ju({},n),{},{payload:r});return O.isValidElement(e.content)?O.cloneElement(e.content,i):typeof e.content=="function"?O.createElement(e.content,i):O.createElement(wne,i)}function Tle(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}),Ju(Ju({},f),d)}function Mle(e){var t=e.align,n=e.layout,r=e.verticalAlign,i=e.itemSorter,a=wt();return O.useLayoutEffect(()=>{a(qae({align:t,layout:n,verticalAlign:r,itemSorter:i}))},[a,t,n,r,i]),null}function Ple(e){var t=e.width,n=e.height,r=wt();return O.useLayoutEffect(()=>{r(O_({width:t,height:n}))},[r,t,n]),O.useLayoutEffect(()=>()=>{r(O_({width:0,height:0}))},[r]),null}function Dle(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var _le={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",labelStyle:{},layout:"horizontal",verticalAlign:"bottom"};function Nle(e){var t=Bn(e,_le),n=jre(),r=vte(),i=Uae(),a=t.width,l=t.height,s=t.wrapperStyle,c=t.portal,f=o$([n]),d=gle(f,2),p=d[0],g=d[1],v=yA(),y=bA();if(v==null||y==null)return null;var x=v-(i?.left||0)-(i?.right||0),w=Dle(t.layout,l,a,x),A=c?s:Ju(Ju({position:"absolute",width:w?.width||a||"auto",height:w?.height||l||"auto"},Tle(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(Mle,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&O.createElement(Ple,{width:p.width,height:p.height}),O.createElement(Ele,dw({},t,w,{margin:i,chartWidth:v,chartHeight:y,contextPayload:n})));return nO.createPortal(k,C)}var Q$=O.memo(Nle,pc);Q$.displayName="Legend";function pw(){return pw=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},pw.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 Tf(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){Rle(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 Rle(e,t,n){return(t=Lle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lle(e){var t=jle(e,"string");return typeof t=="symbol"?t:t+""}function jle(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 Ile(e,t){return Ule(e)||$le(e,t)||zle(e,t)||Ble()}function Ble(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
82
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zle(e,t){if(e){if(typeof e=="string")return D_(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)?D_(e,t):void 0}}function D_(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 $le(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 Ule(e){if(Array.isArray(e))return e}function Hle(e){return Array.isArray(e)&&ia(e[0])&&ia(e[1])?e.join(" ~ "):e}var lu={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 Fle(e,t){return t==null?e:Yv(e,t)}var qle=e=>{var t=e.separator,n=t===void 0?lu.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,l=a===void 0?lu.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?lu.accessibilityLayer:y,w=()=>{if(s&&s.length){var j={padding:0,margin:0},U=Fle(s,f),V=U.map((K,B)=>{if(!K||K.type==="none")return null;var oe=K.formatter||c||Hle,ie=K.value,ue=K.name,z=ie,Z=ue;if(oe){var ae=oe(ie,ue,K,B,s);if(Array.isArray(ae)){var Q=Ile(ae,2);z=Q[0],Z=Q[1]}else if(ae!=null)z=ae;else return null}var le=Tf(Tf({},lu.itemStyle),{},{color:K.color||lu.itemStyle.color},i);return O.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(B),style:le},ia(Z)?O.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,ia(Z)?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"},K.unit||""))});return O.createElement("ul",{className:"recharts-tooltip-item-list",style:j},V)}return null},A=Tf(Tf({},lu.contentStyle),r),C=Tf({margin:0},l),k=!Ct(g),M=k?g:"",D=ut("recharts-default-tooltip",d),P=ut("recharts-tooltip-label",p);k&&v&&s!==void 0&&s!==null&&(M=v(g,s));var N=x?{role:"status","aria-live":"assertive"}:{};return O.createElement("div",pw({className:D,style:A},N),O.createElement("p",{className:P,style:C},O.isValidElement(M)?M:"".concat(M)),w())},Mf="recharts-tooltip-wrapper",Wle={visibility:"hidden"};function Kle(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return ut(Mf,{["".concat(Mf,"-right")]:be(n)&&t&&be(t.x)&&n>=t.x,["".concat(Mf,"-left")]:be(n)&&t&&be(t.x)&&n<t.x,["".concat(Mf,"-bottom")]:be(r)&&t&&be(t.y)&&r>=t.y,["".concat(Mf,"-top")]:be(r)&&t&&be(t.y)&&r<t.y})}function __(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 Vle(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 Qle(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=__({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:s.width,viewBox:f,viewBoxDimension:f.width}),g=__({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:s.height,viewBox:f,viewBoxDimension:f.height}),d=Vle({translateX:p,translateY:g,useTranslate3d:c})):d=Wle,{cssProperties:d,cssClasses:Kle({translateX:p,translateY:g,coordinate:n})}}var Xle=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),td={isSsr:Xle()};function Yle(e,t){return eoe(e)||Jle(e,t)||Zle(e,t)||Gle()}function Gle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
83
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zle(e,t){if(e){if(typeof e=="string")return N_(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)?N_(e,t):void 0}}function N_(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 eoe(e){if(Array.isArray(e))return e}function X$(){var e=O.useState(()=>td.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=Yle(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 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 ou(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){toe(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 toe(e,t,n){return(t=noe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function noe(e){var t=roe(e,"string");return typeof t=="symbol"?t:t+""}function roe(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 ioe(e,t){return soe(e)||ooe(e,t)||loe(e,t)||aoe()}function aoe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
84
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function loe(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 ooe(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 soe(e){if(Array.isArray(e))return e}function uoe(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 coe(e){var t,n,r,i,a,l,s=X$(),c=O.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),f=ioe(c,2),d=f[0],p=f[1];O.useEffect(()=>{var A=C=>{if(C.key==="Escape"){var k,M,D,P;p({dismissed:!0,dismissedAtCoordinate:{x:(k=(M=e.coordinate)===null||M===void 0?void 0:M.x)!==null&&k!==void 0?k:0,y:(D=(P=e.coordinate)===null||P===void 0?void 0:P.y)!==null&&D!==void 0?D: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(ou(ou({},d),{},{dismissed:!1}));var g=Qle({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?{}:ou(ou({transition:uoe({prefersReducedMotion:s,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},y),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),w=ou(ou({},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 foe=O.memo(coe),Y$=()=>{var e;return(e=we(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function mw(){return mw=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},mw.apply(null,arguments)}function j_(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 I_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j_(Object(n),!0).forEach(function(r){hoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hoe(e,t,n){return(t=doe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function doe(e){var t=poe(e,"string");return typeof t=="symbol"?t:t+""}function poe(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 B_={curveBasisClosed:jte,curveBasisOpen:Ite,curveBasis:Lte,curveBumpX:Ste,curveBumpY:wte,curveLinearClosed:Bte,curveLinear:Vv,curveMonotoneX:zte,curveMonotoneY:$te,curveNatural:Ute,curveStep:Hte,curveStepAfter:qte,curveStepBefore:Fte},Fg=e=>Ke(e.x)&&Ke(e.y),z_=e=>e.base!=null&&Fg(e.base)&&Fg(e),Pf=e=>e.x,Df=e=>e.y,moe=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Xh(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=B_["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return B_[n]||Vv},$_={connectNulls:!1,type:"linear"},goe=e=>{var t=e.type,n=t===void 0?$_.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,l=e.layout,s=e.connectNulls,c=s===void 0?$_.connectNulls:s,f=moe(n,l),d=c?i.filter(Fg):i;if(Array.isArray(a)){var p,g=i.map((A,C)=>I_(I_({},A),{},{base:a[C]}));l==="vertical"?p=lm().y(Df).x1(Pf).x0(A=>A.base.x):p=lm().x(Pf).y1(Df).y0(A=>A.base.y);var v=p.defined(z_).curve(f),y=c?g.filter(z_):g;return v(y)}var x;l==="vertical"&&be(a)?x=lm().y(Df).x1(Pf).x0(a):be(a)?x=lm().x(Pf).y1(Df).y0(a):x=Cz().x(Pf).y(Df);var w=x.defined(Fg).curve(f);return w(d)},G$=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=gs();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?goe(l):r;return O.createElement("path",mw({},Si(e),lA(e),{className:ut("recharts-curve",t),d:s===null?void 0:s,ref:i}))},voe=["x","y","top","left","width","height","className"];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 U_(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 yoe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U_(Object(n),!0).forEach(function(r){boe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function boe(e,t,n){return(t=xoe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xoe(e){var t=Soe(e,"string");return typeof t=="symbol"?t:t+""}function Soe(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 woe(e,t){if(e==null)return{};var n,r,i=Ooe(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 Ooe(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 Aoe=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),koe=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=woe(e,voe),x=yoe({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",gw({},_r(x),{className:ut("recharts-cross",v),d:Aoe(n,i,d,g,l,c)}))};function Coe(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,Z$=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],J$=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),H_=(e,t)=>n=>{var r=Z$(e,t);return J$(r,n)},Eoe=(e,t)=>n=>{var r=Z$(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return J$(i,n)},Toe=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]]},Moe=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=Toe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Poe=(e,t,n,r)=>{var i=H_(e,n),a=H_(t,r),l=Eoe(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},F_=function(){return Poe(...Moe(...arguments))},Doe=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,M;if(A<=0)return 0;if(A>=1)return c;var D=A*w,P=Math.floor(D),N=D-P;return((C=f[P])!==null&&C!==void 0?C:0)+(((k=f[P+1])!==null&&k!==void 0?k:0)-((M=f[P])!==null&&M!==void 0?M:0))*N}},_oe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return F_(e);case"spring":return Doe();default:if(e.split("(")[0]==="cubic-bezier")return F_(e)}return typeof e=="function"?e:null},Noe=(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()}},e5=O.createContext(Noe);e5.Provider;function Roe(e){var t=O.useContext(e5);return O.useMemo(()=>e??t,[e,t])}function Loe(e,t,n){return(t=joe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function joe(e){var t=Ioe(e,"string");return typeof t=="symbol"?t:t+""}function Ioe(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 q_="init",W_="pending",K_="active",Boe="completed";function a1(e){return Math.max(0,e)}class zoe{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var n;Loe(this,"state",q_),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=a1(t.animationDuration),this.animationBegin=a1(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()===q_)return this.state=W_,this.beginStartedTime=t,this.animationBegin;if(this.getState()===W_){if(this.beginStartedTime==null)throw new Error;var n=t-this.beginStartedTime;return n>=this.animationBegin?(this.state=K_,this.animationStartedTime=t,this.nextAnimationUpdate(0)):a1(this.animationBegin-n)}if(this.getState()===K_){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=Boe}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class $oe extends zoe{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(Wt(this.getFrom(),this.getTo(),this.getProgress()))}}class Uoe{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 Hoe(e,t){return Koe(e)||Woe(e,t)||qoe(e,t)||Foe()}function Foe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
85
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qoe(e,t){if(e){if(typeof e=="string")return V_(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)?V_(e,t):void 0}}function V_(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 Woe(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 Koe(e){if(Array.isArray(e))return e}var Voe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Q_=0,l1=1;function t5(e){var t=Bn(e,Voe),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=X$(),g=r==="auto"?!td.isSsr&&!p:r,v=Roe(t.animationController),y=O.useState(g?Q_:l1),x=Hoe(y,2),w=x[0],A=x[1];return O.useEffect(()=>{g||A(l1)},[g]),O.useEffect(()=>{var C=_oe(l);if(!g||!i||C==null)return ms;var k=new Uoe,M=new $oe({animationId:n,easing:C,animationDuration:a,animationBegin:s,onAnimationStart:f,onAnimationEnd:c,from:Q_,to:l1});return v(k,M,A)},[v,n,g,i,a,l,s,f,c]),d(Number(w))}function n5(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=O.useRef(kh(t)),r=O.useRef(e);return r.current!==e&&(n.current=kh(t),r.current=e),n.current}var Qoe=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Xoe=(e,t,n)=>e.map(r=>"".concat(Qoe(r)," ").concat(t,"ms ").concat(n)).join(","),Yoe=["radius"],Goe=["radius"],X_,Y_,G_,Z_,J_,eN,tN,nN,rN,iN;function aN(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 lN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aN(Object(n),!0).forEach(function(r){Zoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zoe(e,t,n){return(t=Joe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Joe(e){var t=ese(e,"string");return typeof t=="symbol"?t:t+""}function ese(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 Wg(){return Wg=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},Wg.apply(null,arguments)}function oN(e,t){if(e==null)return{};var n,r,i=tse(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 tse(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 nse(e,t){return lse(e)||ase(e,t)||ise(e,t)||rse()}function rse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
86
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ise(e,t){if(e){if(typeof e=="string")return sN(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)?sN(e,t):void 0}}function sN(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 ase(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 lse(e){if(Array.isArray(e))return e}function Ii(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var uN=(e,t,n,r,i)=>{var a=ja(n),l=ja(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=wn(X_||(X_=Ii(["M",",",""])),e,t+c*g[0]),g[0]>0&&(p+=wn(Y_||(Y_=Ii(["A ",",",",0,0,",",",",",""])),g[0],g[0],d,e+f*g[0],t)),p+=wn(G_||(G_=Ii(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(p+=wn(Z_||(Z_=Ii(["A ",",",",0,0,",`,
|
|
87
|
+
`,",",""])),g[1],g[1],d,e+n,t+c*g[1])),p+=wn(J_||(J_=Ii(["L ",",",""])),e+n,t+r-c*g[2]),g[2]>0&&(p+=wn(eN||(eN=Ii(["A ",",",",0,0,",`,
|
|
88
|
+
`,",",""])),g[2],g[2],d,e+n-f*g[2],t+r)),p+=wn(tN||(tN=Ii(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(p+=wn(nN||(nN=Ii(["A ",",",",0,0,",`,
|
|
89
|
+
`,",",""])),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=wn(rN||(rN=Ii(["M ",",",`
|
|
90
|
+
A `,",",",0,0,",",",",",`
|
|
91
|
+
L `,",",`
|
|
92
|
+
A `,",",",0,0,",",",",",`
|
|
93
|
+
L `,",",`
|
|
94
|
+
A `,",",",0,0,",",",",",`
|
|
95
|
+
L `,",",`
|
|
96
|
+
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=wn(iN||(iN=Ii(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return p},cN={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},r5=e=>{var t=Bn(e,cN),n=O.useRef(null),r=O.useState(-1),i=nse(r,2),a=i[0],l=i[1];O.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var ae=n.current.getTotalLength();ae&&l(ae)}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),M=O.useRef(s),D=O.useRef(c),P=O.useMemo(()=>({x:s,y:c,width:f,height:d,radius:p}),[s,c,f,d,p]),N=n5(P,"rectangle-");if(s!==+s||c!==+c||f!==+f||d!==+d||f===0||d===0)return null;var j=ut("recharts-rectangle",g);if(!A){var U=_r(t);U.radius;var V=oN(U,Yoe);return O.createElement("path",Wg({},V,{x:ja(s),y:ja(c),width:ja(f),height:ja(d),radius:typeof p=="number"?p:void 0,className:j,d:uN(s,c,f,d,p)}))}var K=C.current,B=k.current,oe=M.current,ie=D.current,ue="0px ".concat(a===-1?1:a,"px"),z="".concat(a,"px ").concat(a,"px"),Z=Xoe(["strokeDasharray"],y,typeof v=="string"?v:cN.animationEasing);return O.createElement(t5,{animationId:N,key:N,canBegin:a>0,duration:y,easing:v,isActive:A,begin:x},ae=>{var Q=Wt(K,f,ae),le=Wt(B,d,ae),R=Wt(oe,s,ae),F=Wt(ie,c,ae);n.current&&(C.current=Q,k.current=le,M.current=R,D.current=F);var ee;w?ae>0?ee={transition:Z,strokeDasharray:z}:ee={strokeDasharray:ue}:ee={strokeDasharray:z};var se=_r(t);se.radius;var ge=oN(se,Goe);return O.createElement("path",Wg({},ge,{radius:typeof p=="number"?p:void 0,className:j,d:uN(R,F,Q,le,p),ref:n,style:lN(lN({},ee),t.style)}))})};function fN(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 hN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fN(Object(n),!0).forEach(function(r){ose(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ose(e,t,n){return(t=sse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sse(e){var t=use(e,"string");return typeof t=="symbol"?t:t+""}function use(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 Kg=Math.PI/180,cse=e=>e*180/Math.PI,En=(e,t,n,r)=>({x:e+Math.cos(-Kg*r)*n,y:t+Math.sin(-Kg*r)*n}),fse=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},hse=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},dse=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,l=hse({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:cse(c),angleInRadian:c}},pse=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}},mse=(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},gse=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=dse({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=pse(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?hN(hN({},t),{},{radius:a,angle:mse(g,t)}):null};function i5(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,l=En(t,n,r,i),s=En(t,n,r,a);return{points:[l,s],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var dN,pN,mN,gN,vN,yN,bN;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 Wo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var vse=(e,t)=>{var n=cr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},dm=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)/Kg,p=c?i:i+a*d,g=En(t,n,f,p),v=En(t,n,r,p),y=c?i-a*d:i,x=En(t,n,f*Math.cos(d*Kg),y);return{center:g,circleTangency:v,lineTangency:x,theta:d}},a5=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,l=e.endAngle,s=vse(a,l),c=a+s,f=En(t,n,i,a),d=En(t,n,i,c),p=wn(dN||(dN=Wo(["M ",",",`
|
|
97
|
+
A `,",",`,0,
|
|
98
|
+
`,",",`,
|
|
99
|
+
`,",",`
|
|
100
|
+
`])),f.x,f.y,i,i,+(Math.abs(s)>180),+(a>c),d.x,d.y);if(r>0){var g=En(t,n,r,a),v=En(t,n,r,c);p+=wn(pN||(pN=Wo(["L ",",",`
|
|
101
|
+
A `,",",`,0,
|
|
102
|
+
`,",",`,
|
|
103
|
+
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(s)>180),+(a<=c),g.x,g.y)}else p+=wn(mN||(mN=Wo(["L ",","," Z"])),t,n);return p},yse=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=cr(f-c),p=dm({cx:t,cy:n,radius:i,angle:c,sign:d,cornerRadius:a,cornerIsExternal:s}),g=p.circleTangency,v=p.lineTangency,y=p.theta,x=dm({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?wn(gN||(gN=Wo(["M ",",",`
|
|
104
|
+
a`,",",",0,0,1,",`,0
|
|
105
|
+
a`,",",",0,0,1,",`,0
|
|
106
|
+
`])),v.x,v.y,a,a,a*2,a,a,-a*2):a5({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:f});var M=wn(vN||(vN=Wo(["M ",",",`
|
|
107
|
+
A`,",",",0,0,",",",",",`
|
|
108
|
+
A`,",",",0,",",",",",",",`
|
|
109
|
+
A`,",",",0,0,",",",",",`
|
|
110
|
+
`])),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 D=dm({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),P=D.circleTangency,N=D.lineTangency,j=D.theta,U=dm({cx:t,cy:n,radius:r,angle:f,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),V=U.circleTangency,K=U.lineTangency,B=U.theta,oe=s?Math.abs(c-f):Math.abs(c-f)-j-B;if(oe<0&&a===0)return"".concat(M,"L").concat(t,",").concat(n,"Z");M+=wn(yN||(yN=Wo(["L",",",`
|
|
111
|
+
A`,",",",0,0,",",",",",`
|
|
112
|
+
A`,",",",0,",",",",",",",`
|
|
113
|
+
A`,",",",0,0,",",",",","Z"])),K.x,K.y,a,a,+(d<0),V.x,V.y,r,r,+(oe>180),+(d>0),P.x,P.y,a,a,+(d<0),N.x,N.y)}else M+=wn(bN||(bN=Wo(["L",",","Z"])),t,n);return M},bse={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},xse=e=>{var t=Bn(e,bse),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=ut("recharts-sector",p),v=a-i,y=wi(l,v,0,!0),x;return y>0&&Math.abs(f-d)<360?x=yse({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(y,v/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:f,endAngle:d}):x=a5({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:d}),O.createElement("path",vw({},_r(t),{className:g,d:x}))};function Sse(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(Fz(t)){if(e==="centric"){var r=t.cx,i=t.cy,a=t.innerRadius,l=t.outerRadius,s=t.angle,c=En(r,i,a,s),f=En(r,i,l,s);return[{x:c.x,y:c.y},{x:f.x,y:f.y}]}return i5(t)}}function wse(e){return a$(e)?NaN:Number(e)}function o1(e){return e?(e=wse(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function l5(e,t,n){n&&typeof n!="number"&&nw(e,t,n)&&(t=n=void 0),e=o1(e),t===void 0?(t=e,e=0):t=o1(t),n=n===void 0?e<t?1:-1:o1(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 Ti=e=>e.chartData,xA=W([Ti],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),nd=(e,t,n,r)=>r?xA(e):Ti(e),Ose=(e,t,n)=>n?xA(e):Ti(e),Ase=W([nd],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});W([xA],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});var kse=W([Ti],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});function SA(e,t){return Mse(e)||Tse(e,t)||Ese(e,t)||Cse()}function Cse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
114
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ese(e,t){if(e){if(typeof e=="string")return xN(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)?xN(e,t):void 0}}function xN(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 Tse(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 Mse(e){if(Array.isArray(e))return e}function ea(e){if(Array.isArray(e)&&e.length===2){var t=SA(e,2),n=t[0],r=t[1];if(Ke(n)&&Ke(r))return!0}return!1}function SN(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function o5(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var n=SA(e,2),r=n[0],i=n[1],a,l;if(Ke(r))a=r;else if(typeof r=="function")return;if(Ke(i))l=i;else if(typeof i=="function")return;var s=[a,l];if(ea(s))return s}}function Pse(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(ea(r))return SN(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var i=SA(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"&&m_.test(a)){var f=m_.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"&&g_.test(l)){var p=g_.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(ea(v))return t==null?v:SN(v,t,n)}}}var mc=1e9,Dse={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},OA,kt=!0,ni="[DecimalError] ",Jo=ni+"Invalid argument: ",wA=ni+"Exponent out of range: ",gc=Math.floor,Lo=Math.pow,_se=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Tr,an=1e7,St=7,s5=9007199254740991,Vg=gc(s5/St),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)*St;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 Ua(this,new this.constructor(e))};ve.dividedToIntegerBy=ve.idiv=function(e){var t=this,n=t.constructor;return dt(Ua(t,new n(e),0,1),n.precision)};ve.equals=ve.eq=function(e){return!this.cmp(e)};ve.exponent=function(){return Kt(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(Tr))throw Error(ni+"NaN");if(n.s<1)throw Error(ni+(n.s?"NaN":"-Infinity"));return n.eq(Tr)?new r(0):(kt=!1,t=Ua(Mh(n,a),Mh(e,a),a),kt=!0,dt(t,i))};ve.minus=ve.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?f5(t,e):u5(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(ni+"NaN");return n.s?(kt=!1,t=Ua(n,e,0,1).times(e),kt=!0,n.minus(t)):dt(new r(n),i)};ve.naturalExponential=ve.exp=function(){return c5(this)};ve.naturalLogarithm=ve.ln=function(){return Mh(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?u5(t,e):f5(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(Jo+e);if(t=Kt(i)+1,r=i.d.length-1,n=r*St+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(ni+"NaN")}for(e=Kt(s),kt=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=Zi(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(Ua(s,a,l+2)).times(.5),Zi(a.d).slice(0,l)===(t=Zi(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(dt(a,n+1,0),a.times(a).eq(s)){r=a;break}}else if(t!="9999")break;l+=4}return kt=!0,dt(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%an|0,t=s/an|0;a[i]=(a[i]+t)%an|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,kt?dt(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:(la(e,0,mc),t===void 0?t=r.rounding:la(t,0,8),dt(n,e+Kt(n)+1,t))};ve.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=cs(r,!0):(la(e,0,mc),t===void 0?t=i.rounding:la(t,0,8),r=dt(new i(r),e+1,t),n=cs(r,!0,e+1)),n};ve.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?cs(i):(la(e,0,mc),t===void 0?t=a.rounding:la(t,0,8),r=dt(new a(i),e+Kt(i)+1,t),n=cs(r.abs(),!1,e+Kt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ve.toInteger=ve.toint=function(){var e=this,t=e.constructor;return dt(new t(e),Kt(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(Tr);if(s=new c(s),!s.s){if(e.s<1)throw Error(ni+"Infinity");return s}if(s.eq(Tr))return s;if(r=c.precision,e.eq(Tr))return dt(s,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=s.s,l){if((n=d<0?-d:d)<=s5){for(i=new c(Tr),t=Math.ceil(r/St+4),kt=!1;n%2&&(i=i.times(s),ON(i.d,t)),n=gc(n/2),n!==0;)s=s.times(s),ON(s.d,t);return kt=!0,e.s<0?new c(Tr).div(i):dt(i,r)}}else if(a<0)throw Error(ni+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,kt=!1,i=e.times(Mh(s,r+f)),kt=!0,i=c5(i),i.s=a,i};ve.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Kt(i),r=cs(i,n<=a.toExpNeg||n>=a.toExpPos)):(la(e,1,mc),t===void 0?t=a.rounding:la(t,0,8),i=dt(new a(i),e,t),n=Kt(i),r=cs(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):(la(e,1,mc),t===void 0?t=r.rounding:la(t,0,8)),dt(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=Kt(e),n=e.constructor;return cs(e,t<=n.toExpNeg||t>=n.toExpPos)};function u5(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)),kt?dt(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/St),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)/an|0,c[a]%=an;for(n&&(c.unshift(n),++i),s=c.length;c[--s]==0;)c.pop();return t.d=c,t.e=i,kt?dt(t,p):t}function la(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Jo+e)}function Zi(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=St-r.length,n&&(a+=jl(n)),a+=r;l=e[t],r=l+"",n=St-r.length,n&&(a+=jl(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var Ua=(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%an|0,l=a/an|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*an+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,M,D,P,N,j,U=r.constructor,V=r.s==i.s?1:-1,K=r.d,B=i.d;if(!r.s)return new U(r);if(!i.s)throw Error(ni+"Division by zero");for(c=r.e-i.e,N=B.length,D=K.length,v=new U(V),y=v.d=[],f=0;B[f]==(K[f]||0);)++f;if(B[f]>(K[f]||0)&&--c,a==null?C=a=U.precision:l?C=a+(Kt(r)-Kt(i))+1:C=a,C<0)return new U(0);if(C=C/St+2|0,f=0,N==1)for(d=0,B=B[0],C++;(f<D||d)&&C--;f++)k=d*an+(K[f]||0),y[f]=k/B|0,d=k%B|0;else{for(d=an/(B[0]+1)|0,d>1&&(B=e(B,d),K=e(K,d),N=B.length,D=K.length),M=N,x=K.slice(0,N),w=x.length;w<N;)x[w++]=0;j=B.slice(),j.unshift(0),P=B[0],B[1]>=an/2&&++P;do d=0,s=t(B,x,N,w),s<0?(A=x[0],N!=w&&(A=A*an+(x[1]||0)),d=A/P|0,d>1?(d>=an&&(d=an-1),p=e(B,d),g=p.length,w=x.length,s=t(p,x,g,w),s==1&&(d--,n(p,N<g?j: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?j:B,w))),w=x.length):s===0&&(d++,x=[0]),y[f++]=d,s&&x[0]?x[w++]=K[M]||0:(x=[K[M]],w=1);while((M++<D||x[0]!==void 0)&&C--)}return y[0]||y.shift(),v.e=c,dt(v,l?a+Kt(v)+1:a)}})();function c5(e,t){var n,r,i,a,l,s,c=0,f=0,d=e.constructor,p=d.precision;if(Kt(e)>16)throw Error(wA+Kt(e));if(!e.s)return new d(Tr);for(kt=!1,s=p,l=new d(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(Lo(2,f))/Math.LN10*2+5|0,s+=r,n=i=a=new d(Tr),d.precision=s;;){if(i=dt(i.times(e),s),n=n.times(++c),l=a.plus(Ua(i,n,s)),Zi(l.d).slice(0,s)===Zi(a.d).slice(0,s)){for(;f--;)a=dt(a.times(a),s);return d.precision=p,t==null?(kt=!0,dt(a,p)):a}a=l}}function Kt(e){for(var t=e.e*St,n=e.d[0];n>=10;n/=10)t++;return t}function s1(e,t,n){if(t>e.LN10.sd())throw kt=!0,n&&(e.precision=n),Error(ni+"LN10 precision limit exceeded");return dt(new e(e.LN10),t)}function jl(e){for(var t="";e--;)t+="0";return t}function Mh(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(ni+(v.s?"NaN":"-Infinity"));if(v.eq(Tr))return new x(0);if(t==null?(kt=!1,f=w):f=t,v.eq(10))return t==null&&(kt=!0),s1(x,f);if(f+=g,x.precision=f,n=Zi(y),r=n.charAt(0),a=Kt(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=Zi(v.d),r=n.charAt(0),p++;a=Kt(v),r>1?(v=new x("0."+n),a++):v=new x(r+"."+n.slice(1))}else return c=s1(x,f+2,w).times(a+""),v=Mh(new x(r+"."+n.slice(1)),f-g).plus(c),x.precision=w,t==null?(kt=!0,dt(v,w)):v;for(s=l=v=Ua(v.minus(Tr),v.plus(Tr),f),d=dt(v.times(v),f),i=3;;){if(l=dt(l.times(d),f),c=s.plus(Ua(l,new x(i),f)),Zi(c.d).slice(0,f)===Zi(s.d).slice(0,f))return s=s.times(2),a!==0&&(s=s.plus(s1(x,f+2,w).times(a+""))),s=Ua(s,new x(p),f),x.precision=w,t==null?(kt=!0,dt(s,w)):s;s=c,i+=2}}function wN(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/St),e.d=[],r=(n+1)%St,n<0&&(r+=St),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=St;r<i;)e.d.push(+t.slice(r,r+=St));t=t.slice(r),r=St-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),kt&&(e.e>Vg||e.e<-Vg))throw Error(wA+n)}else e.s=0,e.e=0,e.d=[0];return e}function dt(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+=St,i=t,f=p[d=0];else{if(d=Math.ceil((r+1)/St),a=p.length,d>=a)return e;for(f=a=p[d],l=1;a>=10;a/=10)l++;r%=St,i=r-St+l}if(n!==void 0&&(a=Lo(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/Lo(10,l-i):0:p[d-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return c?(a=Kt(e),p.length=1,t=t-a-1,p[0]=Lo(10,(St-t%St)%St),e.e=gc(-t/St)||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=Lo(10,St-r),p[d]=i>0?(f/Lo(10,l-i)%Lo(10,i)|0)*a:0),c)for(;;)if(d==0){(p[0]+=a)==an&&(p[0]=1,++e.e);break}else{if(p[d]+=a,p[d]!=an)break;p[d--]=0,a=1}for(r=p.length;p[--r]===0;)p.pop();if(kt&&(e.e>Vg||e.e<-Vg))throw Error(wA+Kt(e));return e}function f5(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),kt?dt(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/St),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]=an-1;--c[a],c[i]+=an}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,kt?dt(t,v):t):new g(0)}function cs(e,t,n){var r,i=Kt(e),a=Zi(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+jl(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+jl(-i-1)+a,n&&(r=n-l)>0&&(a+=jl(r))):i>=l?(a+=jl(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+jl(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=jl(r))),e.s<0?"-"+a:a}function ON(e,t){if(e.length>t)return e.length=t,!0}function h5(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(Jo+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 wN(l,a.toString())}else if(typeof a!="string")throw Error(Jo+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,_se.test(a))wN(l,a);else throw Error(Jo+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=h5,i.config=i.set=Nse,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 Nse(e){if(!e||typeof e!="object")throw Error(ni+"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(Jo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Jo+n+": "+r);return this}var OA=h5(Dse);Tr=new OA(1);const We=OA;function d5(e){var t;return e===0?t=1:t=Math.floor(new We(e).abs().log(10).toNumber())+1,t}function p5(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 Ph(e,t){return Ise(e)||jse(e,t)||Lse(e,t)||Rse()}function Rse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
115
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lse(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 jse(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 Ise(e){if(Array.isArray(e))return e}var m5=e=>{var t=Ph(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},AA=(e,t,n)=>{if(e.lte(0))return new We(0);var r=d5(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()))},g5=(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()))},Bse=(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(d5(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},v5=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]:AA;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?v5(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))})},kN=function(t){var n=Ph(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=m5([r,i]),d=Ph(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 Bse(p,a,l);var y=s==="snap125"?g5:AA,x=v5(p,g,c,l,0,y),w=x.step,A=x.tickMin,C=x.tickMax,k=p5(A,C.add(new We(.1).mul(w)),w);return r>i?k.reverse():k},CN=function(t,n){var r=Ph(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=m5([i,a]),f=Ph(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"?g5:AA,v=Math.max(n,2),y=g(new We(p).sub(d).div(v-1),l,0),x=[...p5(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},y5=e=>e.rootProps.maxBarSize,zse=e=>e.rootProps.barGap,b5=e=>e.rootProps.barCategoryGap,$se=e=>e.rootProps.barSize,dy=e=>e.rootProps.stackOffset,x5=e=>e.rootProps.reverseStackOrder,kA=e=>e.options.chartName,CA=e=>e.rootProps.syncId,S5=e=>e.rootProps.syncMethod,EA=e=>e.options.eventEmitter,un={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},To={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Bi={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},py=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function my(e,t,n){if(n!=="auto")return n;if(e!=null)return tl(e,t)?"category":"number"}function EN(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 Qg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EN(Object(n),!0).forEach(function(r){Use(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Use(e,t,n){return(t=Hse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hse(e){var t=Fse(e,"string");return typeof t=="symbol"?t:t+""}function Fse(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 TN={allowDataOverflow:To.allowDataOverflow,allowDecimals:To.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:To.angleAxisId,includeHidden:!1,name:void 0,reversed:To.reversed,scale:To.scale,tick:To.tick,tickCount:void 0,ticks:void 0,type:To.type,unit:void 0,niceTicks:"auto"},MN={allowDataOverflow:Bi.allowDataOverflow,allowDecimals:Bi.allowDecimals,allowDuplicatedCategory:Bi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Bi.radiusAxisId,includeHidden:Bi.includeHidden,name:void 0,reversed:Bi.reversed,scale:Bi.scale,tick:Bi.tick,tickCount:Bi.tickCount,ticks:void 0,type:Bi.type,unit:void 0,niceTicks:"auto"},qse=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},TA=W([qse,K$],(e,t)=>{var n;if(e!=null)return e;var r=(n=my(t,"angleAxis",TN.type))!==null&&n!==void 0?n:"category";return Qg(Qg({},TN),{},{type:r})}),Wse=(e,t)=>e.polarAxis.radiusAxis[t],MA=W([Wse,K$],(e,t)=>{var n;if(e!=null)return e;var r=(n=my(t,"radiusAxis",MN.type))!==null&&n!==void 0?n:"category";return Qg(Qg({},MN),{},{type:r})}),gy=e=>e.polarOptions,PA=W([nl,rl,cn],fse),w5=W([gy,PA],(e,t)=>{if(e!=null)return wi(e.innerRadius,t,0)}),O5=W([gy,PA],(e,t)=>{if(e!=null)return wi(e.outerRadius,t,t*.8)}),Kse=e=>{if(e==null)return[0,0];var t=e.startAngle,n=e.endAngle;return[t,n]},A5=W([gy],Kse);W([TA,A5],py);var k5=W([PA,w5,O5],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});W([MA,k5],py);var C5=W([rt,gy,w5,O5,nl,rl],(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:wi(l,i,i/2),cy:wi(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:f,clockWise:!1}}}),fn=(e,t)=>t,vy=(e,t,n)=>n;function DA(e){return e?.id}function E5(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=DA(c);d.forEach((g,v)=>{var y=l==null||a?v:String($t(g,l,null)),x=$t(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 yy(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var rd=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function by(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Vse(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 hn=e=>{var t=rt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},vc=e=>e.tooltip.settings.axisId;function _A(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 Qse=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!ea(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Ke(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 Wl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Xse(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function NA(e){let t,n,r;e.length!==2?(t=Wl,n=(s,c)=>Wl(e(s),c),r=(s,c)=>e(s)-c):(t=e===Wl||e===Xse?e:Yse,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 Yse(){return 0}function T5(e){return e===null?NaN:+e}function*Gse(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Zse=NA(Wl),id=Zse.right;NA(T5).center;class PN extends Map{constructor(t,n=tue){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(DN(this,t))}has(t){return super.has(DN(this,t))}set(t,n){return super.set(Jse(this,t),n)}delete(t){return super.delete(eue(this,t))}}function DN({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Jse({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function eue({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function tue(e){return e!==null&&typeof e=="object"?e.valueOf():e}function nue(e=Wl){if(e===Wl)return M5;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 M5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const rue=Math.sqrt(50),iue=Math.sqrt(10),aue=Math.sqrt(2);function Xg(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>=rue?10:a>=iue?5:a>=aue?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?Xg(e,t,n*2):[s,c,f]}function yw(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?Xg(t,e,n):Xg(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 bw(e,t,n){return t=+t,e=+e,n=+n,Xg(e,t,n)[2]}function xw(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?bw(t,e,n):bw(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function _N(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function NN(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function P5(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?M5:nue(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));P5(e,t,v,y,i)}const a=e[t];let l=n,s=r;for(_f(e,n,t),i(e[r],a)>0&&_f(e,n,r);l<s;){for(_f(e,l,s),++l,--s;i(e[l],a)<0;)++l;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?_f(e,n,s):(++s,_f(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function _f(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function lue(e,t,n){if(e=Float64Array.from(Gse(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return NN(e);if(t>=1)return _N(e);var r,i=(r-1)*t,a=Math.floor(i),l=_N(P5(e,a).subarray(0,a+1)),s=NN(e.subarray(a+1));return l+(s-l)*(i-a)}}function oue(e,t,n=T5){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 sue(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 ai(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function il(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 Sw=Symbol("implicit");function RA(){var e=new PN,t=[],n=[],r=Sw;function i(a){let l=e.get(a);if(l===void 0){if(r!==Sw)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 PN;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 RA(t,n).unknown(r)},ai.apply(i,arguments),i}function LA(){var e=RA().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=sue(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 LA(t(),[r,i]).round(s).paddingInner(c).paddingOuter(f).align(d)},ai.apply(p(),arguments)}function D5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return D5(t())},e}function uue(){return D5(LA.apply(null,arguments).paddingInner(1))}function jA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ad(){}var Dh=.7,Yg=1/Dh,Iu="\\s*([+-]?\\d+)\\s*",_h="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ta="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cue=/^#([0-9a-f]{3,8})$/,fue=new RegExp(`^rgb\\(${Iu},${Iu},${Iu}\\)$`),hue=new RegExp(`^rgb\\(${ta},${ta},${ta}\\)$`),due=new RegExp(`^rgba\\(${Iu},${Iu},${Iu},${_h}\\)$`),pue=new RegExp(`^rgba\\(${ta},${ta},${ta},${_h}\\)$`),mue=new RegExp(`^hsl\\(${_h},${ta},${ta}\\)$`),gue=new RegExp(`^hsla\\(${_h},${ta},${ta},${_h}\\)$`),RN={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};jA(ad,Nh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:LN,formatHex:LN,formatHex8:vue,formatHsl:yue,formatRgb:jN,toString:jN});function LN(){return this.rgb().formatHex()}function vue(){return this.rgb().formatHex8()}function yue(){return N5(this).formatHsl()}function jN(){return this.rgb().formatRgb()}function Nh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=cue.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?IN(t):n===3?new hr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?pm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?pm(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=fue.exec(e))?new hr(t[1],t[2],t[3],1):(t=hue.exec(e))?new hr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=due.exec(e))?pm(t[1],t[2],t[3],t[4]):(t=pue.exec(e))?pm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mue.exec(e))?$N(t[1],t[2]/100,t[3]/100,1):(t=gue.exec(e))?$N(t[1],t[2]/100,t[3]/100,t[4]):RN.hasOwnProperty(e)?IN(RN[e]):e==="transparent"?new hr(NaN,NaN,NaN,0):null}function IN(e){return new hr(e>>16&255,e>>8&255,e&255,1)}function pm(e,t,n,r){return r<=0&&(e=t=n=NaN),new hr(e,t,n,r)}function bue(e){return e instanceof ad||(e=Nh(e)),e?(e=e.rgb(),new hr(e.r,e.g,e.b,e.opacity)):new hr}function ww(e,t,n,r){return arguments.length===1?bue(e):new hr(e,t,n,r??1)}function hr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}jA(hr,ww,_5(ad,{brighter(e){return e=e==null?Yg:Math.pow(Yg,e),new hr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Dh:Math.pow(Dh,e),new hr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hr(es(this.r),es(this.g),es(this.b),Gg(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:BN,formatHex:BN,formatHex8:xue,formatRgb:zN,toString:zN}));function BN(){return`#${Ko(this.r)}${Ko(this.g)}${Ko(this.b)}`}function xue(){return`#${Ko(this.r)}${Ko(this.g)}${Ko(this.b)}${Ko((isNaN(this.opacity)?1:this.opacity)*255)}`}function zN(){const e=Gg(this.opacity);return`${e===1?"rgb(":"rgba("}${es(this.r)}, ${es(this.g)}, ${es(this.b)}${e===1?")":`, ${e})`}`}function Gg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function es(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ko(e){return e=es(e),(e<16?"0":"")+e.toString(16)}function $N(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pi(e,t,n,r)}function N5(e){if(e instanceof pi)return new pi(e.h,e.s,e.l,e.opacity);if(e instanceof ad||(e=Nh(e)),!e)return new pi;if(e instanceof pi)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 pi(l,s,c,e.opacity)}function Sue(e,t,n,r){return arguments.length===1?N5(e):new pi(e,t,n,r??1)}function pi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jA(pi,Sue,_5(ad,{brighter(e){return e=e==null?Yg:Math.pow(Yg,e),new pi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Dh:Math.pow(Dh,e),new pi(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 hr(u1(e>=240?e-240:e+120,i,r),u1(e,i,r),u1(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new pi(UN(this.h),mm(this.s),mm(this.l),Gg(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=Gg(this.opacity);return`${e===1?"hsl(":"hsla("}${UN(this.h)}, ${mm(this.s)*100}%, ${mm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function UN(e){return e=(e||0)%360,e<0?e+360:e}function mm(e){return Math.max(0,Math.min(1,e||0))}function u1(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 IA=e=>()=>e;function wue(e,t){return function(n){return e+n*t}}function Oue(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 Aue(e){return(e=+e)==1?R5:function(t,n){return n-t?Oue(t,n,e):IA(isNaN(t)?n:t)}}function R5(e,t){var n=t-e;return n?wue(e,n):IA(isNaN(e)?t:e)}const HN=(function e(t){var n=Aue(t);function r(i,a){var l=n((i=ww(i)).r,(a=ww(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),f=R5(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 kue(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 Cue(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Eue(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 Tue(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Zg(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Mue(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 Ow=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,c1=new RegExp(Ow.source,"g");function Pue(e){return function(){return e}}function Due(e){return function(t){return e(t)+""}}function _ue(e,t){var n=Ow.lastIndex=c1.lastIndex=0,r,i,a,l=-1,s=[],c=[];for(e=e+"",t=t+"";(r=Ow.exec(e))&&(i=c1.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:Zg(r,i)})),n=c1.lastIndex;return n<t.length&&(a=t.slice(n),s[l]?s[l]+=a:s[++l]=a),s.length<2?c[0]?Due(c[0].x):Pue(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"?IA(t):(n==="number"?Zg:n==="string"?(r=Nh(t))?(t=r,HN):_ue:t instanceof Nh?HN:t instanceof Date?Tue:Cue(t)?kue:Array.isArray(t)?Eue:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Mue:Zg)(e,t)}function BA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Nue(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 Rue(e){return function(){return e}}function Jg(e){return+e}var FN=[0,1];function Qn(e){return e}function Aw(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Rue(isNaN(t)?NaN:.5)}function Lue(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function jue(e,t,n){var r=e[0],i=e[1],a=t[0],l=t[1];return i<r?(r=Aw(i,r),a=n(l,a)):(r=Aw(r,i),a=n(a,l)),function(s){return a(r(s))}}function Iue(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]=Aw(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(s){var c=id(e,s,1,r)-1;return a[c](i[c](s))}}function ld(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function xy(){var e=FN,t=FN,n=yc,r,i,a,l=Qn,s,c,f;function d(){var g=Math.min(e.length,t.length);return l!==Qn&&(l=Lue(e[0],e[g-1])),s=g>2?Iue:jue,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),Zg)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,Jg),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=BA,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 zA(){return xy()(Qn,Qn)}function Bue(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ev(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 ec(e){return e=ev(Math.abs(e)),e?e[1]:NaN}function zue(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 $ue(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Uue=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Rh(e){if(!(t=Uue.exec(e)))throw new Error("invalid format: "+e);var t;return new $A({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]})}Rh.prototype=$A.prototype;function $A(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+""}$A.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 Hue(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 tv;function Fue(e,t){var n=ev(e,t);if(!n)return tv=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(tv=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")+ev(e,Math.max(0,t+a-1))[0]}function qN(e,t){var n=ev(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 WN={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Bue,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)=>qN(e*100,t),r:qN,s:Fue,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function KN(e){return e}var VN=Array.prototype.map,QN=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function que(e){var t=e.grouping===void 0||e.thousands===void 0?KN:zue(VN.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?KN:$ue(VN.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=Rh(p);var v=p.fill,y=p.align,x=p.sign,w=p.symbol,A=p.zero,C=p.width,k=p.comma,M=p.precision,D=p.trim,P=p.type;P==="n"?(k=!0,P="g"):WN[P]||(M===void 0&&(M=12),D=!0,P="g"),(A||v==="0"&&y==="=")&&(A=!0,v="0",y="=");var N=(g&&g.prefix!==void 0?g.prefix:"")+(w==="$"?n:w==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),j=(w==="$"?r:/[%p]/.test(P)?l:"")+(g&&g.suffix!==void 0?g.suffix:""),U=WN[P],V=/[defgprs%]/.test(P);M=M===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function K(B){var oe=N,ie=j,ue,z,Z;if(P==="c")ie=U(B)+ie,B="";else{B=+B;var ae=B<0||1/B<0;if(B=isNaN(B)?c:U(Math.abs(B),M),D&&(B=Hue(B)),ae&&+B==0&&x!=="+"&&(ae=!1),oe=(ae?x==="("?x:s:x==="-"||x==="("?"":x)+oe,ie=(P==="s"&&!isNaN(B)&&tv!==void 0?QN[8+tv/3]:"")+ie+(ae&&x==="("?")":""),V){for(ue=-1,z=B.length;++ue<z;)if(Z=B.charCodeAt(ue),48>Z||Z>57){ie=(Z===46?i+B.slice(ue+1):B.slice(ue))+ie,B=B.slice(0,ue);break}}}k&&!A&&(B=t(B,1/0));var Q=oe.length+B.length+ie.length,le=Q<C?new Array(C-Q+1).join(v):"";switch(k&&A&&(B=t(le+B,le.length?C-ie.length:1/0),le=""),y){case"<":B=oe+B+ie+le;break;case"=":B=oe+le+B+ie;break;case"^":B=le.slice(0,Q=le.length>>1)+oe+B+ie+le.slice(Q);break;default:B=le+oe+B+ie;break}return a(B)}return K.toString=function(){return p+""},K}function d(p,g){var v=Math.max(-8,Math.min(8,Math.floor(ec(g)/3)))*3,y=Math.pow(10,-v),x=f((p=Rh(p),p.type="f",p),{suffix:QN[8+v/3]});return function(w){return x(y*w)}}return{format:f,formatPrefix:d}}var gm,UA,L5;Wue({thousands:",",grouping:[3],currency:["$",""]});function Wue(e){return gm=que(e),UA=gm.format,L5=gm.formatPrefix,gm}function Kue(e){return Math.max(0,-ec(Math.abs(e)))}function Vue(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ec(t)/3)))*3-ec(Math.abs(e)))}function Que(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ec(t)-ec(e))+1}function j5(e,t,n,r){var i=xw(e,t,n),a;switch(r=Rh(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Vue(i,l))&&(r.precision=a),L5(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Que(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Kue(i))&&(r.precision=a-(r.type==="%")*2);break}}return UA(r)}function lo(e){var t=e.domain;return e.ticks=function(n){var r=t();return yw(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return j5(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=bw(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 I5(){var e=zA();return e.copy=function(){return ld(e,I5())},ai.apply(e,arguments),lo(e)}function B5(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,Jg),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return B5(e).unknown(t)},e=arguments.length?Array.from(e,Jg):[0,1],lo(n)}function z5(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 XN(e){return Math.log(e)}function YN(e){return Math.exp(e)}function Xue(e){return-Math.log(-e)}function Yue(e){return-Math.exp(-e)}function Gue(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Zue(e){return e===10?Gue:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Jue(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 GN(e){return(t,n)=>-e(-t,n)}function HA(e){const t=e(XN,YN),n=t.domain;let r=10,i,a;function l(){return i=Jue(r),a=Zue(r),n()[0]<0?(i=GN(i),a=GN(a),e(Xue,Yue)):e(XN,YN),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=yw(f,d,w))}else A=yw(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=Rh(c)).precision==null&&(c.trim=!0),c=UA(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(z5(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function $5(){const e=HA(xy()).domain([1,10]);return e.copy=()=>ld(e,$5()).base(e.base()),ai.apply(e,arguments),e}function ZN(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function JN(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function FA(e){var t=1,n=e(ZN(t),JN(t));return n.constant=function(r){return arguments.length?e(ZN(t=+r),JN(t)):t},lo(n)}function U5(){var e=FA(xy());return e.copy=function(){return ld(e,U5()).constant(e.constant())},ai.apply(e,arguments)}function eR(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ece(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function tce(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(ece,tce):e(eR(n),eR(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},lo(t)}function WA(){var e=qA(xy());return e.copy=function(){return ld(e,WA()).exponent(e.exponent())},ai.apply(e,arguments),e}function nce(){return WA.apply(null,arguments).exponent(.5)}function tR(e){return Math.sign(e)*e*e}function rce(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function H5(){var e=zA(),t=[0,1],n=!1,r;function i(a){var l=rce(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(tR(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,Jg)).map(tR)),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 H5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ai.apply(i,arguments),lo(i)}function F5(){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]=oue(e,l/s);return a}function a(l){return l==null||isNaN(l=+l)?r:t[id(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(Wl),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 F5().domain(e).range(t).unknown(r)},ai.apply(a,arguments)}function q5(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(c){return c!=null&&c<=c?i[id(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 q5().domain([e,t]).range(i).unknown(a)},ai.apply(lo(l),arguments)}function W5(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[id(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 W5().domain(e).range(t).unknown(n)},ai.apply(i,arguments)}const f1=new Date,h1=new Date;function en(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=>en(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)=>(f1.setTime(+a),h1.setTime(+l),e(f1),e(h1),Math.floor(n(f1,h1))),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 nv=en(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);nv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?en(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):nv);nv.range;const Ia=1e3,Jr=Ia*60,Ba=Jr*60,Ga=Ba*24,KA=Ga*7,nR=Ga*30,d1=Ga*365,Vo=en(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ia)},(e,t)=>(t-e)/Ia,e=>e.getUTCSeconds());Vo.range;const VA=en(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ia)},(e,t)=>{e.setTime(+e+t*Jr)},(e,t)=>(t-e)/Jr,e=>e.getMinutes());VA.range;const QA=en(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Jr)},(e,t)=>(t-e)/Jr,e=>e.getUTCMinutes());QA.range;const XA=en(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ia-e.getMinutes()*Jr)},(e,t)=>{e.setTime(+e+t*Ba)},(e,t)=>(t-e)/Ba,e=>e.getHours());XA.range;const YA=en(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ba)},(e,t)=>(t-e)/Ba,e=>e.getUTCHours());YA.range;const od=en(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Jr)/Ga,e=>e.getDate()-1);od.range;const Sy=en(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ga,e=>e.getUTCDate()-1);Sy.range;const K5=en(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ga,e=>Math.floor(e/Ga));K5.range;function vs(e){return en(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())*Jr)/KA)}const wy=vs(0),rv=vs(1),ice=vs(2),ace=vs(3),tc=vs(4),lce=vs(5),oce=vs(6);wy.range;rv.range;ice.range;ace.range;tc.range;lce.range;oce.range;function ys(e){return en(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)/KA)}const Oy=ys(0),iv=ys(1),sce=ys(2),uce=ys(3),nc=ys(4),cce=ys(5),fce=ys(6);Oy.range;iv.range;sce.range;uce.range;nc.range;cce.range;fce.range;const GA=en(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());GA.range;const ZA=en(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());ZA.range;const Za=en(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());Za.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:en(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)});Za.range;const Ja=en(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());Ja.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:en(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)});Ja.range;function V5(e,t,n,r,i,a){const l=[[Vo,1,Ia],[Vo,5,5*Ia],[Vo,15,15*Ia],[Vo,30,30*Ia],[a,1,Jr],[a,5,5*Jr],[a,15,15*Jr],[a,30,30*Jr],[i,1,Ba],[i,3,3*Ba],[i,6,6*Ba],[i,12,12*Ba],[r,1,Ga],[r,2,2*Ga],[n,1,KA],[t,1,nR],[t,3,3*nR],[e,1,d1]];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=NA(([,,w])=>w).right(l,g);if(v===l.length)return e.every(xw(f/d1,d/d1,p));if(v===0)return nv.every(Math.max(xw(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[hce,dce]=V5(Ja,ZA,Oy,K5,YA,QA),[pce,mce]=V5(Za,GA,wy,od,XA,VA);function p1(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 m1(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 Nf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function gce(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=Rf(i),d=Lf(i),p=Rf(a),g=Lf(a),v=Rf(l),y=Lf(l),x=Rf(s),w=Lf(s),A=Rf(c),C=Lf(c),k={a:Z,A:ae,b:Q,B:le,c:null,d:sR,e:sR,f:zce,g:Xce,G:Gce,H:jce,I:Ice,j:Bce,L:Q5,m:$ce,M:Uce,p:R,q:F,Q:fR,s:hR,S:Hce,u:Fce,U:qce,V:Wce,w:Kce,W:Vce,x:null,X:null,y:Qce,Y:Yce,Z:Zce,"%":cR},M={a:ee,A:se,b:ge,B:Oe,c:null,d:uR,e:uR,f:nfe,g:hfe,G:pfe,H:Jce,I:efe,j:tfe,L:Y5,m:rfe,M:ife,p:Pe,q:gt,Q:fR,s:hR,S:afe,u:lfe,U:ofe,V:sfe,w:ufe,W:cfe,x:null,X:null,y:ffe,Y:dfe,Z:mfe,"%":cR},D={a:V,A:K,b:B,B:oe,c:ie,d:lR,e:lR,f:_ce,g:aR,G:iR,H:oR,I:oR,j:Tce,L:Dce,m:Ece,M:Mce,p:U,q:Cce,Q:Rce,s:Lce,S:Pce,u:Sce,U:wce,V:Oce,w:xce,W:Ace,x:ue,X:z,y:aR,Y:iR,Z:kce,"%":Nce};k.x=P(n,k),k.X=P(r,k),k.c=P(t,k),M.x=P(n,M),M.X=P(r,M),M.c=P(t,M);function P(ce,Te){return function(Ee){var fe=[],Lt=-1,Re=0,xe=ce.length,vt,pn,ha;for(Ee instanceof Date||(Ee=new Date(+Ee));++Lt<xe;)ce.charCodeAt(Lt)===37&&(fe.push(ce.slice(Re,Lt)),(pn=rR[vt=ce.charAt(++Lt)])!=null?vt=ce.charAt(++Lt):pn=vt==="e"?" ":"0",(ha=Te[vt])&&(vt=ha(Ee,pn)),fe.push(vt),Re=Lt+1);return fe.push(ce.slice(Re,Lt)),fe.join("")}}function N(ce,Te){return function(Ee){var fe=Nf(1900,void 0,1),Lt=j(fe,ce,Ee+="",0),Re,xe;if(Lt!=Ee.length)return null;if("Q"in fe)return new Date(fe.Q);if("s"in fe)return new Date(fe.s*1e3+("L"in fe?fe.L:0));if(Te&&!("Z"in fe)&&(fe.Z=0),"p"in fe&&(fe.H=fe.H%12+fe.p*12),fe.m===void 0&&(fe.m="q"in fe?fe.q:0),"V"in fe){if(fe.V<1||fe.V>53)return null;"w"in fe||(fe.w=1),"Z"in fe?(Re=m1(Nf(fe.y,0,1)),xe=Re.getUTCDay(),Re=xe>4||xe===0?iv.ceil(Re):iv(Re),Re=Sy.offset(Re,(fe.V-1)*7),fe.y=Re.getUTCFullYear(),fe.m=Re.getUTCMonth(),fe.d=Re.getUTCDate()+(fe.w+6)%7):(Re=p1(Nf(fe.y,0,1)),xe=Re.getDay(),Re=xe>4||xe===0?rv.ceil(Re):rv(Re),Re=od.offset(Re,(fe.V-1)*7),fe.y=Re.getFullYear(),fe.m=Re.getMonth(),fe.d=Re.getDate()+(fe.w+6)%7)}else("W"in fe||"U"in fe)&&("w"in fe||(fe.w="u"in fe?fe.u%7:"W"in fe?1:0),xe="Z"in fe?m1(Nf(fe.y,0,1)).getUTCDay():p1(Nf(fe.y,0,1)).getDay(),fe.m=0,fe.d="W"in fe?(fe.w+6)%7+fe.W*7-(xe+5)%7:fe.w+fe.U*7-(xe+6)%7);return"Z"in fe?(fe.H+=fe.Z/100|0,fe.M+=fe.Z%100,m1(fe)):p1(fe)}}function j(ce,Te,Ee,fe){for(var Lt=0,Re=Te.length,xe=Ee.length,vt,pn;Lt<Re;){if(fe>=xe)return-1;if(vt=Te.charCodeAt(Lt++),vt===37){if(vt=Te.charAt(Lt++),pn=D[vt in rR?Te.charAt(Lt++):vt],!pn||(fe=pn(ce,Ee,fe))<0)return-1}else if(vt!=Ee.charCodeAt(fe++))return-1}return fe}function U(ce,Te,Ee){var fe=f.exec(Te.slice(Ee));return fe?(ce.p=d.get(fe[0].toLowerCase()),Ee+fe[0].length):-1}function V(ce,Te,Ee){var fe=v.exec(Te.slice(Ee));return fe?(ce.w=y.get(fe[0].toLowerCase()),Ee+fe[0].length):-1}function K(ce,Te,Ee){var fe=p.exec(Te.slice(Ee));return fe?(ce.w=g.get(fe[0].toLowerCase()),Ee+fe[0].length):-1}function B(ce,Te,Ee){var fe=A.exec(Te.slice(Ee));return fe?(ce.m=C.get(fe[0].toLowerCase()),Ee+fe[0].length):-1}function oe(ce,Te,Ee){var fe=x.exec(Te.slice(Ee));return fe?(ce.m=w.get(fe[0].toLowerCase()),Ee+fe[0].length):-1}function ie(ce,Te,Ee){return j(ce,t,Te,Ee)}function ue(ce,Te,Ee){return j(ce,n,Te,Ee)}function z(ce,Te,Ee){return j(ce,r,Te,Ee)}function Z(ce){return l[ce.getDay()]}function ae(ce){return a[ce.getDay()]}function Q(ce){return c[ce.getMonth()]}function le(ce){return s[ce.getMonth()]}function R(ce){return i[+(ce.getHours()>=12)]}function F(ce){return 1+~~(ce.getMonth()/3)}function ee(ce){return l[ce.getUTCDay()]}function se(ce){return a[ce.getUTCDay()]}function ge(ce){return c[ce.getUTCMonth()]}function Oe(ce){return s[ce.getUTCMonth()]}function Pe(ce){return i[+(ce.getUTCHours()>=12)]}function gt(ce){return 1+~~(ce.getUTCMonth()/3)}return{format:function(ce){var Te=P(ce+="",k);return Te.toString=function(){return ce},Te},parse:function(ce){var Te=N(ce+="",!1);return Te.toString=function(){return ce},Te},utcFormat:function(ce){var Te=P(ce+="",M);return Te.toString=function(){return ce},Te},utcParse:function(ce){var Te=N(ce+="",!0);return Te.toString=function(){return ce},Te}}}var rR={"-":"",_:" ",0:"0"},dn=/^\s*\d+/,vce=/^%/,yce=/[\\^$*+?|[\]().{}]/g;function Ze(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 bce(e){return e.replace(yce,"\\$&")}function Rf(e){return new RegExp("^(?:"+e.map(bce).join("|")+")","i")}function Lf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function xce(e,t,n){var r=dn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Sce(e,t,n){var r=dn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function wce(e,t,n){var r=dn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Oce(e,t,n){var r=dn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ace(e,t,n){var r=dn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function iR(e,t,n){var r=dn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function aR(e,t,n){var r=dn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function kce(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 Cce(e,t,n){var r=dn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Ece(e,t,n){var r=dn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function lR(e,t,n){var r=dn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Tce(e,t,n){var r=dn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function oR(e,t,n){var r=dn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Mce(e,t,n){var r=dn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Pce(e,t,n){var r=dn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Dce(e,t,n){var r=dn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function _ce(e,t,n){var r=dn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Nce(e,t,n){var r=vce.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Rce(e,t,n){var r=dn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Lce(e,t,n){var r=dn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function sR(e,t){return Ze(e.getDate(),t,2)}function jce(e,t){return Ze(e.getHours(),t,2)}function Ice(e,t){return Ze(e.getHours()%12||12,t,2)}function Bce(e,t){return Ze(1+od.count(Za(e),e),t,3)}function Q5(e,t){return Ze(e.getMilliseconds(),t,3)}function zce(e,t){return Q5(e,t)+"000"}function $ce(e,t){return Ze(e.getMonth()+1,t,2)}function Uce(e,t){return Ze(e.getMinutes(),t,2)}function Hce(e,t){return Ze(e.getSeconds(),t,2)}function Fce(e){var t=e.getDay();return t===0?7:t}function qce(e,t){return Ze(wy.count(Za(e)-1,e),t,2)}function X5(e){var t=e.getDay();return t>=4||t===0?tc(e):tc.ceil(e)}function Wce(e,t){return e=X5(e),Ze(tc.count(Za(e),e)+(Za(e).getDay()===4),t,2)}function Kce(e){return e.getDay()}function Vce(e,t){return Ze(rv.count(Za(e)-1,e),t,2)}function Qce(e,t){return Ze(e.getFullYear()%100,t,2)}function Xce(e,t){return e=X5(e),Ze(e.getFullYear()%100,t,2)}function Yce(e,t){return Ze(e.getFullYear()%1e4,t,4)}function Gce(e,t){var n=e.getDay();return e=n>=4||n===0?tc(e):tc.ceil(e),Ze(e.getFullYear()%1e4,t,4)}function Zce(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ze(t/60|0,"0",2)+Ze(t%60,"0",2)}function uR(e,t){return Ze(e.getUTCDate(),t,2)}function Jce(e,t){return Ze(e.getUTCHours(),t,2)}function efe(e,t){return Ze(e.getUTCHours()%12||12,t,2)}function tfe(e,t){return Ze(1+Sy.count(Ja(e),e),t,3)}function Y5(e,t){return Ze(e.getUTCMilliseconds(),t,3)}function nfe(e,t){return Y5(e,t)+"000"}function rfe(e,t){return Ze(e.getUTCMonth()+1,t,2)}function ife(e,t){return Ze(e.getUTCMinutes(),t,2)}function afe(e,t){return Ze(e.getUTCSeconds(),t,2)}function lfe(e){var t=e.getUTCDay();return t===0?7:t}function ofe(e,t){return Ze(Oy.count(Ja(e)-1,e),t,2)}function G5(e){var t=e.getUTCDay();return t>=4||t===0?nc(e):nc.ceil(e)}function sfe(e,t){return e=G5(e),Ze(nc.count(Ja(e),e)+(Ja(e).getUTCDay()===4),t,2)}function ufe(e){return e.getUTCDay()}function cfe(e,t){return Ze(iv.count(Ja(e)-1,e),t,2)}function ffe(e,t){return Ze(e.getUTCFullYear()%100,t,2)}function hfe(e,t){return e=G5(e),Ze(e.getUTCFullYear()%100,t,2)}function dfe(e,t){return Ze(e.getUTCFullYear()%1e4,t,4)}function pfe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?nc(e):nc.ceil(e),Ze(e.getUTCFullYear()%1e4,t,4)}function mfe(){return"+0000"}function cR(){return"%"}function fR(e){return+e}function hR(e){return Math.floor(+e/1e3)}var su,Z5,J5;gfe({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 gfe(e){return su=gce(e),Z5=su.format,su.parse,J5=su.utcFormat,su.utcParse,su}function vfe(e){return new Date(e)}function yfe(e){return e instanceof Date?+e:+new Date(+e)}function JA(e,t,n,r,i,a,l,s,c,f){var d=zA(),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"),M=f("%Y");function D(P){return(c(P)<P?v:s(P)<P?y:l(P)<P?x:a(P)<P?w:r(P)<P?i(P)<P?A:C:n(P)<P?k:M)(P)}return d.invert=function(P){return new Date(p(P))},d.domain=function(P){return arguments.length?g(Array.from(P,yfe)):g().map(vfe)},d.ticks=function(P){var N=g();return e(N[0],N[N.length-1],P??10)},d.tickFormat=function(P,N){return N==null?D:f(N)},d.nice=function(P){var N=g();return(!P||typeof P.range!="function")&&(P=t(N[0],N[N.length-1],P??10)),P?g(z5(N,P)):d},d.copy=function(){return ld(d,JA(e,t,n,r,i,a,l,s,c,f))},d}function bfe(){return ai.apply(JA(pce,mce,Za,GA,wy,od,XA,VA,Vo,Z5).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function xfe(){return ai.apply(JA(hce,dce,Ja,ZA,Oy,Sy,YA,QA,Vo,J5).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ay(){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(BA),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 e4(){var e=lo(Ay()(Qn));return e.copy=function(){return oo(e,e4())},il.apply(e,arguments)}function t4(){var e=HA(Ay()).domain([1,10]);return e.copy=function(){return oo(e,t4()).base(e.base())},il.apply(e,arguments)}function n4(){var e=FA(Ay());return e.copy=function(){return oo(e,n4()).constant(e.constant())},il.apply(e,arguments)}function ek(){var e=qA(Ay());return e.copy=function(){return oo(e,ek()).exponent(e.exponent())},il.apply(e,arguments)}function Sfe(){return ek.apply(null,arguments).exponent(.5)}function r4(){var e=[],t=Qn;function n(r){if(r!=null&&!isNaN(r=+r))return t((id(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(Wl),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)=>lue(e,a/r))},n.copy=function(){return r4(t).domain(e)},il.apply(n,arguments)}function ky(){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=Nue(x,[A,C,k]),v):[f(0),f(.5),f(1)]}}return v.range=y(yc),v.rangeRound=y(BA),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 i4(){var e=lo(ky()(Qn));return e.copy=function(){return oo(e,i4())},il.apply(e,arguments)}function a4(){var e=HA(ky()).domain([.1,1,10]);return e.copy=function(){return oo(e,a4()).base(e.base())},il.apply(e,arguments)}function l4(){var e=FA(ky());return e.copy=function(){return oo(e,l4()).constant(e.constant())},il.apply(e,arguments)}function tk(){var e=qA(ky());return e.copy=function(){return oo(e,tk()).exponent(e.exponent())},il.apply(e,arguments)}function wfe(){return tk.apply(null,arguments).exponent(.5)}const o4=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:LA,scaleDiverging:i4,scaleDivergingLog:a4,scaleDivergingPow:tk,scaleDivergingSqrt:wfe,scaleDivergingSymlog:l4,scaleIdentity:B5,scaleImplicit:Sw,scaleLinear:I5,scaleLog:$5,scaleOrdinal:RA,scalePoint:uue,scalePow:WA,scaleQuantile:F5,scaleQuantize:q5,scaleRadial:H5,scaleSequential:e4,scaleSequentialLog:t4,scaleSequentialPow:ek,scaleSequentialQuantile:r4,scaleSequentialSqrt:Sfe,scaleSequentialSymlog:n4,scaleSqrt:nce,scaleSymlog:U5,scaleThreshold:W5,scaleTime:bfe,scaleUtc:xfe,tickFormat:j5},Symbol.toStringTag,{value:"Module"}));function Ofe(e){var t=o4;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(Xh(e));if(n in t&&typeof t[n]=="function")return t[n]()}function dR(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Ofe(e);if(r!=null)return r.domain(t).range(n),r}}function nk(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?dR(e.scale,n,r):dR(t,n,r)}function Afe(e){return"scale".concat(Xh(e))}function kfe(e){return Afe(e)in o4}var s4=(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 kfe(r)?r:"point"}};function Cfe(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 u4(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=Cfe(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 Efe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):u4(e,void 0)}function pR(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 av(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pR(Object(n),!0).forEach(function(r){Tfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tfe(e,t,n){return(t=Mfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mfe(e){var t=Pfe(e,"string");return typeof t=="symbol"?t:t+""}function Pfe(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 c4(e,t){return Rfe(e)||Nfe(e,t)||_fe(e,t)||Dfe()}function Dfe(){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 _fe(e,t){if(e){if(typeof e=="string")return mR(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)?mR(e,t):void 0}}function mR(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 Nfe(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 Rfe(e){if(Array.isArray(e))return e}var kw=[0,"auto"],Qt={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"},f4=(e,t)=>e.cartesianAxis.xAxis[t],al=(e,t)=>{var n=f4(e,t);return n??Qt},Xt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:kw,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:Zh},h4=(e,t)=>e.cartesianAxis.yAxis[t],ll=(e,t)=>{var n=h4(e,t);return n??Xt},Lfe={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:""},rk=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Lfe},Un=(e,t,n)=>{switch(t){case"xAxis":return al(e,n);case"yAxis":return ll(e,n);case"zAxis":return rk(e,n);case"angleAxis":return TA(e,n);case"radiusAxis":return MA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},jfe=(e,t,n)=>{switch(t){case"xAxis":return al(e,n);case"yAxis":return ll(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},sd=(e,t,n)=>{switch(t){case"xAxis":return al(e,n);case"yAxis":return ll(e,n);case"angleAxis":return TA(e,n);case"radiusAxis":return MA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},d4=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function p4(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 Cy=e=>e.graphicalItems.cartesianItems,Ife=W([fn,vy],p4),m4=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),bc=W([Cy,Un,Ife],m4,{memoizeOptions:{resultEqualityCheck:by}}),g4=W([bc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(yy)),v4=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Bfe=W([bc],v4),y4=e=>e.map(t=>t.data).filter(Boolean).flat(1),zfe=W([bc],e=>e.some(t=>!t.data)),b4=W([bc],y4,{memoizeOptions:{resultEqualityCheck:by}}),x4=(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)},ik=W([b4,nd],x4),$fe=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:$t(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:$t(i,r)}))):e.map(r=>({value:r})),S4=(e,t,n,r,i,a)=>{var l=r.chartData,s=l===void 0?[]:l,c=r.dataStartIndex,f=r.dataEndIndex,d=$fe(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=s.slice(c,f+1),g=p.map(v=>({value:$t(v,t.dataKey)})).filter(v=>v.value!=null);return[...g,...d]}return d},ud=W([ik,Un,bc,nd,zfe,b4],S4);function Bu(e){if(ia(e)||e instanceof Date){var t=Number(e);if(Ke(t))return t}}function gR(e){if(Array.isArray(e)){var t=[Bu(e[0]),Bu(e[1])];return ea(t)?t:void 0}var n=Bu(e);if(n!=null)return[n,n]}function Ai(e){return e.map(Bu).filter(fr)}function Ufe(e,t){var n=Bu(e),r=Bu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Hfe=W([ud],e=>e?.map(t=>t.value).sort(Ufe));function w4(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Ffe(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!ra(t))r=t;else if(Array.isArray(t)){var i=Ai(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ai(n.flatMap(a=>{var l=$t(e,a.dataKey),s,c;if(Array.isArray(l)){var f=c4(l,2);s=f[0],c=f[1]}else s=c=l;if(!(!Ke(s)||!Ke(c)))return[r-s,r+c]}))}var tn=e=>{var t=hn(e),n=vc(e);return sd(e,t,n)},rc=W([tn],e=>e?.dataKey),qfe=W([g4,nd,tn],E5),O4=(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=c4(l,2),c=s[0],f=s[1],d=r?[...f].reverse():f,p=d.map(DA);return[c,{stackedData:Gie(e,p,n),graphicalItems:d}]}))},Cw=W([qfe,g4,dy,x5],O4),A4=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!=="zAxis")return nae(e,i,a)},Wfe=W([Un],e=>e.allowDataOverflow),ak=e=>{var t;if(e==null||!("domain"in e))return kw;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ai(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:kw},k4=W([Un],ak),C4=W([k4,Wfe],o5),Kfe=W([Cw,Ti,fn,C4],A4,{memoizeOptions:{resultEqualityCheck:rd}}),lk=e=>e.errorBars,Vfe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>w4(n,r)),lv=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]}},E4=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=>w4(a,v));p.forEach(v=>{var y,x=$t(v,(y=n.dataKey)!==null&&y!==void 0?y:f.dataKey),w=Ffe(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=gR(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=gR($t(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]))}),Ke(s)&&Ke(c))return[s,c]},Qfe=W([ik,Un,Bfe,lk,fn,Ase],E4,{memoizeOptions:{resultEqualityCheck:rd}});function Xfe(e){var t=e.value;if(ia(t)||t instanceof Date)return t}var Yfe=(e,t,n)=>{var r=e.map(Xfe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&zz(r))?l5(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},T4=e=>e.referenceElements.dots,xc=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Gfe=W([T4,fn,vy],xc),M4=e=>e.referenceElements.areas,Zfe=W([M4,fn,vy],xc),P4=e=>e.referenceElements.lines,Jfe=W([P4,fn,vy],xc),D4=(e,t)=>{if(e!=null){var n=Ai(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},ehe=W(Gfe,fn,D4),_4=(e,t)=>{if(e!=null){var n=Ai(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)]}},the=W([Zfe,fn],_4);function nhe(e){var t;if(e.x!=null)return Ai([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ai(n)}function rhe(e){var t;if(e.y!=null)return Ai([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ai(n)}var N4=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?nhe(r):rhe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},ihe=W([Jfe,fn],N4),ahe=W(ehe,ihe,the,(e,t,n)=>lv(e,n,t)),R4=(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?lv(r,a,i):lv(a,i),p=Pse(t,d,e.allowDataOverflow);return p??(e.allowDataOverflow&&d==null&&c!=null?c:p)},lhe=e=>{if(!(e==null||e.type!=="number"||!("ticks"in e)||e.ticks==null)){var t=Ai(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},ohe=W([Un],lhe,{memoizeOptions:{resultEqualityCheck:rd}}),she=W([Un,k4,C4,Kfe,Qfe,ahe,rt,fn,ohe],R4,{memoizeOptions:{resultEqualityCheck:rd}}),uhe=[0,1],L4=(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=tl(t,a);if(f&&s==null){var d;return l5(0,(d=n?.length)!==null&&d!==void 0?d:0)}return c==="category"?Yfe(r,e,f):i==="expand"&&!f?uhe:l}},ok=W([Un,rt,ik,ud,dy,fn,she],L4),Sc=W([Un,d4,kA],s4),j4=(e,t,n)=>{var r=t.niceTicks;if(r!=="none"){var i=ak(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&ea(e)){if(a)return kN(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return CN(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&ea(e))return kN(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&ea(e))return CN(e,t.tickCount,t.allowDecimals,"adaptive")}}},sk=W([ok,sd,Sc],j4),I4=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&ea(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},che=W([Un,ok,sk,fn],I4),fhe=W(ud,Un,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ai(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}}),B4=W(fhe,rt,b5,cn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Ke(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var l=wi(n,e*a),s=e*a/2;return s-l-(s-l)/a*l}return 0}),hhe=(e,t,n)=>{var r=al(e,t);return r==null||typeof r.padding!="string"?0:B4(e,"xAxis",t,n,r.padding)},dhe=(e,t,n)=>{var r=ll(e,t);return r==null||typeof r.padding!="string"?0:B4(e,"yAxis",t,n,r.padding)},phe=W(al,hhe,(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}}),mhe=W(ll,dhe,(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}}),z4=W([cn,phe,fy,cy,(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]}),$4=W([cn,rt,mhe,fy,cy,(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]}),cd=(e,t,n,r)=>{var i;switch(t){case"xAxis":return z4(e,n,r);case"yAxis":return $4(e,n,r);case"zAxis":return(i=rk(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return A5(e);case"radiusAxis":return k5(e,n);default:return}},U4=W([Un,cd],py),ghe=W([Sc,che],Qse),uk=W([Un,Sc,ghe,U4],nk),H4=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var i=n.type,a=n.scale,l=tl(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(s=>s.value)}},ck=W([rt,ud,sd,fn],H4),Ey=W([uk],_A);W([uk],Efe);W([uk,Hfe],u4);W([bc,lk,fn],Vfe);function F4(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Ty=(e,t)=>t,My=(e,t,n)=>n,vhe=W(sy,Ty,My,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(F4)),yhe=W(uy,Ty,My,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(F4)),q4=(e,t)=>({width:e.width,height:t.height}),bhe=(e,t)=>{var n=typeof t.width=="number"?t.width:Zh;return{width:n,height:e.height}},W4=W(cn,al,q4),xhe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},She=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},whe=W(rl,cn,vhe,Ty,My,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=q4(t,s);l==null&&(l=xhe(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}),Ohe=W(nl,cn,yhe,Ty,My,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=bhe(t,s);l==null&&(l=She(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}),Ahe=(e,t)=>{var n=al(e,t);if(n!=null)return whe(e,n.orientation,n.mirror)},khe=W([cn,al,Ahe,(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}}}),Che=(e,t)=>{var n=ll(e,t);if(n!=null)return Ohe(e,n.orientation,n.mirror)},Ehe=W([cn,ll,Che,(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}}}),K4=W(cn,ll,(e,t)=>{var n=typeof t.width=="number"?t.width:Zh;return{width:n,height:e.height}}),vR=(e,t,n)=>{switch(t){case"xAxis":return W4(e,n).width;case"yAxis":return K4(e,n).height;default:return}},V4=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,l=n.dataKey,s=tl(e,r),c=t.map(d=>d.value),f=c.filter(d=>d!=null);if(l&&s&&a==="category"&&i&&zz(f))return c}},fk=W([rt,ud,Un,fn],V4),yR=W([rt,jfe,Sc,Ey,fk,ck,cd,sk,fn],(e,t,n,r,i,a,l,s,c)=>{if(t!=null){var f=tl(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}}}),The=(e,t,n,r,i,a,l,s,c)=>{if(!(t==null||r==null)){var f=tl(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?cr(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 Ke(k)?{index:A,coordinate:k+y,value:w,offset:y}:null}).filter(fr):f&&s?s.map((w,A)=>{var C=r.map(w);return Ke(C)?{coordinate:C+y,value:w,index:A,offset:y}:null}).filter(fr):r.ticks?r.ticks(g).map((w,A)=>{var C=r.map(w);return Ke(C)?{coordinate:C+y,value:w,index:A,offset:y}:null}).filter(fr):r.domain().map((w,A)=>{var C=r.map(w);return Ke(C)?{coordinate:C+y,value:l?l[w]:w,index:A,offset:y}:null}).filter(fr)}},Q4=W([rt,sd,Sc,Ey,sk,cd,fk,ck,fn],The),Mhe=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=tl(e,l),c=t.tickCount,f=0;return f=l==="angleAxis"&&r?.length>=2?cr(r[0]-r[1])*2*f:f,s&&a?a.map((d,p)=>{var g=n.map(d);return Ke(g)?{coordinate:g+f,value:d,index:p,offset:f}:null}).filter(fr):n.ticks?n.ticks(c).map((d,p)=>{var g=n.map(d);return Ke(g)?{coordinate:g+f,value:d,index:p,offset:f}:null}).filter(fr):n.domain().map((d,p)=>{var g=n.map(d);return Ke(g)?{coordinate:g+f,value:i?i[d]:d,index:p,offset:f}:null}).filter(fr)}},to=W([rt,sd,Ey,cd,fk,ck,fn],Mhe),no=W(Un,Ey,(e,t)=>{if(!(e==null||t==null))return av(av({},e),{},{scale:t})}),Phe=W([Un,Sc,ok,U4],nk),Dhe=W([Phe],_A);W((e,t,n)=>rk(e,n),Dhe,(e,t)=>{if(!(e==null||t==null))return av(av({},e),{},{scale:t})});var _he=W([rt,sy,uy],(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}}),Nhe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};W([Nhe],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 X4=e=>e.options.defaultTooltipEventType,Y4=e=>e.options.validateTooltipEventTypes;function G4(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function fd(e,t){var n=X4(e),r=Y4(e);return G4(t,n,r)}function Rhe(e){return we(t=>fd(t,e))}var Z4=(e,t)=>{var n,r=Number(t);if(!(ra(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},Lhe=e=>e.tooltip.settings,$l={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},jhe={itemInteraction:{click:$l,hover:$l},axisInteraction:{click:$l,hover:$l},keyboardInteraction:$l,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}},J4=zn({name:"tooltip",initialState:jhe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(Ge(t.payload))},prepare:xt()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Zr(e).tooltipItemPayloads.indexOf(Ge(r));a>-1&&(e.tooltipItemPayloads[a]=Ge(i))},prepare:xt()},removeTooltipEntrySettings:{reducer(e,t){var n=Zr(e).tooltipItemPayloads.indexOf(Ge(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:xt()},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}}}),li=J4.actions,Ihe=li.addTooltipEntrySettings,Bhe=li.replaceTooltipEntrySettings,zhe=li.removeTooltipEntrySettings,$he=li.setTooltipSettingsState,e8=li.setActiveMouseOverItemIndex,Uhe=li.mouseLeaveItem,t8=li.mouseLeaveChart,Hhe=li.setActiveClickItemIndex,n8=li.setMouseOverAxisIndex,Fhe=li.setMouseClickAxisIndex,Wf=li.setSyncInteraction,ov=li.setKeyboardInteraction,qhe=J4.reducer;function bR(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?bR(Object(n),!0).forEach(function(r){Whe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Whe(e,t,n){return(t=Khe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Khe(e){var t=Vhe(e,"string");return typeof t=="symbol"?t:t+""}function Vhe(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 Qhe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Xhe(e){return e.index!=null}var r8=(e,t,n,r)=>{if(t==null)return $l;var i=Qhe(e,t,n);if(i==null)return $l;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(Xhe(i)){if(a)return vm(vm({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return vm(vm({},$l),{},{coordinate:i.coordinate})};function Yhe(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 Ghe(e,t){var n=Yhe(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 Zhe(e,t,n){if(n==null||t==null)return!0;var r=$t(e,t);return r==null||!ea(n)?!0:Ghe(r,n)}var nh=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!Ke(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||Zhe(f,n,r)?String(c):null},i8=(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}}},a8=(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})},l8=e=>e.options.tooltipPayloadSearcher,wc=e=>e.tooltip;function xR(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 SR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xR(Object(n),!0).forEach(function(r){Jhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jhe(e,t,n){return(t=ede(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ede(e){var t=tde(e,"string");return typeof t=="symbol"?t:t+""}function tde(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 nde(e){if(typeof e=="string"||typeof e=="number")return e}function rde(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function ide(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function wR(e){if(typeof e=="string")return e}function ade(e){if(!(e==null||typeof e!="object")){var t="name"in e?nde(e.name):void 0,n="unit"in e?rde(e.unit):void 0,r="dataKey"in e?ide(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?wR(e.color):void 0,l="fill"in e?wR(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function lde(e,t){return e??t}var o8=(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=lde(x,s),C=Array.isArray(A)?I$(A,f,d):A,k=(y=w?.dataKey)!==null&&y!==void 0?y:r,M=w?.nameKey,D;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&l==="axis"?D=$z(C,r,i):D=a(C,t,c,M),Array.isArray(D))D.forEach(N=>{var j,U,V=ade(N),K=V?.name,B=V?.dataKey,oe=V?.payload,ie=SR(SR({},w),{},{name:K,unit:V?.unit,color:(j=V?.color)!==null&&j!==void 0?j:w?.color,fill:(U=V?.fill)!==null&&U!==void 0?U:w?.fill});g.push(v_({tooltipEntrySettings:ie,dataKey:B,payload:oe,value:$t(oe,B),name:K==null?void 0:String(K)}))});else{var P;g.push(v_({tooltipEntrySettings:w,dataKey:k,payload:D,value:$t(D,k),name:(P=$t(D,M))!==null&&P!==void 0?P:w?.name}))}return g},p)}},hk=W([tn,d4,kA],s4),ode=W([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),sde=W([hn,vc],p4),bs=W([ode,tn,sde],m4,{memoizeOptions:{resultEqualityCheck:by}}),ude=W([bs],e=>e.filter(yy)),s8=W([bs],y4,{memoizeOptions:{resultEqualityCheck:by}}),cde=W([bs],e=>e.some(t=>!t.data)),fs=W([s8,Ti],x4),fde=W([ude,Ti,tn],E5),dk=W([fs,tn,bs,Ti,cde,s8],S4),u8=W([tn],ak),hde=W([tn],e=>e.allowDataOverflow),c8=W([u8,hde],o5),dde=W([bs],e=>e.filter(yy)),pde=W([fde,dde,dy,x5],O4),mde=W([pde,Ti,hn,c8],A4),gde=W([bs],v4),vde=W([fs,tn,gde,lk,hn,kse],E4,{memoizeOptions:{resultEqualityCheck:rd}}),yde=W([T4,hn,vc],xc),bde=W([yde,hn],D4),xde=W([M4,hn,vc],xc),Sde=W([xde,hn],_4),wde=W([P4,hn,vc],xc),Ode=W([wde,hn],N4),Ade=W([bde,Ode,Sde],lv),kde=W([tn,u8,c8,mde,vde,Ade,rt,hn],R4),ic=W([tn,rt,fs,dk,dy,hn,kde],L4),Cde=W([ic,tn,hk],j4),Ede=W([tn,ic,Cde,hn],I4),f8=e=>{var t=hn(e),n=vc(e),r=!1;return cd(e,t,n,r)},h8=W([tn,f8],py),Tde=W([tn,hk,Ede,h8],nk),d8=W([Tde],_A),Mde=W([rt,dk,tn,hn],V4),Pde=W([rt,dk,tn,hn],H4),Dde=(e,t,n,r,i,a,l,s)=>{if(t){var c=t.type,f=tl(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?cr(i[0]-i[1])*2*p:p,f&&l?l.map((g,v)=>{var y=r.map(g);return Ke(y)?{coordinate:y+p,value:g,index:v,offset:p}:null}).filter(fr):r.domain().map((g,v)=>{var y=r.map(g);return Ke(y)?{coordinate:y+p,value:a?a[g]:g,index:v,offset:p}:null}).filter(fr)}}},ol=W([rt,tn,hk,d8,f8,Mde,Pde,hn],Dde),pk=W([X4,Y4,Lhe],(e,t,n)=>G4(n.shared,e,t)),p8=e=>e.tooltip.settings.trigger,mk=e=>e.tooltip.settings.defaultIndex,hd=W([wc,pk,p8,mk],r8),hs=W([hd,fs,rc,ic],nh),m8=W([ol,hs],Z4),g8=W([hd],e=>{if(e)return e.dataKey}),_de=W([hd],e=>{if(e)return e.graphicalItemId}),v8=W([wc,pk,p8,mk],a8),Nde=W([nl,rl,rt,cn,ol,mk,v8],i8),Rde=W([hd,Nde],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Lde=W([hd],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),jde=W([v8,hs,Ti,rc,m8,l8,pk],o8),Ide=W([jde],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});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 AR(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){Bde(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 Bde(e,t,n){return(t=zde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zde(e){var t=$de(e,"string");return typeof t=="symbol"?t:t+""}function $de(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 Ude=()=>we(tn),Hde=()=>{var e=Ude(),t=we(ol),n=we(d8);return Zu(!e||!n?void 0:AR(AR({},e),{},{scale:n}),t)};function kR(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 uu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(r){Fde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fde(e,t,n){return(t=qde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qde(e){var t=Wde(e,"string");return typeof t=="symbol"?t:t+""}function Wde(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 Kde=(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}},Vde=(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 uu(uu(uu({},r),En(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var s=i.coordinate,c=r.angle;return uu(uu(uu({},r),En(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 Qde(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 y8=(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(cr(y-v)!==cr(x-y)){var A=[];if(cr(x-y)===cr(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 M=[Math.min(y,(w+y)/2),Math.max(y,(w+y)/2)];if(e>M[0]&&e<=M[1]||e>=A[0]&&e<=A[1]){var D;return(D=n[s])===null||D===void 0?void 0:D.index}}else{var P=Math.min(v,x),N=Math.max(v,x);if(e>(P+y)/2&&e<=(N+y)/2){var j;return(j=n[s])===null||j===void 0?void 0:j.index}}}else if(t)for(var U=0;U<l;U++){var V=t[U];if(V!=null){var K=t[U+1],B=t[U-1];if(U===0&&K!=null&&e<=(V.coordinate+K.coordinate)/2||U===l-1&&B!=null&&e>(V.coordinate+B.coordinate)/2||U>0&&U<l-1&&B!=null&&K!=null&&e>(V.coordinate+B.coordinate)/2&&e<=(V.coordinate+K.coordinate)/2)return V.index}}return-1},Xde=()=>we(kA),gk=(e,t)=>t,b8=(e,t,n)=>n,vk=(e,t,n,r)=>r,Yde=W(ol,e=>Yv(e,t=>t.coordinate)),yk=W([wc,gk,b8,vk],r8),bk=W([yk,fs,rc,ic],nh),Gde=(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}},x8=W([wc,gk,b8,vk],a8),sv=W([nl,rl,rt,cn,ol,vk,x8],i8),Zde=W([yk,sv],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),S8=W([ol,bk],Z4),Jde=W([x8,bk,Ti,rc,S8,l8,gk],o8),epe=W([yk,bk],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),tpe=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&Qde(e,l)){var s=rae(e,t),c=y8(s,a,i,n,r),f=Kde(t,i,c,e);return{activeIndex:String(c),activeCoordinate:f}}},npe=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var s=gse(e,n);if(s){var c=iae(s,t),f=y8(c,l,a,r,i),d=Vde(t,a,f,s);return{activeIndex:String(f),activeCoordinate:d}}}},rpe=(e,t,n,r,i,a,l,s)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?tpe(e,t,r,i,a,l,s):npe(e,t,n,r,i,a,l)},ipe=W(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}}),ape=W(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(un)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Vse}});function CR(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 ER(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CR(Object(n),!0).forEach(function(r){lpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lpe(e,t,n){return(t=ope(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ope(e){var t=spe(e,"string");return typeof t=="symbol"?t:t+""}function spe(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 upe={},cpe={zIndexMap:Object.values(un).reduce((e,t)=>ER(ER({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),upe)},fpe=new Set(Object.values(un));function hpe(e){return fpe.has(e)}var w8=zn({name:"zIndex",initialState:cpe,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:xt()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!hpe(n)&&delete e.zIndexMap[n])},prepare:xt()},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=Ge(i):e.zIndexMap[r].element=Ge(i):e.zIndexMap[r]={consumers:0,element:a?void 0:Ge(i),panoramaElement:a?Ge(i):void 0}},prepare:xt()},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:xt()}}}),Py=w8.actions,dpe=Py.registerZIndexPortal,g1=Py.unregisterZIndexPortal,ppe=Py.registerZIndexPortalElement,mpe=Py.unregisterZIndexPortalElement,gpe=w8.reducer;function oi(e){var t=e.zIndex,n=e.children,r=Hae(),i=r&&t!==void 0&&t!==0,a=$n(),l=O.useRef(void 0),s=O.useRef(new Set),c=wt(),f=we(p=>ipe(p,t,a));if(O.useLayoutEffect(()=>{if(!i){var p=s.current;p.forEach(v=>{c(g1({zIndex:v}))}),p.clear(),l.current=void 0;return}if(s.current.has(t)||(c(dpe({zIndex:t})),s.current.add(t)),f){l.current=f;var g=s.current;g.forEach(v=>{v!==t&&(c(g1({zIndex:v})),g.delete(v))})}},[c,t,i,f]),O.useLayoutEffect(()=>{var p=s.current;return()=>{p.forEach(g=>{c(g1({zIndex:g}))}),p.clear()}},[c]),!i)return n;var d=f??l.current;return d?nO.createPortal(n,d):null}function Ew(){return Ew=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},Ew.apply(null,arguments)}function TR(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 ym(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TR(Object(n),!0).forEach(function(r){vpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vpe(e,t,n){return(t=ype(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ype(e){var t=bpe(e,"string");return typeof t=="symbol"?t:t+""}function bpe(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 xpe(e){var t=e.cursor,n=e.cursorComp,r=e.cursorProps;return O.isValidElement(t)?O.cloneElement(t,r):O.createElement(n,r)}function Spe(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=koe,w=un.cursorLine;else if(d==="BarChart")y=Coe(s,p,a,l),x=r5,w=un.cursorRectangle;else if(s==="radial"&&Fz(p)){var A=i5(p),C=A.cx,k=A.cy,M=A.radius,D=A.startAngle,P=A.endAngle;y={cx:C,cy:k,startAngle:D,endAngle:P,innerRadius:M,outerRadius:M},x=xse,w=un.cursorLine}else y={points:Sse(s,p,a)},x=G$,w=un.cursorLine;var N=typeof c=="object"&&"className"in c?c.className:void 0,j=ym(ym(ym(ym({stroke:"#ccc",pointerEvents:"none"},a),y),Qh(c)),{},{payload:g,payloadIndex:v,className:ut("recharts-tooltip-cursor",N)});return O.createElement(oi,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:w},O.createElement(xpe,{cursor:c,cursorComp:x,cursorProps:j}))}function wpe(e){var t=Hde(),n=q$(),r=gs(),i=Xde();return t==null||n==null||r==null||i==null?null:O.createElement(Spe,Ew({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var O8=O.createContext(null),Ope=()=>O.useContext(O8),v1={exports:{}},MR;function Ape(){return MR||(MR=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 M=w.length,D;for(k=0;k<M;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(D=1,C=new Array(A-1);D<A;D++)C[D-1]=arguments[D];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})(v1)),v1.exports}var kpe=Ape();const Cpe=yv(kpe);var Lh=new Cpe,Tw="recharts.syncEvent.tooltip",PR="recharts.syncEvent.brush",A8=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ra(n))return e[n]}},Epe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},k8=zn({name:"options",initialState:Epe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Tpe=k8.reducer,Mpe=k8.actions.createEventEmitter;function Ppe(e){return e.tooltip.syncInteraction}var Dpe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},C8=zn({name:"chartData",initialState:Dpe,reducers:{setChartData(e,t){if(e.chartData=Ge(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)}}}),xk=C8.actions,DR=xk.setChartData,_pe=xk.setDataStartEndIndexes;xk.setComputedData;var Npe=C8.reducer,Rpe=["x","y"];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 cu(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){Lpe(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 Lpe(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)}function Bpe(e,t){if(e==null)return{};var n,r,i=zpe(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 zpe(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 $pe(){var e=we(CA),t=we(EA),n=wt(),r=we(S5),i=we(ol),a=gs(),l=hy(),s=we(c=>c.rootProps.className);O.useEffect(()=>{if(e==null)return ms;var c=(f,d,p)=>{if(t!==p&&e===f){if(d.payload.active===!1){n(Wf({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=Bpe(v,Rpe),A=d.payload.sourceViewBox,C=A.x,k=A.y,M=A.width,D=A.height,P=cu(cu({},w),{},{x:l.x+(M?(y-C)/M:0)*l.width,y:l.y+(D?(x-k)/D:0)*l.height});n(cu(cu({},d),{},{payload:cu(cu({},d.payload),{},{coordinate:P})}))}else n(d);return}if(i!=null){var N;if(typeof r=="function"){var j={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,j);N=i[U]}else r==="value"&&(N=i.find(Z=>String(Z.value)===d.payload.label));var V=d.payload.coordinate;if(V==null||l==null){n(Wf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(N==null){n(Wf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:void 0}));return}var K=V.x,B=V.y,oe=Math.min(K,l.x+l.width),ie=Math.min(B,l.y+l.height),ue={x:a==="horizontal"?N.coordinate:oe,y:a==="horizontal"?ie:N.coordinate},z=Wf({active:d.payload.active,coordinate:ue,dataKey:d.payload.dataKey,index:String(N.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n(z)}}};return Lh.on(Tw,c),()=>{Lh.off(Tw,c)}},[s,n,t,e,r,i,a,l])}function Upe(){var e=we(CA),t=we(EA),n=wt();O.useEffect(()=>{if(e==null)return ms;var r=(i,a,l)=>{t!==l&&e===i&&n(_pe(a))};return Lh.on(PR,r),()=>{Lh.off(PR,r)}},[n,t,e])}function Hpe(){var e=wt();O.useEffect(()=>{e(Mpe())},[e]),$pe(),Upe()}function Fpe(e,t,n,r,i,a){var l=we(y=>Gde(y,e,t)),s=we(_de),c=we(EA),f=we(CA),d=we(S5),p=we(Ppe),g=p?.sourceViewBox!=null,v=hy();O.useEffect(()=>{if(!g&&f!=null&&c!=null){var y=Wf({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:s});Lh.emit(Tw,f,y,c)}},[g,n,l,s,i,r,c,f,d,a,v])}function NR(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 RR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NR(Object(n),!0).forEach(function(r){qpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}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=Kpe(e,"string");return typeof t=="symbol"?t:t+""}function Kpe(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 Vpe(e,t){return Gpe(e)||Ype(e,t)||Xpe(e,t)||Qpe()}function Qpe(){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 Xpe(e,t){if(e){if(typeof e=="string")return LR(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)?LR(e,t):void 0}}function LR(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 Ype(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 Gpe(e){if(Array.isArray(e))return e}function Zpe(e){return e.dataKey}function Jpe(e,t){return O.isValidElement(e)?O.cloneElement(e,t):typeof e=="function"?O.createElement(e,t):O.createElement(qle,t)}var jR=[],eme={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 IR(e){var t,n,r=Bn(e,eme),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,M=r.defaultIndex,D=r.portal,P=r.axisId,N=wt(),j=typeof M=="number"?String(M):M;O.useEffect(()=>{N($he({shared:C,trigger:k,axisId:P,active:i,defaultIndex:j}))},[N,C,k,P,i,j]);var U=hy(),V=Y$(),K=Rhe(C),B=(t=we(Ee=>epe(Ee,K,k,j)))!==null&&t!==void 0?t:{},oe=B.activeIndex,ie=B.isActive,ue=we(Ee=>Jde(Ee,K,k,j)),z=we(Ee=>S8(Ee,K,k,j)),Z=we(Ee=>Zde(Ee,K,k,j)),ae=ue,Q=Ope(),le=(n=i??ie)!==null&&n!==void 0?n:!1,R=o$([ae,le]),F=Vpe(R,2),ee=F[0],se=F[1],ge=K==="axis"?z:void 0;Fpe(K,k,Z,ge,oe,le);var Oe=D??Q;if(Oe==null||U==null||K==null)return null;var Pe=ae??jR;le||(Pe=jR),f&&Pe.length&&(Pe=n$(Pe.filter(Ee=>Ee.value!=null&&(Ee.hide!==!0||r.includeHidden)),g,Zpe));var gt=Pe.length>0,ce=RR(RR({},r),{},{payload:Pe,label:ge,active:le,activeIndex:oe,coordinate:Z,accessibilityLayer:V}),Te=O.createElement(foe,{allowEscapeViewBox:a,animationDuration:l,animationEasing:s,isAnimationActive:d,active:le,coordinate:Z,hasPayload:gt,offset:p,position:v,reverseDirection:y,useTranslate3d:x,viewBox:U,wrapperStyle:w,lastBoundingBox:ee,innerRef:se,hasPortalFromProps:!!D},Jpe(c,ce));return O.createElement(O.Fragment,null,nO.createPortal(Te,Oe),le&&O.createElement(wpe,{cursor:A,tooltipEventType:K,coordinate:Z,payload:Pe,index:oe}))}var E8=e=>null;E8.displayName="Cell";function tme(e,t,n){return(t=nme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nme(e){var t=rme(e,"string");return typeof t=="symbol"?t:t+""}function rme(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 ime{constructor(t){tme(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 BR(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 ame(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BR(Object(n),!0).forEach(function(r){lme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lme(e,t,n){return(t=ome(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ome(e){var t=sme(e,"string");return typeof t=="symbol"?t:t+""}function sme(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 ume={cacheSize:2e3,enableCache:!0},T8=ame({},ume),zR=new ime(T8.cacheSize),cme={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},$R="recharts_measurement_span";function fme(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 UR=(e,t)=>{try{var n=document.getElementById($R);n||(n=document.createElement("span"),n.setAttribute("id",$R),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,cme,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||td.isSsr)return{width:0,height:0};if(!T8.enableCache)return UR(t,n);var r=fme(t,n),i=zR.get(r);if(i)return i;var a=UR(t,n);return zR.set(r,a),a},M8;function uv(e,t){return mme(e)||pme(e,t)||dme(e,t)||hme()}function hme(){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 dme(e,t){if(e){if(typeof e=="string")return HR(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)?HR(e,t):void 0}}function HR(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 pme(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 mme(e){if(Array.isArray(e))return e}function gme(e,t,n){return(t=vme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vme(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)}var FR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,qR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,bme=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,xme=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Sme={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},wme=["cm","mm","pt","pc","in","Q","px"];function Ome(e){return wme.includes(e)}var Au="NaN";function Ame(e,t){return e*Sme[t]}class On{static parse(t){var n,r=(n=xme.exec(t))!==null&&n!==void 0?n:[],i=uv(r,3),a=i[1],l=i[2];return a==null?On.NaN:new On(parseFloat(a),l??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,ra(t)&&(this.unit=""),n!==""&&!bme.test(n)&&(this.num=NaN,this.unit=""),Ome(n)&&(this.num=Ame(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new On(NaN,""):new On(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new On(NaN,""):new On(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new On(NaN,""):new On(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new On(NaN,""):new On(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ra(this.num)}}M8=On;gme(On,"NaN",new M8(NaN,""));function P8(e){if(e==null||e.includes(Au))return Au;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=FR.exec(t))!==null&&n!==void 0?n:[],i=uv(r,4),a=i[1],l=i[2],s=i[3],c=On.parse(a??""),f=On.parse(s??""),d=l==="*"?c.multiply(f):c.divide(f);if(d.isNaN())return Au;t=t.replace(FR,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,g=(p=qR.exec(t))!==null&&p!==void 0?p:[],v=uv(g,4),y=v[1],x=v[2],w=v[3],A=On.parse(y??""),C=On.parse(w??""),k=x==="+"?A.add(C):A.subtract(C);if(k.isNaN())return Au;t=t.replace(qR,k.toString())}return t}var WR=/\(([^()]*)\)/;function kme(e){for(var t=e,n;(n=WR.exec(t))!=null;){var r=n,i=uv(r,2),a=i[1];t=t.replace(WR,P8(a))}return t}function Cme(e){var t=e.replace(/\s+/g,"");return t=kme(t),t=P8(t),t}function Eme(e){try{return Cme(e)}catch{return Au}}function y1(e){var t=Eme(e.slice(5,-1));return t===Au?"":t}var Tme=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Mme=["dx","dy","angle","className","breakAll"];function Mw(){return Mw=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},Mw.apply(null,arguments)}function KR(e,t){if(e==null)return{};var n,r,i=Pme(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 Pme(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 VR(e,t){return Rme(e)||Nme(e,t)||_me(e,t)||Dme()}function Dme(){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 _me(e,t){if(e){if(typeof e=="string")return QR(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)?QR(e,t):void 0}}function QR(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 Nme(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 Rme(e){if(Array.isArray(e))return e}var D8=/[ \f\n\r\t\v\u2028\u2029]+/,_8=e=>{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];Ct(t)||(n?i=t.toString().split(""):i=t.toString().split(D8));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 N8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Lme(e){return Ct(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var R8=(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},[]),L8=e=>e.reduce((t,n)=>t.width>n.width?t:n),jme="…",XR=(e,t,n,r,i,a,l,s)=>{var c=e.slice(0,t),f=_8({breakAll:n,style:r,children:c+jme});if(!f)return[!1,[]];var d=R8(f.wordsWithComputedWidth,a,l,s),p=d.length>i||L8(d).width>Number(a);return[p,d]},Ime=(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=R8(t,r,n,i);if(!f||i)return p;var g=p.length>a||L8(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=XR(d,C,c,s,a,r,n,i),M=VR(k,2),D=M[0],P=M[1],N=XR(d,A,c,s,a,r,n,i),j=VR(N,1),U=j[0];if(!D&&!U&&(v=A+1),D&&U&&(y=A-1),!D&&U){w=P;break}x++}return w||p},YR=e=>{var t=Ct(e)?[]:e.toString().split(D8);return[{words:t,width:void 0}]},Bme=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,l=e.maxLines;if((t||n)&&!td.isSsr){var s,c,f=_8({breakAll:a,children:r,style:i});if(f){var d=f.wordsWithComputedWidth,p=f.spaceWidth;s=d,c=p}else return YR(r);return Ime({breakAll:a,children:r,maxLines:l,style:i},s,c,t,!!n)}return YR(r)},j8="#808080",zme={angle:0,breakAll:!1,capHeight:"0.71em",fill:j8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Sk=O.forwardRef((e,t)=>{var n=Bn(e,zme),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=KR(n,Tme),g=O.useMemo(()=>Bme({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=KR(p,Mme);if(!ia(r)||!ia(i)||g.length===0)return null;var k=Number(r)+(be(v)?v:0),M=Number(i)+(be(y)?y:0);if(!Ke(k)||!Ke(M))return null;var D;switch(d){case"start":D=y1("calc(".concat(l,")"));break;case"middle":D=y1("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:D=y1("calc(".concat(g.length-1," * -").concat(a,")"));break}var P=[],N=g[0];if(c&&N!=null){var j=N.width,U=p.width;P.push("scale(".concat(be(U)&&be(j)?U/j:1,")"))}return x&&P.push("rotate(".concat(x,", ").concat(k,", ").concat(M,")")),P.length&&(C.transform=P.join(" ")),O.createElement("text",Mw({},_r(C),{ref:t,x:k,y:M,className:ut("recharts-text",w),textAnchor:f,fill:s.includes("url")?j8:s}),g.map((V,K)=>{var B=V.words.join(A?"":" ");return O.createElement("tspan",{x:k,dy:K===0?D:a,key:"".concat(B,"-").concat(K)},B)}))});Sk.displayName="Text";function GR(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?GR(Object(n),!0).forEach(function(r){$me(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $me(e,t,n){return(t=Ume(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ume(e){var t=Hme(e,"string");return typeof t=="symbol"?t:t+""}function Hme(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 Fme=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,l=vA(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",M=A>0?"start":"end",D=d>=0?1:-1,P=D*i,N=D>0?"end":"start",j=D>0?"start":"end",U=a;if(n==="top"){var V={x:g+d/2,y:c-C,horizontalAnchor:"middle",verticalAnchor:k};return U&&(V.height=Math.max(c-U.y,0),V.width=d),V}if(n==="bottom"){var K={x:v+p/2,y:c+f+C,horizontalAnchor:"middle",verticalAnchor:M};return U&&(K.height=Math.max(U.y+U.height-(c+f),0),K.width=p),K}if(n==="left"){var B={x:y-P,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 oe={x:y+x+P,y:c+f/2,horizontalAnchor:j,verticalAnchor:"middle"};return U&&(oe.width=Math.max(U.x+U.width-oe.x,0),oe.height=f),oe}var ie=U?{width:x,height:f}:{};return n==="insideLeft"?zi({x:y+P,y:c+f/2,horizontalAnchor:j,verticalAnchor:"middle"},ie):n==="insideRight"?zi({x:y+x-P,y:c+f/2,horizontalAnchor:N,verticalAnchor:"middle"},ie):n==="insideTop"?zi({x:g+d/2,y:c+C,horizontalAnchor:"middle",verticalAnchor:M},ie):n==="insideBottom"?zi({x:v+p/2,y:c+f-C,horizontalAnchor:"middle",verticalAnchor:k},ie):n==="insideTopLeft"?zi({x:g+P,y:c+C,horizontalAnchor:j,verticalAnchor:M},ie):n==="insideTopRight"?zi({x:g+d-P,y:c+C,horizontalAnchor:N,verticalAnchor:M},ie):n==="insideBottomLeft"?zi({x:v+P,y:c+f-C,horizontalAnchor:j,verticalAnchor:k},ie):n==="insideBottomRight"?zi({x:v+p-P,y:c+f-C,horizontalAnchor:N,verticalAnchor:k},ie):n&&typeof n=="object"&&(be(n.x)||ss(n.x))&&(be(n.y)||ss(n.y))?zi({x:s+wi(n.x,x),y:c+wi(n.y,f),horizontalAnchor:"end",verticalAnchor:"end"},ie):zi({x:w,y:c+f/2,horizontalAnchor:"middle",verticalAnchor:"middle"},ie)},qme=["labelRef"],Wme=["content"];function ZR(e,t){if(e==null)return{};var n,r,i=Kme(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 Kme(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 JR(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 Kf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JR(Object(n),!0).forEach(function(r){Vme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vme(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=Xme(e,"string");return typeof t=="symbol"?t:t+""}function Xme(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 Ra(){return Ra=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},Ra.apply(null,arguments)}var I8=O.createContext(null),Yme=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(I8.Provider,{value:c},s)},B8=()=>{var e=O.useContext(I8),t=hy();return e||(t?vA(t):void 0)},Gme=O.createContext(null),Zme=()=>{var e=O.useContext(Gme),t=we(C5);return e||t},Jme=e=>{var t=e.value,n=e.formatter,r=Ct(e.children)?t:e.children;return typeof n=="function"?n(r):r},wk=e=>e!=null&&typeof e=="function",ege=(e,t)=>{var n=cr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},tge=(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=ege(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=En(s,c,y,A),M=En(s,c,y,A+(C?1:-1)*359),D="M".concat(k.x,",").concat(k.y,`
|
|
120
|
+
A`).concat(y,",").concat(y,",0,1,").concat(C?0:1,`,
|
|
121
|
+
`).concat(M.x,",").concat(M.y),P=Ct(e.id)?kh("recharts-radial-line-"):e.id;return O.createElement("text",Ra({},r,{dominantBaseline:"central",className:ut("recharts-radial-bar-label",l)}),O.createElement("defs",null,O.createElement("path",{id:P,d:D})),O.createElement("textPath",{xlinkHref:"#".concat(P)},n))},nge=(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=En(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=En(r,i,v,f),x=y.x,w=y.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},$m=e=>e!=null&&"cx"in e&&be(e.cx),rge={angle:0,offset:5,zIndex:un.label,position:"middle",textBreakAll:!1};function ige(e){if(!$m(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 Il(e){var t=Bn(e,rge),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=Zme(),v=B8(),y=i==="center"?v:g??v,x,w,A;n==null?x=y:$m(n)?x=n:x=vA(n);var C=ige(x);if(!x||Ct(a)&&Ct(l)&&!O.isValidElement(s)&&typeof s!="function")return null;var k=Kf(Kf({},t),{},{viewBox:x});if(O.isValidElement(s)){k.labelRef;var M=ZR(k,qme);return O.cloneElement(s,M)}if(typeof s=="function"){k.content;var D=ZR(k,Wme);if(w=O.createElement(s,D),O.isValidElement(w))return w}else w=Jme(t);var P=_r(t);if($m(x)){if(i==="insideStart"||i==="insideEnd"||i==="end")return tge(t,i,w,P,x);A=nge(x,t.offset,t.position)}else{if(!C)return null;var N=Fme({viewBox:C,position:i,offset:t.offset,parentViewBox:$m(r)?void 0:r});A=Kf(Kf({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(oi,{zIndex:t.zIndex},O.createElement(Sk,Ra({ref:p,className:ut("recharts-label",f)},P,A,{textAnchor:N8(P.textAnchor)?P.textAnchor:A.textAnchor,breakAll:d}),w))}Il.displayName="Label";var age=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?O.createElement(Il,Ra({key:"label-implicit"},r)):ia(e)?O.createElement(Il,Ra({key:"label-implicit",value:e},r)):O.isValidElement(e)?e.type===Il?O.cloneElement(e,Kf({key:"label-implicit"},r)):O.createElement(Il,Ra({key:"label-implicit",content:e},r)):wk(e)?O.createElement(Il,Ra({key:"label-implicit",content:e},r)):e&&typeof e=="object"?O.createElement(Il,Ra({},e,{key:"label-implicit"},r)):null};function lge(e){var t=e.label,n=e.labelRef,r=B8();return age(t,r,n)||null}var oge=["valueAccessor"],sge=["dataKey","clockWise","id","textBreakAll","zIndex"];function cv(){return cv=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},cv.apply(null,arguments)}function eL(e,t){if(e==null)return{};var n,r,i=uge(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 uge(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 cge=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Lme(t))return t},z8=O.createContext(void 0),$8=z8.Provider,U8=O.createContext(void 0);U8.Provider;function fge(){return O.useContext(z8)}function hge(){return O.useContext(U8)}function Um(e){var t=e.valueAccessor,n=t===void 0?cge:t,r=eL(e,oge),i=r.dataKey;r.clockWise;var a=r.id,l=r.textBreakAll,s=r.zIndex,c=eL(r,sge),f=fge(),d=hge(),p=f||d;return!p||!p.length?null:O.createElement(oi,{zIndex:s??un.label},O.createElement(Nr,{className:"recharts-label-list"},p.map((g,v)=>{var y,x=Ct(i)?n(g,v):$t(g.payload,i),w=Ct(a)?{}:{id:"".concat(a,"-").concat(v)};return O.createElement(Il,cv({key:"label-".concat(v)},_r(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}))})))}Um.displayName="LabelList";function H8(e){var t=e.label;return t?t===!0?O.createElement(Um,{key:"labelList-implicit"}):O.isValidElement(t)||wk(t)?O.createElement(Um,{key:"labelList-implicit",content:t}):typeof t=="object"?O.createElement(Um,cv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Pw(){return Pw=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},Pw.apply(null,arguments)}var F8=e=>{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=ut("recharts-dot",i);return be(t)&&be(n)&&be(r)?O.createElement("circle",Pw({},Si(e),lA(e),{className:a,cx:t,cy:n,r})):null},dge={radiusAxis:{},angleAxis:{}},q8=zn({name:"polarAxis",initialState:dge,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=Ge(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=Ge(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),Dy=q8.actions;Dy.addRadiusAxis;Dy.removeRadiusAxis;Dy.addAngleAxis;Dy.removeAngleAxis;var pge=q8.reducer;function mge(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var b1={exports:{}},ot={};var tL;function gge(){if(tL)return ot;tL=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 ot.ContextConsumer=a,ot.ContextProvider=l,ot.Element=e,ot.ForwardRef=s,ot.Fragment=n,ot.Lazy=p,ot.Memo=d,ot.Portal=t,ot.Profiler=i,ot.StrictMode=r,ot.Suspense=c,ot.SuspenseList=f,ot.isContextConsumer=function(x){return y(x)===a},ot.isContextProvider=function(x){return y(x)===l},ot.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},ot.isForwardRef=function(x){return y(x)===s},ot.isFragment=function(x){return y(x)===n},ot.isLazy=function(x){return y(x)===p},ot.isMemo=function(x){return y(x)===d},ot.isPortal=function(x){return y(x)===t},ot.isProfiler=function(x){return y(x)===i},ot.isStrictMode=function(x){return y(x)===r},ot.isSuspense=function(x){return y(x)===c},ot.isSuspenseList=function(x){return y(x)===f},ot.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)},ot.typeOf=y,ot}var nL;function vge(){return nL||(nL=1,b1.exports=gge()),b1.exports}var yge=vge(),rL=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",iL=null,x1=null,W8=e=>{if(e===iL&&Array.isArray(x1))return x1;var t=[];return O.Children.forEach(e,n=>{Ct(n)||(yge.isFragment(n)?t=t.concat(W8(n.props.children)):t.push(n))}),x1=t,iL=e,t};function bge(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>rL(i)):r=[rL(t)],W8(e).forEach(i=>{var a=Xa(i,"type.displayName")||Xa(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var K8=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function aL(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 lL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aL(Object(n),!0).forEach(function(r){xge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xge(e,t,n){return(t=Sge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sge(e){var t=wge(e,"string");return typeof t=="symbol"?t:t+""}function wge(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 V8(e,t){return lL(lL({},t),e)}function Oge(e){return O.isValidElement(e)?e.props:e}function Age(e,t){return O.cloneElement(e,V8(Oge(e),t))}function kge(e){if("index"in e){var t=e.index;return typeof t=="number"||typeof t=="string"?t:void 0}}function Cge(e){return"isActive"in e&&e.isActive===!0}function Q8(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=kge(r),f;return O.isValidElement(t)?f=Age(t,r):t===n?f=O.createElement(n,r):typeof t=="function"?f=t(r,c):typeof t=="object"?f=O.createElement(n,V8(t,r)):f=O.createElement(n,r),Cge(r)?O.createElement(Nr,{className:a},f):O.createElement(Nr,{className:s},f)}var X8=(e,t,n)=>{var r=wt();return(i,a)=>l=>{e?.(i,a,l),r(e8({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Y8=e=>{var t=wt();return(n,r)=>i=>{e?.(n,r,i),t(Uhe())}},G8=(e,t,n)=>{var r=wt();return(i,a)=>l=>{e?.(i,a,l),r(Hhe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function Z8(e){var t=e.tooltipEntrySettings,n=wt(),r=$n(),i=O.useRef(null);return O.useLayoutEffect(()=>{r||(i.current===null?n(Ihe(t)):i.current!==t&&n(Bhe({prev:i.current,next:t})),i.current=t)},[t,n,r]),O.useLayoutEffect(()=>()=>{i.current&&(n(zhe(i.current)),i.current=null)},[n]),null}function J8(e){var t=e.legendPayload,n=wt(),r=$n(),i=O.useRef(null);return O.useLayoutEffect(()=>{r||(i.current===null?n(Wae(t)):i.current!==t&&n(Kae({prev:i.current,next:t})),i.current=t)},[n,r,t]),O.useLayoutEffect(()=>()=>{i.current&&(n(Vae(i.current)),i.current=null)},[n]),null}function Ege(e,t){return Dge(e)||Pge(e,t)||Mge(e,t)||Tge()}function Tge(){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 Mge(e,t){if(e){if(typeof e=="string")return oL(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)?oL(e,t):void 0}}function oL(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 Pge(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 Dge(e){if(Array.isArray(e))return e}var Ok="index",e6="append";function Ak(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 _ge(e,t){var n=e.length/t.length,r=t.map((i,a)=>e[Math.floor(a*n)]);return Ak(r,t)}function Nge(e,t){var n=t.map((r,i)=>e[i]);return Ak(n,t)}function Rge(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 Lge(e,t,n){var r=Rge(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=Ege(s,2),f=c[0],d=c[1];i.has(f)||l.push(d)}return Ak(a,t,l)}function jge(e,t,n){return t==null?null:e==null?t.map(r=>({status:"added",next:r})):n===Ok?_ge(e,t):n===e6?Nge(e,t):Lge(e,t,n)}function Ige(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 Bge(e,t){return Hge(e)||Uge(e,t)||$ge(e,t)||zge()}function zge(){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 $ge(e,t){if(e){if(typeof e=="string")return sL(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)?sL(e,t):void 0}}function sL(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 Uge(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 Hge(e){if(Array.isArray(e))return e}function t6(e,t){var n=O.useState(!1),r=Bge(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 n6(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=n5(n,r),C=Ige(A,a),k=(t=C.startValue)!==null&&t!==void 0?t:null,M=jge(k,i,v??Ok);return O.createElement(t5,{animationId:A,begin:s,duration:c,isActive:l,easing:f,onAnimationEnd:p,onAnimationStart:d,key:A},D=>{var P=k==null,N=i==null?i:g(M,D,w),j=y?y(D):D>0;return C.syncStepValue(N,D,j),N==null?null:x(N,D,P)})}var S1;function Fge(e,t){return Vge(e)||Kge(e,t)||Wge(e,t)||qge()}function qge(){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 Wge(e,t){if(e){if(typeof e=="string")return uL(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)?uL(e,t):void 0}}function uL(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 Kge(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 Vge(e){if(Array.isArray(e))return e}var Qge=()=>{var e=O.useState(()=>kh("uid-")),t=Fge(e,1),n=t[0];return n},Xge=(S1=g9.useId)!==null&&S1!==void 0?S1:Qge;function Yge(e,t){var n=Xge();return t||(e?"".concat(e,"-").concat(n):n)}var Gge=O.createContext(void 0),r6=e=>{var t=e.id,n=e.type,r=e.children,i=Yge("recharts-".concat(n),t);return O.createElement(Gge.Provider,{value:i},r(i))},Zge={cartesianItems:[],polarItems:[]},i6=zn({name:"graphicalItems",initialState:Zge,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(Ge(t.payload))},prepare:xt()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Zr(e).cartesianItems.indexOf(Ge(r));a>-1&&(e.cartesianItems[a]=Ge(i))},prepare:xt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Zr(e).cartesianItems.indexOf(Ge(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:xt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(Ge(t.payload))},prepare:xt()},removePolarGraphicalItem:{reducer(e,t){var n=Zr(e).polarItems.indexOf(Ge(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:xt()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Zr(e).polarItems.indexOf(Ge(r));a>-1&&(e.polarItems[a]=Ge(i))},prepare:xt()}}}),Oc=i6.actions,Jge=Oc.addCartesianGraphicalItem,eve=Oc.replaceCartesianGraphicalItem,tve=Oc.removeCartesianGraphicalItem;Oc.addPolarGraphicalItem;Oc.removePolarGraphicalItem;Oc.replacePolarGraphicalItem;var nve=i6.reducer,rve=e=>{var t=wt(),n=O.useRef(null);return O.useLayoutEffect(()=>{n.current===null?t(Jge(e)):n.current!==e&&t(eve({prev:n.current,next:e})),n.current=e},[t,e]),O.useLayoutEffect(()=>()=>{n.current&&(t(tve(n.current)),n.current=null)},[t]),null},a6=O.memo(rve),ive=["points"];function cL(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 w1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cL(Object(n),!0).forEach(function(r){ave(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ave(e,t,n){return(t=lve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lve(e){var t=ove(e,"string");return typeof t=="symbol"?t:t+""}function ove(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 fv(){return fv=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},fv.apply(null,arguments)}function sve(e,t){if(e==null)return{};var n,r,i=uve(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 uve(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 cve(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=ut(r,typeof t!="boolean"?t.className:""),a=n??{};a.points;var l=sve(a,ive);return O.createElement(F8,fv({},l,{className:i}))}function fve(e,t){return e==null?!1:t?!0:e.length===1}function hve(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?un.scatter:f;if(!fve(t,n))return null;var p=K8(n),g=cte(n),v=t.map((x,w)=>{var A,C,k=w1(w1(w1({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(cve,{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(oi,{zIndex:d},O.createElement(Nr,fv({className:r},y),v))}function fL(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 hL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fL(Object(n),!0).forEach(function(r){dve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fL(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)}var l6=0,gve={xAxis:{},yAxis:{},zAxis:{}},o6=zn({name:"cartesianAxis",initialState:gve,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=Ge(t.payload)},prepare:xt()},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]=Ge(i))},prepare:xt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:xt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=Ge(t.payload)},prepare:xt()},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]=Ge(i))},prepare:xt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:xt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=Ge(t.payload)},prepare:xt()},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]=Ge(i))},prepare:xt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:xt()},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]=hL(hL({},a),{},{width:i,widthHistory:c})}}}}),fa=o6.actions,vve=fa.addXAxis,yve=fa.replaceXAxis,bve=fa.removeXAxis,xve=fa.addYAxis,Sve=fa.replaceYAxis,wve=fa.removeYAxis;fa.addZAxis;fa.replaceZAxis;fa.removeZAxis;var Ove=fa.updateYAxisWidth,Ave=o6.reducer,kve=W([cn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Cve=W([kve,nl,rl],(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)}}),kk=()=>we(Cve),Eve=()=>we(Ide);function dL(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 O1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dL(Object(n),!0).forEach(function(r){Tve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tve(e,t,n){return(t=Mve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mve(e){var t=Pve(e,"string");return typeof t=="symbol"?t:t+""}function Pve(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 Dve=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=O1(O1(O1({},s),Qh(i)),lA(i)),f;return O.isValidElement(i)?f=O.cloneElement(i,c):typeof i=="function"?f=i(c):f=O.createElement(F8,c),O.createElement(Nr,{className:"recharts-active-dot",clipPath:l},f)};function _ve(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,l=e.zIndex,s=l===void 0?un.activeDot:l,c=we(hs),f=Eve();if(t==null||f==null)return null;var d=t.find(p=>f.includes(p.payload));return Ct(d)?null:O.createElement(oi,{zIndex:s},O.createElement(Dve,{point:d,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}function Nve(e,t){return Ive(e)||jve(e,t)||Lve(e,t)||Rve()}function Rve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
125
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lve(e,t){if(e){if(typeof e=="string")return pL(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)?pL(e,t):void 0}}function pL(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 jve(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 Ive(e){if(Array.isArray(e))return e}var mL=(e,t,n)=>{var r=n??e;if(!Ct(r))return wi(r,t,0)},Bve=(e,t,n)=>{var r={},i=e.filter(yy),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=Nve(f,2),g=p[0],v=p[1],y=v.map(w=>w.dataKey),x=mL(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=mL(t,n,f.barSize);return{stackId:void 0,dataKeys:d,barSize:p}});return[...s,...c]};function gL(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 bm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gL(Object(n),!0).forEach(function(r){zve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gL(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){var a,l=r.length;if(!(l<1)){var s=wi(e,n,0,!0),c,f=[];if(Ke((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 M,D={stackId:k.stackId,dataKeys:k.dataKeys,position:{offset:y.offset+y.size+s,size:d?p:(M=k.barSize)!==null&&M!==void 0?M:0}},P=[...C,D];return y=D.position,P},f)}else{var x=wi(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=Ke(i)?Math.min(w,i):w;c=r.reduce((C,k,M)=>[...C,{stackId:k.stackId,dataKeys:k.dataKeys,position:{offset:x+(w+s)*M+(w-A)/2,size:A}}],f)}return c}}var Fve=(e,t,n,r,i,a,l)=>{var s=Ct(l)?t:l,c=Hve(n,r,i!==a?i:a,e,s);return i!==a&&c!=null&&(c=c.map(f=>bm(bm({},f),{},{position:bm(bm({},f.position),{},{offset:f.position.offset-i/2})}))),c},qve=(e,t)=>{var n=DA(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)}}}},Wve=(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 Kve(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Ke(e.zIndex)?e.zIndex:t}var Vve=e=>{var t=e.chartData,n=wt(),r=$n();return O.useEffect(()=>r?()=>{}:(n(DR(t)),()=>{n(DR(void 0))}),[t,n,r]),null},vL={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},s6=zn({name:"brush",initialState:vL,reducers:{setBrushSettings(e,t){return t.payload==null?vL:t.payload}}});s6.actions.setBrushSettings;var Qve=s6.reducer;function Xve(e){return(e%180+180)%180}var Yve=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Xve(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)},Gve={dots:[],areas:[],lines:[]},u6=zn({name:"referenceElements",initialState:Gve,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Zr(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=Zr(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(Ge(t.payload))},removeLine:(e,t)=>{var n=Zr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),Ac=u6.actions;Ac.addDot;Ac.removeDot;Ac.addArea;Ac.removeArea;Ac.addLine;Ac.removeLine;var Zve=u6.reducer;function Jve(e,t){return rye(e)||nye(e,t)||tye(e,t)||eye()}function eye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
126
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tye(e,t){if(e){if(typeof e=="string")return yL(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)?yL(e,t):void 0}}function yL(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 nye(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 rye(e){if(Array.isArray(e))return e}var iye=O.createContext(void 0),aye=e=>{var t=e.children,n=O.useState("".concat(kh("recharts"),"-clip")),r=Jve(n,1),i=r[0],a=kk();if(a==null)return null;var l=a.x,s=a.y,c=a.width,f=a.height;return O.createElement(iye.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 c6(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 lye(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Yve(r,n)}function oye(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 jh(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 sye(e,t){return c6(e,t+1)}function uye(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:c6(r,f)};var x=c,w,A=()=>(w===void 0&&(w=n(y,x)),w),C=y.coordinate,k=c===0||jh(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 cye(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 M=r[x];if(M==null)return 0;var D=x,P,N=()=>(P===void 0&&(P=n(M,D)),P),j=M.coordinate,U=x===d||jh(e,j,N,p,c);if(!U)return g=!1,1;U&&(p=j+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 bL(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 Pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bL(Object(n),!0).forEach(function(r){fye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fye(e,t,n){return(t=hye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hye(e){var t=dye(e,"string");return typeof t=="symbol"?t:t+""}function dye(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 pye(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=Pn(Pn({},y),{},{tickCoord:A>0?y.coordinate-A*e:y.coordinate})}else a[g]=y=Pn(Pn({},y),{},{tickCoord:y.coordinate});if(y.tickCoord!=null){var C=jh(e,y.tickCoord,w,s,c);C&&(c=y.tickCoord-e*(w()/2+i),a[g]=Pn(Pn({},y),{},{isShow:!0}))}},d=l-1;d>=0;d--)f(d);return a}function mye(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=Pn(Pn({},d),{},{tickCoord:g>0?d.coordinate-g*e:d.coordinate}),d.tickCoord!=null){var v=jh(e,d.tickCoord,()=>p,c,f);v&&(f=d.tickCoord-e*(p/2+i),l[s-1]=Pn(Pn({},d),{},{isShow:!0}))}}}for(var y=a?s-1:s,x=function(C){var k=l[C];if(k==null)return 1;var M=k,D,P=()=>(D===void 0&&(D=n(k,C)),D);if(C===0){var N=e*(M.coordinate-e*P()/2-c);l[C]=M=Pn(Pn({},M),{},{tickCoord:N<0?M.coordinate-N*e:M.coordinate})}else l[C]=M=Pn(Pn({},M),{},{tickCoord:M.coordinate});if(M.tickCoord!=null){var j=jh(e,M.tickCoord,P,c,f);j&&(c=M.tickCoord+e*(P()/2+i),l[C]=Pn(Pn({},M),{},{isShow:!0}))}},w=0;w<y;w++)x(w);return l}function Ck(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)||td.isSsr){var g;return(g=sye(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=(D,P)=>{var N=typeof f=="function"?f(D.value,P):D.value;return y==="width"?lye(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?cr(C.coordinate-A.coordinate):1,M=oye(a,k,y);return c==="equidistantPreserveStart"?uye(k,M,w,i,l):c==="equidistantPreserveEnd"?cye(k,M,w,i,l):(c==="preserveStart"||c==="preserveStartEnd"?v=mye(k,M,w,i,l,c==="preserveStartEnd"):v=pye(k,M,w,i,l),v.filter(D=>D.isShow))}var gye=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},vye={xAxis:{},yAxis:{}},f6=zn({name:"renderedTicks",initialState:vye,reducers:{setRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId,a=n.ticks;e[r][i]=Ge(a)},removeRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId;delete e[r][i]}}}),h6=f6.actions,yye=h6.setRenderedTicks,bye=h6.removeRenderedTicks,xye=f6.reducer,Sye=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function xL(e,t){return kye(e)||Aye(e,t)||Oye(e,t)||wye()}function wye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
127
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oye(e,t){if(e){if(typeof e=="string")return SL(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)?SL(e,t):void 0}}function SL(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 Aye(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 kye(e){if(Array.isArray(e))return e}function Cye(e,t){if(e==null)return{};var n,r,i=Eye(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 Eye(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 ds(){return ds=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},ds.apply(null,arguments)}function wL(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 Dt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wL(Object(n),!0).forEach(function(r){Tye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tye(e,t,n){return(t=Mye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mye(e){var t=Pye(e,"string");return typeof t=="symbol"?t:t+""}function Pye(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 Ha={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:un.axis};function Dye(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=Dt(Dt(Dt({},c),Si(s)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!l||a==="bottom"&&l);f=Dt(Dt({},f),{},{x1:t,y1:n+d*i,x2:t+r,y2:n+d*i})}else{var p=+(a==="left"&&!l||a==="right"&&l);f=Dt(Dt({},f),{},{x1:t+p*r,y1:n,x2:t+p*r,y2:n+i})}return O.createElement("line",ds({},f,{className:ut("recharts-cartesian-axis-line",Xa(s,"className"))}))}function _ye(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 Nye(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function Rye(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Lye(e){var t=e.option,n=e.tickProps,r=e.value,i,a=ut(n.className,"recharts-cartesian-axis-tick-value");if(O.isValidElement(t))i=O.cloneElement(t,Dt(Dt({},n),{},{className:a}));else if(typeof t=="function")i=t(Dt(Dt({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=ut(l,mge(t))),i=O.createElement(Sk,ds({},n,{className:l}),r)}return i}function jye(e){var t=e.ticks,n=e.axisType,r=e.axisId,i=wt();return O.useEffect(()=>{if(r==null||n==null)return ms;var a=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(yye({ticks:a,axisId:r,axisType:n})),()=>{i(bye({axisId:r,axisType:n}))}},[i,t,r,n]),null}var Iye=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,M=e.letterSpacing,D=e.getTicksConfig,P=e.events,N=e.axisType,j=e.axisId,U=Ck(Dt(Dt({},D),{},{ticks:r}),k,M),V=Si(D),K=Qh(i),B=N8(V.textAnchor)?V.textAnchor:Nye(p,g),oe=Rye(p,g),ie={};typeof a=="object"&&(ie=a);var ue=Dt(Dt({},V),{},{fill:"none"},ie),z=U.map(Q=>Dt({entry:Q},_ye(Q,v,y,x,w,p,A,g,C))),Z=z.map(Q=>{var le=Q.entry,R=Q.line;return O.createElement(Nr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(le.value,"-").concat(le.coordinate,"-").concat(le.tickCoord)},a&&O.createElement("line",ds({},ue,R,{className:ut("recharts-cartesian-axis-tick-line",Xa(a,"className"))})))}),ae=z.map((Q,le)=>{var R,F,ee=Q.entry,se=Q.tick,ge=Dt(Dt(Dt(Dt({verticalAnchor:oe},V),{},{textAnchor:B,stroke:"none",fill:l},se),{},{index:le,payload:ee,visibleTicksCount:U.length,tickFormatter:s,padding:f},d),{},{angle:(R=(F=d?.angle)!==null&&F!==void 0?F:V.angle)!==null&&R!==void 0?R:0}),Oe=Dt(Dt({},ge),K);return O.createElement(Nr,ds({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(ee.value,"-").concat(ee.coordinate,"-").concat(ee.tickCoord)},Xv(P,ee,le)),i&&O.createElement(Lye,{option:i,tickProps:Oe,value:"".concat(typeof s=="function"?s(ee.value,le):ee.value).concat(c||"")}))});return O.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(N,"-ticks")},O.createElement(jye,{ticks:U,axisId:j,axisType:N}),ae.length>0&&O.createElement(oi,{zIndex:un.label},O.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(N,"-tick-labels"),ref:t},ae)),Z.length>0&&O.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(N,"-tick-lines")},Z))}),Bye=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=Cye(e,Sye),p=O.useState(""),g=xL(p,2),v=g[0],y=g[1],x=O.useState(""),w=xL(x,2),A=w[0],C=w[1],k=O.useRef(null);O.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var D;return gye({ticks:k.current,label:(D=e.labelRef)===null||D===void 0?void 0:D.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var M=O.useCallback(D=>{if(D){var P=D.getElementsByClassName("recharts-cartesian-axis-tick-value");k.current=P;var N=P[0];if(N){var j=window.getComputedStyle(N),U=j.fontSize,V=j.letterSpacing;(U!==v||V!==A)&&(y(U),C(V))}}},[v,A]);return l||r!=null&&r<=0||i!=null&&i<=0?null:O.createElement(oi,{zIndex:e.zIndex},O.createElement(Nr,{className:ut("recharts-cartesian-axis",a)},O.createElement(Dye,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Si(e)}),O.createElement(Iye,{ref:M,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(Yme,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},O.createElement(lge,{label:e.label,labelRef:e.labelRef}),e.children)))}),Ek=O.forwardRef((e,t)=>{var n=Bn(e,Ha);return O.createElement(Bye,ds({},n,{ref:t}))});Ek.displayName="CartesianAxis";var zye=["x1","y1","x2","y2","key"],$ye=["offset"],Uye=["xAxisId","yAxisId"],Hye=["xAxisId","yAxisId"];function OL(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 Nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OL(Object(n),!0).forEach(function(r){Fye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fye(e,t,n){return(t=qye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qye(e){var t=Wye(e,"string");return typeof t=="symbol"?t:t+""}function Wye(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 hv(e,t){if(e==null)return{};var n,r,i=Kye(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 Kye(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 Vye=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 d6(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=hv(n,zye),p=(i=Si(d))!==null&&i!==void 0?i:{};p.offset;var g=hv(p,$ye);r=O.createElement("line",Qo({},g,{x1:a,y1:l,x2:s,y2:c,fill:"none",key:f}))}return r}function Qye(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=hv(e,Uye),s=a.map((c,f)=>{var d=Nn(Nn({},l),{},{x1:t,y1:c,x2:t+n,y2:c,key:"line-".concat(f),index:f});return O.createElement(d6,{key:"line-".concat(f),option:i,lineItemProps:d})});return O.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function Xye(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=hv(e,Hye),s=a.map((c,f)=>{var d=Nn(Nn({},l),{},{x1:c,y1:t,x2:c,y2:t+n,key:"line-".concat(f),index:f});return O.createElement(d6,{option:i,lineItemProps:d,key:"line-".concat(f)})});return O.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function Yye(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 Gye(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 Zye=(e,t)=>{var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return B$(Ck(Nn(Nn(Nn({},Ha),n),{},{ticks:z$(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Jye=(e,t)=>{var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return B$(Ck(Nn(Nn(Nn({},Ha),n),{},{ticks:z$(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},e0e={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:un.grid};function Dw(e){var t=yA(),n=bA(),r=q$(),i=Nn(Nn({},Bn(e,e0e)),{},{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=$n(),x=we(U=>yR(U,"xAxis",a,y)),w=we(U=>yR(U,"yAxis",l,y));if(!aa(f)||!aa(d)||!be(s)||!be(c))return null;var A=i.verticalCoordinatesGenerator||Zye,C=i.horizontalCoordinatesGenerator||Jye,k=i.horizontalPoints,M=i.verticalPoints;if((!k||!k.length)&&typeof C=="function"){var D=g&&g.length,P=C({yAxis:w?Nn(Nn({},w),{},{ticks:D?g:w.ticks}):void 0,width:t??f,height:n??d,offset:r},D?!0:p);Ug(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(k=P)}if((!M||!M.length)&&typeof A=="function"){var N=v&&v.length,j=A({xAxis:x?Nn(Nn({},x),{},{ticks:N?v:x.ticks}):void 0,width:t??f,height:n??d,offset:r},N?!0:p);Ug(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(M=j)}return O.createElement(oi,{zIndex:i.zIndex},O.createElement("g",{className:"recharts-cartesian-grid"},O.createElement(Vye,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),O.createElement(Yye,Qo({},i,{horizontalPoints:k})),O.createElement(Gye,Qo({},i,{verticalPoints:M})),O.createElement(Qye,Qo({},i,{offset:r,horizontalPoints:k,xAxis:x,yAxis:w})),O.createElement(Xye,Qo({},i,{offset:r,verticalPoints:M,xAxis:x,yAxis:w}))))}Dw.displayName="CartesianGrid";var t0e=["animationElapsedTime","isAnimating","isEntrance","visibleLength","strokeDasharray","connectNulls"];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 n0e(e,t){if(e==null)return{};var n,r,i=r0e(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 r0e(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 i0e(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function p6(e,t){return"".concat(t,"px ").concat(e,"px")}function a0e(e){return e.length%2!==0?[...e,...e]:e}function l0e(e,t){for(var n=[],r=0;r<t;++r)n.push(...e);return n}function o0e(e,t,n){var r=a0e(n),i=r.reduce((v,y)=>v+y,0);if(!i)return p6(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[...l0e(r,a),...s,...g].map(v=>"".concat(v,"px")).join(", ")}function s0e(e,t,n){if(e){var r="".concat(e).split(/[,\s]+/gim).map(i=>parseFloat(i));return o0e(n,t,r)}return p6(t,n)}function u0e(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=n0e(e,t0e),a=r??!1,l;if(t!=null){var s,c=i.pathRef,f=i0e((s=c?.current)!==null&&s!==void 0?s:null);l=s0e(n,f,t)}else n!=null&&(l=String(n));return O.createElement(G$,_w({},i,{connectNulls:a,strokeDasharray:l}))}function c0e(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(ja(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 f0e={},m6=zn({name:"errorBars",initialState:f0e,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))}}}),Tk=m6.actions;Tk.addErrorBar;Tk.replaceErrorBar;Tk.removeErrorBar;var h0e=m6.reducer,d0e=["children"];function p0e(e,t){if(e==null)return{};var n,r,i=m0e(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 m0e(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 g0e={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},v0e=O.createContext(g0e);function g6(e){var t=e.children,n=p0e(e,d0e);return O.createElement(v0e.Provider,{value:n},t)}function Mk(e,t){var n,r,i=we(f=>al(f,e)),a=we(f=>ll(f,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Qt.allowDataOverflow,s=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Xt.allowDataOverflow,c=l||s;return{needClip:c,needClipX:l,needClipY:s}}function v6(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=kk(),a=Mk(t,n),l=a.needClipX,s=a.needClipY,c=a.needClip,f=we(k=>z4(k,t,!1)),d=we(k=>$4(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 y6=(e,t,n,r)=>no(e,"xAxis",t,r),b6=(e,t,n,r)=>to(e,"xAxis",t,r),x6=(e,t,n,r)=>no(e,"yAxis",n,r),S6=(e,t,n,r)=>to(e,"yAxis",n,r),y0e=W([rt,y6,x6,b6,S6],(e,t,n,r,i)=>tl(e,"xAxis")?Zu(t,r,!1):Zu(n,i,!1)),b0e=(e,t,n,r,i)=>i;function x0e(e){return e.type==="line"}var S0e=W([Cy,b0e],(e,t)=>e.filter(x0e).find(n=>n.id===t)),w0e=W([rt,y6,x6,b6,S6,S0e,y0e,nd],(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 q0e({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:p,bandSize:l,displayedData:v})}});function O0e(e){var t=Qh(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 A0e=["id"],k0e=["type","layout","connectNulls","needClip","shape","strokeDasharray"],C0e=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function dv(){return dv=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},dv.apply(null,arguments)}function Pk(e,t){if(e==null)return{};var n,r,i=E0e(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 E0e(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 AL(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 Hi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AL(Object(n),!0).forEach(function(r){T0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T0e(e,t,n){return(t=M0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M0e(e){var t=P0e(e,"string");return typeof t=="symbol"?t:t+""}function P0e(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 D0e(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function _0e(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 N0e=(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(s=>s.status==="removed"?[]:[s.next]);var n=_0e(e),r=[];for(var i of e)if(i.status==="matched")r.push(Hi(Hi({},i.next),{},{x:Wt(i.prev.x,i.next.x,t),y:Wt(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(Hi(Hi({},i.next),{},{x:Wt(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(Hi(Hi({},i.prev),{},{x:Wt(i.prev.x,l,t),y:i.prev.y}))}return r},Dk={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:N0e,animationMatchBy:Ok,connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",shape:u0e,stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:un.line,type:"linear"},R0e=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:oy(n,t),payload:e}]},L0e=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:ms,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:oy(l,t),hide:s,type:d,color:r,unit:c,formatter:f,graphicalItemId:p}};return O.createElement(Z8,{tooltipEntrySettings:g})});function j0e(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,l=r.needClip;r.id;var s=Pk(r,A0e),c=Si(s);return O.createElement(hve,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:c,needClip:l,clipPathId:t})}function I0e(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 Hi(Hi({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return O.createElement($8,{value:t?i:void 0},n)}function B0e(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=Pk(i,k0e),w=Hi(Hi({},_r(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(Q8,{option:v,DefaultShape:Dk.shape,shapeProps:w}),O.createElement(j0e,{points:r,clipPathId:t,props:i}))}function z0e(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=D0e(r.current),y=t6(n.onAnimationStart,n.onAnimationEnd),x=y.isAnimating,w=y.handleAnimationStart,A=y.handleAnimationEnd,C=!x,k=c0e(a),M=O.useCallback(D=>D>0&&v>0,[v]);return O.createElement(I0e,{points:a,showLabels:C},n.children,O.createElement(n6,{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:M,layout:g},(D,P,N)=>{var j=x||P<1,U=j?k(P,v):null;return O.createElement(B0e,{props:n,points:D,clipPathId:t,pathRef:r,animationElapsedTime:P,isAnimating:j,isEntrance:N,visibleLength:U})}),O.createElement(H8,{label:n.label}))}function $0e(e){var t=e.clipPathId,n=e.props,r=O.useRef(null),i=O.useRef(null);return O.createElement(z0e,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var U0e=(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:$t(e.payload,t)}};class H0e 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=ut("recharts-line",a),w=g,A=O0e(r),C=A.r,k=A.strokeWidth,M=K8(r),D=C*2+k,P=v?"url(#clipPath-".concat(M?"":"dots-").concat(w,")"):void 0;return O.createElement(oi,{zIndex:y},O.createElement(Nr,{className:x},v&&O.createElement("defs",null,O.createElement(v6,{clipPathId:w,xAxisId:l,yAxisId:s}),!M&&O.createElement("clipPath",{id:"clipPath-dots-".concat(w)},O.createElement("rect",{x:f-D/2,y:c-D/2,width:d+D,height:p+D}))),O.createElement(g6,{xAxisId:l,yAxisId:s,data:i,dataPointFormatter:U0e,errorBarOffset:0},O.createElement($0e,{props:this.props,clipPathId:w}))),O.createElement(_ve,{activeDot:this.props.activeDot,points:i,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:P}))}}function F0e(e){var t=Bn(e,Dk),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=Pk(t,C0e),A=Mk(v,y),C=A.needClip,k=kk(),M=gs(),D=$n(),P=we(K=>w0e(K,v,y,D,x));if(M!=="horizontal"&&M!=="vertical"||P==null||k==null)return null;var N=k.height,j=k.width,U=k.x,V=k.y;return O.createElement(H0e,dv({},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:P,layout:M,height:N,width:j,left:U,top:V,needClip:C}))}function q0e(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=$t(f,l);if(t==="horizontal"){var g=d_({axis:n,ticks:i,bandSize:s,entry:f,index:d}),v=Ct(p)?null:r.scale.map(p);return{x:g,y:v??null,value:p,payload:f}}var y=Ct(p)?null:n.scale.map(p),x=d_({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 W0e(e){var t=Bn(e,Dk),n=$n();return O.createElement(r6,{id:t.id,type:"line"},r=>O.createElement(O.Fragment,null,O.createElement(J8,{legendPayload:R0e(t)}),O.createElement(L0e,{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(a6,{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(F0e,dv({},t,{id:r}))))}var w6=O.memo(W0e,pc);w6.displayName="Line";function xs(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:l6}function Ss(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:l6}var K0e="Invariant failed";function V0e(e,t){throw new Error(K0e)}var Q0e=["option"];function X0e(e,t){if(e==null)return{};var n,r,i=Y0e(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 Y0e(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 _k=r5;function Nk(e){var t=e.option,n=X0e(e,Q0e);return O.createElement(Q8,{option:t,DefaultShape:_k,shapeProps:n,activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"})}var G0e=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)||Ct(r);return a?t(r,i):(a||V0e(),n)}},Z0e=(e,t,n)=>n,J0e=(e,t)=>t,dd=W([Cy,J0e],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),ebe=W([dd],e=>e?.maxBarSize),tbe=(e,t,n,r)=>r,nbe=W([rt,Cy,xs,Ss,Z0e],(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")),rbe=(e,t,n)=>{var r=rt(e),i=xs(e,t),a=Ss(e,t);if(!(i==null||a==null))return r==="horizontal"?Cw(e,"yAxis",a,n):Cw(e,"xAxis",i,n)},ibe=(e,t)=>{var n=rt(e),r=xs(e,t),i=Ss(e,t);if(!(r==null||i==null))return n==="horizontal"?vR(e,"xAxis",r):vR(e,"yAxis",i)},abe=W([nbe,$se,ibe],Bve),lbe=(e,t,n)=>{var r,i,a=dd(e,t);if(a==null)return 0;var l=xs(e,t),s=Ss(e,t);if(l==null||s==null)return 0;var c=rt(e),f=y5(e),d=a.maxBarSize,p=Ct(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=Zu(g,v,!0))!==null&&i!==void 0?i:p)!==null&&r!==void 0?r:0},O6=(e,t,n)=>{var r=rt(e),i=xs(e,t),a=Ss(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)),Zu(l,s)}},obe=W([abe,y5,zse,b5,lbe,O6,ebe],Fve),sbe=(e,t,n)=>{var r=xs(e,t);if(r!=null)return no(e,"xAxis",r,n)},ube=(e,t,n)=>{var r=Ss(e,t);if(r!=null)return no(e,"yAxis",r,n)},cbe=(e,t,n)=>{var r=xs(e,t);if(r!=null)return to(e,"xAxis",r,n)},fbe=(e,t,n)=>{var r=Ss(e,t);if(r!=null)return to(e,"yAxis",r,n)},hbe=W([obe,dd],Wve),dbe=W([rbe,dd],qve),pbe=W([cn,mA,sbe,ube,cbe,fbe,hbe,rt,Ose,O6,dbe,dd,tbe],(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 Vbe({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})}}),mbe=["index"];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 gbe(e,t){if(e==null)return{};var n,r,i=vbe(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 vbe(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 A6=O.createContext(void 0),ybe=e=>{var t=O.useContext(A6);if(t!=null)return t.stackId;if(e!=null)return Zie(e)},bbe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),xbe=e=>{var t=O.useContext(A6);if(t!=null){var n=t.stackId;return"url(#".concat(bbe(n,e),")")}},k6=e=>{var t=e.index,n=gbe(e,mbe),r=xbe(t);return O.createElement(Nr,Nw({className:"recharts-bar-stack-layer",clipPath:r},n))},Sbe=["onMouseEnter","onMouseLeave","onClick"],wbe=["value","background","tooltipPosition"],Obe=["id"],Abe=["onMouseEnter","onClick","onMouseLeave"];function kL(e,t){return Tbe(e)||Ebe(e,t)||Cbe(e,t)||kbe()}function kbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
128
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cbe(e,t){if(e){if(typeof e=="string")return CL(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)?CL(e,t):void 0}}function CL(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 Ebe(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 Tbe(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 EL(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 Yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EL(Object(n),!0).forEach(function(r){Mbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mbe(e,t,n){return(t=Pbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pbe(e){var t=Dbe(e,"string");return typeof t=="symbol"?t:t+""}function Dbe(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 pv(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}var Nbe=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:oy(n,t),payload:e}]},Rbe=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:ms,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:oy(a,t),hide:l,type:f,color:i,unit:s,formatter:c,graphicalItemId:d}};return O.createElement(Z8,{tooltipEntrySettings:p})});function Lbe(e){var t=we(hs),n=e.data,r=e.dataKey,i=e.background,a=e.allOtherBarProps,l=a.onMouseEnter,s=a.onMouseLeave,c=a.onClick,f=pv(a,Sbe),d=X8(l,r,a.id),p=Y8(s),g=G8(c,r,a.id);if(!i||n==null)return null;var v=Qh(i);return O.createElement(oi,{zIndex:Kve(i,un.barBackground)},n.map((y,x)=>{y.value;var w=y.background;y.tooltipPosition;var A=pv(y,wbe);if(!w)return null;var C=d(y,y.originalDataIndex),k=p(y,y.originalDataIndex),M=g(y,y.originalDataIndex),D=Yt(Yt(Yt(Yt(Yt({option:i,isActive:String(y.originalDataIndex)===t},A),{},{fill:"#eee"},w),v),Xv(f,y,x)),{},{onMouseEnter:C,onMouseLeave:k,onClick:M,dataKey:r,index:x,className:"recharts-bar-background-rectangle"});return O.createElement(Nk,ro({key:"background-bar-".concat(x)},D))}))}function jbe(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 Yt(Yt({},l),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:l,fill:a.fill})});return O.createElement($8,{value:t?i:void 0},n)}function Ibe(e){var t=e.shape,n=e.activeBar,r=e.baseProps,i=e.entry,a=e.index,l=e.dataKey,s=we(hs),c=we(g8),f=n&&String(i.originalDataIndex)===s&&(c==null||l===c),d=O.useState(!1),p=kL(d,2),g=p[0],v=p[1],y=O.useState(!1),x=kL(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,M=f||g,D;f?n===!0?D=t:D=n:D=t;var P=O.createElement(Nk,ro({},r,{name:String(r.name)},i,{isActive:k,option:D,index:a,dataKey:l,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance,onTransitionEnd:C}));return M?O.createElement(oi,{zIndex:un.activeBar},O.createElement(k6,{index:i.originalDataIndex},P)):P}function Bbe(e){var t=e.shape,n=e.baseProps,r=e.entry,i=e.index,a=e.dataKey;return O.createElement(Nk,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 zbe(e){var t,n=e.data,r=e.props,i=e.animationElapsedTime,a=e.isAnimating,l=e.isEntrance,s=(t=Si(r))!==null&&t!==void 0?t:{},c=s.id,f=pv(s,Obe),d=r.shape,p=r.dataKey,g=r.activeBar,v=r.onMouseEnter,y=r.onClick,x=r.onMouseLeave,w=pv(r,Abe),A=X8(v,p,c),C=Y8(x),k=G8(y,p,c);return n?O.createElement(O.Fragment,null,n.map((M,D)=>O.createElement(k6,ro({index:M.originalDataIndex,key:"rectangle-".concat(M?.x,"-").concat(M?.y,"-").concat(M?.value,"-").concat(D),className:"recharts-bar-rectangle"},Xv(w,M,D),{onMouseEnter:A(M,M.originalDataIndex),onMouseLeave:C(M,M.originalDataIndex),onClick:k(M,M.originalDataIndex)}),g?O.createElement(Ibe,{shape:d,activeBar:g,baseProps:f,entry:M,index:D,dataKey:p,animationElapsedTime:i,isAnimating:a,isEntrance:l}):O.createElement(Bbe,{shape:d,baseProps:f,entry:M,index:D,dataKey:p,animationElapsedTime:i,isAnimating:a,isEntrance:l})))):null}var $be=(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"?[Yt(Yt({},r.prev),{},{height:Wt(r.prev.height,0,t),y:Wt(r.prev.y,r.prev.y+r.prev.height,t)})]:[Yt(Yt({},r.prev),{},{width:Wt(r.prev.width,0,t)})];if(r.status==="matched")return[Yt(Yt({},r.next),{},{x:Wt(r.prev.x,r.next.x,t),y:Wt(r.prev.y,r.next.y,t),width:Wt(r.prev.width,r.next.width,t),height:Wt(r.prev.height,r.next.height,t)})];var i=r.next;return n==="horizontal"?[Yt(Yt({},i),{},{height:Wt(0,i.height,t),y:Wt(i.stackedBarStart,i.y,t)})]:[Yt(Yt({},i),{},{width:Wt(0,i.width,t),x:Wt(i.stackedBarStart,i.x,t)})]});function Ube(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=t6(t.onAnimationStart,t.onAnimationEnd),p=d.isAnimating,g=d.handleAnimationStart,v=d.handleAnimationEnd;return O.createElement(jbe,{showLabels:!p,rects:r},O.createElement(n6,{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(Nr,null,O.createElement(zbe,{props:t,data:y,animationElapsedTime:x,isAnimating:p||x<1,isEntrance:w}))),O.createElement(H8,{label:t.label}),t.children)}function Hbe(e){var t=O.useRef(null);return O.createElement(Ube,{previousRectanglesRef:t,props:e})}var C6=0,Fbe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:$t(e,t)}};class qbe 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=ut("recharts-bar",a),g=d;return O.createElement(Nr,{className:p,id:d},c&&O.createElement("defs",null,O.createElement(v6,{clipPathId:g,xAxisId:l,yAxisId:s})),O.createElement(Nr,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(g,")"):void 0},O.createElement(Lbe,{data:r,dataKey:i,background:f,allOtherBarProps:this.props}),O.createElement(Hbe,this.props)))}}var Wbe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",animationInterpolateFn:$be,animationMatchBy:e6,background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:C6,shape:_k,xAxisId:0,yAxisId:0,zIndex:un.bar};function Kbe(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=Mk(t,n),g=p.needClip,v=gs(),y=$n(),x=bge(e.children,E8),w=we(k=>pbe(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(g6,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:Fbe,errorBarOffset:A},O.createElement(qbe,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 Vbe(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,M=Jie({numericAxis:C}),D=C.scale.map(M);return v.map((P,N)=>{var j,U,V,K,B,oe;if(g){var ie=g[N+A];if(ie==null)return null;j=Vie(ie,k)}else j=$t(P,r),Array.isArray(j)||(j=[M,j]);var ue=G0e(i,C6)(j[1],N);if(t==="horizontal"){var z,Z=f.scale.map(j[0]),ae=f.scale.map(j[1]);if(Z==null||ae==null)return null;U=p_({axis:c,ticks:d,bandSize:s,offset:l.offset,entry:P,index:N}),V=(z=ae??Z)!==null&&z!==void 0?z:void 0,K=l.size;var Q=Z-ae;if(B=ra(Q)?0:Q,oe={x:U,y:y.top,width:K,height:y.height},Math.abs(ue)>0&&Math.abs(B)<Math.abs(ue)){var le=cr(B||ue)*(Math.abs(ue)-Math.abs(B));V-=le,B+=le}}else{var R=c.scale.map(j[0]),F=c.scale.map(j[1]);if(R==null||F==null)return null;if(U=R,V=p_({axis:f,ticks:p,bandSize:s,offset:l.offset,entry:P,index:N}),K=F-R,B=l.size,oe={x:y.left,y:V,width:y.width,height:B},Math.abs(ue)>0&&Math.abs(K)<Math.abs(ue)){var ee=cr(K||ue)*(Math.abs(ue)-Math.abs(K));K+=ee}}if(U==null||V==null||K==null||B==null||!a&&(K===0||B===0))return null;var se=Yt(Yt({},P),{},{stackedBarStart:D,x:U,y:V,width:K,height:B,value:g?j:j[1],payload:P,background:oe,tooltipPosition:{x:U+K/2,y:V+B/2},parentViewBox:w,originalDataIndex:N},x&&x[N]&&x[N].props);return se}).filter(Boolean)}function Qbe(e){var t=Bn(e,Wbe),n=ybe(t.stackId),r=$n();return O.createElement(r6,{id:t.id,type:"bar"},i=>O.createElement(O.Fragment,null,O.createElement(J8,{legendPayload:Nbe(t)}),O.createElement(Rbe,{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(a6,{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!==_k}),O.createElement(oi,{zIndex:t.zIndex},O.createElement(Kbe,ro({},t,{id:i})))))}var E6=O.memo(Qbe,pc);E6.displayName="Bar";var Xbe=["domain","range"],Ybe=["domain","range"];function TL(e,t){if(e==null)return{};var n,r,i=Gbe(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 Gbe(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 ML(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 T6(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=TL(e,Xbe),a=t.domain,l=t.range,s=TL(t,Ybe);return!ML(n,a)||!ML(r,l)?!1:pc(i,s)}var Zbe=["type"],Jbe=["dangerouslySetInnerHTML","ticks","scale"],exe=["id","scale"];function Rw(){return Rw=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},Rw.apply(null,arguments)}function PL(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 DL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PL(Object(n),!0).forEach(function(r){txe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function txe(e,t,n){return(t=nxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nxe(e){var t=rxe(e,"string");return typeof t=="symbol"?t:t+""}function rxe(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 Lw(e,t){if(e==null)return{};var n,r,i=ixe(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 ixe(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 axe(e){var t=wt(),n=O.useRef(null),r=W$(),i=e.type,a=Lw(e,Zbe),l=my(r,"xAxis",i),s=O.useMemo(()=>{if(l!=null)return DL(DL({},a),{},{type:l})},[a,l]);return O.useLayoutEffect(()=>{s!=null&&(n.current===null?t(vve(s)):n.current!==s&&t(yve({prev:n.current,next:s})),n.current=s)},[s,t]),O.useLayoutEffect(()=>()=>{n.current&&(t(bve(n.current)),n.current=null)},[t]),null}var lxe=e=>{var t=e.xAxisId,n=e.className,r=we(mA),i=$n(),a="xAxis",l=we(g=>Q4(g,a,t,i)),s=we(g=>W4(g,t)),c=we(g=>khe(g,t)),f=we(g=>f4(g,t));if(s==null||c==null||f==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var d=Lw(e,Jbe);f.id,f.scale;var p=Lw(f,exe);return O.createElement(Ek,Rw({},d,p,{x:c.x,y:c.y,width:s.width,height:s.height,className:ut("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a,axisId:t}))},oxe={allowDataOverflow:Qt.allowDataOverflow,allowDecimals:Qt.allowDecimals,allowDuplicatedCategory:Qt.allowDuplicatedCategory,angle:Qt.angle,axisLine:Ha.axisLine,height:Qt.height,hide:!1,includeHidden:Qt.includeHidden,interval:Qt.interval,label:!1,minTickGap:Qt.minTickGap,mirror:Qt.mirror,orientation:Qt.orientation,padding:Qt.padding,reversed:Qt.reversed,scale:Qt.scale,tick:Qt.tick,tickCount:Qt.tickCount,tickLine:Ha.tickLine,tickSize:Ha.tickSize,type:Qt.type,niceTicks:Qt.niceTicks,xAxisId:0},sxe=e=>{var t=Bn(e,oxe);return O.createElement(O.Fragment,null,O.createElement(axe,{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(lxe,t))},jw=O.memo(sxe,T6);jw.displayName="XAxis";var uxe=["type"],cxe=["dangerouslySetInnerHTML","ticks","scale"],fxe=["id","scale"];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 _L(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 NL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_L(Object(n),!0).forEach(function(r){hxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_L(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hxe(e,t,n){return(t=dxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dxe(e){var t=pxe(e,"string");return typeof t=="symbol"?t:t+""}function pxe(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=mxe(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 mxe(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 gxe(e){var t=wt(),n=O.useRef(null),r=W$(),i=e.type,a=Bw(e,uxe),l=my(r,"yAxis",i),s=O.useMemo(()=>{if(l!=null)return NL(NL({},a),{},{type:l})},[l,a]);return O.useLayoutEffect(()=>{s!=null&&(n.current===null?t(xve(s)):n.current!==s&&t(Sve({prev:n.current,next:s})),n.current=s)},[s,t]),O.useLayoutEffect(()=>()=>{n.current&&(t(wve(n.current)),n.current=null)},[t]),null}function vxe(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=O.useRef(null),l=O.useRef(null),s=we(mA),c=$n(),f=wt(),d="yAxis",p=we(A=>K4(A,t)),g=we(A=>Ehe(A,t)),v=we(A=>Q4(A,d,t,c)),y=we(A=>h4(A,t));if(O.useLayoutEffect(()=>{if(!(r!=="auto"||!p||wk(i)||O.isValidElement(i)||y==null)){var A=a.current;if(A){var C=A.getCalculatedWidth();Math.round(p.width)!==Math.round(C)&&f(Ove({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=Bw(e,cxe);y.id,y.scale;var w=Bw(y,fxe);return O.createElement(Ek,Iw({},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:ut("recharts-".concat(d," ").concat(d),n),viewBox:s,ticks:v,axisType:d,axisId:t}))}var yxe={allowDataOverflow:Xt.allowDataOverflow,allowDecimals:Xt.allowDecimals,allowDuplicatedCategory:Xt.allowDuplicatedCategory,angle:Xt.angle,axisLine:Ha.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:Ha.tickLine,tickSize:Ha.tickSize,type:Xt.type,niceTicks:Xt.niceTicks,width:Xt.width,yAxisId:0},bxe=e=>{var t=Bn(e,yxe);return O.createElement(O.Fragment,null,O.createElement(gxe,{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(vxe,t))},zw=O.memo(bxe,T6);zw.displayName="YAxis";var xxe=(e,t)=>t,Rk=W([xxe,rt,C5,hn,h8,ol,Yde,cn],rpe);function Sxe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Lk(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Sxe(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 M6=Rr("mouseClick"),P6=Gh();P6.startListening({actionCreator:M6,effect:(e,t)=>{var n=e.payload,r=Rk(t.getState(),Lk(n));r?.activeIndex!=null&&t.dispatch(Fhe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var $w=Rr("mouseMove"),D6=Gh(),fu=null,Mo=null,A1=null;D6.startListening({actionCreator:$w,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");fu!==null&&(cancelAnimationFrame(fu),fu=null),Mo!==null&&(typeof a!="number"||!s)&&(clearTimeout(Mo),Mo=null),A1=Lk(n);var c=()=>{var f=t.getState(),d=fd(f,f.tooltip.settings.shared);if(!A1){fu=null,Mo=null;return}if(d==="axis"){var p=Rk(f,A1);p?.activeIndex!=null?t.dispatch(n8({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(t8())}fu=null,Mo=null};if(!s){c();return}a==="raf"?fu=requestAnimationFrame(c):typeof a=="number"&&Mo===null&&(Mo=setTimeout(c,a))}});function wxe(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 RL={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},_6=zn({name:"rootProps",initialState:RL,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:RL.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}}}),Oxe=_6.reducer,Axe=_6.actions.updateOptions,kxe=null,Cxe={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)},N6=zn({name:"polarOptions",initialState:kxe,reducers:Cxe});N6.actions.updatePolarOptions;var Exe=N6.reducer,R6=Rr("keyDown"),L6=Rr("focus"),j6=Rr("blur"),_y=Gh(),hu=null,Po=null,xm=null;_y.startListening({actionCreator:R6,effect:(e,t)=>{xm=e.payload,hu!==null&&(cancelAnimationFrame(hu),hu=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=xm;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var g=nh(d,fs(c),rc(c),ic(c)),v=g==null?-1:Number(g),y=!Number.isFinite(v)||v<0,x=ol(c),w=fs(c),A=fd(c,c.tooltip.settings.shared);if(p==="Enter"){if(y)return;var C=sv(c,A,"hover",String(d.index));t.dispatch(ov({active:!d.active,activeIndex:d.index,activeCoordinate:C}));return}var k=_he(c),M=k==="left-to-right"?1:-1,D=p==="ArrowRight"?1:-1,P;if(y){var N=rc(c),j=ic(c),U=D*M,V=ue=>({active:!1,index:String(ue),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(P=-1,U>0){for(var K=0;K<w.length;K++)if(nh(V(K),w,N,j)!=null){P=K;break}}else for(var B=w.length-1;B>=0;B--)if(nh(V(B),w,N,j)!=null){P=B;break}if(P<0)return}else{P=v+D*M;var oe=x?.length||w.length;if(oe===0||P>=oe||P<0)return}var ie=sv(c,A,"hover",String(P));t.dispatch(ov({active:!0,activeIndex:P.toString(),activeCoordinate:ie}))}finally{hu=null,Po=null}};if(!l){s();return}i==="raf"?hu=requestAnimationFrame(s):typeof i=="number"&&Po===null&&(s(),xm=null,Po=setTimeout(()=>{xm?s():(Po=null,hu=null)},i))}});_y.startListening({actionCreator:L6,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=fd(n,n.tooltip.settings.shared),s=sv(n,l,"hover",String(a));t.dispatch(ov({active:!0,activeIndex:a,activeCoordinate:s}))}}}});_y.startListening({actionCreator:j6,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;i.active&&t.dispatch(ov({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function I6(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=Rr("externalEvent"),B6=Gh(),Sm=new Map,jf=new Map,k1=new Map;B6.startListening({actionCreator:Vr,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,l=I6(i);k1.set(a,{handler:r,reactEvent:l});var s=Sm.get(a);s!==void 0&&(cancelAnimationFrame(s),Sm.delete(a));var c=t.getState(),f=c.eventSettings,d=f.throttleDelay,p=f.throttledEvents,g=p,v=g==="all"||g?.includes(a),y=jf.get(a);y!==void 0&&(typeof d!="number"||!v)&&(clearTimeout(y),jf.delete(a));var x=()=>{var C=k1.get(a);try{if(!C)return;var k=C.handler,M=C.reactEvent,D=t.getState(),P={activeCoordinate:Rde(D),activeDataKey:g8(D),activeIndex:hs(D),activeLabel:m8(D),activeTooltipIndex:hs(D),isTooltipActive:Lde(D)};k&&k(P,M)}finally{Sm.delete(a),jf.delete(a),k1.delete(a)}};if(!v){x();return}if(d==="raf"){var w=requestAnimationFrame(x);Sm.set(a,w)}else if(typeof d=="number"){if(!jf.has(a)){x();var A=setTimeout(x,d);jf.set(a,A)}}else x()}}});var Txe=W([wc],e=>e.tooltipItemPayloads),Mxe=W([Txe,(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)}}}),z6=Rr("touchMove"),$6=Gh(),Do=null,Nl=null,LL=null,If=null;$6.startListening({actionCreator:z6,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){If=I6(n);var r=t.getState(),i=r.eventSettings,a=i.throttleDelay,l=i.throttledEvents,s=l==="all"||l.includes("touchmove");Do!==null&&(cancelAnimationFrame(Do),Do=null),Nl!==null&&(typeof a!="number"||!s)&&(clearTimeout(Nl),Nl=null),LL=Array.from(n.touches).map(f=>Lk({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var c=()=>{if(If!=null){var f=t.getState(),d=fd(f,f.tooltip.settings.shared);if(d==="axis"){var p,g=(p=LL)===null||p===void 0?void 0:p[0];if(g==null){Do=null,Nl=null;return}var v=Rk(f,g);v?.activeIndex!=null&&t.dispatch(n8({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(d==="item"){var y,x=If.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(lae),C=(y=w.getAttribute(oae))!==null&&y!==void 0?y:void 0,k=bs(f).find(P=>P.id===C);if(A==null||k==null||C==null)return;var M=k.dataKey,D=Mxe(f,A,C);t.dispatch(e8({activeDataKey:M,activeIndex:A,activeCoordinate:D,activeGraphicalItemId:C}))}Do=null,Nl=null}};if(!s){c();return}a==="raf"?Do=requestAnimationFrame(c):typeof a=="number"&&Nl===null&&(c(),If=null,Nl=setTimeout(()=>{If?c():(Nl=null,Do=null)},a))}}});var U6={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},H6=zn({name:"eventSettings",initialState:U6,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=Ge(t.payload.throttledEvents))}}}),Pxe=H6.actions.setEventSettings,Dxe=H6.reducer,_xe=u$({brush:Qve,cartesianAxis:Ave,chartData:Npe,errorBars:h0e,eventSettings:Dxe,graphicalItems:nve,layout:Hie,legend:Qae,options:Tpe,polarAxis:pge,polarOptions:Exe,referenceElements:Zve,renderedTicks:xye,rootProps:Oxe,tooltip:qhe,zIndex:gpe}),Nxe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return die({reducer:_xe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([P6.middleware,D6.middleware,_y.middleware,B6.middleware,$6.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(A$({type:"raf"}))},devTools:{serialize:{replacer:wxe},name:"recharts-".concat(n)}})};function Rxe(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=$n(),a=O.useRef(null);if(i)return n;a.current==null&&(a.current=Nxe(t,r));var l=sA;return O.createElement(hle,{context:l,store:a.current},n)}function Lxe(e){var t=e.layout,n=e.margin,r=wt(),i=$n();return O.useEffect(()=>{i||(r(zie(t)),r(Bie(n)))},[r,i,t,n]),null}var jxe=O.memo(Lxe,pc);function Ixe(e){var t=wt();return O.useEffect(()=>{t(Axe(e))},[t,e]),null}var Bxe=e=>{var t=wt();return O.useEffect(()=>{t(Pxe(e))},[t,e]),null},zxe=O.memo(Bxe,pc);function jL(e){var t=e.zIndex,n=e.isPanorama,r=O.useRef(null),i=wt();return O.useLayoutEffect(()=>(r.current&&i(ppe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(mpe({zIndex:t,isPanorama:n}))}),[i,t,n]),O.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function IL(e){var t=e.children,n=e.isPanorama,r=we(ape);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(jL,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>O.createElement(jL,{key:l,zIndex:l,isPanorama:n})))}var $xe=["children"];function Uxe(e,t){if(e==null)return{};var n,r,i=Hxe(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 Hxe(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 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)}var Fxe={width:"100%",height:"100%",display:"block"},qxe=O.forwardRef((e,t)=>{var n=yA(),r=bA(),i=Y$();if(!aa(n)||!aa(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(eA,mv({},l,{title:s,desc:c,role:d,tabIndex:f,width:n,height:r,style:Fxe,ref:t}),a)}),Wxe=e=>{var t=e.children,n=we(fy);if(!n)return null;var r=n.width,i=n.height,a=n.y,l=n.x;return O.createElement(eA,{width:r,height:i,x:l,y:a},t)},BL=O.forwardRef((e,t)=>{var n=e.children,r=Uxe(e,$xe),i=$n();return i?O.createElement(Wxe,null,O.createElement(IL,{isPanorama:!0},n)):O.createElement(qxe,mv({ref:t},r),O.createElement(IL,{isPanorama:!1},n))});function Kxe(e,t){return Yxe(e)||Xxe(e,t)||Qxe(e,t)||Vxe()}function Vxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
129
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qxe(e,t){if(e){if(typeof e=="string")return zL(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)?zL(e,t):void 0}}function zL(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 Xxe(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 Yxe(e){if(Array.isArray(e))return e}function Gxe(){var e=wt(),t=O.useState(null),n=Kxe(t,2),r=n[0],i=n[1],a=we(aae);return O.useEffect(()=>{if(r!=null){var l=r.getBoundingClientRect(),s=l.width/r.offsetWidth;Ke(s)&&s!==a&&e(Uie(s))}},[r,e,a]),i}function $L(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 Zxe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$L(Object(n),!0).forEach(function(r){Jxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$L(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jxe(e,t,n){return(t=e1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e1e(e){var t=t1e(e,"string");return typeof t=="symbol"?t:t+""}function t1e(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 gv(e,t){return a1e(e)||i1e(e,t)||r1e(e,t)||n1e()}function n1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
130
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r1e(e,t){if(e){if(typeof e=="string")return UL(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)?UL(e,t):void 0}}function UL(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 i1e(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 a1e(e){if(Array.isArray(e))return e}var l1e=()=>(Hpe(),null);function vv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var o1e=O.forwardRef((e,t)=>{var n,r,i=O.useRef(null),a=O.useState({containerWidth:vv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:vv((r=e.style)===null||r===void 0?void 0:r.height)}),l=gv(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,M=k.width,D=k.height;f(M,D)}},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(Jh,{width:s.containerWidth,height:s.containerHeight}),O.createElement("div",Kl({ref:d},e)))}),s1e=O.forwardRef((e,t)=>{var n=e.width,r=e.height,i=O.useState({containerWidth:vv(n),containerHeight:vv(r)}),a=gv(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(Jh,{width:l.containerWidth,height:l.containerHeight}),O.createElement("div",Kl({ref:f},e)))}),u1e=O.forwardRef((e,t)=>{var n=e.width,r=e.height;return O.createElement(O.Fragment,null,O.createElement(Jh,{width:n,height:r}),O.createElement("div",Kl({ref:t},e)))}),c1e=O.forwardRef((e,t)=>{var n=e.width,r=e.height;return typeof n=="string"||typeof r=="string"?O.createElement(s1e,Kl({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?O.createElement(u1e,Kl({},e,{width:n,height:r,ref:t})):O.createElement(O.Fragment,null,O.createElement(Jh,{width:n,height:r}),O.createElement("div",Kl({ref:t},e)))});function f1e(e){return e?o1e:c1e}var h1e=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,M=k===void 0?!0:k,D=O.useRef(null),P=wt(),N=O.useState(null),j=gv(N,2),U=j[0],V=j[1],K=O.useState(null),B=gv(K,2),oe=B[0],ie=B[1],ue=Gxe(),z=gA(),Z=z?.width>0?z.width:A,ae=z?.height>0?z.height:i,Q=O.useCallback(xe=>{ue(xe),typeof t=="function"&&t(xe),V(xe),ie(xe),xe!=null&&(D.current=xe)},[ue,t,V,ie]),le=O.useCallback(xe=>{P(M6(xe)),P(Vr({handler:a,reactEvent:xe}))},[P,a]),R=O.useCallback(xe=>{P($w(xe)),P(Vr({handler:f,reactEvent:xe}))},[P,f]),F=O.useCallback(xe=>{P(t8()),P(Vr({handler:d,reactEvent:xe}))},[P,d]),ee=O.useCallback(xe=>{P($w(xe)),P(Vr({handler:p,reactEvent:xe}))},[P,p]),se=O.useCallback(()=>{P(L6())},[P]),ge=O.useCallback(()=>{P(j6())},[P]),Oe=O.useCallback(xe=>{P(R6(xe.key))},[P]),Pe=O.useCallback(xe=>{P(Vr({handler:l,reactEvent:xe}))},[P,l]),gt=O.useCallback(xe=>{P(Vr({handler:s,reactEvent:xe}))},[P,s]),ce=O.useCallback(xe=>{P(Vr({handler:c,reactEvent:xe}))},[P,c]),Te=O.useCallback(xe=>{P(Vr({handler:g,reactEvent:xe}))},[P,g]),Ee=O.useCallback(xe=>{P(Vr({handler:x,reactEvent:xe}))},[P,x]),fe=O.useCallback(xe=>{M&&P(z6(xe)),P(Vr({handler:y,reactEvent:xe}))},[P,M,y]),Lt=O.useCallback(xe=>{P(Vr({handler:v,reactEvent:xe}))},[P,v]),Re=f1e(C);return O.createElement(O8.Provider,{value:U},O.createElement(xz.Provider,{value:oe},O.createElement(Re,{width:Z??w?.width,height:ae??w?.height,className:ut("recharts-wrapper",r),style:Zxe({position:"relative",cursor:"default",width:Z,height:ae},w),onClick:le,onContextMenu:Pe,onDoubleClick:gt,onFocus:se,onBlur:ge,onKeyDown:Oe,onMouseDown:ce,onMouseEnter:R,onMouseLeave:F,onMouseMove:ee,onMouseUp:Te,onTouchEnd:Lt,onTouchMove:fe,onTouchStart:Ee,ref:Q},O.createElement(l1e,null),n)))}),d1e=["width","height","responsive","children","className","style","compact","title","desc"];function p1e(e,t){if(e==null)return{};var n,r,i=m1e(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 m1e(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 g1e=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=p1e(e,d1e),g=Si(p);return c?O.createElement(O.Fragment,null,O.createElement(Jh,{width:n,height:r}),O.createElement(BL,{otherAttributes:g,title:f,desc:d},a)):O.createElement(h1e,{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(BL,{otherAttributes:g,title:f,desc:d,ref:t},O.createElement(aye,null,a)))});function Uw(){return Uw=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},Uw.apply(null,arguments)}function HL(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 v1e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HL(Object(n),!0).forEach(function(r){y1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function y1e(e,t,n){return(t=b1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b1e(e){var t=x1e(e,"string");return typeof t=="symbol"?t:t+""}function x1e(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 S1e={top:5,right:5,bottom:5,left:5},w1e=v1e({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:S1e,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},U6),F6=O.forwardRef(function(t,n){var r,i=Bn(t.categoricalChartProps,w1e),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(Rxe,{preloadedState:{options:d},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},O.createElement(Vve,{chartData:f.data}),O.createElement(jxe,{layout:i.layout,margin:i.margin}),O.createElement(zxe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),O.createElement(Ixe,{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(g1e,Uw({},i,{ref:n})))}),O1e=["axis"],A1e=O.forwardRef((e,t)=>O.createElement(F6,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:O1e,tooltipPayloadSearcher:A8,categoricalChartProps:e,ref:t})),k1e=["axis","item"],C1e=O.forwardRef((e,t)=>O.createElement(F6,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:k1e,tooltipPayloadSearcher:A8,categoricalChartProps:e,ref:t}));const E1e={succeeded:"var(--status-good)",failed:"var(--status-critical)",skipped:"var(--status-warning)",canceled:"var(--text-muted)"},FL=["succeeded","failed","skipped","canceled"];function wm({label:e,value:t,sub:n}){return T.jsxs("div",{className:"rounded-lg border border-edge bg-surface px-4 py-3",children:[T.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:e}),T.jsx("p",{className:"mt-1 text-2xl font-semibold",children:t}),n&&T.jsx("p",{className:"mt-0.5 text-xs text-ink-muted",children:n})]})}function qL({active:e,payload:t,label:n,unit:r}){return!e||!t?.length?null:T.jsxs("div",{className:"rounded-md border border-edge bg-surface px-3 py-2 text-xs shadow-sm",children:[T.jsx("p",{className:"mb-1 font-medium text-ink-secondary",children:n}),t.map(i=>T.jsxs("p",{className:"flex items-center gap-2 text-ink-secondary",children:[T.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{background:i.color}}),i.name,": ",T.jsx("span",{className:"font-medium text-ink",children:r==="s"?zu(i.value):i.value})]},i.dataKey))]})}function T1e({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 T.jsxs("div",{className:"space-y-6",children:[T.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[T.jsx(wm,{label:"Runs",value:String(e.totals.total)}),T.jsx(wm,{label:"Success rate",value:r===null?"—":`${r}%`,sub:e.totals.failed>0?`${e.totals.failed} failed`:void 0}),T.jsx(wm,{label:"Skipped",value:String(e.totals.skipped),sub:"overlapping schedule"}),T.jsx(wm,{label:"Avg duration",value:i===null?"—":zu(i),sub:"last 50 runs"})]}),T.jsxs("div",{className:"rounded-lg border border-edge bg-surface p-4",children:[T.jsx("h3",{className:"mb-3 text-sm font-semibold text-ink-secondary",children:"Runs per day"}),t.length===0?T.jsx("p",{className:"py-10 text-center text-sm text-ink-muted",children:"No runs in this period."}):T.jsx(w_,{width:"100%",height:220,children:T.jsxs(C1e,{data:t,margin:{top:4,right:8,left:-18,bottom:0},children:[T.jsx(Dw,{vertical:!1,stroke:"var(--gridline)"}),T.jsx(jw,{dataKey:"day",tick:a,axisLine:{stroke:"var(--baseline)"},tickLine:!1}),T.jsx(zw,{tick:a,axisLine:!1,tickLine:!1,allowDecimals:!1}),T.jsx(IR,{content:T.jsx(qL,{}),cursor:{fill:"var(--gridline)",opacity:.4}}),T.jsx(Q$,{wrapperStyle:{fontSize:12,color:"var(--text-secondary)"},iconSize:8}),FL.map((l,s)=>T.jsx(E6,{dataKey:l,name:l,stackId:"runs",fill:E1e[l],stroke:"var(--surface-1)",strokeWidth:1,maxBarSize:28,radius:s===FL.length-1?[3,3,0,0]:void 0,isAnimationActive:!1},l))]})})]}),T.jsxs("div",{className:"rounded-lg border border-edge bg-surface p-4",children:[T.jsxs("h3",{className:"mb-3 text-sm font-semibold text-ink-secondary",children:["Run duration (last ",n.length," runs)"]}),n.length===0?T.jsx("p",{className:"py-10 text-center text-sm text-ink-muted",children:"No finished runs yet."}):T.jsx(w_,{width:"100%",height:200,children:T.jsxs(A1e,{data:n,margin:{top:4,right:8,left:-10,bottom:0},children:[T.jsx(Dw,{vertical:!1,stroke:"var(--gridline)"}),T.jsx(jw,{dataKey:"id",tick:a,axisLine:{stroke:"var(--baseline)"},tickLine:!1}),T.jsx(zw,{tick:a,axisLine:!1,tickLine:!1,tickFormatter:l=>zu(l)}),T.jsx(IR,{content:T.jsx(qL,{unit:"s"}),cursor:{stroke:"var(--baseline)"}}),T.jsx(w6,{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 M1e(){const{id:e}=Yw(),t=Number(e),n=xv(),r=io(),[i,a]=O.useState("runs"),[l,s]=O.useState(30),[c,f]=O.useState("form"),{data:d,error:p}=Ki({queryKey:["configs",t],queryFn:()=>Et.config(t)}),{data:g}=Ki({queryKey:["health"],queryFn:Et.health}),{data:v}=Ki({queryKey:["runs",{configId:t}],queryFn:()=>Et.runs({configId:t,limit:100})}),{data:y}=Ki({queryKey:["runs","stats",t,l],queryFn:()=>Et.configStats(t,l),enabled:i==="stats"}),x=Ih({mutationFn:()=>Et.deleteConfig(t),onSuccess:()=>{r.invalidateQueries({queryKey:["configs"]}),n("/")}});if(p)return T.jsx("p",{className:"text-critical",children:p.message});if(!d)return T.jsx("p",{className:"text-ink-muted",children:"Loading…"});const w=g?.mode==="rw";return T.jsxs("div",{className:"space-y-6",children:[T.jsxs("div",{children:[T.jsx(yi,{to:"/",className:"text-sm text-ink-muted hover:text-accent",children:"← Configurations"}),T.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[T.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:d.name}),d.parse_error&&T.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]}),T.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[T.jsx(sI,{config:d,variant:"primary"}),w&&T.jsx("button",{onClick:()=>{window.confirm(`Delete config '${d.name}' and its file?
|
|
131
|
+
|
|
132
|
+
Run history is kept.`)&&x.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&&T.jsx("p",{className:"mt-2 text-sm text-critical",children:x.error.message}),T.jsxs("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Schedule"}),T.jsxs("dd",{className:"mt-0.5 text-ink-secondary",children:[iO(d.schedule),d.schedule&&T.jsx("code",{className:"ml-2 text-xs text-ink-muted",children:d.schedule})]})]}),T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Next run"}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",title:d.next_run?qa(d.next_run):void 0,children:d.next_run?j1(d.next_run):"—"})]}),T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"File"}),T.jsx("dd",{className:"mt-0.5 font-mono text-xs text-ink-muted",children:d.path})]})]}),T.jsx("div",{className:"mt-3",children:T.jsx(uI,{sources:d.source_summary})})]}),T.jsx("div",{className:"border-b border-edge",children:T.jsx("nav",{className:"flex gap-6 text-sm",children:["runs","stats","config"].map(A=>T.jsx("button",{onClick:()=>a(A),className:`-mb-px border-b-2 px-1 pb-2 font-medium capitalize transition ${i===A?"border-accent text-accent":"border-transparent text-ink-muted hover:text-ink-secondary"}`,children:A},A))})}),i==="runs"&&T.jsx(lte,{runs:v??[]}),i==="stats"&&T.jsxs("div",{className:"space-y-4",children:[T.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[T.jsx("span",{className:"text-ink-muted",children:"Period:"}),[7,30,90].map(A=>T.jsxs("button",{onClick:()=>s(A),className:`rounded-md border px-2.5 py-1 text-xs font-medium transition ${l===A?"border-accent text-accent":"border-edge text-ink-muted hover:text-ink-secondary"}`,children:[A,"d"]},A))]}),y?T.jsx(T1e,{stats:y}):T.jsx("p",{className:"text-ink-muted",children:"Loading…"})]}),i==="config"&&T.jsxs("div",{className:"space-y-4",children:[T.jsx("div",{className:"flex items-center gap-2 text-sm",children:w?["form","yaml"].map(A=>T.jsx("button",{onClick:()=>f(A),className:`rounded-md border px-2.5 py-1 text-xs font-medium uppercase transition ${c===A?"border-accent text-accent":"border-edge text-ink-muted hover:text-ink-secondary"}`,children:A},A)):T.jsx("p",{className:"text-xs text-ink-muted",children:"Read-only mode — configs are managed from the files passed to the controller."})}),w&&c==="form"?T.jsx(oI,{mode:"edit",config:d,onSaved:()=>r.invalidateQueries({queryKey:["configs",t]})},d.content_hash):w?T.jsx(DD,{mode:"edit",config:d,onSaved:()=>r.invalidateQueries({queryKey:["configs",t]})},d.content_hash):T.jsx(DD,{mode:"view",config:d})]})]})}const C1=1e4,Bf=2e3,P1e=1e4,D1e=["error","warn","info","debug"],E1={error:"text-critical",warn:"text-warning",info:"text-ink-secondary",debug:"text-ink-muted"};function _1e({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,v]=O.useState(""),[y,x]=O.useState(null),[w,A]=O.useState({rows:[],loading:!1,hasMore:!1,error:null}),C=O.useRef(null),k=O.useRef(l);k.current=l;const M=O.useMemo(()=>[...c].sort(),[c]),D=M.join(","),P=M.length>0||g!=="";O.useEffect(()=>{const Q=setTimeout(()=>v(d.trim()),300);return()=>clearTimeout(Q)},[d]);const N=O.useRef({match:()=>!1,enabled:!1});N.current={enabled:P&&!w.loading&&!w.hasMore&&!w.error,match:Q=>{if(M.length>0&&!M.includes(Q.level))return!1;if(!g)return!0;const le=g.toLowerCase();return Q.message.toLowerCase().includes(le)||(Q.module??"").toLowerCase().includes(le)}},O.useEffect(()=>{r([]);const Q=new EventSource(`/api/runs/${e}/logs/stream?tail=${C1}`);return Q.addEventListener("log",le=>{const R=JSON.parse(le.data);r(ee=>{const se=ee.length>=C1?ee.slice(ee.length-C1+1):ee.slice();return se.push(R),se});const F=N.current;F.enabled&&F.match(R)&&A(ee=>ee.rows.length>0&&R.seq<=ee.rows[ee.rows.length-1].seq?ee:{...ee,rows:[...ee.rows,R]})}),Q.addEventListener("end",()=>{a(!0),Q.close()}),Q.onerror=()=>{},()=>Q.close()},[e]),O.useEffect(()=>{let Q=!1;const le=()=>{Et.runLogCounts(e).then(F=>!Q&&x(F)).catch(()=>{})};if(le(),i)return()=>{Q=!0};const R=setInterval(le,P1e);return()=>{Q=!0,clearInterval(R)}},[e,i]),O.useEffect(()=>{if(!P){A({rows:[],loading:!1,hasMore:!1,error:null});return}let Q=!1;return A({rows:[],loading:!0,hasMore:!1,error:null}),Et.runLogs(e,{levels:M,q:g,limit:Bf}).then(le=>{Q||A({rows:le,loading:!1,hasMore:le.length===Bf,error:null})}).catch(le=>{Q||A({rows:[],loading:!1,hasMore:!1,error:le.message})}),()=>{Q=!0}},[e,D,g,P]);const j=O.useCallback(()=>{A(Q=>{if(Q.loading||!Q.hasMore)return Q;const le=Q.rows.length>0?Q.rows[Q.rows.length-1].seq:0;return Et.runLogs(e,{levels:M,q:g,afterSeq:le,limit:Bf}).then(R=>A(F=>({...F,rows:[...F.rows,...R],loading:!1,hasMore:R.length===Bf}))).catch(R=>A(F=>({...F,loading:!1,error:R.message}))),{...Q,loading:!0}})},[e,D,g]),U=O.useMemo(()=>{const Q={};for(const le of n)Q[le.level]=(Q[le.level]??0)+1;return Q},[n]),V=y??U,K=y?Object.values(y).reduce((Q,le)=>Q+le,0):n.length,B=K>n.length,oe=P?w.rows:n,ie=O.useRef(!1);O.useLayoutEffect(()=>{k.current&&C.current&&(ie.current=!0,C.current.scrollTop=C.current.scrollHeight)},[oe,l]);const ue=()=>{const Q=C.current;if(!Q)return;const le=Q.scrollHeight-Q.scrollTop-Q.clientHeight<40;if(ie.current){ie.current=!1,le&&!k.current&&s(!0);return}le!==k.current&&s(le)},z=Q=>{Q.deltaY<0&&k.current&&s(!1)},Z=Q=>{f(le=>{const R=new Set(le);return R.has(Q)?R.delete(Q):R.add(Q),R})},ae=c.size>0||d.trim()!=="";return T.jsxs("div",{className:"rounded-lg border border-edge bg-surface",children:[T.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-edge px-4 py-2 text-xs text-ink-muted",children:[T.jsx("span",{className:"shrink-0",children:P?`${w.rows.length.toLocaleString()}${w.hasMore?"+":""} / ${K.toLocaleString()} lines`:`${K.toLocaleString()} lines${B?` (showing last ${n.length.toLocaleString()})`:""}`}),!i&&T.jsx("span",{className:"shrink-0 text-accent",children:"● live"}),T.jsx("div",{className:"flex items-center gap-1",children:D1e.map(Q=>T.jsxs("button",{onClick:()=>Z(Q),title:`${V[Q]??0} ${Q} line(s) in this run`,className:`rounded-full border px-2 py-0.5 font-medium uppercase transition ${c.has(Q)?`border-current ${E1[Q]}`:"border-edge text-ink-muted hover:text-ink-secondary"}`,children:[Q,(V[Q]??0)>0&&T.jsx("span",{className:"ml-1 font-normal",children:V[Q]})]},Q))}),T.jsx("input",{value:d,onChange:Q=>p(Q.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"}),ae&&T.jsx("button",{onClick:()=>{f(new Set),p("")},className:"text-ink-muted underline-offset-2 hover:text-accent hover:underline",children:"clear"}),T.jsxs("a",{href:Et.runLogsDownloadUrl(e,P?{levels:M,q:g}:{}),className:"text-ink-muted underline-offset-2 hover:text-accent hover:underline",title:P?"Download the matching lines":"Download the full log",children:["↓ ",P?"download matches":"download log"]}),!l&&!i&&T.jsx("button",{onClick:()=>{s(!0),C.current?.scrollTo({top:C.current.scrollHeight})},className:"ml-auto rounded border border-edge px-2 py-0.5 hover:border-accent hover:text-accent",children:"↓ Follow"})]}),T.jsxs("div",{ref:C,onScroll:ue,onWheel:z,className:"log-scroll max-h-[560px] overflow-auto px-4 py-3 font-mono text-xs leading-5",children:[w.error&&T.jsxs("p",{className:"text-critical",children:["Log search failed: ",w.error]}),!w.error&&oe.length===0&&T.jsx("p",{className:"text-ink-muted",children:w.loading?"Searching…":P?"No lines match the current filters.":`No log output${i?"":" yet"}.`}),oe.map(Q=>T.jsxs("div",{className:"flex gap-3 whitespace-pre-wrap break-all hover:bg-ink/[0.03]",children:[T.jsx("span",{className:"shrink-0 select-none text-ink-muted",children:Q.ts.slice(11,19)}),T.jsx("span",{className:`w-10 shrink-0 select-none uppercase ${E1[Q.level]??"text-ink-secondary"}`,children:Q.level}),T.jsxs("span",{className:E1[Q.level]??"text-ink-secondary",children:[Q.module&&T.jsxs("span",{className:"text-ink-muted",children:["[",Q.module.replace(/^Doc2Vec:?/,"")||"main","] "]}),Q.message]})]},Q.seq)),P&&w.hasMore&&T.jsx("button",{onClick:j,disabled:w.loading,className:"mt-2 rounded border border-edge px-2 py-1 text-ink-muted hover:border-accent hover:text-accent disabled:opacity-50",children:w.loading?"Loading…":`Load ${Bf.toLocaleString()} more`})]})]})}function WL(e,t){switch(t){case"source":return e.product_name;case"type":return e.type;case"version":return e.version??"";case"duration":return e.duration_ms;case"changes":{const n=e.counters;return n?n.items_new+n.items_updated+n.items_deleted:-1}case"result":return e.ok?1:0}}function N1e(){const{id:e}=Yw(),t=Number(e),n=io(),r=xv(),{data:i,error:a}=Ki({queryKey:["runs",t],queryFn:()=>Et.run(t),refetchInterval:g=>g.state.data&&["queued","running"].includes(g.state.data.status)?3e3:!1}),l=Ih({mutationFn:()=>Et.cancelRun(t),onSettled:()=>n.invalidateQueries({queryKey:["runs",t]})}),[s,c]=O.useState(null),f=O.useMemo(()=>{const g=(i?.stats?.sources??[]).map((v,y)=>({source:v,index:y}));return s?[...g].sort((v,y)=>{const x=WL(v.source,s.key),w=WL(y.source,s.key);return(typeof x=="string"&&typeof w=="string"?x.localeCompare(w):Number(x)-Number(w))*s.dir}):g},[i,s]);if(a)return T.jsx("p",{className:"text-critical",children:a.message});if(!i)return T.jsx("p",{className:"text-ink-muted",children:"Loading…"});const d=i.status==="queued"||i.status==="running",p=(g,v)=>T.jsx("th",{className:"px-4 py-2 font-medium",children:T.jsxs("button",{onClick:()=>c(y=>y?.key!==v?{key:v,dir:1}:y.dir===1?{key:v,dir:-1}:null),className:`inline-flex items-center gap-1 uppercase tracking-wide transition hover:text-ink-secondary ${s?.key===v?"text-ink-secondary":""}`,children:[g,T.jsx("span",{className:"text-[10px]",children:s?.key===v?s.dir===1?"▲":"▼":""})]})});return T.jsxs("div",{className:"space-y-6",children:[T.jsxs("div",{children:[T.jsxs(yi,{to:`/configs/${i.config_id}`,className:"text-sm text-ink-muted hover:text-accent",children:["← ",i.config_name??`Config ${i.config_id}`]}),T.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[T.jsxs("h1",{className:"text-xl font-semibold tracking-tight",children:["Run #",i.id]}),T.jsx(Ov,{status:i.status}),d&&T.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&&T.jsx("p",{className:"mt-2 text-sm text-critical",children:i.error}),l.error&&T.jsx("p",{className:"mt-2 text-sm text-critical",children:l.error.message}),T.jsx("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[["Trigger",i.requested_sources?.length?`${i.trigger} (partial)`:i.trigger],["Queued",qa(i.queued_at)],["Started",qa(i.started_at)],["Duration",d?"…":rO(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(([g,v])=>T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:g}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:v})]},g))}),i.requested_sources&&i.requested_sources.length>0&&T.jsxs("p",{className:"mt-2 text-sm text-ink-secondary",children:[T.jsx("span",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Selected sources"})," ",T.jsx("span",{className:"ml-1 inline-flex flex-wrap gap-1.5 align-middle",children:i.requested_sources.map(g=>T.jsxs("span",{className:"rounded-full border border-edge bg-page px-2 py-0.5 text-xs",children:[g.product_name,T.jsxs("span",{className:"ml-1 text-ink-muted",children:[g.type,g.version?` · ${g.version}`:""]})]},g.index))})]})]}),f.length>0&&T.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge bg-surface",children:T.jsxs("table",{className:"w-full text-sm",children:[T.jsx("thead",{children:T.jsxs("tr",{className:"border-b border-edge text-left text-xs uppercase tracking-wide text-ink-muted",children:[p("Source","source"),p("Type","type"),p("Version","version"),p("Duration","duration"),p("Changes","changes"),p("Result","result"),T.jsx("th",{className:"px-4 py-2"})]})}),T.jsx("tbody",{children:f.map(({source:g,index:v})=>T.jsxs("tr",{onClick:()=>r(`/runs/${i.id}/sources/${v}`),className:"cursor-pointer border-b border-edge/60 transition last:border-0 hover:bg-edge/20",children:[T.jsx("td",{className:"px-4 py-2 font-medium",children:g.product_name}),T.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:g.type}),T.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:g.version}),T.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:zu(g.duration_ms/1e3)}),T.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:g.counters?T.jsxs("span",{className:"whitespace-nowrap tabular-nums",children:[T.jsxs("span",{className:g.counters.items_new>0?"text-good-text":"",children:["+",g.counters.items_new]})," ",T.jsxs("span",{children:["~",g.counters.items_updated]})," ",T.jsxs("span",{className:g.counters.items_deleted>0?"text-critical":"",children:["−",g.counters.items_deleted]}),T.jsx("span",{className:"ml-1 text-xs text-ink-muted",children:g.counters.items_kind})]}):"—"}),T.jsx("td",{className:"px-4 py-2",children:g.ok?T.jsx("span",{className:"text-good-text",children:"✓ ok"}):T.jsxs("span",{className:"text-critical",title:g.error,children:["✕ ",g.error??"failed"]})}),T.jsx("td",{className:"px-4 py-2 text-ink-muted",children:"›"})]},`${g.product_name}-${g.type}-${v}`))})]})}),T.jsxs("div",{children:[T.jsx("h2",{className:"mb-2 text-sm font-semibold text-ink-secondary",children:"Logs"}),T.jsx(_1e,{runId:t,isActive:d})]})]})}function R1e(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 L1e={chunk_id:"asc",position:"asc",section:"asc",size:"desc"};function j1e(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 Om({label:e,sortKey:t,sort:n,onSort:r,align:i="left"}){const a=n.key===t;return T.jsx("th",{className:`px-4 py-2 font-medium ${i==="right"?"text-right":"text-left"}`,children:T.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,T.jsx("span",{className:a?"":"opacity-30",children:a?n.dir==="asc"?"▲":"▼":"↕"})]})})}function I1e({chunk:e}){const[t,n]=O.useState(!1);return T.jsxs(T.Fragment,{children:[T.jsxs("tr",{onClick:()=>n(r=>!r),className:"cursor-pointer border-b border-edge/60 transition last:border-0 hover:bg-edge/20",children:[T.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),"…"]}),T.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}`:"—"}),T.jsx("td",{className:"max-w-xs truncate px-4 py-2 text-ink-secondary",title:e.section??void 0,children:e.section||"—"}),T.jsxs("td",{className:"px-4 py-2 text-right text-ink-muted",children:[e.content.length.toLocaleString()," chars"]}),T.jsx("td",{className:"px-4 py-2 text-ink-muted",children:t?"▾":"▸"})]}),t&&T.jsx("tr",{className:"border-b border-edge/60 last:border-0",children:T.jsxs("td",{colSpan:5,className:"bg-edge/10 px-4 py-3",children:[T.jsxs("dl",{className:"mb-3 flex flex-wrap gap-x-8 gap-y-1 text-xs",children:[T.jsxs("div",{children:[T.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Chunk ID"}),T.jsx("dd",{className:"mt-0.5 font-mono text-ink-secondary",children:e.chunk_id})]}),e.hash&&T.jsxs("div",{children:[T.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Content hash"}),T.jsx("dd",{className:"mt-0.5 font-mono text-ink-secondary",children:e.hash})]}),e.created_at&&T.jsxs("div",{children:[T.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Created / Updated"}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:qa(e.created_at)})]}),e.heading_hierarchy.length>0&&T.jsxs("div",{children:[T.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Headings"}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:e.heading_hierarchy.join(" › ")})]}),e.product_name&&T.jsxs("div",{children:[T.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Product"}),T.jsxs("dd",{className:"mt-0.5 text-ink-secondary",children:[e.product_name,e.version?` @ ${e.version}`:""]})]})]}),T.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 B1e(){const{id:e,sourceIndex:t}=Yw(),n=Number(e),r=Number(t),{data:i,error:a}=Ki({queryKey:["runs",n],queryFn:()=>Et.run(n)}),[l,s]=O.useState(""),[c,f]=O.useState(null),[d,p]=O.useState({key:"position",dir:"asc"}),g=k=>p(M=>M.key===k?{key:k,dir:M.dir==="asc"?"desc":"asc"}:{key:k,dir:L1e[k]}),v=i?.stats?.sources?.[r],y=Ki({queryKey:["chunks",i?.config_id,v?.product_name,v?.version,c],queryFn:()=>Et.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,M)=>j1e(k,M,d.key,d.dir)):[],[y.data,d]),w=O.useMemo(()=>{const k=(y.data?.chunks??[]).map(M=>M.created_at).filter(M=>!!M);return k.length>0?k.reduce((M,D)=>M>D?M:D):null},[y.data]);if(a)return T.jsx("p",{className:"text-critical",children:a.message});if(!i)return T.jsx("p",{className:"text-ink-muted",children:"Loading…"});if(!v)return T.jsxs("div",{className:"space-y-2",children:[T.jsxs(yi,{to:`/runs/${n}`,className:"text-sm text-ink-muted hover:text-accent",children:["← Run #",n]}),T.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 M=l.trim();M&&f(M)};return T.jsxs("div",{className:"space-y-6",children:[T.jsxs("div",{children:[T.jsxs(yi,{to:`/runs/${n}`,className:"text-sm text-ink-muted hover:text-accent",children:["← Run #",n]}),T.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[T.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:v.product_name}),T.jsx(Ov,{status:i.status}),v.ok?T.jsx("span",{className:"text-sm text-good-text",children:"✓ ok"}):T.jsxs("span",{className:"text-sm text-critical",children:["✕ ",v.error??"failed"]})]}),T.jsx("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[["Type",v.type],["Version",v.version],["Duration",zu(v.duration_ms/1e3)],["Run started",qa(i.started_at)]].map(([k,M])=>T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:k}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:M})]},k))})]}),T.jsxs("div",{children:[T.jsx("h2",{className:"mb-2 text-sm font-semibold text-ink-secondary",children:"Changes in this run"}),A?T.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:R1e(A).map(k=>T.jsxs("div",{className:"rounded-lg border border-edge bg-surface px-4 py-3",children:[T.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()}),T.jsx("div",{className:"mt-1 text-xs uppercase tracking-wide text-ink-muted",children:k.label})]},k.label))}):T.jsx("p",{className:"text-sm text-ink-muted",children:"This run predates detailed source statistics — trigger a new run to collect them."})]}),T.jsxs("div",{children:[T.jsx("h2",{className:"mb-2 text-sm font-semibold text-ink-secondary",children:"Chunk lookup"}),T.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)."}),T.jsxs("form",{onSubmit:C,className:"flex gap-2",children:[T.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"}),T.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&&T.jsx("p",{className:"mt-3 text-sm text-critical",children:y.error.message}),y.data&&T.jsxs("div",{className:"mt-4 space-y-3",children:[T.jsxs("dl",{className:"flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Chunks"}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:y.data.chunks.length})]}),y.data.chunks.length>0&&T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Created / Updated"}),T.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?qa(w):"unknown (synced before dates were recorded)"})]}),T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Store"}),T.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&&T.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge bg-surface",children:T.jsxs("table",{className:"w-full text-sm",children:[T.jsx("thead",{children:T.jsxs("tr",{className:"border-b border-edge text-xs text-ink-muted",children:[T.jsx(Om,{label:"Chunk",sortKey:"chunk_id",sort:d,onSort:g}),T.jsx(Om,{label:"Position",sortKey:"position",sort:d,onSort:g}),T.jsx(Om,{label:"Section",sortKey:"section",sort:d,onSort:g}),T.jsx(Om,{label:"Size",sortKey:"size",sort:d,onSort:g,align:"right"}),T.jsx("th",{className:"px-4 py-2"})]})}),T.jsx("tbody",{children:x.map(k=>T.jsx(I1e,{chunk:k},k.chunk_id))})]})})]})]})]})}function z1e(){const e=io(),{data:t}=Ki({queryKey:["health"],queryFn:Et.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]),T.jsxs("div",{className:"min-h-screen",children:[T.jsx("header",{className:"border-b border-edge bg-surface",children:T.jsxs("div",{className:"mx-auto flex max-w-6xl items-center gap-3 px-6 py-4",children:[T.jsxs(yi,{to:"/",className:"flex items-center gap-2 text-lg font-semibold tracking-tight",children:[T.jsx("span",{"aria-hidden":!0,children:"📚"})," doc2vec"]}),T.jsx("span",{className:"text-sm text-ink-muted",children:"controller"}),T.jsx("div",{className:"ml-auto flex items-center gap-3 text-sm",children:t&&T.jsxs(T.Fragment,{children:[T.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"}),T.jsxs("span",{className:"text-ink-muted",children:["v",t.version]})]})})]})}),T.jsx("main",{className:"mx-auto max-w-6xl px-6 py-8",children:T.jsxs(lq,{children:[T.jsx(zf,{path:"/",element:T.jsx(KV,{})}),T.jsx(zf,{path:"/configs/:id",element:T.jsx(M1e,{})}),T.jsx(zf,{path:"/runs/:id",element:T.jsx(N1e,{})}),T.jsx(zf,{path:"/runs/:id/sources/:sourceIndex",element:T.jsx(B1e,{})})]})})]})}const $1e=new X9({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:5e3}}});O9.createRoot(document.getElementById("root")).render(T.jsx(KL.StrictMode,{children:T.jsx(Y9,{client:$1e,children:T.jsx(Pq,{children:T.jsx(z1e,{})})})}));
|