var $W=Object.defineProperty;var u5=t=>{throw TypeError(t)};var IW=(t,e,n)=>e in t?$W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Yn=(t,e,n)=>IW(t,typeof e!="symbol"?e+"":e,n),A_=(t,e,n)=>e.has(t)||u5("Cannot "+n);var B=(t,e,n)=>(A_(t,e,"read from private field"),n?n.call(t):e.get(t)),Je=(t,e,n)=>e.has(t)?u5("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Me=(t,e,n,r)=>(A_(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Ue=(t,e,n)=>(A_(t,e,"access private method"),n);var wd=(t,e,n,r)=>({set _(i){Me(t,e,i,n)},get _(){return B(t,e,r)}});function BW(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function dl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function f7(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var M_={exports:{}},W0={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var h5;function zW(){if(h5)return W0;h5=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var l in i)l!=="key"&&(s[l]=i[l])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:o,ref:i!==void 0?i:null,props:s}}return W0.Fragment=e,W0.jsx=n,W0.jsxs=n,W0}var d5;function qW(){return d5||(d5=1,M_.exports=zW()),M_.exports}var a=qW(),R_={exports:{}},Vt={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var f5;function FW(){if(f5)return Vt;f5=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function v(V){return V===null||typeof V!="object"?null:(V=m&&V[m]||V["@@iterator"],typeof V=="function"?V:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,w={};function S(V,G,W){this.props=V,this.context=G,this.refs=w,this.updater=W||b}S.prototype.isReactComponent={},S.prototype.setState=function(V,G){if(typeof V!="object"&&typeof V!="function"&&V!=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,V,G,"setState")},S.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function _(){}_.prototype=S.prototype;function T(V,G,W){this.props=V,this.context=G,this.refs=w,this.updater=W||b}var C=T.prototype=new _;C.constructor=T,x(C,S.prototype),C.isPureReactComponent=!0;var j=Array.isArray;function A(){}var E={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function N(V,G,W){var te=W.ref;return{$$typeof:t,type:V,key:G,ref:te!==void 0?te:null,props:W}}function $(V,G){return N(V.type,G,V.props)}function D(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function F(V){var G={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(W){return G[W]})}var Q=/\/+/g;function H(V,G){return typeof V=="object"&&V!==null&&V.key!=null?F(""+V.key):G.toString(36)}function q(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(A,A):(V.status="pending",V.then(function(G){V.status==="pending"&&(V.status="fulfilled",V.value=G)},function(G){V.status==="pending"&&(V.status="rejected",V.reason=G)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function P(V,G,W,te,oe){var be=typeof V;(be==="undefined"||be==="boolean")&&(V=null);var ye=!1;if(V===null)ye=!0;else switch(be){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(V.$$typeof){case t:case e:ye=!0;break;case f:return ye=V._init,P(ye(V._payload),G,W,te,oe)}}if(ye)return oe=oe(V),ye=te===""?"."+H(V,0):te,j(oe)?(W="",ye!=null&&(W=ye.replace(Q,"$&/")+"/"),P(oe,G,W,"",function(Pe){return Pe})):oe!=null&&(D(oe)&&(oe=$(oe,W+(oe.key==null||V&&V.key===oe.key?"":(""+oe.key).replace(Q,"$&/")+"/")+ye)),G.push(oe)),1;ye=0;var Ke=te===""?".":te+":";if(j(V))for(var Fe=0;Fe<V.length;Fe++)te=V[Fe],be=Ke+H(te,Fe),ye+=P(te,G,W,be,oe);else if(Fe=v(V),typeof Fe=="function")for(V=Fe.call(V),Fe=0;!(te=V.next()).done;)te=te.value,be=Ke+H(te,Fe++),ye+=P(te,G,W,be,oe);else if(be==="object"){if(typeof V.then=="function")return P(q(V),G,W,te,oe);throw G=String(V),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ye}function I(V,G,W){if(V==null)return V;var te=[],oe=0;return P(V,te,"","",function(be){return G.call(W,be,oe++)}),te}function U(V){if(V._status===-1){var G=V._result;G=G(),G.then(function(W){(V._status===0||V._status===-1)&&(V._status=1,V._result=W)},function(W){(V._status===0||V._status===-1)&&(V._status=2,V._result=W)}),V._status===-1&&(V._status=0,V._result=G)}if(V._status===1)return V._result.default;throw V._result}var Z=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",V);return}console.error(V)},X={map:I,forEach:function(V,G,W){I(V,function(){G.apply(this,arguments)},W)},count:function(V){var G=0;return I(V,function(){G++}),G},toArray:function(V){return I(V,function(G){return G})||[]},only:function(V){if(!D(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return Vt.Activity=p,Vt.Children=X,Vt.Component=S,Vt.Fragment=n,Vt.Profiler=i,Vt.PureComponent=T,Vt.StrictMode=r,Vt.Suspense=u,Vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,Vt.__COMPILER_RUNTIME={__proto__:null,c:function(V){return E.H.useMemoCache(V)}},Vt.cache=function(V){return function(){return V.apply(null,arguments)}},Vt.cacheSignal=function(){return null},Vt.cloneElement=function(V,G,W){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var te=x({},V.props),oe=V.key;if(G!=null)for(be in G.key!==void 0&&(oe=""+G.key),G)!R.call(G,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&G.ref===void 0||(te[be]=G[be]);var be=arguments.length-2;if(be===1)te.children=W;else if(1<be){for(var ye=Array(be),Ke=0;Ke<be;Ke++)ye[Ke]=arguments[Ke+2];te.children=ye}return N(V.type,oe,te)},Vt.createContext=function(V){return V={$$typeof:o,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:s,_context:V},V},Vt.createElement=function(V,G,W){var te,oe={},be=null;if(G!=null)for(te in G.key!==void 0&&(be=""+G.key),G)R.call(G,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(oe[te]=G[te]);var ye=arguments.length-2;if(ye===1)oe.children=W;else if(1<ye){for(var Ke=Array(ye),Fe=0;Fe<ye;Fe++)Ke[Fe]=arguments[Fe+2];oe.children=Ke}if(V&&V.defaultProps)for(te in ye=V.defaultProps,ye)oe[te]===void 0&&(oe[te]=ye[te]);return N(V,be,oe)},Vt.createRef=function(){return{current:null}},Vt.forwardRef=function(V){return{$$typeof:l,render:V}},Vt.isValidElement=D,Vt.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:U}},Vt.memo=function(V,G){return{$$typeof:h,type:V,compare:G===void 0?null:G}},Vt.startTransition=function(V){var G=E.T,W={};E.T=W;try{var te=V(),oe=E.S;oe!==null&&oe(W,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(A,Z)}catch(be){Z(be)}finally{G!==null&&W.types!==null&&(G.types=W.types),E.T=G}},Vt.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},Vt.use=function(V){return E.H.use(V)},Vt.useActionState=function(V,G,W){return E.H.useActionState(V,G,W)},Vt.useCallback=function(V,G){return E.H.useCallback(V,G)},Vt.useContext=function(V){return E.H.useContext(V)},Vt.useDebugValue=function(){},Vt.useDeferredValue=function(V,G){return E.H.useDeferredValue(V,G)},Vt.useEffect=function(V,G){return E.H.useEffect(V,G)},Vt.useEffectEvent=function(V){return E.H.useEffectEvent(V)},Vt.useId=function(){return E.H.useId()},Vt.useImperativeHandle=function(V,G,W){return E.H.useImperativeHandle(V,G,W)},Vt.useInsertionEffect=function(V,G){return E.H.useInsertionEffect(V,G)},Vt.useLayoutEffect=function(V,G){return E.H.useLayoutEffect(V,G)},Vt.useMemo=function(V,G){return E.H.useMemo(V,G)},Vt.useOptimistic=function(V,G){return E.H.useOptimistic(V,G)},Vt.useReducer=function(V,G,W){return E.H.useReducer(V,G,W)},Vt.useRef=function(V){return E.H.useRef(V)},Vt.useState=function(V){return E.H.useState(V)},Vt.useSyncExternalStore=function(V,G,W){return E.H.useSyncExternalStore(V,G,W)},Vt.useTransition=function(){return E.H.useTransition()},Vt.version="19.2.4",Vt}var p5;function Nv(){return p5||(p5=1,R_.exports=FW()),R_.exports}var M=Nv();const _n=dl(M),p7=BW({__proto__:null,default:_n},[M]);var D_={exports:{}},Y0={},N_={exports:{}},P_={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var m5;function HW(){return m5||(m5=1,function(t){function e(P,I){var U=P.length;P.push(I);e:for(;0<U;){var Z=U-1>>>1,X=P[Z];if(0<i(X,I))P[Z]=I,P[U]=X,U=Z;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var I=P[0],U=P.pop();if(U!==I){P[0]=U;e:for(var Z=0,X=P.length,V=X>>>1;Z<V;){var G=2*(Z+1)-1,W=P[G],te=G+1,oe=P[te];if(0>i(W,U))te<X&&0>i(oe,W)?(P[Z]=oe,P[te]=U,Z=te):(P[Z]=W,P[G]=U,Z=G);else if(te<X&&0>i(oe,U))P[Z]=oe,P[te]=U,Z=te;else break e}}return I}function i(P,I){var U=P.sortIndex-I.sortIndex;return U!==0?U:P.id-I.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],h=[],f=1,p=null,m=3,v=!1,b=!1,x=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function C(P){for(var I=n(h);I!==null;){if(I.callback===null)r(h);else if(I.startTime<=P)r(h),I.sortIndex=I.expirationTime,e(u,I);else break;I=n(h)}}function j(P){if(x=!1,C(P),!b)if(n(u)!==null)b=!0,A||(A=!0,F());else{var I=n(h);I!==null&&q(j,I.startTime-P)}}var A=!1,E=-1,R=5,N=-1;function $(){return w?!0:!(t.unstable_now()-N<R)}function D(){if(w=!1,A){var P=t.unstable_now();N=P;var I=!0;try{e:{b=!1,x&&(x=!1,_(E),E=-1),v=!0;var U=m;try{t:{for(C(P),p=n(u);p!==null&&!(p.expirationTime>P&&$());){var Z=p.callback;if(typeof Z=="function"){p.callback=null,m=p.priorityLevel;var X=Z(p.expirationTime<=P);if(P=t.unstable_now(),typeof X=="function"){p.callback=X,C(P),I=!0;break t}p===n(u)&&r(u),C(P)}else r(u);p=n(u)}if(p!==null)I=!0;else{var V=n(h);V!==null&&q(j,V.startTime-P),I=!1}}break e}finally{p=null,m=U,v=!1}I=void 0}}finally{I?F():A=!1}}}var F;if(typeof T=="function")F=function(){T(D)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,H=Q.port2;Q.port1.onmessage=D,F=function(){H.postMessage(null)}}else F=function(){S(D,0)};function q(P,I){E=S(function(){P(t.unstable_now())},I)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(P){switch(m){case 1:case 2:case 3:var I=3;break;default:I=m}var U=m;m=I;try{return P()}finally{m=U}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(P,I){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var U=m;m=P;try{return I()}finally{m=U}},t.unstable_scheduleCallback=function(P,I,U){var Z=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?Z+U:Z):U=Z,P){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=U+X,P={id:f++,callback:I,priorityLevel:P,startTime:U,expirationTime:X,sortIndex:-1},U>Z?(P.sortIndex=U,e(h,P),n(u)===null&&P===n(h)&&(x?(_(E),E=-1):x=!0,q(j,U-Z))):(P.sortIndex=X,e(u,P),b||v||(b=!0,A||(A=!0,F()))),P},t.unstable_shouldYield=$,t.unstable_wrapCallback=function(P){var I=m;return function(){var U=m;m=I;try{return P.apply(this,arguments)}finally{m=U}}}}(P_)),P_}var g5;function VW(){return g5||(g5=1,N_.exports=HW()),N_.exports}var L_={exports:{}},Ss={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var v5;function UW(){if(v5)return Ss;v5=1;var t=Nv();function e(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)h+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+u+"; visit "+h+" 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(e(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 s(u,h,f){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:u,containerInfo:h,implementation:f}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Ss.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ss.createPortal=function(u,h){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return s(u,h,null,f)},Ss.flushSync=function(u){var h=o.T,f=r.p;try{if(o.T=null,r.p=2,u)return u()}finally{o.T=h,r.p=f,r.d.f()}},Ss.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(u,h))},Ss.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Ss.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var f=h.as,p=l(f,h.crossOrigin),m=typeof h.integrity=="string"?h.integrity:void 0,v=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;f==="style"?r.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:m,fetchPriority:v}):f==="script"&&r.d.X(u,{crossOrigin:p,integrity:m,fetchPriority:v,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ss.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var f=l(h.as,h.crossOrigin);r.d.M(u,{crossOrigin:f,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(u)},Ss.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var f=h.as,p=l(f,h.crossOrigin);r.d.L(u,f,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Ss.preloadModule=function(u,h){if(typeof u=="string")if(h){var f=l(h.as,h.crossOrigin);r.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:f,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(u)},Ss.requestFormReset=function(u){r.d.r(u)},Ss.unstable_batchedUpdates=function(u,h){return u(h)},Ss.useFormState=function(u,h,f){return o.H.useFormState(u,h,f)},Ss.useFormStatus=function(){return o.H.useHostTransitionStatus()},Ss.version="19.2.4",Ss}var b5;function m7(){if(b5)return L_.exports;b5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),L_.exports=UW(),L_.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var y5;function QW(){if(y5)return Y0;y5=1;var t=VW(),e=Nv(),n=m7();function r(c){var d="https://react.dev/errors/"+c;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function s(c){var d=c,g=c;if(c.alternate)for(;d.return;)d=d.return;else{c=d;do d=c,(d.flags&4098)!==0&&(g=d.return),c=d.return;while(c)}return d.tag===3?g:null}function o(c){if(c.tag===13){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function l(c){if(c.tag===31){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function u(c){if(s(c)!==c)throw Error(r(188))}function h(c){var d=c.alternate;if(!d){if(d=s(c),d===null)throw Error(r(188));return d!==c?null:c}for(var g=c,y=d;;){var k=g.return;if(k===null)break;var O=k.alternate;if(O===null){if(y=k.return,y!==null){g=y;continue}break}if(k.child===O.child){for(O=k.child;O;){if(O===g)return u(k),c;if(O===y)return u(k),d;O=O.sibling}throw Error(r(188))}if(g.return!==y.return)g=k,y=O;else{for(var L=!1,K=k.child;K;){if(K===g){L=!0,g=k,y=O;break}if(K===y){L=!0,y=k,g=O;break}K=K.sibling}if(!L){for(K=O.child;K;){if(K===g){L=!0,g=O,y=k;break}if(K===y){L=!0,y=O,g=k;break}K=K.sibling}if(!L)throw Error(r(189))}}if(g.alternate!==y)throw Error(r(190))}if(g.tag!==3)throw Error(r(188));return g.stateNode.current===g?c:d}function f(c){var d=c.tag;if(d===5||d===26||d===27||d===6)return c;for(c=c.child;c!==null;){if(d=f(c),d!==null)return d;c=c.sibling}return null}var p=Object.assign,m=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),T=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),D=Symbol.iterator;function F(c){return c===null||typeof c!="object"?null:(c=D&&c[D]||c["@@iterator"],typeof c=="function"?c:null)}var Q=Symbol.for("react.client.reference");function H(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===Q?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case x:return"Fragment";case S:return"Profiler";case w:return"StrictMode";case j:return"Suspense";case A:return"SuspenseList";case N:return"Activity"}if(typeof c=="object")switch(c.$$typeof){case b:return"Portal";case T:return c.displayName||"Context";case _:return(c._context.displayName||"Context")+".Consumer";case C:var d=c.render;return c=c.displayName,c||(c=d.displayName||d.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case E:return d=c.displayName||null,d!==null?d:H(c.type)||"Memo";case R:d=c._payload,c=c._init;try{return H(c(d))}catch{}}return null}var q=Array.isArray,P=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},Z=[],X=-1;function V(c){return{current:c}}function G(c){0>X||(c.current=Z[X],Z[X]=null,X--)}function W(c,d){X++,Z[X]=c.current,c.current=d}var te=V(null),oe=V(null),be=V(null),ye=V(null);function Ke(c,d){switch(W(be,d),W(oe,c),W(te,null),d.nodeType){case 9:case 11:c=(c=d.documentElement)&&(c=c.namespaceURI)?D8(c):0;break;default:if(c=d.tagName,d=d.namespaceURI)d=D8(d),c=N8(d,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}G(te),W(te,c)}function Fe(){G(te),G(oe),G(be)}function Pe(c){c.memoizedState!==null&&W(ye,c);var d=te.current,g=N8(d,c.type);d!==g&&(W(oe,c),W(te,g))}function ae(c){oe.current===c&&(G(te),G(oe)),ye.current===c&&(G(ye),H0._currentValue=U)}var Te,fe;function Ee(c){if(Te===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);Te=d&&d[1]||"",fe=-1<g.stack.indexOf(`
    at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Te+c+fe}var gt=!1;function We(c,d){if(!c||gt)return"";gt=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(d){var Ie=function(){throw Error()};if(Object.defineProperty(Ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ie,[])}catch(_e){var je=_e}Reflect.construct(c,[],Ie)}else{try{Ie.call()}catch(_e){je=_e}c.call(Ie.prototype)}}else{try{throw Error()}catch(_e){je=_e}(Ie=c())&&typeof Ie.catch=="function"&&Ie.catch(function(){})}}catch(_e){if(_e&&je&&typeof _e.stack=="string")return[_e.stack,je.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var k=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");k&&k.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=y.DetermineComponentFrameRoot(),L=O[0],K=O[1];if(L&&K){var ne=L.split(`
`),we=K.split(`
`);for(k=y=0;y<ne.length&&!ne[y].includes("DetermineComponentFrameRoot");)y++;for(;k<we.length&&!we[k].includes("DetermineComponentFrameRoot");)k++;if(y===ne.length||k===we.length)for(y=ne.length-1,k=we.length-1;1<=y&&0<=k&&ne[y]!==we[k];)k--;for(;1<=y&&0<=k;y--,k--)if(ne[y]!==we[k]){if(y!==1||k!==1)do if(y--,k--,0>k||ne[y]!==we[k]){var ke=`
`+ne[y].replace(" at new "," at ");return c.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",c.displayName)),ke}while(1<=y&&0<=k);break}}}finally{gt=!1,Error.prepareStackTrace=g}return(g=c?c.displayName||c.name:"")?Ee(g):""}function Be(c,d){switch(c.tag){case 26:case 27:case 5:return Ee(c.type);case 16:return Ee("Lazy");case 13:return c.child!==d&&d!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return We(c.type,!1);case 11:return We(c.type.render,!1);case 1:return We(c.type,!0);case 31:return Ee("Activity");default:return""}}function ze(c){try{var d="",g=null;do d+=Be(c,g),g=c,c=c.return;while(c);return d}catch(y){return`
Error generating stack: `+y.message+`
`+y.stack}}var De=Object.prototype.hasOwnProperty,Ye=t.unstable_scheduleCallback,$t=t.unstable_cancelCallback,tt=t.unstable_shouldYield,et=t.unstable_requestPaint,Ve=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Ce=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,Kt=t.unstable_NormalPriority,qn=t.unstable_LowPriority,Ft=t.unstable_IdlePriority,xn=t.log,Zt=t.unstable_setDisableYieldValue,ln=null,nn=null;function Pt(c){if(typeof xn=="function"&&Zt(c),nn&&typeof nn.setStrictMode=="function")try{nn.setStrictMode(ln,c)}catch{}}var Wt=Math.clz32?Math.clz32:kt,Ri=Math.log,yt=Math.LN2;function kt(c){return c>>>=0,c===0?32:31-(Ri(c)/yt|0)|0}var ir=256,It=262144,dr=4194304;function An(c){var d=c&42;if(d!==0)return d;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function ie(c,d,g){var y=c.pendingLanes;if(y===0)return 0;var k=0,O=c.suspendedLanes,L=c.pingedLanes;c=c.warmLanes;var K=y&134217727;return K!==0?(y=K&~O,y!==0?k=An(y):(L&=K,L!==0?k=An(L):g||(g=K&~c,g!==0&&(k=An(g))))):(K=y&~O,K!==0?k=An(K):L!==0?k=An(L):g||(g=y&~c,g!==0&&(k=An(g)))),k===0?0:d!==0&&d!==k&&(d&O)===0&&(O=k&-k,g=d&-d,O>=g||O===32&&(g&4194048)!==0)?d:k}function Oe(c,d){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&d)===0}function nt(c,d){switch(c){case 1:case 2:case 4:case 8:case 64:return d+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 d+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 Et(){var c=dr;return dr<<=1,(dr&62914560)===0&&(dr=4194304),c}function Mn(c){for(var d=[],g=0;31>g;g++)d.push(c);return d}function rn(c,d){c.pendingLanes|=d,d!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function rt(c,d,g,y,k,O){var L=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var K=c.entanglements,ne=c.expirationTimes,we=c.hiddenUpdates;for(g=L&~g;0<g;){var ke=31-Wt(g),Ie=1<<ke;K[ke]=0,ne[ke]=-1;var je=we[ke];if(je!==null)for(we[ke]=null,ke=0;ke<je.length;ke++){var _e=je[ke];_e!==null&&(_e.lane&=-536870913)}g&=~Ie}y!==0&&st(c,y,0),O!==0&&k===0&&c.tag!==0&&(c.suspendedLanes|=O&~(L&~d))}function st(c,d,g){c.pendingLanes|=d,c.suspendedLanes&=~d;var y=31-Wt(d);c.entangledLanes|=d,c.entanglements[y]=c.entanglements[y]|1073741824|g&261930}function Ze(c,d){var g=c.entangledLanes|=d;for(c=c.entanglements;g;){var y=31-Wt(g),k=1<<y;k&d|c[y]&d&&(c[y]|=d),g&=~k}}function Ht(c,d){var g=d&-d;return g=(g&42)!==0?1:Yt(g),(g&(c.suspendedLanes|d))!==0?0:g}function Yt(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=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:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function xi(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function ds(){var c=I.p;return c!==0?c:(c=window.event,c===void 0?32:r5(c.type))}function oc(c,d){var g=I.p;try{return I.p=c,d()}finally{I.p=g}}var ga=Math.random().toString(36).slice(2),$r="__reactFiber$"+ga,Di="__reactProps$"+ga,fs="__reactContainer$"+ga,ed="__reactEvents$"+ga,ml="__reactListeners$"+ga,lc="__reactHandles$"+ga,va="__reactResources$"+ga,vr="__reactMarker$"+ga;function Er(c){delete c[$r],delete c[Di],delete c[ed],delete c[ml],delete c[lc]}function yn(c){var d=c[$r];if(d)return d;for(var g=c.parentNode;g;){if(d=g[fs]||g[$r]){if(g=d.alternate,d.child!==null||g!==null&&g.child!==null)for(c=q8(c);c!==null;){if(g=c[$r])return g;c=q8(c)}return d}c=g,g=c.parentNode}return null}function Ys(c){if(c=c[$r]||c[fs]){var d=c.tag;if(d===5||d===6||d===13||d===31||d===26||d===27||d===3)return c}return null}function oi(c){var d=c.tag;if(d===5||d===26||d===27||d===6)return c.stateNode;throw Error(r(33))}function Xs(c){var d=c[va];return d||(d=c[va]={hoistableStyles:new Map,hoistableScripts:new Map}),d}function Ir(c){c[vr]=!0}var hu=new Set,Qa={};function ps(c,d){Qe(c,d),Qe(c+"Capture",d)}function Qe(c,d){for(Qa[c]=d,c=0;c<d.length;c++)hu.add(d[c])}var _t=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]*$"),Xt={},wn={};function br(c){return De.call(wn,c)?!0:De.call(Xt,c)?!1:_t.test(c)?wn[c]=!0:(Xt[c]=!0,!1)}function li(c,d,g){if(br(d))if(g===null)c.removeAttribute(d);else{switch(typeof g){case"undefined":case"function":case"symbol":c.removeAttribute(d);return;case"boolean":var y=d.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){c.removeAttribute(d);return}}c.setAttribute(d,""+g)}}function Gi(c,d,g){if(g===null)c.removeAttribute(d);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(d);return}c.setAttribute(d,""+g)}}function Fn(c,d,g,y){if(y===null)c.removeAttribute(g);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(g);return}c.setAttributeNS(d,g,""+y)}}function Hn(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function ms(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function du(c,d,g){var y=Object.getOwnPropertyDescriptor(c.constructor.prototype,d);if(!c.hasOwnProperty(d)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var k=y.get,O=y.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return k.call(this)},set:function(L){g=""+L,O.call(this,L)}}),Object.defineProperty(c,d,{enumerable:y.enumerable}),{getValue:function(){return g},setValue:function(L){g=""+L},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function cc(c){if(!c._valueTracker){var d=ms(c)?"checked":"value";c._valueTracker=du(c,d,""+c[d])}}function td(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var g=d.getValue(),y="";return c&&(y=ms(c)?c.checked?"true":"false":c.value),c=y,c!==g?(d.setValue(c),!0):!1}function fu(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var i0=/[\n"\\]/g;function Ki(c){return c.replace(i0,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function pu(c,d,g,y,k,O,L,K){c.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?c.type=L:c.removeAttribute("type"),d!=null?L==="number"?(d===0&&c.value===""||c.value!=d)&&(c.value=""+Hn(d)):c.value!==""+Hn(d)&&(c.value=""+Hn(d)):L!=="submit"&&L!=="reset"||c.removeAttribute("value"),d!=null?hc(c,L,Hn(d)):g!=null?hc(c,L,Hn(g)):y!=null&&c.removeAttribute("value"),k==null&&O!=null&&(c.defaultChecked=!!O),k!=null&&(c.checked=k&&typeof k!="function"&&typeof k!="symbol"),K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?c.name=""+Hn(K):c.removeAttribute("name")}function uc(c,d,g,y,k,O,L,K){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(c.type=O),d!=null||g!=null){if(!(O!=="submit"&&O!=="reset"||d!=null)){cc(c);return}g=g!=null?""+Hn(g):"",d=d!=null?""+Hn(d):g,K||d===c.value||(c.value=d),c.defaultValue=d}y=y??k,y=typeof y!="function"&&typeof y!="symbol"&&!!y,c.checked=K?c.checked:!!y,c.defaultChecked=!!y,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(c.name=L),cc(c)}function hc(c,d,g){d==="number"&&fu(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function Jr(c,d,g,y){if(c=c.options,d){d={};for(var k=0;k<g.length;k++)d["$"+g[k]]=!0;for(g=0;g<c.length;g++)k=d.hasOwnProperty("$"+c[g].value),c[g].selected!==k&&(c[g].selected=k),k&&y&&(c[g].defaultSelected=!0)}else{for(g=""+Hn(g),d=null,k=0;k<c.length;k++){if(c[k].value===g){c[k].selected=!0,y&&(c[k].defaultSelected=!0);return}d!==null||c[k].disabled||(d=c[k])}d!==null&&(d.selected=!0)}}function dc(c,d,g){if(d!=null&&(d=""+Hn(d),d!==c.value&&(c.value=d),g==null)){c.defaultValue!==d&&(c.defaultValue=d);return}c.defaultValue=g!=null?""+Hn(g):""}function Eo(c,d,g,y){if(d==null){if(y!=null){if(g!=null)throw Error(r(92));if(q(y)){if(1<y.length)throw Error(r(93));y=y[0]}g=y}g==null&&(g=""),d=g}g=Hn(d),c.defaultValue=g,y=c.textContent,y===g&&y!==""&&y!==null&&(c.value=y),cc(c)}function At(c,d){if(d){var g=c.firstChild;if(g&&g===c.lastChild&&g.nodeType===3){g.nodeValue=d;return}}c.textContent=d}var mu=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 Fr(c,d,g){var y=d.indexOf("--")===0;g==null||typeof g=="boolean"||g===""?y?c.setProperty(d,""):d==="float"?c.cssFloat="":c[d]="":y?c.setProperty(d,g):typeof g!="number"||g===0||mu.has(d)?d==="float"?c.cssFloat=g:c[d]=(""+g).trim():c[d]=g+"px"}function Rn(c,d,g){if(d!=null&&typeof d!="object")throw Error(r(62));if(c=c.style,g!=null){for(var y in g)!g.hasOwnProperty(y)||d!=null&&d.hasOwnProperty(y)||(y.indexOf("--")===0?c.setProperty(y,""):y==="float"?c.cssFloat="":c[y]="");for(var k in d)y=d[k],d.hasOwnProperty(k)&&g[k]!==y&&Fr(c,k,y)}else for(var O in d)d.hasOwnProperty(O)&&Fr(c,O,d[O])}function gl(c){if(c.indexOf("-")===-1)return!1;switch(c){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 gs=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"]]),vl=/^[\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 Wa(c){return vl.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}function Ge(){}var wt=null;function Dt(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var sn=null,fr=null;function vs(c){var d=Ys(c);if(d&&(c=d.stateNode)){var g=c[Di]||null;e:switch(c=d.stateNode,d.type){case"input":if(pu(c,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name),d=g.name,g.type==="radio"&&d!=null){for(g=c;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll('input[name="'+Ki(""+d)+'"][type="radio"]'),d=0;d<g.length;d++){var y=g[d];if(y!==c&&y.form===c.form){var k=y[Di]||null;if(!k)throw Error(r(90));pu(y,k.value,k.defaultValue,k.defaultValue,k.checked,k.defaultChecked,k.type,k.name)}}for(d=0;d<g.length;d++)y=g[d],y.form===c.form&&td(y)}break e;case"textarea":dc(c,g.value,g.defaultValue);break e;case"select":d=g.value,d!=null&&Jr(c,!!g.multiple,d,!1)}}}var fc=!1;function gu(c,d,g){if(fc)return c(d,g);fc=!0;try{var y=c(d);return y}finally{if(fc=!1,(sn!==null||fr!==null)&&(uy(),sn&&(d=sn,c=fr,fr=sn=null,vs(d),c)))for(d=0;d<c.length;d++)vs(c[d])}}function Ya(c,d){var g=c.stateNode;if(g===null)return null;var y=g[Di]||null;if(y===null)return null;g=y[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(c=c.type,y=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!y;break e;default:c=!1}if(c)return null;if(g&&typeof g!="function")throw Error(r(231,d,typeof g));return g}var bs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Df=!1;if(bs)try{var vu={};Object.defineProperty(vu,"passive",{get:function(){Df=!0}}),window.addEventListener("test",vu,vu),window.removeEventListener("test",vu,vu)}catch{Df=!1}var Rs=null,bl=null,nd=null;function s0(){if(nd)return nd;var c,d=bl,g=d.length,y,k="value"in Rs?Rs.value:Rs.textContent,O=k.length;for(c=0;c<g&&d[c]===k[c];c++);var L=g-c;for(y=1;y<=L&&d[g-y]===k[O-y];y++);return nd=k.slice(c,1<y?1-y:void 0)}function Ln(c){var d=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&d===13&&(c=13)):c=d,c===10&&(c=13),32<=c||c===13?c:0}function Vn(){return!0}function Ao(){return!1}function Tn(c){function d(g,y,k,O,L){this._reactName=g,this._targetInst=k,this.type=y,this.nativeEvent=O,this.target=L,this.currentTarget=null;for(var K in c)c.hasOwnProperty(K)&&(g=c[K],this[K]=g?g(O):O[K]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?Vn:Ao,this.isPropagationStopped=Ao,this}return p(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var g=this.nativeEvent;g&&(g.preventDefault?g.preventDefault():typeof g.returnValue!="unknown"&&(g.returnValue=!1),this.isDefaultPrevented=Vn)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=Vn)},persist:function(){},isPersistent:Vn}),d}var pr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Br=Tn(pr),Dn=p({},pr,{view:0,detail:0}),bu=Tn(Dn),yu,a0,Gs,Ds=p({},Dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:o0,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==Gs&&(Gs&&c.type==="mousemove"?(yu=c.screenX-Gs.screenX,a0=c.screenY-Gs.screenY):a0=yu=0,Gs=c),yu)},movementY:function(c){return"movementY"in c?c.movementY:a0}}),bb=Tn(Ds),$S=p({},Ds,{dataTransfer:0}),IS=Tn($S),BS=p({},Dn,{relatedTarget:0}),ba=Tn(BS),yl=p({},pr,{animationName:0,elapsedTime:0,pseudoElement:0}),pc=Tn(yl),xu=p({},pr,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),zS=Tn(xu),Xa=p({},pr,{data:0}),yb=Tn(Xa),xb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wb={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"},rd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function id(c){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(c):(c=rd[c])?!!d[c]:!1}function o0(){return id}var l0=p({},Dn,{key:function(c){if(c.key){var d=xb[c.key]||c.key;if(d!=="Unidentified")return d}return c.type==="keypress"?(c=Ln(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?wb[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:o0,charCode:function(c){return c.type==="keypress"?Ln(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?Ln(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),qS=Tn(l0),mc=p({},Ds,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mo=Tn(mc),sd=p({},Dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:o0}),Sb=Tn(sd),c0=p({},pr,{propertyName:0,elapsedTime:0,pseudoElement:0}),u0=Tn(c0),h0=p({},Ds,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),jb=Tn(h0),_b=p({},pr,{newState:0,oldState:0}),Tb=Tn(_b),Cb=[9,13,27,32],Nf=bs&&"CompositionEvent"in window,wu=null;bs&&"documentMode"in document&&(wu=document.documentMode);var FS=bs&&"TextEvent"in window&&!wu,d0=bs&&(!Nf||wu&&8<wu&&11>=wu),f0=" ",gc=!1;function ad(c,d){switch(c){case"keyup":return Cb.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ei(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var vc=!1;function Hr(c,d){switch(c){case"compositionend":return ei(d);case"keypress":return d.which!==32?null:(gc=!0,f0);case"textInput":return c=d.data,c===f0&&gc?null:c;default:return null}}function kb(c,d){if(vc)return c==="compositionend"||!Nf&&ad(c,d)?(c=s0(),nd=bl=Rs=null,vc=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return d0&&d.locale!=="ko"?null:d.data;default:return null}}var p0={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 Su(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d==="input"?!!p0[c.type]:d==="textarea"}function Ob(c,d,g,y){sn?fr?fr.push(y):fr=[y]:sn=y,d=vy(d,"onChange"),0<d.length&&(g=new Br("onChange","change",null,g,y),c.push({event:g,listeners:d}))}var od=null,bc=null;function z(c){k8(c,0)}function Y(c){var d=oi(c);if(td(d))return c}function J(c,d){if(c==="change")return d}var ee=!1;if(bs){var ce;if(bs){var me="oninput"in document;if(!me){var Re=document.createElement("div");Re.setAttribute("oninput","return;"),me=typeof Re.oninput=="function"}ce=me}else ce=!1;ee=ce&&(!document.documentMode||9<document.documentMode)}function He(){od&&(od.detachEvent("onpropertychange",Xe),bc=od=null)}function Xe(c){if(c.propertyName==="value"&&Y(bc)){var d=[];Ob(d,bc,c,Dt(c)),gu(z,d)}}function ct(c,d,g){c==="focusin"?(He(),od=d,bc=g,od.attachEvent("onpropertychange",Xe)):c==="focusout"&&He()}function dt(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return Y(bc)}function vt(c,d){if(c==="click")return Y(d)}function Lt(c,d){if(c==="input"||c==="change")return Y(d)}function Sn(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var Bt=typeof Object.is=="function"?Object.is:Sn;function Qt(c,d){if(Bt(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var g=Object.keys(c),y=Object.keys(d);if(g.length!==y.length)return!1;for(y=0;y<g.length;y++){var k=g[y];if(!De.call(d,k)||!Bt(c[k],d[k]))return!1}return!0}function Mt(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function Tt(c,d){var g=Mt(c);c=0;for(var y;g;){if(g.nodeType===3){if(y=c+g.textContent.length,c<=d&&y>=d)return{node:g,offset:d-c};c=y}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Mt(g)}}function Jn(c,d){return c&&d?c===d?!0:c&&c.nodeType===3?!1:d&&d.nodeType===3?Jn(c,d.parentNode):"contains"in c?c.contains(d):c.compareDocumentPosition?!!(c.compareDocumentPosition(d)&16):!1:!1}function yr(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var d=fu(c.document);d instanceof c.HTMLIFrameElement;){try{var g=typeof d.contentWindow.location.href=="string"}catch{g=!1}if(g)c=d.contentWindow;else break;d=fu(c.document)}return d}function Vr(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d&&(d==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||d==="textarea"||c.contentEditable==="true")}var $n=bs&&"documentMode"in document&&11>=document.documentMode,Un=null,Zi=null,ti=null,ys=!1;function Ks(c,d,g){var y=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;ys||Un==null||Un!==fu(y)||(y=Un,"selectionStart"in y&&Vr(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),ti&&Qt(ti,y)||(ti=y,y=vy(Zi,"onSelect"),0<y.length&&(d=new Br("onSelect","select",null,d,g),c.push({event:d,listeners:y}),d.target=Un)))}function Ni(c,d){var g={};return g[c.toLowerCase()]=d.toLowerCase(),g["Webkit"+c]="webkit"+d,g["Moz"+c]="moz"+d,g}var ci={animationend:Ni("Animation","AnimationEnd"),animationiteration:Ni("Animation","AnimationIteration"),animationstart:Ni("Animation","AnimationStart"),transitionrun:Ni("Transition","TransitionRun"),transitionstart:Ni("Transition","TransitionStart"),transitioncancel:Ni("Transition","TransitionCancel"),transitionend:Ni("Transition","TransitionEnd")},xs={},Zs={};bs&&(Zs=document.createElement("div").style,"AnimationEvent"in window||(delete ci.animationend.animation,delete ci.animationiteration.animation,delete ci.animationstart.animation),"TransitionEvent"in window||delete ci.transitionend.transition);function Pi(c){if(xs[c])return xs[c];if(!ci[c])return c;var d=ci[c],g;for(g in d)if(d.hasOwnProperty(g)&&g in Zs)return xs[c]=d[g];return c}var Li=Pi("animationend"),ws=Pi("animationiteration"),xl=Pi("animationstart"),Ji=Pi("transitionrun"),Eb=Pi("transitionstart"),yQ=Pi("transitioncancel"),aA=Pi("transitionend"),oA=new Map,HS="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(" ");HS.push("scrollEnd");function Ro(c,d){oA.set(c,d),ps(d,[c])}var Ab=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var d=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(d))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},Ga=[],Pf=0,VS=0;function Mb(){for(var c=Pf,d=VS=Pf=0;d<c;){var g=Ga[d];Ga[d++]=null;var y=Ga[d];Ga[d++]=null;var k=Ga[d];Ga[d++]=null;var O=Ga[d];if(Ga[d++]=null,y!==null&&k!==null){var L=y.pending;L===null?k.next=k:(k.next=L.next,L.next=k),y.pending=k}O!==0&&lA(g,k,O)}}function Rb(c,d,g,y){Ga[Pf++]=c,Ga[Pf++]=d,Ga[Pf++]=g,Ga[Pf++]=y,VS|=y,c.lanes|=y,c=c.alternate,c!==null&&(c.lanes|=y)}function US(c,d,g,y){return Rb(c,d,g,y),Db(c)}function ld(c,d){return Rb(c,null,null,d),Db(c)}function lA(c,d,g){c.lanes|=g;var y=c.alternate;y!==null&&(y.lanes|=g);for(var k=!1,O=c.return;O!==null;)O.childLanes|=g,y=O.alternate,y!==null&&(y.childLanes|=g),O.tag===22&&(c=O.stateNode,c===null||c._visibility&1||(k=!0)),c=O,O=O.return;return c.tag===3?(O=c.stateNode,k&&d!==null&&(k=31-Wt(g),c=O.hiddenUpdates,y=c[k],y===null?c[k]=[d]:y.push(d),d.lane=g|536870912),O):null}function Db(c){if(50<L0)throw L0=0,e_=null,Error(r(185));for(var d=c.return;d!==null;)c=d,d=c.return;return c.tag===3?c.stateNode:null}var Lf={};function xQ(c,d,g,y){this.tag=c,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ya(c,d,g,y){return new xQ(c,d,g,y)}function QS(c){return c=c.prototype,!(!c||!c.isReactComponent)}function yc(c,d){var g=c.alternate;return g===null?(g=ya(c.tag,d,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=d,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&65011712,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,d=c.dependencies,g.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g.refCleanup=c.refCleanup,g}function cA(c,d){c.flags&=65011714;var g=c.alternate;return g===null?(c.childLanes=0,c.lanes=d,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=g.childLanes,c.lanes=g.lanes,c.child=g.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=g.memoizedProps,c.memoizedState=g.memoizedState,c.updateQueue=g.updateQueue,c.type=g.type,d=g.dependencies,c.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),c}function Nb(c,d,g,y,k,O){var L=0;if(y=c,typeof c=="function")QS(c)&&(L=1);else if(typeof c=="string")L=TW(c,g,te.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case N:return c=ya(31,g,d,k),c.elementType=N,c.lanes=O,c;case x:return cd(g.children,k,O,d);case w:L=8,k|=24;break;case S:return c=ya(12,g,d,k|2),c.elementType=S,c.lanes=O,c;case j:return c=ya(13,g,d,k),c.elementType=j,c.lanes=O,c;case A:return c=ya(19,g,d,k),c.elementType=A,c.lanes=O,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case T:L=10;break e;case _:L=9;break e;case C:L=11;break e;case E:L=14;break e;case R:L=16,y=null;break e}L=29,g=Error(r(130,c===null?"null":typeof c,"")),y=null}return d=ya(L,g,d,k),d.elementType=c,d.type=y,d.lanes=O,d}function cd(c,d,g,y){return c=ya(7,c,y,d),c.lanes=g,c}function WS(c,d,g){return c=ya(6,c,null,d),c.lanes=g,c}function uA(c){var d=ya(18,null,null,0);return d.stateNode=c,d}function YS(c,d,g){return d=ya(4,c.children!==null?c.children:[],c.key,d),d.lanes=g,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}var hA=new WeakMap;function Ka(c,d){if(typeof c=="object"&&c!==null){var g=hA.get(c);return g!==void 0?g:(d={value:c,source:d,stack:ze(d)},hA.set(c,d),d)}return{value:c,source:d,stack:ze(d)}}var $f=[],If=0,Pb=null,m0=0,Za=[],Ja=0,ju=null,wl=1,Sl="";function xc(c,d){$f[If++]=m0,$f[If++]=Pb,Pb=c,m0=d}function dA(c,d,g){Za[Ja++]=wl,Za[Ja++]=Sl,Za[Ja++]=ju,ju=c;var y=wl;c=Sl;var k=32-Wt(y)-1;y&=~(1<<k),g+=1;var O=32-Wt(d)+k;if(30<O){var L=k-k%5;O=(y&(1<<L)-1).toString(32),y>>=L,k-=L,wl=1<<32-Wt(d)+k|g<<k|y,Sl=O+c}else wl=1<<O|g<<k|y,Sl=c}function XS(c){c.return!==null&&(xc(c,1),dA(c,1,0))}function GS(c){for(;c===Pb;)Pb=$f[--If],$f[If]=null,m0=$f[--If],$f[If]=null;for(;c===ju;)ju=Za[--Ja],Za[Ja]=null,Sl=Za[--Ja],Za[Ja]=null,wl=Za[--Ja],Za[Ja]=null}function fA(c,d){Za[Ja++]=wl,Za[Ja++]=Sl,Za[Ja++]=ju,wl=d.id,Sl=d.overflow,ju=c}var es=null,xr=null,vn=!1,_u=null,eo=!1,KS=Error(r(519));function Tu(c){var d=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw g0(Ka(d,c)),KS}function pA(c){var d=c.stateNode,g=c.type,y=c.memoizedProps;switch(d[$r]=c,d[Di]=y,g){case"dialog":un("cancel",d),un("close",d);break;case"iframe":case"object":case"embed":un("load",d);break;case"video":case"audio":for(g=0;g<I0.length;g++)un(I0[g],d);break;case"source":un("error",d);break;case"img":case"image":case"link":un("error",d),un("load",d);break;case"details":un("toggle",d);break;case"input":un("invalid",d),uc(d,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":un("invalid",d);break;case"textarea":un("invalid",d),Eo(d,y.value,y.defaultValue,y.children)}g=y.children,typeof g!="string"&&typeof g!="number"&&typeof g!="bigint"||d.textContent===""+g||y.suppressHydrationWarning===!0||M8(d.textContent,g)?(y.popover!=null&&(un("beforetoggle",d),un("toggle",d)),y.onScroll!=null&&un("scroll",d),y.onScrollEnd!=null&&un("scrollend",d),y.onClick!=null&&(d.onclick=Ge),d=!0):d=!1,d||Tu(c,!0)}function mA(c){for(es=c.return;es;)switch(es.tag){case 5:case 31:case 13:eo=!1;return;case 27:case 3:eo=!0;return;default:es=es.return}}function Bf(c){if(c!==es)return!1;if(!vn)return mA(c),vn=!0,!1;var d=c.tag,g;if((g=d!==3&&d!==27)&&((g=d===5)&&(g=c.type,g=!(g!=="form"&&g!=="button")||m_(c.type,c.memoizedProps)),g=!g),g&&xr&&Tu(c),mA(c),d===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));xr=z8(c)}else if(d===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));xr=z8(c)}else d===27?(d=xr,Bu(c.type)?(c=x_,x_=null,xr=c):xr=d):xr=es?no(c.stateNode.nextSibling):null;return!0}function ud(){xr=es=null,vn=!1}function ZS(){var c=_u;return c!==null&&(na===null?na=c:na.push.apply(na,c),_u=null),c}function g0(c){_u===null?_u=[c]:_u.push(c)}var JS=V(null),hd=null,wc=null;function Cu(c,d,g){W(JS,d._currentValue),d._currentValue=g}function Sc(c){c._currentValue=JS.current,G(JS)}function ej(c,d,g){for(;c!==null;){var y=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,y!==null&&(y.childLanes|=d)):y!==null&&(y.childLanes&d)!==d&&(y.childLanes|=d),c===g)break;c=c.return}}function tj(c,d,g,y){var k=c.child;for(k!==null&&(k.return=c);k!==null;){var O=k.dependencies;if(O!==null){var L=k.child;O=O.firstContext;e:for(;O!==null;){var K=O;O=k;for(var ne=0;ne<d.length;ne++)if(K.context===d[ne]){O.lanes|=g,K=O.alternate,K!==null&&(K.lanes|=g),ej(O.return,g,c),y||(L=null);break e}O=K.next}}else if(k.tag===18){if(L=k.return,L===null)throw Error(r(341));L.lanes|=g,O=L.alternate,O!==null&&(O.lanes|=g),ej(L,g,c),L=null}else L=k.child;if(L!==null)L.return=k;else for(L=k;L!==null;){if(L===c){L=null;break}if(k=L.sibling,k!==null){k.return=L.return,L=k;break}L=L.return}k=L}}function zf(c,d,g,y){c=null;for(var k=d,O=!1;k!==null;){if(!O){if((k.flags&524288)!==0)O=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var L=k.alternate;if(L===null)throw Error(r(387));if(L=L.memoizedProps,L!==null){var K=k.type;Bt(k.pendingProps.value,L.value)||(c!==null?c.push(K):c=[K])}}else if(k===ye.current){if(L=k.alternate,L===null)throw Error(r(387));L.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(c!==null?c.push(H0):c=[H0])}k=k.return}c!==null&&tj(d,c,g,y),d.flags|=262144}function Lb(c){for(c=c.firstContext;c!==null;){if(!Bt(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function dd(c){hd=c,wc=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function ts(c){return gA(hd,c)}function $b(c,d){return hd===null&&dd(c),gA(c,d)}function gA(c,d){var g=d._currentValue;if(d={context:d,memoizedValue:g,next:null},wc===null){if(c===null)throw Error(r(308));wc=d,c.dependencies={lanes:0,firstContext:d},c.flags|=524288}else wc=wc.next=d;return g}var wQ=typeof AbortController<"u"?AbortController:function(){var c=[],d=this.signal={aborted:!1,addEventListener:function(g,y){c.push(y)}};this.abort=function(){d.aborted=!0,c.forEach(function(g){return g()})}},SQ=t.unstable_scheduleCallback,jQ=t.unstable_NormalPriority,ui={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nj(){return{controller:new wQ,data:new Map,refCount:0}}function v0(c){c.refCount--,c.refCount===0&&SQ(jQ,function(){c.controller.abort()})}var b0=null,rj=0,qf=0,Ff=null;function _Q(c,d){if(b0===null){var g=b0=[];rj=0,qf=a_(),Ff={status:"pending",value:void 0,then:function(y){g.push(y)}}}return rj++,d.then(vA,vA),d}function vA(){if(--rj===0&&b0!==null){Ff!==null&&(Ff.status="fulfilled");var c=b0;b0=null,qf=0,Ff=null;for(var d=0;d<c.length;d++)(0,c[d])()}}function TQ(c,d){var g=[],y={status:"pending",value:null,reason:null,then:function(k){g.push(k)}};return c.then(function(){y.status="fulfilled",y.value=d;for(var k=0;k<g.length;k++)(0,g[k])(d)},function(k){for(y.status="rejected",y.reason=k,k=0;k<g.length;k++)(0,g[k])(void 0)}),y}var bA=P.S;P.S=function(c,d){t8=Ve(),typeof d=="object"&&d!==null&&typeof d.then=="function"&&_Q(c,d),bA!==null&&bA(c,d)};var fd=V(null);function ij(){var c=fd.current;return c!==null?c:sr.pooledCache}function Ib(c,d){d===null?W(fd,fd.current):W(fd,d.pool)}function yA(){var c=ij();return c===null?null:{parent:ui._currentValue,pool:c}}var Hf=Error(r(460)),sj=Error(r(474)),Bb=Error(r(542)),zb={then:function(){}};function xA(c){return c=c.status,c==="fulfilled"||c==="rejected"}function wA(c,d,g){switch(g=c[g],g===void 0?c.push(d):g!==d&&(d.then(Ge,Ge),d=g),d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,jA(c),c;default:if(typeof d.status=="string")d.then(Ge,Ge);else{if(c=sr,c!==null&&100<c.shellSuspendCounter)throw Error(r(482));c=d,c.status="pending",c.then(function(y){if(d.status==="pending"){var k=d;k.status="fulfilled",k.value=y}},function(y){if(d.status==="pending"){var k=d;k.status="rejected",k.reason=y}})}switch(d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,jA(c),c}throw md=d,Hf}}function pd(c){try{var d=c._init;return d(c._payload)}catch(g){throw g!==null&&typeof g=="object"&&typeof g.then=="function"?(md=g,Hf):g}}var md=null;function SA(){if(md===null)throw Error(r(459));var c=md;return md=null,c}function jA(c){if(c===Hf||c===Bb)throw Error(r(483))}var Vf=null,y0=0;function qb(c){var d=y0;return y0+=1,Vf===null&&(Vf=[]),wA(Vf,c,d)}function x0(c,d){d=d.props.ref,c.ref=d!==void 0?d:null}function Fb(c,d){throw d.$$typeof===m?Error(r(525)):(c=Object.prototype.toString.call(d),Error(r(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c)))}function _A(c){function d(he,ue){if(c){var xe=he.deletions;xe===null?(he.deletions=[ue],he.flags|=16):xe.push(ue)}}function g(he,ue){if(!c)return null;for(;ue!==null;)d(he,ue),ue=ue.sibling;return null}function y(he){for(var ue=new Map;he!==null;)he.key!==null?ue.set(he.key,he):ue.set(he.index,he),he=he.sibling;return ue}function k(he,ue){return he=yc(he,ue),he.index=0,he.sibling=null,he}function O(he,ue,xe){return he.index=xe,c?(xe=he.alternate,xe!==null?(xe=xe.index,xe<ue?(he.flags|=67108866,ue):xe):(he.flags|=67108866,ue)):(he.flags|=1048576,ue)}function L(he){return c&&he.alternate===null&&(he.flags|=67108866),he}function K(he,ue,xe,Ne){return ue===null||ue.tag!==6?(ue=WS(xe,he.mode,Ne),ue.return=he,ue):(ue=k(ue,xe),ue.return=he,ue)}function ne(he,ue,xe,Ne){var Ot=xe.type;return Ot===x?ke(he,ue,xe.props.children,Ne,xe.key):ue!==null&&(ue.elementType===Ot||typeof Ot=="object"&&Ot!==null&&Ot.$$typeof===R&&pd(Ot)===ue.type)?(ue=k(ue,xe.props),x0(ue,xe),ue.return=he,ue):(ue=Nb(xe.type,xe.key,xe.props,null,he.mode,Ne),x0(ue,xe),ue.return=he,ue)}function we(he,ue,xe,Ne){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==xe.containerInfo||ue.stateNode.implementation!==xe.implementation?(ue=YS(xe,he.mode,Ne),ue.return=he,ue):(ue=k(ue,xe.children||[]),ue.return=he,ue)}function ke(he,ue,xe,Ne,Ot){return ue===null||ue.tag!==7?(ue=cd(xe,he.mode,Ne,Ot),ue.return=he,ue):(ue=k(ue,xe),ue.return=he,ue)}function Ie(he,ue,xe){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ue=WS(""+ue,he.mode,xe),ue.return=he,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return xe=Nb(ue.type,ue.key,ue.props,null,he.mode,xe),x0(xe,ue),xe.return=he,xe;case b:return ue=YS(ue,he.mode,xe),ue.return=he,ue;case R:return ue=pd(ue),Ie(he,ue,xe)}if(q(ue)||F(ue))return ue=cd(ue,he.mode,xe,null),ue.return=he,ue;if(typeof ue.then=="function")return Ie(he,qb(ue),xe);if(ue.$$typeof===T)return Ie(he,$b(he,ue),xe);Fb(he,ue)}return null}function je(he,ue,xe,Ne){var Ot=ue!==null?ue.key:null;if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return Ot!==null?null:K(he,ue,""+xe,Ne);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case v:return xe.key===Ot?ne(he,ue,xe,Ne):null;case b:return xe.key===Ot?we(he,ue,xe,Ne):null;case R:return xe=pd(xe),je(he,ue,xe,Ne)}if(q(xe)||F(xe))return Ot!==null?null:ke(he,ue,xe,Ne,null);if(typeof xe.then=="function")return je(he,ue,qb(xe),Ne);if(xe.$$typeof===T)return je(he,ue,$b(he,xe),Ne);Fb(he,xe)}return null}function _e(he,ue,xe,Ne,Ot){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return he=he.get(xe)||null,K(ue,he,""+Ne,Ot);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case v:return he=he.get(Ne.key===null?xe:Ne.key)||null,ne(ue,he,Ne,Ot);case b:return he=he.get(Ne.key===null?xe:Ne.key)||null,we(ue,he,Ne,Ot);case R:return Ne=pd(Ne),_e(he,ue,xe,Ne,Ot)}if(q(Ne)||F(Ne))return he=he.get(xe)||null,ke(ue,he,Ne,Ot,null);if(typeof Ne.then=="function")return _e(he,ue,xe,qb(Ne),Ot);if(Ne.$$typeof===T)return _e(he,ue,xe,$b(ue,Ne),Ot);Fb(ue,Ne)}return null}function xt(he,ue,xe,Ne){for(var Ot=null,Cn=null,jt=ue,Jt=ue=0,pn=null;jt!==null&&Jt<xe.length;Jt++){jt.index>Jt?(pn=jt,jt=null):pn=jt.sibling;var kn=je(he,jt,xe[Jt],Ne);if(kn===null){jt===null&&(jt=pn);break}c&&jt&&kn.alternate===null&&d(he,jt),ue=O(kn,ue,Jt),Cn===null?Ot=kn:Cn.sibling=kn,Cn=kn,jt=pn}if(Jt===xe.length)return g(he,jt),vn&&xc(he,Jt),Ot;if(jt===null){for(;Jt<xe.length;Jt++)jt=Ie(he,xe[Jt],Ne),jt!==null&&(ue=O(jt,ue,Jt),Cn===null?Ot=jt:Cn.sibling=jt,Cn=jt);return vn&&xc(he,Jt),Ot}for(jt=y(jt);Jt<xe.length;Jt++)pn=_e(jt,he,Jt,xe[Jt],Ne),pn!==null&&(c&&pn.alternate!==null&&jt.delete(pn.key===null?Jt:pn.key),ue=O(pn,ue,Jt),Cn===null?Ot=pn:Cn.sibling=pn,Cn=pn);return c&&jt.forEach(function(Vu){return d(he,Vu)}),vn&&xc(he,Jt),Ot}function Rt(he,ue,xe,Ne){if(xe==null)throw Error(r(151));for(var Ot=null,Cn=null,jt=ue,Jt=ue=0,pn=null,kn=xe.next();jt!==null&&!kn.done;Jt++,kn=xe.next()){jt.index>Jt?(pn=jt,jt=null):pn=jt.sibling;var Vu=je(he,jt,kn.value,Ne);if(Vu===null){jt===null&&(jt=pn);break}c&&jt&&Vu.alternate===null&&d(he,jt),ue=O(Vu,ue,Jt),Cn===null?Ot=Vu:Cn.sibling=Vu,Cn=Vu,jt=pn}if(kn.done)return g(he,jt),vn&&xc(he,Jt),Ot;if(jt===null){for(;!kn.done;Jt++,kn=xe.next())kn=Ie(he,kn.value,Ne),kn!==null&&(ue=O(kn,ue,Jt),Cn===null?Ot=kn:Cn.sibling=kn,Cn=kn);return vn&&xc(he,Jt),Ot}for(jt=y(jt);!kn.done;Jt++,kn=xe.next())kn=_e(jt,he,Jt,kn.value,Ne),kn!==null&&(c&&kn.alternate!==null&&jt.delete(kn.key===null?Jt:kn.key),ue=O(kn,ue,Jt),Cn===null?Ot=kn:Cn.sibling=kn,Cn=kn);return c&&jt.forEach(function(LW){return d(he,LW)}),vn&&xc(he,Jt),Ot}function nr(he,ue,xe,Ne){if(typeof xe=="object"&&xe!==null&&xe.type===x&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case v:e:{for(var Ot=xe.key;ue!==null;){if(ue.key===Ot){if(Ot=xe.type,Ot===x){if(ue.tag===7){g(he,ue.sibling),Ne=k(ue,xe.props.children),Ne.return=he,he=Ne;break e}}else if(ue.elementType===Ot||typeof Ot=="object"&&Ot!==null&&Ot.$$typeof===R&&pd(Ot)===ue.type){g(he,ue.sibling),Ne=k(ue,xe.props),x0(Ne,xe),Ne.return=he,he=Ne;break e}g(he,ue);break}else d(he,ue);ue=ue.sibling}xe.type===x?(Ne=cd(xe.props.children,he.mode,Ne,xe.key),Ne.return=he,he=Ne):(Ne=Nb(xe.type,xe.key,xe.props,null,he.mode,Ne),x0(Ne,xe),Ne.return=he,he=Ne)}return L(he);case b:e:{for(Ot=xe.key;ue!==null;){if(ue.key===Ot)if(ue.tag===4&&ue.stateNode.containerInfo===xe.containerInfo&&ue.stateNode.implementation===xe.implementation){g(he,ue.sibling),Ne=k(ue,xe.children||[]),Ne.return=he,he=Ne;break e}else{g(he,ue);break}else d(he,ue);ue=ue.sibling}Ne=YS(xe,he.mode,Ne),Ne.return=he,he=Ne}return L(he);case R:return xe=pd(xe),nr(he,ue,xe,Ne)}if(q(xe))return xt(he,ue,xe,Ne);if(F(xe)){if(Ot=F(xe),typeof Ot!="function")throw Error(r(150));return xe=Ot.call(xe),Rt(he,ue,xe,Ne)}if(typeof xe.then=="function")return nr(he,ue,qb(xe),Ne);if(xe.$$typeof===T)return nr(he,ue,$b(he,xe),Ne);Fb(he,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint"?(xe=""+xe,ue!==null&&ue.tag===6?(g(he,ue.sibling),Ne=k(ue,xe),Ne.return=he,he=Ne):(g(he,ue),Ne=WS(xe,he.mode,Ne),Ne.return=he,he=Ne),L(he)):g(he,ue)}return function(he,ue,xe,Ne){try{y0=0;var Ot=nr(he,ue,xe,Ne);return Vf=null,Ot}catch(jt){if(jt===Hf||jt===Bb)throw jt;var Cn=ya(29,jt,null,he.mode);return Cn.lanes=Ne,Cn.return=he,Cn}finally{}}}var gd=_A(!0),TA=_A(!1),ku=!1;function aj(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oj(c,d){c=c.updateQueue,d.updateQueue===c&&(d.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function Ou(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function Eu(c,d,g){var y=c.updateQueue;if(y===null)return null;if(y=y.shared,(Nn&2)!==0){var k=y.pending;return k===null?d.next=d:(d.next=k.next,k.next=d),y.pending=d,d=Db(c),lA(c,null,g),d}return Rb(c,y,d,g),Db(c)}function w0(c,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194048)!==0)){var y=d.lanes;y&=c.pendingLanes,g|=y,d.lanes=g,Ze(c,g)}}function lj(c,d){var g=c.updateQueue,y=c.alternate;if(y!==null&&(y=y.updateQueue,g===y)){var k=null,O=null;if(g=g.firstBaseUpdate,g!==null){do{var L={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};O===null?k=O=L:O=O.next=L,g=g.next}while(g!==null);O===null?k=O=d:O=O.next=d}else k=O=d;g={baseState:y.baseState,firstBaseUpdate:k,lastBaseUpdate:O,shared:y.shared,callbacks:y.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=d:c.next=d,g.lastBaseUpdate=d}var cj=!1;function S0(){if(cj){var c=Ff;if(c!==null)throw c}}function j0(c,d,g,y){cj=!1;var k=c.updateQueue;ku=!1;var O=k.firstBaseUpdate,L=k.lastBaseUpdate,K=k.shared.pending;if(K!==null){k.shared.pending=null;var ne=K,we=ne.next;ne.next=null,L===null?O=we:L.next=we,L=ne;var ke=c.alternate;ke!==null&&(ke=ke.updateQueue,K=ke.lastBaseUpdate,K!==L&&(K===null?ke.firstBaseUpdate=we:K.next=we,ke.lastBaseUpdate=ne))}if(O!==null){var Ie=k.baseState;L=0,ke=we=ne=null,K=O;do{var je=K.lane&-536870913,_e=je!==K.lane;if(_e?(fn&je)===je:(y&je)===je){je!==0&&je===qf&&(cj=!0),ke!==null&&(ke=ke.next={lane:0,tag:K.tag,payload:K.payload,callback:null,next:null});e:{var xt=c,Rt=K;je=d;var nr=g;switch(Rt.tag){case 1:if(xt=Rt.payload,typeof xt=="function"){Ie=xt.call(nr,Ie,je);break e}Ie=xt;break e;case 3:xt.flags=xt.flags&-65537|128;case 0:if(xt=Rt.payload,je=typeof xt=="function"?xt.call(nr,Ie,je):xt,je==null)break e;Ie=p({},Ie,je);break e;case 2:ku=!0}}je=K.callback,je!==null&&(c.flags|=64,_e&&(c.flags|=8192),_e=k.callbacks,_e===null?k.callbacks=[je]:_e.push(je))}else _e={lane:je,tag:K.tag,payload:K.payload,callback:K.callback,next:null},ke===null?(we=ke=_e,ne=Ie):ke=ke.next=_e,L|=je;if(K=K.next,K===null){if(K=k.shared.pending,K===null)break;_e=K,K=_e.next,_e.next=null,k.lastBaseUpdate=_e,k.shared.pending=null}}while(!0);ke===null&&(ne=Ie),k.baseState=ne,k.firstBaseUpdate=we,k.lastBaseUpdate=ke,O===null&&(k.shared.lanes=0),Nu|=L,c.lanes=L,c.memoizedState=Ie}}function CA(c,d){if(typeof c!="function")throw Error(r(191,c));c.call(d)}function kA(c,d){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;c<g.length;c++)CA(g[c],d)}var Uf=V(null),Hb=V(0);function OA(c,d){c=Mc,W(Hb,c),W(Uf,d),Mc=c|d.baseLanes}function uj(){W(Hb,Mc),W(Uf,Uf.current)}function hj(){Mc=Hb.current,G(Uf),G(Hb)}var xa=V(null),to=null;function Au(c){var d=c.alternate;W(ni,ni.current&1),W(xa,c),to===null&&(d===null||Uf.current!==null||d.memoizedState!==null)&&(to=c)}function dj(c){W(ni,ni.current),W(xa,c),to===null&&(to=c)}function EA(c){c.tag===22?(W(ni,ni.current),W(xa,c),to===null&&(to=c)):Mu()}function Mu(){W(ni,ni.current),W(xa,xa.current)}function wa(c){G(xa),to===c&&(to=null),G(ni)}var ni=V(0);function Vb(c){for(var d=c;d!==null;){if(d.tag===13){var g=d.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||b_(g)||y_(g)))return d}else if(d.tag===19&&(d.memoizedProps.revealOrder==="forwards"||d.memoizedProps.revealOrder==="backwards"||d.memoizedProps.revealOrder==="unstable_legacy-backwards"||d.memoizedProps.revealOrder==="together")){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var jc=0,Gt=null,er=null,hi=null,Ub=!1,Qf=!1,vd=!1,Qb=0,_0=0,Wf=null,CQ=0;function Ur(){throw Error(r(321))}function fj(c,d){if(d===null)return!1;for(var g=0;g<d.length&&g<c.length;g++)if(!Bt(c[g],d[g]))return!1;return!0}function pj(c,d,g,y,k,O){return jc=O,Gt=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,P.H=c===null||c.memoizedState===null?dM:Ej,vd=!1,O=g(y,k),vd=!1,Qf&&(O=MA(d,g,y,k)),AA(c),O}function AA(c){P.H=k0;var d=er!==null&&er.next!==null;if(jc=0,hi=er=Gt=null,Ub=!1,_0=0,Wf=null,d)throw Error(r(300));c===null||di||(c=c.dependencies,c!==null&&Lb(c)&&(di=!0))}function MA(c,d,g,y){Gt=c;var k=0;do{if(Qf&&(Wf=null),_0=0,Qf=!1,25<=k)throw Error(r(301));if(k+=1,hi=er=null,c.updateQueue!=null){var O=c.updateQueue;O.lastEffect=null,O.events=null,O.stores=null,O.memoCache!=null&&(O.memoCache.index=0)}P.H=fM,O=d(g,y)}while(Qf);return O}function kQ(){var c=P.H,d=c.useState()[0];return d=typeof d.then=="function"?T0(d):d,c=c.useState()[0],(er!==null?er.memoizedState:null)!==c&&(Gt.flags|=1024),d}function mj(){var c=Qb!==0;return Qb=0,c}function gj(c,d,g){d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~g}function vj(c){if(Ub){for(c=c.memoizedState;c!==null;){var d=c.queue;d!==null&&(d.pending=null),c=c.next}Ub=!1}jc=0,hi=er=Gt=null,Qf=!1,_0=Qb=0,Wf=null}function Ns(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hi===null?Gt.memoizedState=hi=c:hi=hi.next=c,hi}function ri(){if(er===null){var c=Gt.alternate;c=c!==null?c.memoizedState:null}else c=er.next;var d=hi===null?Gt.memoizedState:hi.next;if(d!==null)hi=d,er=c;else{if(c===null)throw Gt.alternate===null?Error(r(467)):Error(r(310));er=c,c={memoizedState:er.memoizedState,baseState:er.baseState,baseQueue:er.baseQueue,queue:er.queue,next:null},hi===null?Gt.memoizedState=hi=c:hi=hi.next=c}return hi}function Wb(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function T0(c){var d=_0;return _0+=1,Wf===null&&(Wf=[]),c=wA(Wf,c,d),d=Gt,(hi===null?d.memoizedState:hi.next)===null&&(d=d.alternate,P.H=d===null||d.memoizedState===null?dM:Ej),c}function Yb(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return T0(c);if(c.$$typeof===T)return ts(c)}throw Error(r(438,String(c)))}function bj(c){var d=null,g=Gt.updateQueue;if(g!==null&&(d=g.memoCache),d==null){var y=Gt.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(d={data:y.data.map(function(k){return k.slice()}),index:0})))}if(d==null&&(d={data:[],index:0}),g===null&&(g=Wb(),Gt.updateQueue=g),g.memoCache=d,g=d.data[d.index],g===void 0)for(g=d.data[d.index]=Array(c),y=0;y<c;y++)g[y]=$;return d.index++,g}function _c(c,d){return typeof d=="function"?d(c):d}function Xb(c){var d=ri();return yj(d,er,c)}function yj(c,d,g){var y=c.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=g;var k=c.baseQueue,O=y.pending;if(O!==null){if(k!==null){var L=k.next;k.next=O.next,O.next=L}d.baseQueue=k=O,y.pending=null}if(O=c.baseState,k===null)c.memoizedState=O;else{d=k.next;var K=L=null,ne=null,we=d,ke=!1;do{var Ie=we.lane&-536870913;if(Ie!==we.lane?(fn&Ie)===Ie:(jc&Ie)===Ie){var je=we.revertLane;if(je===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null}),Ie===qf&&(ke=!0);else if((jc&je)===je){we=we.next,je===qf&&(ke=!0);continue}else Ie={lane:0,revertLane:we.revertLane,gesture:null,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null},ne===null?(K=ne=Ie,L=O):ne=ne.next=Ie,Gt.lanes|=je,Nu|=je;Ie=we.action,vd&&g(O,Ie),O=we.hasEagerState?we.eagerState:g(O,Ie)}else je={lane:Ie,revertLane:we.revertLane,gesture:we.gesture,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null},ne===null?(K=ne=je,L=O):ne=ne.next=je,Gt.lanes|=Ie,Nu|=Ie;we=we.next}while(we!==null&&we!==d);if(ne===null?L=O:ne.next=K,!Bt(O,c.memoizedState)&&(di=!0,ke&&(g=Ff,g!==null)))throw g;c.memoizedState=O,c.baseState=L,c.baseQueue=ne,y.lastRenderedState=O}return k===null&&(y.lanes=0),[c.memoizedState,y.dispatch]}function xj(c){var d=ri(),g=d.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=c;var y=g.dispatch,k=g.pending,O=d.memoizedState;if(k!==null){g.pending=null;var L=k=k.next;do O=c(O,L.action),L=L.next;while(L!==k);Bt(O,d.memoizedState)||(di=!0),d.memoizedState=O,d.baseQueue===null&&(d.baseState=O),g.lastRenderedState=O}return[O,y]}function RA(c,d,g){var y=Gt,k=ri(),O=vn;if(O){if(g===void 0)throw Error(r(407));g=g()}else g=d();var L=!Bt((er||k).memoizedState,g);if(L&&(k.memoizedState=g,di=!0),k=k.queue,jj(PA.bind(null,y,k,c),[c]),k.getSnapshot!==d||L||hi!==null&&hi.memoizedState.tag&1){if(y.flags|=2048,Yf(9,{destroy:void 0},NA.bind(null,y,k,g,d),null),sr===null)throw Error(r(349));O||(jc&127)!==0||DA(y,d,g)}return g}function DA(c,d,g){c.flags|=16384,c={getSnapshot:d,value:g},d=Gt.updateQueue,d===null?(d=Wb(),Gt.updateQueue=d,d.stores=[c]):(g=d.stores,g===null?d.stores=[c]:g.push(c))}function NA(c,d,g,y){d.value=g,d.getSnapshot=y,LA(d)&&$A(c)}function PA(c,d,g){return g(function(){LA(d)&&$A(c)})}function LA(c){var d=c.getSnapshot;c=c.value;try{var g=d();return!Bt(c,g)}catch{return!0}}function $A(c){var d=ld(c,2);d!==null&&ra(d,c,2)}function wj(c){var d=Ns();if(typeof c=="function"){var g=c;if(c=g(),vd){Pt(!0);try{g()}finally{Pt(!1)}}}return d.memoizedState=d.baseState=c,d.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_c,lastRenderedState:c},d}function IA(c,d,g,y){return c.baseState=g,yj(c,er,typeof y=="function"?y:_c)}function OQ(c,d,g,y,k){if(Zb(c))throw Error(r(485));if(c=d.action,c!==null){var O={payload:k,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){O.listeners.push(L)}};P.T!==null?g(!0):O.isTransition=!1,y(O),g=d.pending,g===null?(O.next=d.pending=O,BA(d,O)):(O.next=g.next,d.pending=g.next=O)}}function BA(c,d){var g=d.action,y=d.payload,k=c.state;if(d.isTransition){var O=P.T,L={};P.T=L;try{var K=g(k,y),ne=P.S;ne!==null&&ne(L,K),zA(c,d,K)}catch(we){Sj(c,d,we)}finally{O!==null&&L.types!==null&&(O.types=L.types),P.T=O}}else try{O=g(k,y),zA(c,d,O)}catch(we){Sj(c,d,we)}}function zA(c,d,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(y){qA(c,d,y)},function(y){return Sj(c,d,y)}):qA(c,d,g)}function qA(c,d,g){d.status="fulfilled",d.value=g,FA(d),c.state=g,d=c.pending,d!==null&&(g=d.next,g===d?c.pending=null:(g=g.next,d.next=g,BA(c,g)))}function Sj(c,d,g){var y=c.pending;if(c.pending=null,y!==null){y=y.next;do d.status="rejected",d.reason=g,FA(d),d=d.next;while(d!==y)}c.action=null}function FA(c){c=c.listeners;for(var d=0;d<c.length;d++)(0,c[d])()}function HA(c,d){return d}function VA(c,d){if(vn){var g=sr.formState;if(g!==null){e:{var y=Gt;if(vn){if(xr){t:{for(var k=xr,O=eo;k.nodeType!==8;){if(!O){k=null;break t}if(k=no(k.nextSibling),k===null){k=null;break t}}O=k.data,k=O==="F!"||O==="F"?k:null}if(k){xr=no(k.nextSibling),y=k.data==="F!";break e}}Tu(y)}y=!1}y&&(d=g[0])}}return g=Ns(),g.memoizedState=g.baseState=d,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:HA,lastRenderedState:d},g.queue=y,g=cM.bind(null,Gt,y),y.dispatch=g,y=wj(!1),O=Oj.bind(null,Gt,!1,y.queue),y=Ns(),k={state:d,dispatch:null,action:c,pending:null},y.queue=k,g=OQ.bind(null,Gt,k,O,g),k.dispatch=g,y.memoizedState=c,[d,g,!1]}function UA(c){var d=ri();return QA(d,er,c)}function QA(c,d,g){if(d=yj(c,d,HA)[0],c=Xb(_c)[0],typeof d=="object"&&d!==null&&typeof d.then=="function")try{var y=T0(d)}catch(L){throw L===Hf?Bb:L}else y=d;d=ri();var k=d.queue,O=k.dispatch;return g!==d.memoizedState&&(Gt.flags|=2048,Yf(9,{destroy:void 0},EQ.bind(null,k,g),null)),[y,O,c]}function EQ(c,d){c.action=d}function WA(c){var d=ri(),g=er;if(g!==null)return QA(d,g,c);ri(),d=d.memoizedState,g=ri();var y=g.queue.dispatch;return g.memoizedState=c,[d,y,!1]}function Yf(c,d,g,y){return c={tag:c,create:g,deps:y,inst:d,next:null},d=Gt.updateQueue,d===null&&(d=Wb(),Gt.updateQueue=d),g=d.lastEffect,g===null?d.lastEffect=c.next=c:(y=g.next,g.next=c,c.next=y,d.lastEffect=c),c}function YA(){return ri().memoizedState}function Gb(c,d,g,y){var k=Ns();Gt.flags|=c,k.memoizedState=Yf(1|d,{destroy:void 0},g,y===void 0?null:y)}function Kb(c,d,g,y){var k=ri();y=y===void 0?null:y;var O=k.memoizedState.inst;er!==null&&y!==null&&fj(y,er.memoizedState.deps)?k.memoizedState=Yf(d,O,g,y):(Gt.flags|=c,k.memoizedState=Yf(1|d,O,g,y))}function XA(c,d){Gb(8390656,8,c,d)}function jj(c,d){Kb(2048,8,c,d)}function AQ(c){Gt.flags|=4;var d=Gt.updateQueue;if(d===null)d=Wb(),Gt.updateQueue=d,d.events=[c];else{var g=d.events;g===null?d.events=[c]:g.push(c)}}function GA(c){var d=ri().memoizedState;return AQ({ref:d,nextImpl:c}),function(){if((Nn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}function KA(c,d){return Kb(4,2,c,d)}function ZA(c,d){return Kb(4,4,c,d)}function JA(c,d){if(typeof d=="function"){c=c();var g=d(c);return function(){typeof g=="function"?g():d(null)}}if(d!=null)return c=c(),d.current=c,function(){d.current=null}}function eM(c,d,g){g=g!=null?g.concat([c]):null,Kb(4,4,JA.bind(null,d,c),g)}function _j(){}function tM(c,d){var g=ri();d=d===void 0?null:d;var y=g.memoizedState;return d!==null&&fj(d,y[1])?y[0]:(g.memoizedState=[c,d],c)}function nM(c,d){var g=ri();d=d===void 0?null:d;var y=g.memoizedState;if(d!==null&&fj(d,y[1]))return y[0];if(y=c(),vd){Pt(!0);try{c()}finally{Pt(!1)}}return g.memoizedState=[y,d],y}function Tj(c,d,g){return g===void 0||(jc&1073741824)!==0&&(fn&261930)===0?c.memoizedState=d:(c.memoizedState=g,c=r8(),Gt.lanes|=c,Nu|=c,g)}function rM(c,d,g,y){return Bt(g,d)?g:Uf.current!==null?(c=Tj(c,g,y),Bt(c,d)||(di=!0),c):(jc&42)===0||(jc&1073741824)!==0&&(fn&261930)===0?(di=!0,c.memoizedState=g):(c=r8(),Gt.lanes|=c,Nu|=c,d)}function iM(c,d,g,y,k){var O=I.p;I.p=O!==0&&8>O?O:8;var L=P.T,K={};P.T=K,Oj(c,!1,d,g);try{var ne=k(),we=P.S;if(we!==null&&we(K,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var ke=TQ(ne,y);C0(c,d,ke,_a(c))}else C0(c,d,y,_a(c))}catch(Ie){C0(c,d,{then:function(){},status:"rejected",reason:Ie},_a())}finally{I.p=O,L!==null&&K.types!==null&&(L.types=K.types),P.T=L}}function MQ(){}function Cj(c,d,g,y){if(c.tag!==5)throw Error(r(476));var k=sM(c).queue;iM(c,k,d,U,g===null?MQ:function(){return aM(c),g(y)})}function sM(c){var d=c.memoizedState;if(d!==null)return d;d={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_c,lastRenderedState:U},next:null};var g={};return d.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_c,lastRenderedState:g},next:null},c.memoizedState=d,c=c.alternate,c!==null&&(c.memoizedState=d),d}function aM(c){var d=sM(c);d.next===null&&(d=c.alternate.memoizedState),C0(c,d.next.queue,{},_a())}function kj(){return ts(H0)}function oM(){return ri().memoizedState}function lM(){return ri().memoizedState}function RQ(c){for(var d=c.return;d!==null;){switch(d.tag){case 24:case 3:var g=_a();c=Ou(g);var y=Eu(d,c,g);y!==null&&(ra(y,d,g),w0(y,d,g)),d={cache:nj()},c.payload=d;return}d=d.return}}function DQ(c,d,g){var y=_a();g={lane:y,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Zb(c)?uM(d,g):(g=US(c,d,g,y),g!==null&&(ra(g,c,y),hM(g,d,y)))}function cM(c,d,g){var y=_a();C0(c,d,g,y)}function C0(c,d,g,y){var k={lane:y,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Zb(c))uM(d,k);else{var O=c.alternate;if(c.lanes===0&&(O===null||O.lanes===0)&&(O=d.lastRenderedReducer,O!==null))try{var L=d.lastRenderedState,K=O(L,g);if(k.hasEagerState=!0,k.eagerState=K,Bt(K,L))return Rb(c,d,k,0),sr===null&&Mb(),!1}catch{}finally{}if(g=US(c,d,k,y),g!==null)return ra(g,c,y),hM(g,d,y),!0}return!1}function Oj(c,d,g,y){if(y={lane:2,revertLane:a_(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},Zb(c)){if(d)throw Error(r(479))}else d=US(c,g,y,2),d!==null&&ra(d,c,2)}function Zb(c){var d=c.alternate;return c===Gt||d!==null&&d===Gt}function uM(c,d){Qf=Ub=!0;var g=c.pending;g===null?d.next=d:(d.next=g.next,g.next=d),c.pending=d}function hM(c,d,g){if((g&4194048)!==0){var y=d.lanes;y&=c.pendingLanes,g|=y,d.lanes=g,Ze(c,g)}}var k0={readContext:ts,use:Yb,useCallback:Ur,useContext:Ur,useEffect:Ur,useImperativeHandle:Ur,useLayoutEffect:Ur,useInsertionEffect:Ur,useMemo:Ur,useReducer:Ur,useRef:Ur,useState:Ur,useDebugValue:Ur,useDeferredValue:Ur,useTransition:Ur,useSyncExternalStore:Ur,useId:Ur,useHostTransitionStatus:Ur,useFormState:Ur,useActionState:Ur,useOptimistic:Ur,useMemoCache:Ur,useCacheRefresh:Ur};k0.useEffectEvent=Ur;var dM={readContext:ts,use:Yb,useCallback:function(c,d){return Ns().memoizedState=[c,d===void 0?null:d],c},useContext:ts,useEffect:XA,useImperativeHandle:function(c,d,g){g=g!=null?g.concat([c]):null,Gb(4194308,4,JA.bind(null,d,c),g)},useLayoutEffect:function(c,d){return Gb(4194308,4,c,d)},useInsertionEffect:function(c,d){Gb(4,2,c,d)},useMemo:function(c,d){var g=Ns();d=d===void 0?null:d;var y=c();if(vd){Pt(!0);try{c()}finally{Pt(!1)}}return g.memoizedState=[y,d],y},useReducer:function(c,d,g){var y=Ns();if(g!==void 0){var k=g(d);if(vd){Pt(!0);try{g(d)}finally{Pt(!1)}}}else k=d;return y.memoizedState=y.baseState=k,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:k},y.queue=c,c=c.dispatch=DQ.bind(null,Gt,c),[y.memoizedState,c]},useRef:function(c){var d=Ns();return c={current:c},d.memoizedState=c},useState:function(c){c=wj(c);var d=c.queue,g=cM.bind(null,Gt,d);return d.dispatch=g,[c.memoizedState,g]},useDebugValue:_j,useDeferredValue:function(c,d){var g=Ns();return Tj(g,c,d)},useTransition:function(){var c=wj(!1);return c=iM.bind(null,Gt,c.queue,!0,!1),Ns().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,d,g){var y=Gt,k=Ns();if(vn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=d(),sr===null)throw Error(r(349));(fn&127)!==0||DA(y,d,g)}k.memoizedState=g;var O={value:g,getSnapshot:d};return k.queue=O,XA(PA.bind(null,y,O,c),[c]),y.flags|=2048,Yf(9,{destroy:void 0},NA.bind(null,y,O,g,d),null),g},useId:function(){var c=Ns(),d=sr.identifierPrefix;if(vn){var g=Sl,y=wl;g=(y&~(1<<32-Wt(y)-1)).toString(32)+g,d="_"+d+"R_"+g,g=Qb++,0<g&&(d+="H"+g.toString(32)),d+="_"}else g=CQ++,d="_"+d+"r_"+g.toString(32)+"_";return c.memoizedState=d},useHostTransitionStatus:kj,useFormState:VA,useActionState:VA,useOptimistic:function(c){var d=Ns();d.memoizedState=d.baseState=c;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return d.queue=g,d=Oj.bind(null,Gt,!0,g),g.dispatch=d,[c,d]},useMemoCache:bj,useCacheRefresh:function(){return Ns().memoizedState=RQ.bind(null,Gt)},useEffectEvent:function(c){var d=Ns(),g={impl:c};return d.memoizedState=g,function(){if((Nn&2)!==0)throw Error(r(440));return g.impl.apply(void 0,arguments)}}},Ej={readContext:ts,use:Yb,useCallback:tM,useContext:ts,useEffect:jj,useImperativeHandle:eM,useInsertionEffect:KA,useLayoutEffect:ZA,useMemo:nM,useReducer:Xb,useRef:YA,useState:function(){return Xb(_c)},useDebugValue:_j,useDeferredValue:function(c,d){var g=ri();return rM(g,er.memoizedState,c,d)},useTransition:function(){var c=Xb(_c)[0],d=ri().memoizedState;return[typeof c=="boolean"?c:T0(c),d]},useSyncExternalStore:RA,useId:oM,useHostTransitionStatus:kj,useFormState:UA,useActionState:UA,useOptimistic:function(c,d){var g=ri();return IA(g,er,c,d)},useMemoCache:bj,useCacheRefresh:lM};Ej.useEffectEvent=GA;var fM={readContext:ts,use:Yb,useCallback:tM,useContext:ts,useEffect:jj,useImperativeHandle:eM,useInsertionEffect:KA,useLayoutEffect:ZA,useMemo:nM,useReducer:xj,useRef:YA,useState:function(){return xj(_c)},useDebugValue:_j,useDeferredValue:function(c,d){var g=ri();return er===null?Tj(g,c,d):rM(g,er.memoizedState,c,d)},useTransition:function(){var c=xj(_c)[0],d=ri().memoizedState;return[typeof c=="boolean"?c:T0(c),d]},useSyncExternalStore:RA,useId:oM,useHostTransitionStatus:kj,useFormState:WA,useActionState:WA,useOptimistic:function(c,d){var g=ri();return er!==null?IA(g,er,c,d):(g.baseState=c,[c,g.queue.dispatch])},useMemoCache:bj,useCacheRefresh:lM};fM.useEffectEvent=GA;function Aj(c,d,g,y){d=c.memoizedState,g=g(y,d),g=g==null?d:p({},d,g),c.memoizedState=g,c.lanes===0&&(c.updateQueue.baseState=g)}var Mj={enqueueSetState:function(c,d,g){c=c._reactInternals;var y=_a(),k=Ou(y);k.payload=d,g!=null&&(k.callback=g),d=Eu(c,k,y),d!==null&&(ra(d,c,y),w0(d,c,y))},enqueueReplaceState:function(c,d,g){c=c._reactInternals;var y=_a(),k=Ou(y);k.tag=1,k.payload=d,g!=null&&(k.callback=g),d=Eu(c,k,y),d!==null&&(ra(d,c,y),w0(d,c,y))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var g=_a(),y=Ou(g);y.tag=2,d!=null&&(y.callback=d),d=Eu(c,y,g),d!==null&&(ra(d,c,g),w0(d,c,g))}};function pM(c,d,g,y,k,O,L){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(y,O,L):d.prototype&&d.prototype.isPureReactComponent?!Qt(g,y)||!Qt(k,O):!0}function mM(c,d,g,y){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(g,y),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(g,y),d.state!==c&&Mj.enqueueReplaceState(d,d.state,null)}function bd(c,d){var g=d;if("ref"in d){g={};for(var y in d)y!=="ref"&&(g[y]=d[y])}if(c=c.defaultProps){g===d&&(g=p({},g));for(var k in c)g[k]===void 0&&(g[k]=c[k])}return g}function gM(c){Ab(c)}function vM(c){console.error(c)}function bM(c){Ab(c)}function Jb(c,d){try{var g=c.onUncaughtError;g(d.value,{componentStack:d.stack})}catch(y){setTimeout(function(){throw y})}}function yM(c,d,g){try{var y=c.onCaughtError;y(g.value,{componentStack:g.stack,errorBoundary:d.tag===1?d.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function Rj(c,d,g){return g=Ou(g),g.tag=3,g.payload={element:null},g.callback=function(){Jb(c,d)},g}function xM(c){return c=Ou(c),c.tag=3,c}function wM(c,d,g,y){var k=g.type.getDerivedStateFromError;if(typeof k=="function"){var O=y.value;c.payload=function(){return k(O)},c.callback=function(){yM(d,g,y)}}var L=g.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(c.callback=function(){yM(d,g,y),typeof k!="function"&&(Pu===null?Pu=new Set([this]):Pu.add(this));var K=y.stack;this.componentDidCatch(y.value,{componentStack:K!==null?K:""})})}function NQ(c,d,g,y,k){if(g.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(d=g.alternate,d!==null&&zf(d,g,k,!0),g=xa.current,g!==null){switch(g.tag){case 31:case 13:return to===null?hy():g.alternate===null&&Qr===0&&(Qr=3),g.flags&=-257,g.flags|=65536,g.lanes=k,y===zb?g.flags|=16384:(d=g.updateQueue,d===null?g.updateQueue=new Set([y]):d.add(y),r_(c,y,k)),!1;case 22:return g.flags|=65536,y===zb?g.flags|=16384:(d=g.updateQueue,d===null?(d={transitions:null,markerInstances:null,retryQueue:new Set([y])},g.updateQueue=d):(g=d.retryQueue,g===null?d.retryQueue=new Set([y]):g.add(y)),r_(c,y,k)),!1}throw Error(r(435,g.tag))}return r_(c,y,k),hy(),!1}if(vn)return d=xa.current,d!==null?((d.flags&65536)===0&&(d.flags|=256),d.flags|=65536,d.lanes=k,y!==KS&&(c=Error(r(422),{cause:y}),g0(Ka(c,g)))):(y!==KS&&(d=Error(r(423),{cause:y}),g0(Ka(d,g))),c=c.current.alternate,c.flags|=65536,k&=-k,c.lanes|=k,y=Ka(y,g),k=Rj(c.stateNode,y,k),lj(c,k),Qr!==4&&(Qr=2)),!1;var O=Error(r(520),{cause:y});if(O=Ka(O,g),P0===null?P0=[O]:P0.push(O),Qr!==4&&(Qr=2),d===null)return!0;y=Ka(y,g),g=d;do{switch(g.tag){case 3:return g.flags|=65536,c=k&-k,g.lanes|=c,c=Rj(g.stateNode,y,c),lj(g,c),!1;case 1:if(d=g.type,O=g.stateNode,(g.flags&128)===0&&(typeof d.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Pu===null||!Pu.has(O))))return g.flags|=65536,k&=-k,g.lanes|=k,k=xM(k),wM(k,c,g,y),lj(g,k),!1}g=g.return}while(g!==null);return!1}var Dj=Error(r(461)),di=!1;function ns(c,d,g,y){d.child=c===null?TA(d,null,g,y):gd(d,c.child,g,y)}function SM(c,d,g,y,k){g=g.render;var O=d.ref;if("ref"in y){var L={};for(var K in y)K!=="ref"&&(L[K]=y[K])}else L=y;return dd(d),y=pj(c,d,g,L,O,k),K=mj(),c!==null&&!di?(gj(c,d,k),Tc(c,d,k)):(vn&&K&&XS(d),d.flags|=1,ns(c,d,y,k),d.child)}function jM(c,d,g,y,k){if(c===null){var O=g.type;return typeof O=="function"&&!QS(O)&&O.defaultProps===void 0&&g.compare===null?(d.tag=15,d.type=O,_M(c,d,O,y,k)):(c=Nb(g.type,null,y,d,d.mode,k),c.ref=d.ref,c.return=d,d.child=c)}if(O=c.child,!qj(c,k)){var L=O.memoizedProps;if(g=g.compare,g=g!==null?g:Qt,g(L,y)&&c.ref===d.ref)return Tc(c,d,k)}return d.flags|=1,c=yc(O,y),c.ref=d.ref,c.return=d,d.child=c}function _M(c,d,g,y,k){if(c!==null){var O=c.memoizedProps;if(Qt(O,y)&&c.ref===d.ref)if(di=!1,d.pendingProps=y=O,qj(c,k))(c.flags&131072)!==0&&(di=!0);else return d.lanes=c.lanes,Tc(c,d,k)}return Nj(c,d,g,y,k)}function TM(c,d,g,y){var k=y.children,O=c!==null?c.memoizedState:null;if(c===null&&d.stateNode===null&&(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((d.flags&128)!==0){if(O=O!==null?O.baseLanes|g:g,c!==null){for(y=d.child=c.child,k=0;y!==null;)k=k|y.lanes|y.childLanes,y=y.sibling;y=k&~O}else y=0,d.child=null;return CM(c,d,O,g,y)}if((g&536870912)!==0)d.memoizedState={baseLanes:0,cachePool:null},c!==null&&Ib(d,O!==null?O.cachePool:null),O!==null?OA(d,O):uj(),EA(d);else return y=d.lanes=536870912,CM(c,d,O!==null?O.baseLanes|g:g,g,y)}else O!==null?(Ib(d,O.cachePool),OA(d,O),Mu(),d.memoizedState=null):(c!==null&&Ib(d,null),uj(),Mu());return ns(c,d,k,g),d.child}function O0(c,d){return c!==null&&c.tag===22||d.stateNode!==null||(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.sibling}function CM(c,d,g,y,k){var O=ij();return O=O===null?null:{parent:ui._currentValue,pool:O},d.memoizedState={baseLanes:g,cachePool:O},c!==null&&Ib(d,null),uj(),EA(d),c!==null&&zf(c,d,y,!0),d.childLanes=k,null}function ey(c,d){return d=ny({mode:d.mode,children:d.children},c.mode),d.ref=c.ref,c.child=d,d.return=c,d}function kM(c,d,g){return gd(d,c.child,null,g),c=ey(d,d.pendingProps),c.flags|=2,wa(d),d.memoizedState=null,c}function PQ(c,d,g){var y=d.pendingProps,k=(d.flags&128)!==0;if(d.flags&=-129,c===null){if(vn){if(y.mode==="hidden")return c=ey(d,y),d.lanes=536870912,O0(null,c);if(dj(d),(c=xr)?(c=B8(c,eo),c=c!==null&&c.data==="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:ju!==null?{id:wl,overflow:Sl}:null,retryLane:536870912,hydrationErrors:null},g=uA(c),g.return=d,d.child=g,es=d,xr=null)):c=null,c===null)throw Tu(d);return d.lanes=536870912,null}return ey(d,y)}var O=c.memoizedState;if(O!==null){var L=O.dehydrated;if(dj(d),k)if(d.flags&256)d.flags&=-257,d=kM(c,d,g);else if(d.memoizedState!==null)d.child=c.child,d.flags|=128,d=null;else throw Error(r(558));else if(di||zf(c,d,g,!1),k=(g&c.childLanes)!==0,di||k){if(y=sr,y!==null&&(L=Ht(y,g),L!==0&&L!==O.retryLane))throw O.retryLane=L,ld(c,L),ra(y,c,L),Dj;hy(),d=kM(c,d,g)}else c=O.treeContext,xr=no(L.nextSibling),es=d,vn=!0,_u=null,eo=!1,c!==null&&fA(d,c),d=ey(d,y),d.flags|=4096;return d}return c=yc(c.child,{mode:y.mode,children:y.children}),c.ref=d.ref,d.child=c,c.return=d,c}function ty(c,d){var g=d.ref;if(g===null)c!==null&&c.ref!==null&&(d.flags|=4194816);else{if(typeof g!="function"&&typeof g!="object")throw Error(r(284));(c===null||c.ref!==g)&&(d.flags|=4194816)}}function Nj(c,d,g,y,k){return dd(d),g=pj(c,d,g,y,void 0,k),y=mj(),c!==null&&!di?(gj(c,d,k),Tc(c,d,k)):(vn&&y&&XS(d),d.flags|=1,ns(c,d,g,k),d.child)}function OM(c,d,g,y,k,O){return dd(d),d.updateQueue=null,g=MA(d,y,g,k),AA(c),y=mj(),c!==null&&!di?(gj(c,d,O),Tc(c,d,O)):(vn&&y&&XS(d),d.flags|=1,ns(c,d,g,O),d.child)}function EM(c,d,g,y,k){if(dd(d),d.stateNode===null){var O=Lf,L=g.contextType;typeof L=="object"&&L!==null&&(O=ts(L)),O=new g(y,O),d.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=Mj,d.stateNode=O,O._reactInternals=d,O=d.stateNode,O.props=y,O.state=d.memoizedState,O.refs={},aj(d),L=g.contextType,O.context=typeof L=="object"&&L!==null?ts(L):Lf,O.state=d.memoizedState,L=g.getDerivedStateFromProps,typeof L=="function"&&(Aj(d,g,L,y),O.state=d.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(L=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),L!==O.state&&Mj.enqueueReplaceState(O,O.state,null),j0(d,y,O,k),S0(),O.state=d.memoizedState),typeof O.componentDidMount=="function"&&(d.flags|=4194308),y=!0}else if(c===null){O=d.stateNode;var K=d.memoizedProps,ne=bd(g,K);O.props=ne;var we=O.context,ke=g.contextType;L=Lf,typeof ke=="object"&&ke!==null&&(L=ts(ke));var Ie=g.getDerivedStateFromProps;ke=typeof Ie=="function"||typeof O.getSnapshotBeforeUpdate=="function",K=d.pendingProps!==K,ke||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(K||we!==L)&&mM(d,O,y,L),ku=!1;var je=d.memoizedState;O.state=je,j0(d,y,O,k),S0(),we=d.memoizedState,K||je!==we||ku?(typeof Ie=="function"&&(Aj(d,g,Ie,y),we=d.memoizedState),(ne=ku||pM(d,g,ne,y,je,we,L))?(ke||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(d.flags|=4194308)):(typeof O.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=y,d.memoizedState=we),O.props=y,O.state=we,O.context=L,y=ne):(typeof O.componentDidMount=="function"&&(d.flags|=4194308),y=!1)}else{O=d.stateNode,oj(c,d),L=d.memoizedProps,ke=bd(g,L),O.props=ke,Ie=d.pendingProps,je=O.context,we=g.contextType,ne=Lf,typeof we=="object"&&we!==null&&(ne=ts(we)),K=g.getDerivedStateFromProps,(we=typeof K=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(L!==Ie||je!==ne)&&mM(d,O,y,ne),ku=!1,je=d.memoizedState,O.state=je,j0(d,y,O,k),S0();var _e=d.memoizedState;L!==Ie||je!==_e||ku||c!==null&&c.dependencies!==null&&Lb(c.dependencies)?(typeof K=="function"&&(Aj(d,g,K,y),_e=d.memoizedState),(ke=ku||pM(d,g,ke,y,je,_e,ne)||c!==null&&c.dependencies!==null&&Lb(c.dependencies))?(we||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(y,_e,ne),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(y,_e,ne)),typeof O.componentDidUpdate=="function"&&(d.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof O.componentDidUpdate!="function"||L===c.memoizedProps&&je===c.memoizedState||(d.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||L===c.memoizedProps&&je===c.memoizedState||(d.flags|=1024),d.memoizedProps=y,d.memoizedState=_e),O.props=y,O.state=_e,O.context=ne,y=ke):(typeof O.componentDidUpdate!="function"||L===c.memoizedProps&&je===c.memoizedState||(d.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||L===c.memoizedProps&&je===c.memoizedState||(d.flags|=1024),y=!1)}return O=y,ty(c,d),y=(d.flags&128)!==0,O||y?(O=d.stateNode,g=y&&typeof g.getDerivedStateFromError!="function"?null:O.render(),d.flags|=1,c!==null&&y?(d.child=gd(d,c.child,null,k),d.child=gd(d,null,g,k)):ns(c,d,g,k),d.memoizedState=O.state,c=d.child):c=Tc(c,d,k),c}function AM(c,d,g,y){return ud(),d.flags|=256,ns(c,d,g,y),d.child}var Pj={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lj(c){return{baseLanes:c,cachePool:yA()}}function $j(c,d,g){return c=c!==null?c.childLanes&~g:0,d&&(c|=ja),c}function MM(c,d,g){var y=d.pendingProps,k=!1,O=(d.flags&128)!==0,L;if((L=O)||(L=c!==null&&c.memoizedState===null?!1:(ni.current&2)!==0),L&&(k=!0,d.flags&=-129),L=(d.flags&32)!==0,d.flags&=-33,c===null){if(vn){if(k?Au(d):Mu(),(c=xr)?(c=B8(c,eo),c=c!==null&&c.data!=="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:ju!==null?{id:wl,overflow:Sl}:null,retryLane:536870912,hydrationErrors:null},g=uA(c),g.return=d,d.child=g,es=d,xr=null)):c=null,c===null)throw Tu(d);return y_(c)?d.lanes=32:d.lanes=536870912,null}var K=y.children;return y=y.fallback,k?(Mu(),k=d.mode,K=ny({mode:"hidden",children:K},k),y=cd(y,k,g,null),K.return=d,y.return=d,K.sibling=y,d.child=K,y=d.child,y.memoizedState=Lj(g),y.childLanes=$j(c,L,g),d.memoizedState=Pj,O0(null,y)):(Au(d),Ij(d,K))}var ne=c.memoizedState;if(ne!==null&&(K=ne.dehydrated,K!==null)){if(O)d.flags&256?(Au(d),d.flags&=-257,d=Bj(c,d,g)):d.memoizedState!==null?(Mu(),d.child=c.child,d.flags|=128,d=null):(Mu(),K=y.fallback,k=d.mode,y=ny({mode:"visible",children:y.children},k),K=cd(K,k,g,null),K.flags|=2,y.return=d,K.return=d,y.sibling=K,d.child=y,gd(d,c.child,null,g),y=d.child,y.memoizedState=Lj(g),y.childLanes=$j(c,L,g),d.memoizedState=Pj,d=O0(null,y));else if(Au(d),y_(K)){if(L=K.nextSibling&&K.nextSibling.dataset,L)var we=L.dgst;L=we,y=Error(r(419)),y.stack="",y.digest=L,g0({value:y,source:null,stack:null}),d=Bj(c,d,g)}else if(di||zf(c,d,g,!1),L=(g&c.childLanes)!==0,di||L){if(L=sr,L!==null&&(y=Ht(L,g),y!==0&&y!==ne.retryLane))throw ne.retryLane=y,ld(c,y),ra(L,c,y),Dj;b_(K)||hy(),d=Bj(c,d,g)}else b_(K)?(d.flags|=192,d.child=c.child,d=null):(c=ne.treeContext,xr=no(K.nextSibling),es=d,vn=!0,_u=null,eo=!1,c!==null&&fA(d,c),d=Ij(d,y.children),d.flags|=4096);return d}return k?(Mu(),K=y.fallback,k=d.mode,ne=c.child,we=ne.sibling,y=yc(ne,{mode:"hidden",children:y.children}),y.subtreeFlags=ne.subtreeFlags&65011712,we!==null?K=yc(we,K):(K=cd(K,k,g,null),K.flags|=2),K.return=d,y.return=d,y.sibling=K,d.child=y,O0(null,y),y=d.child,K=c.child.memoizedState,K===null?K=Lj(g):(k=K.cachePool,k!==null?(ne=ui._currentValue,k=k.parent!==ne?{parent:ne,pool:ne}:k):k=yA(),K={baseLanes:K.baseLanes|g,cachePool:k}),y.memoizedState=K,y.childLanes=$j(c,L,g),d.memoizedState=Pj,O0(c.child,y)):(Au(d),g=c.child,c=g.sibling,g=yc(g,{mode:"visible",children:y.children}),g.return=d,g.sibling=null,c!==null&&(L=d.deletions,L===null?(d.deletions=[c],d.flags|=16):L.push(c)),d.child=g,d.memoizedState=null,g)}function Ij(c,d){return d=ny({mode:"visible",children:d},c.mode),d.return=c,c.child=d}function ny(c,d){return c=ya(22,c,null,d),c.lanes=0,c}function Bj(c,d,g){return gd(d,c.child,null,g),c=Ij(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function RM(c,d,g){c.lanes|=d;var y=c.alternate;y!==null&&(y.lanes|=d),ej(c.return,d,g)}function zj(c,d,g,y,k,O){var L=c.memoizedState;L===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:y,tail:g,tailMode:k,treeForkCount:O}:(L.isBackwards=d,L.rendering=null,L.renderingStartTime=0,L.last=y,L.tail=g,L.tailMode=k,L.treeForkCount=O)}function DM(c,d,g){var y=d.pendingProps,k=y.revealOrder,O=y.tail;y=y.children;var L=ni.current,K=(L&2)!==0;if(K?(L=L&1|2,d.flags|=128):L&=1,W(ni,L),ns(c,d,y,g),y=vn?m0:0,!K&&c!==null&&(c.flags&128)!==0)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&RM(c,g,d);else if(c.tag===19)RM(c,g,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}switch(k){case"forwards":for(g=d.child,k=null;g!==null;)c=g.alternate,c!==null&&Vb(c)===null&&(k=g),g=g.sibling;g=k,g===null?(k=d.child,d.child=null):(k=g.sibling,g.sibling=null),zj(d,!1,k,g,O,y);break;case"backwards":case"unstable_legacy-backwards":for(g=null,k=d.child,d.child=null;k!==null;){if(c=k.alternate,c!==null&&Vb(c)===null){d.child=k;break}c=k.sibling,k.sibling=g,g=k,k=c}zj(d,!0,g,null,O,y);break;case"together":zj(d,!1,null,null,void 0,y);break;default:d.memoizedState=null}return d.child}function Tc(c,d,g){if(c!==null&&(d.dependencies=c.dependencies),Nu|=d.lanes,(g&d.childLanes)===0)if(c!==null){if(zf(c,d,g,!1),(g&d.childLanes)===0)return null}else return null;if(c!==null&&d.child!==c.child)throw Error(r(153));if(d.child!==null){for(c=d.child,g=yc(c,c.pendingProps),d.child=g,g.return=d;c.sibling!==null;)c=c.sibling,g=g.sibling=yc(c,c.pendingProps),g.return=d;g.sibling=null}return d.child}function qj(c,d){return(c.lanes&d)!==0?!0:(c=c.dependencies,!!(c!==null&&Lb(c)))}function LQ(c,d,g){switch(d.tag){case 3:Ke(d,d.stateNode.containerInfo),Cu(d,ui,c.memoizedState.cache),ud();break;case 27:case 5:Pe(d);break;case 4:Ke(d,d.stateNode.containerInfo);break;case 10:Cu(d,d.type,d.memoizedProps.value);break;case 31:if(d.memoizedState!==null)return d.flags|=128,dj(d),null;break;case 13:var y=d.memoizedState;if(y!==null)return y.dehydrated!==null?(Au(d),d.flags|=128,null):(g&d.child.childLanes)!==0?MM(c,d,g):(Au(d),c=Tc(c,d,g),c!==null?c.sibling:null);Au(d);break;case 19:var k=(c.flags&128)!==0;if(y=(g&d.childLanes)!==0,y||(zf(c,d,g,!1),y=(g&d.childLanes)!==0),k){if(y)return DM(c,d,g);d.flags|=128}if(k=d.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),W(ni,ni.current),y)break;return null;case 22:return d.lanes=0,TM(c,d,g,d.pendingProps);case 24:Cu(d,ui,c.memoizedState.cache)}return Tc(c,d,g)}function NM(c,d,g){if(c!==null)if(c.memoizedProps!==d.pendingProps)di=!0;else{if(!qj(c,g)&&(d.flags&128)===0)return di=!1,LQ(c,d,g);di=(c.flags&131072)!==0}else di=!1,vn&&(d.flags&1048576)!==0&&dA(d,m0,d.index);switch(d.lanes=0,d.tag){case 16:e:{var y=d.pendingProps;if(c=pd(d.elementType),d.type=c,typeof c=="function")QS(c)?(y=bd(c,y),d.tag=1,d=EM(null,d,c,y,g)):(d.tag=0,d=Nj(null,d,c,y,g));else{if(c!=null){var k=c.$$typeof;if(k===C){d.tag=11,d=SM(null,d,c,y,g);break e}else if(k===E){d.tag=14,d=jM(null,d,c,y,g);break e}}throw d=H(c)||c,Error(r(306,d,""))}}return d;case 0:return Nj(c,d,d.type,d.pendingProps,g);case 1:return y=d.type,k=bd(y,d.pendingProps),EM(c,d,y,k,g);case 3:e:{if(Ke(d,d.stateNode.containerInfo),c===null)throw Error(r(387));y=d.pendingProps;var O=d.memoizedState;k=O.element,oj(c,d),j0(d,y,null,g);var L=d.memoizedState;if(y=L.cache,Cu(d,ui,y),y!==O.cache&&tj(d,[ui],g,!0),S0(),y=L.element,O.isDehydrated)if(O={element:y,isDehydrated:!1,cache:L.cache},d.updateQueue.baseState=O,d.memoizedState=O,d.flags&256){d=AM(c,d,y,g);break e}else if(y!==k){k=Ka(Error(r(424)),d),g0(k),d=AM(c,d,y,g);break e}else{switch(c=d.stateNode.containerInfo,c.nodeType){case 9:c=c.body;break;default:c=c.nodeName==="HTML"?c.ownerDocument.body:c}for(xr=no(c.firstChild),es=d,vn=!0,_u=null,eo=!0,g=TA(d,null,y,g),d.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling}else{if(ud(),y===k){d=Tc(c,d,g);break e}ns(c,d,y,g)}d=d.child}return d;case 26:return ty(c,d),c===null?(g=U8(d.type,null,d.pendingProps,null))?d.memoizedState=g:vn||(g=d.type,c=d.pendingProps,y=by(be.current).createElement(g),y[$r]=d,y[Di]=c,rs(y,g,c),Ir(y),d.stateNode=y):d.memoizedState=U8(d.type,c.memoizedProps,d.pendingProps,c.memoizedState),null;case 27:return Pe(d),c===null&&vn&&(y=d.stateNode=F8(d.type,d.pendingProps,be.current),es=d,eo=!0,k=xr,Bu(d.type)?(x_=k,xr=no(y.firstChild)):xr=k),ns(c,d,d.pendingProps.children,g),ty(c,d),c===null&&(d.flags|=4194304),d.child;case 5:return c===null&&vn&&((k=y=xr)&&(y=dW(y,d.type,d.pendingProps,eo),y!==null?(d.stateNode=y,es=d,xr=no(y.firstChild),eo=!1,k=!0):k=!1),k||Tu(d)),Pe(d),k=d.type,O=d.pendingProps,L=c!==null?c.memoizedProps:null,y=O.children,m_(k,O)?y=null:L!==null&&m_(k,L)&&(d.flags|=32),d.memoizedState!==null&&(k=pj(c,d,kQ,null,null,g),H0._currentValue=k),ty(c,d),ns(c,d,y,g),d.child;case 6:return c===null&&vn&&((c=g=xr)&&(g=fW(g,d.pendingProps,eo),g!==null?(d.stateNode=g,es=d,xr=null,c=!0):c=!1),c||Tu(d)),null;case 13:return MM(c,d,g);case 4:return Ke(d,d.stateNode.containerInfo),y=d.pendingProps,c===null?d.child=gd(d,null,y,g):ns(c,d,y,g),d.child;case 11:return SM(c,d,d.type,d.pendingProps,g);case 7:return ns(c,d,d.pendingProps,g),d.child;case 8:return ns(c,d,d.pendingProps.children,g),d.child;case 12:return ns(c,d,d.pendingProps.children,g),d.child;case 10:return y=d.pendingProps,Cu(d,d.type,y.value),ns(c,d,y.children,g),d.child;case 9:return k=d.type._context,y=d.pendingProps.children,dd(d),k=ts(k),y=y(k),d.flags|=1,ns(c,d,y,g),d.child;case 14:return jM(c,d,d.type,d.pendingProps,g);case 15:return _M(c,d,d.type,d.pendingProps,g);case 19:return DM(c,d,g);case 31:return PQ(c,d,g);case 22:return TM(c,d,g,d.pendingProps);case 24:return dd(d),y=ts(ui),c===null?(k=ij(),k===null&&(k=sr,O=nj(),k.pooledCache=O,O.refCount++,O!==null&&(k.pooledCacheLanes|=g),k=O),d.memoizedState={parent:y,cache:k},aj(d),Cu(d,ui,k)):((c.lanes&g)!==0&&(oj(c,d),j0(d,null,null,g),S0()),k=c.memoizedState,O=d.memoizedState,k.parent!==y?(k={parent:y,cache:y},d.memoizedState=k,d.lanes===0&&(d.memoizedState=d.updateQueue.baseState=k),Cu(d,ui,y)):(y=O.cache,Cu(d,ui,y),y!==k.cache&&tj(d,[ui],g,!0))),ns(c,d,d.pendingProps.children,g),d.child;case 29:throw d.pendingProps}throw Error(r(156,d.tag))}function Cc(c){c.flags|=4}function Fj(c,d,g,y,k){if((d=(c.mode&32)!==0)&&(d=!1),d){if(c.flags|=16777216,(k&335544128)===k)if(c.stateNode.complete)c.flags|=8192;else if(o8())c.flags|=8192;else throw md=zb,sj}else c.flags&=-16777217}function PM(c,d){if(d.type!=="stylesheet"||(d.state.loading&4)!==0)c.flags&=-16777217;else if(c.flags|=16777216,!G8(d))if(o8())c.flags|=8192;else throw md=zb,sj}function ry(c,d){d!==null&&(c.flags|=4),c.flags&16384&&(d=c.tag!==22?Et():536870912,c.lanes|=d,Zf|=d)}function E0(c,d){if(!vn)switch(c.tailMode){case"hidden":d=c.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?c.tail=null:g.sibling=null;break;case"collapsed":g=c.tail;for(var y=null;g!==null;)g.alternate!==null&&(y=g),g=g.sibling;y===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:y.sibling=null}}function wr(c){var d=c.alternate!==null&&c.alternate.child===c.child,g=0,y=0;if(d)for(var k=c.child;k!==null;)g|=k.lanes|k.childLanes,y|=k.subtreeFlags&65011712,y|=k.flags&65011712,k.return=c,k=k.sibling;else for(k=c.child;k!==null;)g|=k.lanes|k.childLanes,y|=k.subtreeFlags,y|=k.flags,k.return=c,k=k.sibling;return c.subtreeFlags|=y,c.childLanes=g,d}function $Q(c,d,g){var y=d.pendingProps;switch(GS(d),d.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wr(d),null;case 1:return wr(d),null;case 3:return g=d.stateNode,y=null,c!==null&&(y=c.memoizedState.cache),d.memoizedState.cache!==y&&(d.flags|=2048),Sc(ui),Fe(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(c===null||c.child===null)&&(Bf(d)?Cc(d):c===null||c.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,ZS())),wr(d),null;case 26:var k=d.type,O=d.memoizedState;return c===null?(Cc(d),O!==null?(wr(d),PM(d,O)):(wr(d),Fj(d,k,null,y,g))):O?O!==c.memoizedState?(Cc(d),wr(d),PM(d,O)):(wr(d),d.flags&=-16777217):(c=c.memoizedProps,c!==y&&Cc(d),wr(d),Fj(d,k,c,y,g)),null;case 27:if(ae(d),g=be.current,k=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==y&&Cc(d);else{if(!y){if(d.stateNode===null)throw Error(r(166));return wr(d),null}c=te.current,Bf(d)?pA(d):(c=F8(k,y,g),d.stateNode=c,Cc(d))}return wr(d),null;case 5:if(ae(d),k=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==y&&Cc(d);else{if(!y){if(d.stateNode===null)throw Error(r(166));return wr(d),null}if(O=te.current,Bf(d))pA(d);else{var L=by(be.current);switch(O){case 1:O=L.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:O=L.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":O=L.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":O=L.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":O=L.createElement("div"),O.innerHTML="<script><\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof y.is=="string"?L.createElement("select",{is:y.is}):L.createElement("select"),y.multiple?O.multiple=!0:y.size&&(O.size=y.size);break;default:O=typeof y.is=="string"?L.createElement(k,{is:y.is}):L.createElement(k)}}O[$r]=d,O[Di]=y;e:for(L=d.child;L!==null;){if(L.tag===5||L.tag===6)O.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===d)break e;for(;L.sibling===null;){if(L.return===null||L.return===d)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}d.stateNode=O;e:switch(rs(O,k,y),k){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&Cc(d)}}return wr(d),Fj(d,d.type,c===null?null:c.memoizedProps,d.pendingProps,g),null;case 6:if(c&&d.stateNode!=null)c.memoizedProps!==y&&Cc(d);else{if(typeof y!="string"&&d.stateNode===null)throw Error(r(166));if(c=be.current,Bf(d)){if(c=d.stateNode,g=d.memoizedProps,y=null,k=es,k!==null)switch(k.tag){case 27:case 5:y=k.memoizedProps}c[$r]=d,c=!!(c.nodeValue===g||y!==null&&y.suppressHydrationWarning===!0||M8(c.nodeValue,g)),c||Tu(d,!0)}else c=by(c).createTextNode(y),c[$r]=d,d.stateNode=c}return wr(d),null;case 31:if(g=d.memoizedState,c===null||c.memoizedState!==null){if(y=Bf(d),g!==null){if(c===null){if(!y)throw Error(r(318));if(c=d.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[$r]=d}else ud(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;wr(d),c=!1}else g=ZS(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return d.flags&256?(wa(d),d):(wa(d),null);if((d.flags&128)!==0)throw Error(r(558))}return wr(d),null;case 13:if(y=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(k=Bf(d),y!==null&&y.dehydrated!==null){if(c===null){if(!k)throw Error(r(318));if(k=d.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(r(317));k[$r]=d}else ud(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;wr(d),k=!1}else k=ZS(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=k),k=!0;if(!k)return d.flags&256?(wa(d),d):(wa(d),null)}return wa(d),(d.flags&128)!==0?(d.lanes=g,d):(g=y!==null,c=c!==null&&c.memoizedState!==null,g&&(y=d.child,k=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(k=y.alternate.memoizedState.cachePool.pool),O=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(O=y.memoizedState.cachePool.pool),O!==k&&(y.flags|=2048)),g!==c&&g&&(d.child.flags|=8192),ry(d,d.updateQueue),wr(d),null);case 4:return Fe(),c===null&&u_(d.stateNode.containerInfo),wr(d),null;case 10:return Sc(d.type),wr(d),null;case 19:if(G(ni),y=d.memoizedState,y===null)return wr(d),null;if(k=(d.flags&128)!==0,O=y.rendering,O===null)if(k)E0(y,!1);else{if(Qr!==0||c!==null&&(c.flags&128)!==0)for(c=d.child;c!==null;){if(O=Vb(c),O!==null){for(d.flags|=128,E0(y,!1),c=O.updateQueue,d.updateQueue=c,ry(d,c),d.subtreeFlags=0,c=g,g=d.child;g!==null;)cA(g,c),g=g.sibling;return W(ni,ni.current&1|2),vn&&xc(d,y.treeForkCount),d.child}c=c.sibling}y.tail!==null&&Ve()>ly&&(d.flags|=128,k=!0,E0(y,!1),d.lanes=4194304)}else{if(!k)if(c=Vb(O),c!==null){if(d.flags|=128,k=!0,c=c.updateQueue,d.updateQueue=c,ry(d,c),E0(y,!0),y.tail===null&&y.tailMode==="hidden"&&!O.alternate&&!vn)return wr(d),null}else 2*Ve()-y.renderingStartTime>ly&&g!==536870912&&(d.flags|=128,k=!0,E0(y,!1),d.lanes=4194304);y.isBackwards?(O.sibling=d.child,d.child=O):(c=y.last,c!==null?c.sibling=O:d.child=O,y.last=O)}return y.tail!==null?(c=y.tail,y.rendering=c,y.tail=c.sibling,y.renderingStartTime=Ve(),c.sibling=null,g=ni.current,W(ni,k?g&1|2:g&1),vn&&xc(d,y.treeForkCount),c):(wr(d),null);case 22:case 23:return wa(d),hj(),y=d.memoizedState!==null,c!==null?c.memoizedState!==null!==y&&(d.flags|=8192):y&&(d.flags|=8192),y?(g&536870912)!==0&&(d.flags&128)===0&&(wr(d),d.subtreeFlags&6&&(d.flags|=8192)):wr(d),g=d.updateQueue,g!==null&&ry(d,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==g&&(d.flags|=2048),c!==null&&G(fd),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),d.memoizedState.cache!==g&&(d.flags|=2048),Sc(ui),wr(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function IQ(c,d){switch(GS(d),d.tag){case 1:return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return Sc(ui),Fe(),c=d.flags,(c&65536)!==0&&(c&128)===0?(d.flags=c&-65537|128,d):null;case 26:case 27:case 5:return ae(d),null;case 31:if(d.memoizedState!==null){if(wa(d),d.alternate===null)throw Error(r(340));ud()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 13:if(wa(d),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(r(340));ud()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return G(ni),null;case 4:return Fe(),null;case 10:return Sc(d.type),null;case 22:case 23:return wa(d),hj(),c!==null&&G(fd),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 24:return Sc(ui),null;case 25:return null;default:return null}}function LM(c,d){switch(GS(d),d.tag){case 3:Sc(ui),Fe();break;case 26:case 27:case 5:ae(d);break;case 4:Fe();break;case 31:d.memoizedState!==null&&wa(d);break;case 13:wa(d);break;case 19:G(ni);break;case 10:Sc(d.type);break;case 22:case 23:wa(d),hj(),c!==null&&G(fd);break;case 24:Sc(ui)}}function A0(c,d){try{var g=d.updateQueue,y=g!==null?g.lastEffect:null;if(y!==null){var k=y.next;g=k;do{if((g.tag&c)===c){y=void 0;var O=g.create,L=g.inst;y=O(),L.destroy=y}g=g.next}while(g!==k)}}catch(K){Wn(d,d.return,K)}}function Ru(c,d,g){try{var y=d.updateQueue,k=y!==null?y.lastEffect:null;if(k!==null){var O=k.next;y=O;do{if((y.tag&c)===c){var L=y.inst,K=L.destroy;if(K!==void 0){L.destroy=void 0,k=d;var ne=g,we=K;try{we()}catch(ke){Wn(k,ne,ke)}}}y=y.next}while(y!==O)}}catch(ke){Wn(d,d.return,ke)}}function $M(c){var d=c.updateQueue;if(d!==null){var g=c.stateNode;try{kA(d,g)}catch(y){Wn(c,c.return,y)}}}function IM(c,d,g){g.props=bd(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(y){Wn(c,d,y)}}function M0(c,d){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var y=c.stateNode;break;case 30:y=c.stateNode;break;default:y=c.stateNode}typeof g=="function"?c.refCleanup=g(y):g.current=y}}catch(k){Wn(c,d,k)}}function jl(c,d){var g=c.ref,y=c.refCleanup;if(g!==null)if(typeof y=="function")try{y()}catch(k){Wn(c,d,k)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(k){Wn(c,d,k)}else g.current=null}function BM(c){var d=c.type,g=c.memoizedProps,y=c.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":g.autoFocus&&y.focus();break e;case"img":g.src?y.src=g.src:g.srcSet&&(y.srcset=g.srcSet)}}catch(k){Wn(c,c.return,k)}}function Hj(c,d,g){try{var y=c.stateNode;aW(y,c.type,g,d),y[Di]=d}catch(k){Wn(c,c.return,k)}}function zM(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Bu(c.type)||c.tag===4}function Vj(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zM(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Bu(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function Uj(c,d,g){var y=c.tag;if(y===5||y===6)c=c.stateNode,d?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,d):(d=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,d.appendChild(c),g=g._reactRootContainer,g!=null||d.onclick!==null||(d.onclick=Ge));else if(y!==4&&(y===27&&Bu(c.type)&&(g=c.stateNode,d=null),c=c.child,c!==null))for(Uj(c,d,g),c=c.sibling;c!==null;)Uj(c,d,g),c=c.sibling}function iy(c,d,g){var y=c.tag;if(y===5||y===6)c=c.stateNode,d?g.insertBefore(c,d):g.appendChild(c);else if(y!==4&&(y===27&&Bu(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(iy(c,d,g),c=c.sibling;c!==null;)iy(c,d,g),c=c.sibling}function qM(c){var d=c.stateNode,g=c.memoizedProps;try{for(var y=c.type,k=d.attributes;k.length;)d.removeAttributeNode(k[0]);rs(d,y,g),d[$r]=c,d[Di]=g}catch(O){Wn(c,c.return,O)}}var kc=!1,fi=!1,Qj=!1,FM=typeof WeakSet=="function"?WeakSet:Set,$i=null;function BQ(c,d){if(c=c.containerInfo,f_=Ty,c=yr(c),Vr(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var y=g.getSelection&&g.getSelection();if(y&&y.rangeCount!==0){g=y.anchorNode;var k=y.anchorOffset,O=y.focusNode;y=y.focusOffset;try{g.nodeType,O.nodeType}catch{g=null;break e}var L=0,K=-1,ne=-1,we=0,ke=0,Ie=c,je=null;t:for(;;){for(var _e;Ie!==g||k!==0&&Ie.nodeType!==3||(K=L+k),Ie!==O||y!==0&&Ie.nodeType!==3||(ne=L+y),Ie.nodeType===3&&(L+=Ie.nodeValue.length),(_e=Ie.firstChild)!==null;)je=Ie,Ie=_e;for(;;){if(Ie===c)break t;if(je===g&&++we===k&&(K=L),je===O&&++ke===y&&(ne=L),(_e=Ie.nextSibling)!==null)break;Ie=je,je=Ie.parentNode}Ie=_e}g=K===-1||ne===-1?null:{start:K,end:ne}}else g=null}g=g||{start:0,end:0}}else g=null;for(p_={focusedElem:c,selectionRange:g},Ty=!1,$i=d;$i!==null;)if(d=$i,c=d.child,(d.subtreeFlags&1028)!==0&&c!==null)c.return=d,$i=c;else for(;$i!==null;){switch(d=$i,O=d.alternate,c=d.flags,d.tag){case 0:if((c&4)!==0&&(c=d.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g<c.length;g++)k=c[g],k.ref.impl=k.nextImpl;break;case 11:case 15:break;case 1:if((c&1024)!==0&&O!==null){c=void 0,g=d,k=O.memoizedProps,O=O.memoizedState,y=g.stateNode;try{var xt=bd(g.type,k);c=y.getSnapshotBeforeUpdate(xt,O),y.__reactInternalSnapshotBeforeUpdate=c}catch(Rt){Wn(g,g.return,Rt)}}break;case 3:if((c&1024)!==0){if(c=d.stateNode.containerInfo,g=c.nodeType,g===9)v_(c);else if(g===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":v_(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(r(163))}if(c=d.sibling,c!==null){c.return=d.return,$i=c;break}$i=d.return}}function HM(c,d,g){var y=g.flags;switch(g.tag){case 0:case 11:case 15:Ec(c,g),y&4&&A0(5,g);break;case 1:if(Ec(c,g),y&4)if(c=g.stateNode,d===null)try{c.componentDidMount()}catch(L){Wn(g,g.return,L)}else{var k=bd(g.type,d.memoizedProps);d=d.memoizedState;try{c.componentDidUpdate(k,d,c.__reactInternalSnapshotBeforeUpdate)}catch(L){Wn(g,g.return,L)}}y&64&&$M(g),y&512&&M0(g,g.return);break;case 3:if(Ec(c,g),y&64&&(c=g.updateQueue,c!==null)){if(d=null,g.child!==null)switch(g.child.tag){case 27:case 5:d=g.child.stateNode;break;case 1:d=g.child.stateNode}try{kA(c,d)}catch(L){Wn(g,g.return,L)}}break;case 27:d===null&&y&4&&qM(g);case 26:case 5:Ec(c,g),d===null&&y&4&&BM(g),y&512&&M0(g,g.return);break;case 12:Ec(c,g);break;case 31:Ec(c,g),y&4&&QM(c,g);break;case 13:Ec(c,g),y&4&&WM(c,g),y&64&&(c=g.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(g=YQ.bind(null,g),pW(c,g))));break;case 22:if(y=g.memoizedState!==null||kc,!y){d=d!==null&&d.memoizedState!==null||fi,k=kc;var O=fi;kc=y,(fi=d)&&!O?Ac(c,g,(g.subtreeFlags&8772)!==0):Ec(c,g),kc=k,fi=O}break;case 30:break;default:Ec(c,g)}}function VM(c){var d=c.alternate;d!==null&&(c.alternate=null,VM(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&Er(d)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}var Ar=null,Js=!1;function Oc(c,d,g){for(g=g.child;g!==null;)UM(c,d,g),g=g.sibling}function UM(c,d,g){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(ln,g)}catch{}switch(g.tag){case 26:fi||jl(g,d),Oc(c,d,g),g.memoizedState?g.memoizedState.count--:g.stateNode&&(g=g.stateNode,g.parentNode.removeChild(g));break;case 27:fi||jl(g,d);var y=Ar,k=Js;Bu(g.type)&&(Ar=g.stateNode,Js=!1),Oc(c,d,g),z0(g.stateNode),Ar=y,Js=k;break;case 5:fi||jl(g,d);case 6:if(y=Ar,k=Js,Ar=null,Oc(c,d,g),Ar=y,Js=k,Ar!==null)if(Js)try{(Ar.nodeType===9?Ar.body:Ar.nodeName==="HTML"?Ar.ownerDocument.body:Ar).removeChild(g.stateNode)}catch(O){Wn(g,d,O)}else try{Ar.removeChild(g.stateNode)}catch(O){Wn(g,d,O)}break;case 18:Ar!==null&&(Js?(c=Ar,$8(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,g.stateNode),ap(c)):$8(Ar,g.stateNode));break;case 4:y=Ar,k=Js,Ar=g.stateNode.containerInfo,Js=!0,Oc(c,d,g),Ar=y,Js=k;break;case 0:case 11:case 14:case 15:Ru(2,g,d),fi||Ru(4,g,d),Oc(c,d,g);break;case 1:fi||(jl(g,d),y=g.stateNode,typeof y.componentWillUnmount=="function"&&IM(g,d,y)),Oc(c,d,g);break;case 21:Oc(c,d,g);break;case 22:fi=(y=fi)||g.memoizedState!==null,Oc(c,d,g),fi=y;break;default:Oc(c,d,g)}}function QM(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{ap(c)}catch(g){Wn(d,d.return,g)}}}function WM(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{ap(c)}catch(g){Wn(d,d.return,g)}}function zQ(c){switch(c.tag){case 31:case 13:case 19:var d=c.stateNode;return d===null&&(d=c.stateNode=new FM),d;case 22:return c=c.stateNode,d=c._retryCache,d===null&&(d=c._retryCache=new FM),d;default:throw Error(r(435,c.tag))}}function sy(c,d){var g=zQ(c);d.forEach(function(y){if(!g.has(y)){g.add(y);var k=XQ.bind(null,c,y);y.then(k,k)}})}function ea(c,d){var g=d.deletions;if(g!==null)for(var y=0;y<g.length;y++){var k=g[y],O=c,L=d,K=L;e:for(;K!==null;){switch(K.tag){case 27:if(Bu(K.type)){Ar=K.stateNode,Js=!1;break e}break;case 5:Ar=K.stateNode,Js=!1;break e;case 3:case 4:Ar=K.stateNode.containerInfo,Js=!0;break e}K=K.return}if(Ar===null)throw Error(r(160));UM(O,L,k),Ar=null,Js=!1,O=k.alternate,O!==null&&(O.return=null),k.return=null}if(d.subtreeFlags&13886)for(d=d.child;d!==null;)YM(d,c),d=d.sibling}var Do=null;function YM(c,d){var g=c.alternate,y=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:ea(d,c),ta(c),y&4&&(Ru(3,c,c.return),A0(3,c),Ru(5,c,c.return));break;case 1:ea(d,c),ta(c),y&512&&(fi||g===null||jl(g,g.return)),y&64&&kc&&(c=c.updateQueue,c!==null&&(y=c.callbacks,y!==null&&(g=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=g===null?y:g.concat(y))));break;case 26:var k=Do;if(ea(d,c),ta(c),y&512&&(fi||g===null||jl(g,g.return)),y&4){var O=g!==null?g.memoizedState:null;if(y=c.memoizedState,g===null)if(y===null)if(c.stateNode===null){e:{y=c.type,g=c.memoizedProps,k=k.ownerDocument||k;t:switch(y){case"title":O=k.getElementsByTagName("title")[0],(!O||O[vr]||O[$r]||O.namespaceURI==="http://www.w3.org/2000/svg"||O.hasAttribute("itemprop"))&&(O=k.createElement(y),k.head.insertBefore(O,k.querySelector("head > title"))),rs(O,y,g),O[$r]=c,Ir(O),y=O;break e;case"link":var L=Y8("link","href",k).get(y+(g.href||""));if(L){for(var K=0;K<L.length;K++)if(O=L[K],O.getAttribute("href")===(g.href==null||g.href===""?null:g.href)&&O.getAttribute("rel")===(g.rel==null?null:g.rel)&&O.getAttribute("title")===(g.title==null?null:g.title)&&O.getAttribute("crossorigin")===(g.crossOrigin==null?null:g.crossOrigin)){L.splice(K,1);break t}}O=k.createElement(y),rs(O,y,g),k.head.appendChild(O);break;case"meta":if(L=Y8("meta","content",k).get(y+(g.content||""))){for(K=0;K<L.length;K++)if(O=L[K],O.getAttribute("content")===(g.content==null?null:""+g.content)&&O.getAttribute("name")===(g.name==null?null:g.name)&&O.getAttribute("property")===(g.property==null?null:g.property)&&O.getAttribute("http-equiv")===(g.httpEquiv==null?null:g.httpEquiv)&&O.getAttribute("charset")===(g.charSet==null?null:g.charSet)){L.splice(K,1);break t}}O=k.createElement(y),rs(O,y,g),k.head.appendChild(O);break;default:throw Error(r(468,y))}O[$r]=c,Ir(O),y=O}c.stateNode=y}else X8(k,c.type,c.stateNode);else c.stateNode=W8(k,y,c.memoizedProps);else O!==y?(O===null?g.stateNode!==null&&(g=g.stateNode,g.parentNode.removeChild(g)):O.count--,y===null?X8(k,c.type,c.stateNode):W8(k,y,c.memoizedProps)):y===null&&c.stateNode!==null&&Hj(c,c.memoizedProps,g.memoizedProps)}break;case 27:ea(d,c),ta(c),y&512&&(fi||g===null||jl(g,g.return)),g!==null&&y&4&&Hj(c,c.memoizedProps,g.memoizedProps);break;case 5:if(ea(d,c),ta(c),y&512&&(fi||g===null||jl(g,g.return)),c.flags&32){k=c.stateNode;try{At(k,"")}catch(xt){Wn(c,c.return,xt)}}y&4&&c.stateNode!=null&&(k=c.memoizedProps,Hj(c,k,g!==null?g.memoizedProps:k)),y&1024&&(Qj=!0);break;case 6:if(ea(d,c),ta(c),y&4){if(c.stateNode===null)throw Error(r(162));y=c.memoizedProps,g=c.stateNode;try{g.nodeValue=y}catch(xt){Wn(c,c.return,xt)}}break;case 3:if(wy=null,k=Do,Do=yy(d.containerInfo),ea(d,c),Do=k,ta(c),y&4&&g!==null&&g.memoizedState.isDehydrated)try{ap(d.containerInfo)}catch(xt){Wn(c,c.return,xt)}Qj&&(Qj=!1,XM(c));break;case 4:y=Do,Do=yy(c.stateNode.containerInfo),ea(d,c),ta(c),Do=y;break;case 12:ea(d,c),ta(c);break;case 31:ea(d,c),ta(c),y&4&&(y=c.updateQueue,y!==null&&(c.updateQueue=null,sy(c,y)));break;case 13:ea(d,c),ta(c),c.child.flags&8192&&c.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(oy=Ve()),y&4&&(y=c.updateQueue,y!==null&&(c.updateQueue=null,sy(c,y)));break;case 22:k=c.memoizedState!==null;var ne=g!==null&&g.memoizedState!==null,we=kc,ke=fi;if(kc=we||k,fi=ke||ne,ea(d,c),fi=ke,kc=we,ta(c),y&8192)e:for(d=c.stateNode,d._visibility=k?d._visibility&-2:d._visibility|1,k&&(g===null||ne||kc||fi||yd(c)),g=null,d=c;;){if(d.tag===5||d.tag===26){if(g===null){ne=g=d;try{if(O=ne.stateNode,k)L=O.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{K=ne.stateNode;var Ie=ne.memoizedProps.style,je=Ie!=null&&Ie.hasOwnProperty("display")?Ie.display:null;K.style.display=je==null||typeof je=="boolean"?"":(""+je).trim()}}catch(xt){Wn(ne,ne.return,xt)}}}else if(d.tag===6){if(g===null){ne=d;try{ne.stateNode.nodeValue=k?"":ne.memoizedProps}catch(xt){Wn(ne,ne.return,xt)}}}else if(d.tag===18){if(g===null){ne=d;try{var _e=ne.stateNode;k?I8(_e,!0):I8(ne.stateNode,!1)}catch(xt){Wn(ne,ne.return,xt)}}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===c)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break e;for(;d.sibling===null;){if(d.return===null||d.return===c)break e;g===d&&(g=null),d=d.return}g===d&&(g=null),d.sibling.return=d.return,d=d.sibling}y&4&&(y=c.updateQueue,y!==null&&(g=y.retryQueue,g!==null&&(y.retryQueue=null,sy(c,g))));break;case 19:ea(d,c),ta(c),y&4&&(y=c.updateQueue,y!==null&&(c.updateQueue=null,sy(c,y)));break;case 30:break;case 21:break;default:ea(d,c),ta(c)}}function ta(c){var d=c.flags;if(d&2){try{for(var g,y=c.return;y!==null;){if(zM(y)){g=y;break}y=y.return}if(g==null)throw Error(r(160));switch(g.tag){case 27:var k=g.stateNode,O=Vj(c);iy(c,O,k);break;case 5:var L=g.stateNode;g.flags&32&&(At(L,""),g.flags&=-33);var K=Vj(c);iy(c,K,L);break;case 3:case 4:var ne=g.stateNode.containerInfo,we=Vj(c);Uj(c,we,ne);break;default:throw Error(r(161))}}catch(ke){Wn(c,c.return,ke)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function XM(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var d=c;XM(d),d.tag===5&&d.flags&1024&&d.stateNode.reset(),c=c.sibling}}function Ec(c,d){if(d.subtreeFlags&8772)for(d=d.child;d!==null;)HM(c,d.alternate,d),d=d.sibling}function yd(c){for(c=c.child;c!==null;){var d=c;switch(d.tag){case 0:case 11:case 14:case 15:Ru(4,d,d.return),yd(d);break;case 1:jl(d,d.return);var g=d.stateNode;typeof g.componentWillUnmount=="function"&&IM(d,d.return,g),yd(d);break;case 27:z0(d.stateNode);case 26:case 5:jl(d,d.return),yd(d);break;case 22:d.memoizedState===null&&yd(d);break;case 30:yd(d);break;default:yd(d)}c=c.sibling}}function Ac(c,d,g){for(g=g&&(d.subtreeFlags&8772)!==0,d=d.child;d!==null;){var y=d.alternate,k=c,O=d,L=O.flags;switch(O.tag){case 0:case 11:case 15:Ac(k,O,g),A0(4,O);break;case 1:if(Ac(k,O,g),y=O,k=y.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(we){Wn(y,y.return,we)}if(y=O,k=y.updateQueue,k!==null){var K=y.stateNode;try{var ne=k.shared.hiddenCallbacks;if(ne!==null)for(k.shared.hiddenCallbacks=null,k=0;k<ne.length;k++)CA(ne[k],K)}catch(we){Wn(y,y.return,we)}}g&&L&64&&$M(O),M0(O,O.return);break;case 27:qM(O);case 26:case 5:Ac(k,O,g),g&&y===null&&L&4&&BM(O),M0(O,O.return);break;case 12:Ac(k,O,g);break;case 31:Ac(k,O,g),g&&L&4&&QM(k,O);break;case 13:Ac(k,O,g),g&&L&4&&WM(k,O);break;case 22:O.memoizedState===null&&Ac(k,O,g),M0(O,O.return);break;case 30:break;default:Ac(k,O,g)}d=d.sibling}}function Wj(c,d){var g=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),c=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(c=d.memoizedState.cachePool.pool),c!==g&&(c!=null&&c.refCount++,g!=null&&v0(g))}function Yj(c,d){c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&v0(c))}function No(c,d,g,y){if(d.subtreeFlags&10256)for(d=d.child;d!==null;)GM(c,d,g,y),d=d.sibling}function GM(c,d,g,y){var k=d.flags;switch(d.tag){case 0:case 11:case 15:No(c,d,g,y),k&2048&&A0(9,d);break;case 1:No(c,d,g,y);break;case 3:No(c,d,g,y),k&2048&&(c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&v0(c)));break;case 12:if(k&2048){No(c,d,g,y),c=d.stateNode;try{var O=d.memoizedProps,L=O.id,K=O.onPostCommit;typeof K=="function"&&K(L,d.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(ne){Wn(d,d.return,ne)}}else No(c,d,g,y);break;case 31:No(c,d,g,y);break;case 13:No(c,d,g,y);break;case 23:break;case 22:O=d.stateNode,L=d.alternate,d.memoizedState!==null?O._visibility&2?No(c,d,g,y):R0(c,d):O._visibility&2?No(c,d,g,y):(O._visibility|=2,Xf(c,d,g,y,(d.subtreeFlags&10256)!==0||!1)),k&2048&&Wj(L,d);break;case 24:No(c,d,g,y),k&2048&&Yj(d.alternate,d);break;default:No(c,d,g,y)}}function Xf(c,d,g,y,k){for(k=k&&((d.subtreeFlags&10256)!==0||!1),d=d.child;d!==null;){var O=c,L=d,K=g,ne=y,we=L.flags;switch(L.tag){case 0:case 11:case 15:Xf(O,L,K,ne,k),A0(8,L);break;case 23:break;case 22:var ke=L.stateNode;L.memoizedState!==null?ke._visibility&2?Xf(O,L,K,ne,k):R0(O,L):(ke._visibility|=2,Xf(O,L,K,ne,k)),k&&we&2048&&Wj(L.alternate,L);break;case 24:Xf(O,L,K,ne,k),k&&we&2048&&Yj(L.alternate,L);break;default:Xf(O,L,K,ne,k)}d=d.sibling}}function R0(c,d){if(d.subtreeFlags&10256)for(d=d.child;d!==null;){var g=c,y=d,k=y.flags;switch(y.tag){case 22:R0(g,y),k&2048&&Wj(y.alternate,y);break;case 24:R0(g,y),k&2048&&Yj(y.alternate,y);break;default:R0(g,y)}d=d.sibling}}var D0=8192;function Gf(c,d,g){if(c.subtreeFlags&D0)for(c=c.child;c!==null;)KM(c,d,g),c=c.sibling}function KM(c,d,g){switch(c.tag){case 26:Gf(c,d,g),c.flags&D0&&c.memoizedState!==null&&CW(g,Do,c.memoizedState,c.memoizedProps);break;case 5:Gf(c,d,g);break;case 3:case 4:var y=Do;Do=yy(c.stateNode.containerInfo),Gf(c,d,g),Do=y;break;case 22:c.memoizedState===null&&(y=c.alternate,y!==null&&y.memoizedState!==null?(y=D0,D0=16777216,Gf(c,d,g),D0=y):Gf(c,d,g));break;default:Gf(c,d,g)}}function ZM(c){var d=c.alternate;if(d!==null&&(c=d.child,c!==null)){d.child=null;do d=c.sibling,c.sibling=null,c=d;while(c!==null)}}function N0(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var g=0;g<d.length;g++){var y=d[g];$i=y,e8(y,c)}ZM(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)JM(c),c=c.sibling}function JM(c){switch(c.tag){case 0:case 11:case 15:N0(c),c.flags&2048&&Ru(9,c,c.return);break;case 3:N0(c);break;case 12:N0(c);break;case 22:var d=c.stateNode;c.memoizedState!==null&&d._visibility&2&&(c.return===null||c.return.tag!==13)?(d._visibility&=-3,ay(c)):N0(c);break;default:N0(c)}}function ay(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var g=0;g<d.length;g++){var y=d[g];$i=y,e8(y,c)}ZM(c)}for(c=c.child;c!==null;){switch(d=c,d.tag){case 0:case 11:case 15:Ru(8,d,d.return),ay(d);break;case 22:g=d.stateNode,g._visibility&2&&(g._visibility&=-3,ay(d));break;default:ay(d)}c=c.sibling}}function e8(c,d){for(;$i!==null;){var g=$i;switch(g.tag){case 0:case 11:case 15:Ru(8,g,d);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var y=g.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:v0(g.memoizedState.cache)}if(y=g.child,y!==null)y.return=g,$i=y;else e:for(g=c;$i!==null;){y=$i;var k=y.sibling,O=y.return;if(VM(y),y===g){$i=null;break e}if(k!==null){k.return=O,$i=k;break e}$i=O}}}var qQ={getCacheForType:function(c){var d=ts(ui),g=d.data.get(c);return g===void 0&&(g=c(),d.data.set(c,g)),g},cacheSignal:function(){return ts(ui).controller.signal}},FQ=typeof WeakMap=="function"?WeakMap:Map,Nn=0,sr=null,cn=null,fn=0,Qn=0,Sa=null,Du=!1,Kf=!1,Xj=!1,Mc=0,Qr=0,Nu=0,xd=0,Gj=0,ja=0,Zf=0,P0=null,na=null,Kj=!1,oy=0,t8=0,ly=1/0,cy=null,Pu=null,wi=0,Lu=null,Jf=null,Rc=0,Zj=0,Jj=null,n8=null,L0=0,e_=null;function _a(){return(Nn&2)!==0&&fn!==0?fn&-fn:P.T!==null?a_():ds()}function r8(){if(ja===0)if((fn&536870912)===0||vn){var c=It;It<<=1,(It&3932160)===0&&(It=262144),ja=c}else ja=536870912;return c=xa.current,c!==null&&(c.flags|=32),ja}function ra(c,d,g){(c===sr&&(Qn===2||Qn===9)||c.cancelPendingCommit!==null)&&(ep(c,0),$u(c,fn,ja,!1)),rn(c,g),((Nn&2)===0||c!==sr)&&(c===sr&&((Nn&2)===0&&(xd|=g),Qr===4&&$u(c,fn,ja,!1)),_l(c))}function i8(c,d,g){if((Nn&6)!==0)throw Error(r(327));var y=!g&&(d&127)===0&&(d&c.expiredLanes)===0||Oe(c,d),k=y?UQ(c,d):n_(c,d,!0),O=y;do{if(k===0){Kf&&!y&&$u(c,d,0,!1);break}else{if(g=c.current.alternate,O&&!HQ(g)){k=n_(c,d,!1),O=!1;continue}if(k===2){if(O=d,c.errorRecoveryDisabledLanes&O)var L=0;else L=c.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){d=L;e:{var K=c;k=P0;var ne=K.current.memoizedState.isDehydrated;if(ne&&(ep(K,L).flags|=256),L=n_(K,L,!1),L!==2){if(Xj&&!ne){K.errorRecoveryDisabledLanes|=O,xd|=O,k=4;break e}O=na,na=k,O!==null&&(na===null?na=O:na.push.apply(na,O))}k=L}if(O=!1,k!==2)continue}}if(k===1){ep(c,0),$u(c,d,0,!0);break}e:{switch(y=c,O=k,O){case 0:case 1:throw Error(r(345));case 4:if((d&4194048)!==d)break;case 6:$u(y,d,ja,!Du);break e;case 2:na=null;break;case 3:case 5:break;default:throw Error(r(329))}if((d&62914560)===d&&(k=oy+300-Ve(),10<k)){if($u(y,d,ja,!Du),ie(y,0,!0)!==0)break e;Rc=d,y.timeoutHandle=P8(s8.bind(null,y,g,na,cy,Kj,d,ja,xd,Zf,Du,O,"Throttled",-0,0),k);break e}s8(y,g,na,cy,Kj,d,ja,xd,Zf,Du,O,null,-0,0)}}break}while(!0);_l(c)}function s8(c,d,g,y,k,O,L,K,ne,we,ke,Ie,je,_e){if(c.timeoutHandle=-1,Ie=d.subtreeFlags,Ie&8192||(Ie&16785408)===16785408){Ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ge},KM(d,O,Ie);var xt=(O&62914560)===O?oy-Ve():(O&4194048)===O?t8-Ve():0;if(xt=kW(Ie,xt),xt!==null){Rc=O,c.cancelPendingCommit=xt(f8.bind(null,c,d,O,g,y,k,L,K,ne,ke,Ie,null,je,_e)),$u(c,O,L,!we);return}}f8(c,d,O,g,y,k,L,K,ne)}function HQ(c){for(var d=c;;){var g=d.tag;if((g===0||g===11||g===15)&&d.flags&16384&&(g=d.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var y=0;y<g.length;y++){var k=g[y],O=k.getSnapshot;k=k.value;try{if(!Bt(O(),k))return!1}catch{return!1}}if(g=d.child,d.subtreeFlags&16384&&g!==null)g.return=d,d=g;else{if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function $u(c,d,g,y){d&=~Gj,d&=~xd,c.suspendedLanes|=d,c.pingedLanes&=~d,y&&(c.warmLanes|=d),y=c.expirationTimes;for(var k=d;0<k;){var O=31-Wt(k),L=1<<O;y[O]=-1,k&=~L}g!==0&&st(c,g,d)}function uy(){return(Nn&6)===0?($0(0),!1):!0}function t_(){if(cn!==null){if(Qn===0)var c=cn.return;else c=cn,wc=hd=null,vj(c),Vf=null,y0=0,c=cn;for(;c!==null;)LM(c.alternate,c),c=c.return;cn=null}}function ep(c,d){var g=c.timeoutHandle;g!==-1&&(c.timeoutHandle=-1,cW(g)),g=c.cancelPendingCommit,g!==null&&(c.cancelPendingCommit=null,g()),Rc=0,t_(),sr=c,cn=g=yc(c.current,null),fn=d,Qn=0,Sa=null,Du=!1,Kf=Oe(c,d),Xj=!1,Zf=ja=Gj=xd=Nu=Qr=0,na=P0=null,Kj=!1,(d&8)!==0&&(d|=d&32);var y=c.entangledLanes;if(y!==0)for(c=c.entanglements,y&=d;0<y;){var k=31-Wt(y),O=1<<k;d|=c[k],y&=~O}return Mc=d,Mb(),g}function a8(c,d){Gt=null,P.H=k0,d===Hf||d===Bb?(d=SA(),Qn=3):d===sj?(d=SA(),Qn=4):Qn=d===Dj?8:d!==null&&typeof d=="object"&&typeof d.then=="function"?6:1,Sa=d,cn===null&&(Qr=1,Jb(c,Ka(d,c.current)))}function o8(){var c=xa.current;return c===null?!0:(fn&4194048)===fn?to===null:(fn&62914560)===fn||(fn&536870912)!==0?c===to:!1}function l8(){var c=P.H;return P.H=k0,c===null?k0:c}function c8(){var c=P.A;return P.A=qQ,c}function hy(){Qr=4,Du||(fn&4194048)!==fn&&xa.current!==null||(Kf=!0),(Nu&134217727)===0&&(xd&134217727)===0||sr===null||$u(sr,fn,ja,!1)}function n_(c,d,g){var y=Nn;Nn|=2;var k=l8(),O=c8();(sr!==c||fn!==d)&&(cy=null,ep(c,d)),d=!1;var L=Qr;e:do try{if(Qn!==0&&cn!==null){var K=cn,ne=Sa;switch(Qn){case 8:t_(),L=6;break e;case 3:case 2:case 9:case 6:xa.current===null&&(d=!0);var we=Qn;if(Qn=0,Sa=null,tp(c,K,ne,we),g&&Kf){L=0;break e}break;default:we=Qn,Qn=0,Sa=null,tp(c,K,ne,we)}}VQ(),L=Qr;break}catch(ke){a8(c,ke)}while(!0);return d&&c.shellSuspendCounter++,wc=hd=null,Nn=y,P.H=k,P.A=O,cn===null&&(sr=null,fn=0,Mb()),L}function VQ(){for(;cn!==null;)u8(cn)}function UQ(c,d){var g=Nn;Nn|=2;var y=l8(),k=c8();sr!==c||fn!==d?(cy=null,ly=Ve()+500,ep(c,d)):Kf=Oe(c,d);e:do try{if(Qn!==0&&cn!==null){d=cn;var O=Sa;t:switch(Qn){case 1:Qn=0,Sa=null,tp(c,d,O,1);break;case 2:case 9:if(xA(O)){Qn=0,Sa=null,h8(d);break}d=function(){Qn!==2&&Qn!==9||sr!==c||(Qn=7),_l(c)},O.then(d,d);break e;case 3:Qn=7;break e;case 4:Qn=5;break e;case 7:xA(O)?(Qn=0,Sa=null,h8(d)):(Qn=0,Sa=null,tp(c,d,O,7));break;case 5:var L=null;switch(cn.tag){case 26:L=cn.memoizedState;case 5:case 27:var K=cn;if(L?G8(L):K.stateNode.complete){Qn=0,Sa=null;var ne=K.sibling;if(ne!==null)cn=ne;else{var we=K.return;we!==null?(cn=we,dy(we)):cn=null}break t}}Qn=0,Sa=null,tp(c,d,O,5);break;case 6:Qn=0,Sa=null,tp(c,d,O,6);break;case 8:t_(),Qr=6;break e;default:throw Error(r(462))}}QQ();break}catch(ke){a8(c,ke)}while(!0);return wc=hd=null,P.H=y,P.A=k,Nn=g,cn!==null?0:(sr=null,fn=0,Mb(),Qr)}function QQ(){for(;cn!==null&&!tt();)u8(cn)}function u8(c){var d=NM(c.alternate,c,Mc);c.memoizedProps=c.pendingProps,d===null?dy(c):cn=d}function h8(c){var d=c,g=d.alternate;switch(d.tag){case 15:case 0:d=OM(g,d,d.pendingProps,d.type,void 0,fn);break;case 11:d=OM(g,d,d.pendingProps,d.type.render,d.ref,fn);break;case 5:vj(d);default:LM(g,d),d=cn=cA(d,Mc),d=NM(g,d,Mc)}c.memoizedProps=c.pendingProps,d===null?dy(c):cn=d}function tp(c,d,g,y){wc=hd=null,vj(d),Vf=null,y0=0;var k=d.return;try{if(NQ(c,k,d,g,fn)){Qr=1,Jb(c,Ka(g,c.current)),cn=null;return}}catch(O){if(k!==null)throw cn=k,O;Qr=1,Jb(c,Ka(g,c.current)),cn=null;return}d.flags&32768?(vn||y===1?c=!0:Kf||(fn&536870912)!==0?c=!1:(Du=c=!0,(y===2||y===9||y===3||y===6)&&(y=xa.current,y!==null&&y.tag===13&&(y.flags|=16384))),d8(d,c)):dy(d)}function dy(c){var d=c;do{if((d.flags&32768)!==0){d8(d,Du);return}c=d.return;var g=$Q(d.alternate,d,Mc);if(g!==null){cn=g;return}if(d=d.sibling,d!==null){cn=d;return}cn=d=c}while(d!==null);Qr===0&&(Qr=5)}function d8(c,d){do{var g=IQ(c.alternate,c);if(g!==null){g.flags&=32767,cn=g;return}if(g=c.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!d&&(c=c.sibling,c!==null)){cn=c;return}cn=c=g}while(c!==null);Qr=6,cn=null}function f8(c,d,g,y,k,O,L,K,ne){c.cancelPendingCommit=null;do fy();while(wi!==0);if((Nn&6)!==0)throw Error(r(327));if(d!==null){if(d===c.current)throw Error(r(177));if(O=d.lanes|d.childLanes,O|=VS,rt(c,g,O,L,K,ne),c===sr&&(cn=sr=null,fn=0),Jf=d,Lu=c,Rc=g,Zj=O,Jj=k,n8=y,(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,GQ(Kt,function(){return b8(),null})):(c.callbackNode=null,c.callbackPriority=0),y=(d.flags&13878)!==0,(d.subtreeFlags&13878)!==0||y){y=P.T,P.T=null,k=I.p,I.p=2,L=Nn,Nn|=4;try{BQ(c,d,g)}finally{Nn=L,I.p=k,P.T=y}}wi=1,p8(),m8(),g8()}}function p8(){if(wi===1){wi=0;var c=Lu,d=Jf,g=(d.flags&13878)!==0;if((d.subtreeFlags&13878)!==0||g){g=P.T,P.T=null;var y=I.p;I.p=2;var k=Nn;Nn|=4;try{YM(d,c);var O=p_,L=yr(c.containerInfo),K=O.focusedElem,ne=O.selectionRange;if(L!==K&&K&&K.ownerDocument&&Jn(K.ownerDocument.documentElement,K)){if(ne!==null&&Vr(K)){var we=ne.start,ke=ne.end;if(ke===void 0&&(ke=we),"selectionStart"in K)K.selectionStart=we,K.selectionEnd=Math.min(ke,K.value.length);else{var Ie=K.ownerDocument||document,je=Ie&&Ie.defaultView||window;if(je.getSelection){var _e=je.getSelection(),xt=K.textContent.length,Rt=Math.min(ne.start,xt),nr=ne.end===void 0?Rt:Math.min(ne.end,xt);!_e.extend&&Rt>nr&&(L=nr,nr=Rt,Rt=L);var he=Tt(K,Rt),ue=Tt(K,nr);if(he&&ue&&(_e.rangeCount!==1||_e.anchorNode!==he.node||_e.anchorOffset!==he.offset||_e.focusNode!==ue.node||_e.focusOffset!==ue.offset)){var xe=Ie.createRange();xe.setStart(he.node,he.offset),_e.removeAllRanges(),Rt>nr?(_e.addRange(xe),_e.extend(ue.node,ue.offset)):(xe.setEnd(ue.node,ue.offset),_e.addRange(xe))}}}}for(Ie=[],_e=K;_e=_e.parentNode;)_e.nodeType===1&&Ie.push({element:_e,left:_e.scrollLeft,top:_e.scrollTop});for(typeof K.focus=="function"&&K.focus(),K=0;K<Ie.length;K++){var Ne=Ie[K];Ne.element.scrollLeft=Ne.left,Ne.element.scrollTop=Ne.top}}Ty=!!f_,p_=f_=null}finally{Nn=k,I.p=y,P.T=g}}c.current=d,wi=2}}function m8(){if(wi===2){wi=0;var c=Lu,d=Jf,g=(d.flags&8772)!==0;if((d.subtreeFlags&8772)!==0||g){g=P.T,P.T=null;var y=I.p;I.p=2;var k=Nn;Nn|=4;try{HM(c,d.alternate,d)}finally{Nn=k,I.p=y,P.T=g}}wi=3}}function g8(){if(wi===4||wi===3){wi=0,et();var c=Lu,d=Jf,g=Rc,y=n8;(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?wi=5:(wi=0,Jf=Lu=null,v8(c,c.pendingLanes));var k=c.pendingLanes;if(k===0&&(Pu=null),xi(g),d=d.stateNode,nn&&typeof nn.onCommitFiberRoot=="function")try{nn.onCommitFiberRoot(ln,d,void 0,(d.current.flags&128)===128)}catch{}if(y!==null){d=P.T,k=I.p,I.p=2,P.T=null;try{for(var O=c.onRecoverableError,L=0;L<y.length;L++){var K=y[L];O(K.value,{componentStack:K.stack})}}finally{P.T=d,I.p=k}}(Rc&3)!==0&&fy(),_l(c),k=c.pendingLanes,(g&261930)!==0&&(k&42)!==0?c===e_?L0++:(L0=0,e_=c):L0=0,$0(0)}}function v8(c,d){(c.pooledCacheLanes&=d)===0&&(d=c.pooledCache,d!=null&&(c.pooledCache=null,v0(d)))}function fy(){return p8(),m8(),g8(),b8()}function b8(){if(wi!==5)return!1;var c=Lu,d=Zj;Zj=0;var g=xi(Rc),y=P.T,k=I.p;try{I.p=32>g?32:g,P.T=null,g=Jj,Jj=null;var O=Lu,L=Rc;if(wi=0,Jf=Lu=null,Rc=0,(Nn&6)!==0)throw Error(r(331));var K=Nn;if(Nn|=4,JM(O.current),GM(O,O.current,L,g),Nn=K,$0(0,!1),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(ln,O)}catch{}return!0}finally{I.p=k,P.T=y,v8(c,d)}}function y8(c,d,g){d=Ka(g,d),d=Rj(c.stateNode,d,2),c=Eu(c,d,2),c!==null&&(rn(c,2),_l(c))}function Wn(c,d,g){if(c.tag===3)y8(c,c,g);else for(;d!==null;){if(d.tag===3){y8(d,c,g);break}else if(d.tag===1){var y=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Pu===null||!Pu.has(y))){c=Ka(g,c),g=xM(2),y=Eu(d,g,2),y!==null&&(wM(g,y,d,c),rn(y,2),_l(y));break}}d=d.return}}function r_(c,d,g){var y=c.pingCache;if(y===null){y=c.pingCache=new FQ;var k=new Set;y.set(d,k)}else k=y.get(d),k===void 0&&(k=new Set,y.set(d,k));k.has(g)||(Xj=!0,k.add(g),c=WQ.bind(null,c,d,g),d.then(c,c))}function WQ(c,d,g){var y=c.pingCache;y!==null&&y.delete(d),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,sr===c&&(fn&g)===g&&(Qr===4||Qr===3&&(fn&62914560)===fn&&300>Ve()-oy?(Nn&2)===0&&ep(c,0):Gj|=g,Zf===fn&&(Zf=0)),_l(c)}function x8(c,d){d===0&&(d=Et()),c=ld(c,d),c!==null&&(rn(c,d),_l(c))}function YQ(c){var d=c.memoizedState,g=0;d!==null&&(g=d.retryLane),x8(c,g)}function XQ(c,d){var g=0;switch(c.tag){case 31:case 13:var y=c.stateNode,k=c.memoizedState;k!==null&&(g=k.retryLane);break;case 19:y=c.stateNode;break;case 22:y=c.stateNode._retryCache;break;default:throw Error(r(314))}y!==null&&y.delete(d),x8(c,g)}function GQ(c,d){return Ye(c,d)}var py=null,np=null,i_=!1,my=!1,s_=!1,Iu=0;function _l(c){c!==np&&c.next===null&&(np===null?py=np=c:np=np.next=c),my=!0,i_||(i_=!0,ZQ())}function $0(c,d){if(!s_&&my){s_=!0;do for(var g=!1,y=py;y!==null;){if(c!==0){var k=y.pendingLanes;if(k===0)var O=0;else{var L=y.suspendedLanes,K=y.pingedLanes;O=(1<<31-Wt(42|c)+1)-1,O&=k&~(L&~K),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(g=!0,_8(y,O))}else O=fn,O=ie(y,y===sr?O:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(O&3)===0||Oe(y,O)||(g=!0,_8(y,O));y=y.next}while(g);s_=!1}}function KQ(){w8()}function w8(){my=i_=!1;var c=0;Iu!==0&&lW()&&(c=Iu);for(var d=Ve(),g=null,y=py;y!==null;){var k=y.next,O=S8(y,d);O===0?(y.next=null,g===null?py=k:g.next=k,k===null&&(np=g)):(g=y,(c!==0||(O&3)!==0)&&(my=!0)),y=k}wi!==0&&wi!==5||$0(c),Iu!==0&&(Iu=0)}function S8(c,d){for(var g=c.suspendedLanes,y=c.pingedLanes,k=c.expirationTimes,O=c.pendingLanes&-62914561;0<O;){var L=31-Wt(O),K=1<<L,ne=k[L];ne===-1?((K&g)===0||(K&y)!==0)&&(k[L]=nt(K,d)):ne<=d&&(c.expiredLanes|=K),O&=~K}if(d=sr,g=fn,g=ie(c,c===d?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),y=c.callbackNode,g===0||c===d&&(Qn===2||Qn===9)||c.cancelPendingCommit!==null)return y!==null&&y!==null&&$t(y),c.callbackNode=null,c.callbackPriority=0;if((g&3)===0||Oe(c,g)){if(d=g&-g,d===c.callbackPriority)return d;switch(y!==null&&$t(y),xi(g)){case 2:case 8:g=ge;break;case 32:g=Kt;break;case 268435456:g=Ft;break;default:g=Kt}return y=j8.bind(null,c),g=Ye(g,y),c.callbackPriority=d,c.callbackNode=g,d}return y!==null&&y!==null&&$t(y),c.callbackPriority=2,c.callbackNode=null,2}function j8(c,d){if(wi!==0&&wi!==5)return c.callbackNode=null,c.callbackPriority=0,null;var g=c.callbackNode;if(fy()&&c.callbackNode!==g)return null;var y=fn;return y=ie(c,c===sr?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),y===0?null:(i8(c,y,d),S8(c,Ve()),c.callbackNode!=null&&c.callbackNode===g?j8.bind(null,c):null)}function _8(c,d){if(fy())return null;i8(c,d,!0)}function ZQ(){uW(function(){(Nn&6)!==0?Ye(Ce,KQ):w8()})}function a_(){if(Iu===0){var c=qf;c===0&&(c=ir,ir<<=1,(ir&261888)===0&&(ir=256)),Iu=c}return Iu}function T8(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:Wa(""+c)}function C8(c,d){var g=d.ownerDocument.createElement("input");return g.name=d.name,g.value=d.value,c.id&&g.setAttribute("form",c.id),d.parentNode.insertBefore(g,d),c=new FormData(c),g.parentNode.removeChild(g),c}function JQ(c,d,g,y,k){if(d==="submit"&&g&&g.stateNode===k){var O=T8((k[Di]||null).action),L=y.submitter;L&&(d=(d=L[Di]||null)?T8(d.formAction):L.getAttribute("formAction"),d!==null&&(O=d,L=null));var K=new Br("action","action",null,y,k);c.push({event:K,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(Iu!==0){var ne=L?C8(k,L):new FormData(k);Cj(g,{pending:!0,data:ne,method:k.method,action:O},null,ne)}}else typeof O=="function"&&(K.preventDefault(),ne=L?C8(k,L):new FormData(k),Cj(g,{pending:!0,data:ne,method:k.method,action:O},O,ne))},currentTarget:k}]})}}for(var o_=0;o_<HS.length;o_++){var l_=HS[o_],eW=l_.toLowerCase(),tW=l_[0].toUpperCase()+l_.slice(1);Ro(eW,"on"+tW)}Ro(Li,"onAnimationEnd"),Ro(ws,"onAnimationIteration"),Ro(xl,"onAnimationStart"),Ro("dblclick","onDoubleClick"),Ro("focusin","onFocus"),Ro("focusout","onBlur"),Ro(Ji,"onTransitionRun"),Ro(Eb,"onTransitionStart"),Ro(yQ,"onTransitionCancel"),Ro(aA,"onTransitionEnd"),Qe("onMouseEnter",["mouseout","mouseover"]),Qe("onMouseLeave",["mouseout","mouseover"]),Qe("onPointerEnter",["pointerout","pointerover"]),Qe("onPointerLeave",["pointerout","pointerover"]),ps("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ps("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ps("onBeforeInput",["compositionend","keypress","textInput","paste"]),ps("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ps("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ps("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var I0="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(" "),nW=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(I0));function k8(c,d){d=(d&4)!==0;for(var g=0;g<c.length;g++){var y=c[g],k=y.event;y=y.listeners;e:{var O=void 0;if(d)for(var L=y.length-1;0<=L;L--){var K=y[L],ne=K.instance,we=K.currentTarget;if(K=K.listener,ne!==O&&k.isPropagationStopped())break e;O=K,k.currentTarget=we;try{O(k)}catch(ke){Ab(ke)}k.currentTarget=null,O=ne}else for(L=0;L<y.length;L++){if(K=y[L],ne=K.instance,we=K.currentTarget,K=K.listener,ne!==O&&k.isPropagationStopped())break e;O=K,k.currentTarget=we;try{O(k)}catch(ke){Ab(ke)}k.currentTarget=null,O=ne}}}}function un(c,d){var g=d[ed];g===void 0&&(g=d[ed]=new Set);var y=c+"__bubble";g.has(y)||(O8(d,c,2,!1),g.add(y))}function c_(c,d,g){var y=0;d&&(y|=4),O8(g,c,y,d)}var gy="_reactListening"+Math.random().toString(36).slice(2);function u_(c){if(!c[gy]){c[gy]=!0,hu.forEach(function(g){g!=="selectionchange"&&(nW.has(g)||c_(g,!1,c),c_(g,!0,c))});var d=c.nodeType===9?c:c.ownerDocument;d===null||d[gy]||(d[gy]=!0,c_("selectionchange",!1,d))}}function O8(c,d,g,y){switch(r5(d)){case 2:var k=AW;break;case 8:k=MW;break;default:k=T_}g=k.bind(null,d,g,c),k=void 0,!Df||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(k=!0),y?k!==void 0?c.addEventListener(d,g,{capture:!0,passive:k}):c.addEventListener(d,g,!0):k!==void 0?c.addEventListener(d,g,{passive:k}):c.addEventListener(d,g,!1)}function h_(c,d,g,y,k){var O=y;if((d&1)===0&&(d&2)===0&&y!==null)e:for(;;){if(y===null)return;var L=y.tag;if(L===3||L===4){var K=y.stateNode.containerInfo;if(K===k)break;if(L===4)for(L=y.return;L!==null;){var ne=L.tag;if((ne===3||ne===4)&&L.stateNode.containerInfo===k)return;L=L.return}for(;K!==null;){if(L=yn(K),L===null)return;if(ne=L.tag,ne===5||ne===6||ne===26||ne===27){y=O=L;continue e}K=K.parentNode}}y=y.return}gu(function(){var we=O,ke=Dt(g),Ie=[];e:{var je=oA.get(c);if(je!==void 0){var _e=Br,xt=c;switch(c){case"keypress":if(Ln(g)===0)break e;case"keydown":case"keyup":_e=qS;break;case"focusin":xt="focus",_e=ba;break;case"focusout":xt="blur",_e=ba;break;case"beforeblur":case"afterblur":_e=ba;break;case"click":if(g.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_e=bb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=IS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=Sb;break;case Li:case ws:case xl:_e=pc;break;case aA:_e=u0;break;case"scroll":case"scrollend":_e=bu;break;case"wheel":_e=jb;break;case"copy":case"cut":case"paste":_e=zS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=Mo;break;case"toggle":case"beforetoggle":_e=Tb}var Rt=(d&4)!==0,nr=!Rt&&(c==="scroll"||c==="scrollend"),he=Rt?je!==null?je+"Capture":null:je;Rt=[];for(var ue=we,xe;ue!==null;){var Ne=ue;if(xe=Ne.stateNode,Ne=Ne.tag,Ne!==5&&Ne!==26&&Ne!==27||xe===null||he===null||(Ne=Ya(ue,he),Ne!=null&&Rt.push(B0(ue,Ne,xe))),nr)break;ue=ue.return}0<Rt.length&&(je=new _e(je,xt,null,g,ke),Ie.push({event:je,listeners:Rt}))}}if((d&7)===0){e:{if(je=c==="mouseover"||c==="pointerover",_e=c==="mouseout"||c==="pointerout",je&&g!==wt&&(xt=g.relatedTarget||g.fromElement)&&(yn(xt)||xt[fs]))break e;if((_e||je)&&(je=ke.window===ke?ke:(je=ke.ownerDocument)?je.defaultView||je.parentWindow:window,_e?(xt=g.relatedTarget||g.toElement,_e=we,xt=xt?yn(xt):null,xt!==null&&(nr=s(xt),Rt=xt.tag,xt!==nr||Rt!==5&&Rt!==27&&Rt!==6)&&(xt=null)):(_e=null,xt=we),_e!==xt)){if(Rt=bb,Ne="onMouseLeave",he="onMouseEnter",ue="mouse",(c==="pointerout"||c==="pointerover")&&(Rt=Mo,Ne="onPointerLeave",he="onPointerEnter",ue="pointer"),nr=_e==null?je:oi(_e),xe=xt==null?je:oi(xt),je=new Rt(Ne,ue+"leave",_e,g,ke),je.target=nr,je.relatedTarget=xe,Ne=null,yn(ke)===we&&(Rt=new Rt(he,ue+"enter",xt,g,ke),Rt.target=xe,Rt.relatedTarget=nr,Ne=Rt),nr=Ne,_e&&xt)t:{for(Rt=rW,he=_e,ue=xt,xe=0,Ne=he;Ne;Ne=Rt(Ne))xe++;Ne=0;for(var Ot=ue;Ot;Ot=Rt(Ot))Ne++;for(;0<xe-Ne;)he=Rt(he),xe--;for(;0<Ne-xe;)ue=Rt(ue),Ne--;for(;xe--;){if(he===ue||ue!==null&&he===ue.alternate){Rt=he;break t}he=Rt(he),ue=Rt(ue)}Rt=null}else Rt=null;_e!==null&&E8(Ie,je,_e,Rt,!1),xt!==null&&nr!==null&&E8(Ie,nr,xt,Rt,!0)}}e:{if(je=we?oi(we):window,_e=je.nodeName&&je.nodeName.toLowerCase(),_e==="select"||_e==="input"&&je.type==="file")var Cn=J;else if(Su(je))if(ee)Cn=Lt;else{Cn=dt;var jt=ct}else _e=je.nodeName,!_e||_e.toLowerCase()!=="input"||je.type!=="checkbox"&&je.type!=="radio"?we&&gl(we.elementType)&&(Cn=J):Cn=vt;if(Cn&&(Cn=Cn(c,we))){Ob(Ie,Cn,g,ke);break e}jt&&jt(c,je,we),c==="focusout"&&we&&je.type==="number"&&we.memoizedProps.value!=null&&hc(je,"number",je.value)}switch(jt=we?oi(we):window,c){case"focusin":(Su(jt)||jt.contentEditable==="true")&&(Un=jt,Zi=we,ti=null);break;case"focusout":ti=Zi=Un=null;break;case"mousedown":ys=!0;break;case"contextmenu":case"mouseup":case"dragend":ys=!1,Ks(Ie,g,ke);break;case"selectionchange":if($n)break;case"keydown":case"keyup":Ks(Ie,g,ke)}var Jt;if(Nf)e:{switch(c){case"compositionstart":var pn="onCompositionStart";break e;case"compositionend":pn="onCompositionEnd";break e;case"compositionupdate":pn="onCompositionUpdate";break e}pn=void 0}else vc?ad(c,g)&&(pn="onCompositionEnd"):c==="keydown"&&g.keyCode===229&&(pn="onCompositionStart");pn&&(d0&&g.locale!=="ko"&&(vc||pn!=="onCompositionStart"?pn==="onCompositionEnd"&&vc&&(Jt=s0()):(Rs=ke,bl="value"in Rs?Rs.value:Rs.textContent,vc=!0)),jt=vy(we,pn),0<jt.length&&(pn=new yb(pn,c,null,g,ke),Ie.push({event:pn,listeners:jt}),Jt?pn.data=Jt:(Jt=ei(g),Jt!==null&&(pn.data=Jt)))),(Jt=FS?Hr(c,g):kb(c,g))&&(pn=vy(we,"onBeforeInput"),0<pn.length&&(jt=new yb("onBeforeInput","beforeinput",null,g,ke),Ie.push({event:jt,listeners:pn}),jt.data=Jt)),JQ(Ie,c,we,g,ke)}k8(Ie,d)})}function B0(c,d,g){return{instance:c,listener:d,currentTarget:g}}function vy(c,d){for(var g=d+"Capture",y=[];c!==null;){var k=c,O=k.stateNode;if(k=k.tag,k!==5&&k!==26&&k!==27||O===null||(k=Ya(c,g),k!=null&&y.unshift(B0(c,k,O)),k=Ya(c,d),k!=null&&y.push(B0(c,k,O))),c.tag===3)return y;c=c.return}return[]}function rW(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function E8(c,d,g,y,k){for(var O=d._reactName,L=[];g!==null&&g!==y;){var K=g,ne=K.alternate,we=K.stateNode;if(K=K.tag,ne!==null&&ne===y)break;K!==5&&K!==26&&K!==27||we===null||(ne=we,k?(we=Ya(g,O),we!=null&&L.unshift(B0(g,we,ne))):k||(we=Ya(g,O),we!=null&&L.push(B0(g,we,ne)))),g=g.return}L.length!==0&&c.push({event:d,listeners:L})}var iW=/\r\n?/g,sW=/\u0000|\uFFFD/g;function A8(c){return(typeof c=="string"?c:""+c).replace(iW,`
`).replace(sW,"")}function M8(c,d){return d=A8(d),A8(c)===d}function tr(c,d,g,y,k,O){switch(g){case"children":typeof y=="string"?d==="body"||d==="textarea"&&y===""||At(c,y):(typeof y=="number"||typeof y=="bigint")&&d!=="body"&&At(c,""+y);break;case"className":Gi(c,"class",y);break;case"tabIndex":Gi(c,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Gi(c,g,y);break;case"style":Rn(c,y,O);break;case"data":if(d!=="object"){Gi(c,"data",y);break}case"src":case"href":if(y===""&&(d!=="a"||g!=="href")){c.removeAttribute(g);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){c.removeAttribute(g);break}y=Wa(""+y),c.setAttribute(g,y);break;case"action":case"formAction":if(typeof y=="function"){c.setAttribute(g,"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 O=="function"&&(g==="formAction"?(d!=="input"&&tr(c,d,"name",k.name,k,null),tr(c,d,"formEncType",k.formEncType,k,null),tr(c,d,"formMethod",k.formMethod,k,null),tr(c,d,"formTarget",k.formTarget,k,null)):(tr(c,d,"encType",k.encType,k,null),tr(c,d,"method",k.method,k,null),tr(c,d,"target",k.target,k,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){c.removeAttribute(g);break}y=Wa(""+y),c.setAttribute(g,y);break;case"onClick":y!=null&&(c.onclick=Ge);break;case"onScroll":y!=null&&un("scroll",c);break;case"onScrollEnd":y!=null&&un("scrollend",c);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(g=y.__html,g!=null){if(k.children!=null)throw Error(r(60));c.innerHTML=g}}break;case"multiple":c.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":c.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){c.removeAttribute("xlink:href");break}g=Wa(""+y),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",g);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?c.setAttribute(g,""+y):c.removeAttribute(g);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":y&&typeof y!="function"&&typeof y!="symbol"?c.setAttribute(g,""):c.removeAttribute(g);break;case"capture":case"download":y===!0?c.setAttribute(g,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?c.setAttribute(g,y):c.removeAttribute(g);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?c.setAttribute(g,y):c.removeAttribute(g);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?c.removeAttribute(g):c.setAttribute(g,y);break;case"popover":un("beforetoggle",c),un("toggle",c),li(c,"popover",y);break;case"xlinkActuate":Fn(c,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":Fn(c,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":Fn(c,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":Fn(c,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":Fn(c,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":Fn(c,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":Fn(c,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":Fn(c,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":Fn(c,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":li(c,"is",y);break;case"innerText":case"textContent":break;default:(!(2<g.length)||g[0]!=="o"&&g[0]!=="O"||g[1]!=="n"&&g[1]!=="N")&&(g=gs.get(g)||g,li(c,g,y))}}function d_(c,d,g,y,k,O){switch(g){case"style":Rn(c,y,O);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(g=y.__html,g!=null){if(k.children!=null)throw Error(r(60));c.innerHTML=g}}break;case"children":typeof y=="string"?At(c,y):(typeof y=="number"||typeof y=="bigint")&&At(c,""+y);break;case"onScroll":y!=null&&un("scroll",c);break;case"onScrollEnd":y!=null&&un("scrollend",c);break;case"onClick":y!=null&&(c.onclick=Ge);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qa.hasOwnProperty(g))e:{if(g[0]==="o"&&g[1]==="n"&&(k=g.endsWith("Capture"),d=g.slice(2,k?g.length-7:void 0),O=c[Di]||null,O=O!=null?O[g]:null,typeof O=="function"&&c.removeEventListener(d,O,k),typeof y=="function")){typeof O!="function"&&O!==null&&(g in c?c[g]=null:c.hasAttribute(g)&&c.removeAttribute(g)),c.addEventListener(d,y,k);break e}g in c?c[g]=y:y===!0?c.setAttribute(g,""):li(c,g,y)}}}function rs(c,d,g){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":un("error",c),un("load",c);var y=!1,k=!1,O;for(O in g)if(g.hasOwnProperty(O)){var L=g[O];if(L!=null)switch(O){case"src":y=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:tr(c,d,O,L,g,null)}}k&&tr(c,d,"srcSet",g.srcSet,g,null),y&&tr(c,d,"src",g.src,g,null);return;case"input":un("invalid",c);var K=O=L=k=null,ne=null,we=null;for(y in g)if(g.hasOwnProperty(y)){var ke=g[y];if(ke!=null)switch(y){case"name":k=ke;break;case"type":L=ke;break;case"checked":ne=ke;break;case"defaultChecked":we=ke;break;case"value":O=ke;break;case"defaultValue":K=ke;break;case"children":case"dangerouslySetInnerHTML":if(ke!=null)throw Error(r(137,d));break;default:tr(c,d,y,ke,g,null)}}uc(c,O,K,ne,we,L,k,!1);return;case"select":un("invalid",c),y=L=O=null;for(k in g)if(g.hasOwnProperty(k)&&(K=g[k],K!=null))switch(k){case"value":O=K;break;case"defaultValue":L=K;break;case"multiple":y=K;default:tr(c,d,k,K,g,null)}d=O,g=L,c.multiple=!!y,d!=null?Jr(c,!!y,d,!1):g!=null&&Jr(c,!!y,g,!0);return;case"textarea":un("invalid",c),O=k=y=null;for(L in g)if(g.hasOwnProperty(L)&&(K=g[L],K!=null))switch(L){case"value":y=K;break;case"defaultValue":k=K;break;case"children":O=K;break;case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(91));break;default:tr(c,d,L,K,g,null)}Eo(c,y,k,O);return;case"option":for(ne in g)if(g.hasOwnProperty(ne)&&(y=g[ne],y!=null))switch(ne){case"selected":c.selected=y&&typeof y!="function"&&typeof y!="symbol";break;default:tr(c,d,ne,y,g,null)}return;case"dialog":un("beforetoggle",c),un("toggle",c),un("cancel",c),un("close",c);break;case"iframe":case"object":un("load",c);break;case"video":case"audio":for(y=0;y<I0.length;y++)un(I0[y],c);break;case"image":un("error",c),un("load",c);break;case"details":un("toggle",c);break;case"embed":case"source":case"link":un("error",c),un("load",c);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(we in g)if(g.hasOwnProperty(we)&&(y=g[we],y!=null))switch(we){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:tr(c,d,we,y,g,null)}return;default:if(gl(d)){for(ke in g)g.hasOwnProperty(ke)&&(y=g[ke],y!==void 0&&d_(c,d,ke,y,g,void 0));return}}for(K in g)g.hasOwnProperty(K)&&(y=g[K],y!=null&&tr(c,d,K,y,g,null))}function aW(c,d,g,y){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var k=null,O=null,L=null,K=null,ne=null,we=null,ke=null;for(_e in g){var Ie=g[_e];if(g.hasOwnProperty(_e)&&Ie!=null)switch(_e){case"checked":break;case"value":break;case"defaultValue":ne=Ie;default:y.hasOwnProperty(_e)||tr(c,d,_e,null,y,Ie)}}for(var je in y){var _e=y[je];if(Ie=g[je],y.hasOwnProperty(je)&&(_e!=null||Ie!=null))switch(je){case"type":O=_e;break;case"name":k=_e;break;case"checked":we=_e;break;case"defaultChecked":ke=_e;break;case"value":L=_e;break;case"defaultValue":K=_e;break;case"children":case"dangerouslySetInnerHTML":if(_e!=null)throw Error(r(137,d));break;default:_e!==Ie&&tr(c,d,je,_e,y,Ie)}}pu(c,L,K,ne,we,ke,O,k);return;case"select":_e=L=K=je=null;for(O in g)if(ne=g[O],g.hasOwnProperty(O)&&ne!=null)switch(O){case"value":break;case"multiple":_e=ne;default:y.hasOwnProperty(O)||tr(c,d,O,null,y,ne)}for(k in y)if(O=y[k],ne=g[k],y.hasOwnProperty(k)&&(O!=null||ne!=null))switch(k){case"value":je=O;break;case"defaultValue":K=O;break;case"multiple":L=O;default:O!==ne&&tr(c,d,k,O,y,ne)}d=K,g=L,y=_e,je!=null?Jr(c,!!g,je,!1):!!y!=!!g&&(d!=null?Jr(c,!!g,d,!0):Jr(c,!!g,g?[]:"",!1));return;case"textarea":_e=je=null;for(K in g)if(k=g[K],g.hasOwnProperty(K)&&k!=null&&!y.hasOwnProperty(K))switch(K){case"value":break;case"children":break;default:tr(c,d,K,null,y,k)}for(L in y)if(k=y[L],O=g[L],y.hasOwnProperty(L)&&(k!=null||O!=null))switch(L){case"value":je=k;break;case"defaultValue":_e=k;break;case"children":break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:k!==O&&tr(c,d,L,k,y,O)}dc(c,je,_e);return;case"option":for(var xt in g)if(je=g[xt],g.hasOwnProperty(xt)&&je!=null&&!y.hasOwnProperty(xt))switch(xt){case"selected":c.selected=!1;break;default:tr(c,d,xt,null,y,je)}for(ne in y)if(je=y[ne],_e=g[ne],y.hasOwnProperty(ne)&&je!==_e&&(je!=null||_e!=null))switch(ne){case"selected":c.selected=je&&typeof je!="function"&&typeof je!="symbol";break;default:tr(c,d,ne,je,y,_e)}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 Rt in g)je=g[Rt],g.hasOwnProperty(Rt)&&je!=null&&!y.hasOwnProperty(Rt)&&tr(c,d,Rt,null,y,je);for(we in y)if(je=y[we],_e=g[we],y.hasOwnProperty(we)&&je!==_e&&(je!=null||_e!=null))switch(we){case"children":case"dangerouslySetInnerHTML":if(je!=null)throw Error(r(137,d));break;default:tr(c,d,we,je,y,_e)}return;default:if(gl(d)){for(var nr in g)je=g[nr],g.hasOwnProperty(nr)&&je!==void 0&&!y.hasOwnProperty(nr)&&d_(c,d,nr,void 0,y,je);for(ke in y)je=y[ke],_e=g[ke],!y.hasOwnProperty(ke)||je===_e||je===void 0&&_e===void 0||d_(c,d,ke,je,y,_e);return}}for(var he in g)je=g[he],g.hasOwnProperty(he)&&je!=null&&!y.hasOwnProperty(he)&&tr(c,d,he,null,y,je);for(Ie in y)je=y[Ie],_e=g[Ie],!y.hasOwnProperty(Ie)||je===_e||je==null&&_e==null||tr(c,d,Ie,je,y,_e)}function R8(c){switch(c){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function oW(){if(typeof performance.getEntriesByType=="function"){for(var c=0,d=0,g=performance.getEntriesByType("resource"),y=0;y<g.length;y++){var k=g[y],O=k.transferSize,L=k.initiatorType,K=k.duration;if(O&&K&&R8(L)){for(L=0,K=k.responseEnd,y+=1;y<g.length;y++){var ne=g[y],we=ne.startTime;if(we>K)break;var ke=ne.transferSize,Ie=ne.initiatorType;ke&&R8(Ie)&&(ne=ne.responseEnd,L+=ke*(ne<K?1:(K-we)/(ne-we)))}if(--y,d+=8*(O+L)/(k.duration/1e3),c++,10<c)break}}if(0<c)return d/c/1e6}return navigator.connection&&(c=navigator.connection.downlink,typeof c=="number")?c:5}var f_=null,p_=null;function by(c){return c.nodeType===9?c:c.ownerDocument}function D8(c){switch(c){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function N8(c,d){if(c===0)switch(d){case"svg":return 1;case"math":return 2;default:return 0}return c===1&&d==="foreignObject"?0:c}function m_(c,d){return c==="textarea"||c==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.children=="bigint"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var g_=null;function lW(){var c=window.event;return c&&c.type==="popstate"?c===g_?!1:(g_=c,!0):(g_=null,!1)}var P8=typeof setTimeout=="function"?setTimeout:void 0,cW=typeof clearTimeout=="function"?clearTimeout:void 0,L8=typeof Promise=="function"?Promise:void 0,uW=typeof queueMicrotask=="function"?queueMicrotask:typeof L8<"u"?function(c){return L8.resolve(null).then(c).catch(hW)}:P8;function hW(c){setTimeout(function(){throw c})}function Bu(c){return c==="head"}function $8(c,d){var g=d,y=0;do{var k=g.nextSibling;if(c.removeChild(g),k&&k.nodeType===8)if(g=k.data,g==="/$"||g==="/&"){if(y===0){c.removeChild(k),ap(d);return}y--}else if(g==="$"||g==="$?"||g==="$~"||g==="$!"||g==="&")y++;else if(g==="html")z0(c.ownerDocument.documentElement);else if(g==="head"){g=c.ownerDocument.head,z0(g);for(var O=g.firstChild;O;){var L=O.nextSibling,K=O.nodeName;O[vr]||K==="SCRIPT"||K==="STYLE"||K==="LINK"&&O.rel.toLowerCase()==="stylesheet"||g.removeChild(O),O=L}}else g==="body"&&z0(c.ownerDocument.body);g=k}while(g);ap(d)}function I8(c,d){var g=c;c=0;do{var y=g.nextSibling;if(g.nodeType===1?d?(g._stashedDisplay=g.style.display,g.style.display="none"):(g.style.display=g._stashedDisplay||"",g.getAttribute("style")===""&&g.removeAttribute("style")):g.nodeType===3&&(d?(g._stashedText=g.nodeValue,g.nodeValue=""):g.nodeValue=g._stashedText||""),y&&y.nodeType===8)if(g=y.data,g==="/$"){if(c===0)break;c--}else g!=="$"&&g!=="$?"&&g!=="$~"&&g!=="$!"||c++;g=y}while(g)}function v_(c){var d=c.firstChild;for(d&&d.nodeType===10&&(d=d.nextSibling);d;){var g=d;switch(d=d.nextSibling,g.nodeName){case"HTML":case"HEAD":case"BODY":v_(g),Er(g);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(g.rel.toLowerCase()==="stylesheet")continue}c.removeChild(g)}}function dW(c,d,g,y){for(;c.nodeType===1;){var k=g;if(c.nodeName.toLowerCase()!==d.toLowerCase()){if(!y&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(y){if(!c[vr])switch(d){case"meta":if(!c.hasAttribute("itemprop"))break;return c;case"link":if(O=c.getAttribute("rel"),O==="stylesheet"&&c.hasAttribute("data-precedence"))break;if(O!==k.rel||c.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||c.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||c.getAttribute("title")!==(k.title==null?null:k.title))break;return c;case"style":if(c.hasAttribute("data-precedence"))break;return c;case"script":if(O=c.getAttribute("src"),(O!==(k.src==null?null:k.src)||c.getAttribute("type")!==(k.type==null?null:k.type)||c.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&O&&c.hasAttribute("async")&&!c.hasAttribute("itemprop"))break;return c;default:return c}}else if(d==="input"&&c.type==="hidden"){var O=k.name==null?null:""+k.name;if(k.type==="hidden"&&c.getAttribute("name")===O)return c}else return c;if(c=no(c.nextSibling),c===null)break}return null}function fW(c,d,g){if(d==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!g||(c=no(c.nextSibling),c===null))return null;return c}function B8(c,d){for(;c.nodeType!==8;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!d||(c=no(c.nextSibling),c===null))return null;return c}function b_(c){return c.data==="$?"||c.data==="$~"}function y_(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState!=="loading"}function pW(c,d){var g=c.ownerDocument;if(c.data==="$~")c._reactRetry=d;else if(c.data!=="$?"||g.readyState!=="loading")d();else{var y=function(){d(),g.removeEventListener("DOMContentLoaded",y)};g.addEventListener("DOMContentLoaded",y),c._reactRetry=y}}function no(c){for(;c!=null;c=c.nextSibling){var d=c.nodeType;if(d===1||d===3)break;if(d===8){if(d=c.data,d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"||d==="F!"||d==="F")break;if(d==="/$"||d==="/&")return null}}return c}var x_=null;function z8(c){c=c.nextSibling;for(var d=0;c;){if(c.nodeType===8){var g=c.data;if(g==="/$"||g==="/&"){if(d===0)return no(c.nextSibling);d--}else g!=="$"&&g!=="$!"&&g!=="$?"&&g!=="$~"&&g!=="&"||d++}c=c.nextSibling}return null}function q8(c){c=c.previousSibling;for(var d=0;c;){if(c.nodeType===8){var g=c.data;if(g==="$"||g==="$!"||g==="$?"||g==="$~"||g==="&"){if(d===0)return c;d--}else g!=="/$"&&g!=="/&"||d++}c=c.previousSibling}return null}function F8(c,d,g){switch(d=by(g),c){case"html":if(c=d.documentElement,!c)throw Error(r(452));return c;case"head":if(c=d.head,!c)throw Error(r(453));return c;case"body":if(c=d.body,!c)throw Error(r(454));return c;default:throw Error(r(451))}}function z0(c){for(var d=c.attributes;d.length;)c.removeAttributeNode(d[0]);Er(c)}var ro=new Map,H8=new Set;function yy(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var Dc=I.d;I.d={f:mW,r:gW,D:vW,C:bW,L:yW,m:xW,X:SW,S:wW,M:jW};function mW(){var c=Dc.f(),d=uy();return c||d}function gW(c){var d=Ys(c);d!==null&&d.tag===5&&d.type==="form"?aM(d):Dc.r(c)}var rp=typeof document>"u"?null:document;function V8(c,d,g){var y=rp;if(y&&typeof d=="string"&&d){var k=Ki(d);k='link[rel="'+c+'"][href="'+k+'"]',typeof g=="string"&&(k+='[crossorigin="'+g+'"]'),H8.has(k)||(H8.add(k),c={rel:c,crossOrigin:g,href:d},y.querySelector(k)===null&&(d=y.createElement("link"),rs(d,"link",c),Ir(d),y.head.appendChild(d)))}}function vW(c){Dc.D(c),V8("dns-prefetch",c,null)}function bW(c,d){Dc.C(c,d),V8("preconnect",c,d)}function yW(c,d,g){Dc.L(c,d,g);var y=rp;if(y&&c&&d){var k='link[rel="preload"][as="'+Ki(d)+'"]';d==="image"&&g&&g.imageSrcSet?(k+='[imagesrcset="'+Ki(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(k+='[imagesizes="'+Ki(g.imageSizes)+'"]')):k+='[href="'+Ki(c)+'"]';var O=k;switch(d){case"style":O=ip(c);break;case"script":O=sp(c)}ro.has(O)||(c=p({rel:"preload",href:d==="image"&&g&&g.imageSrcSet?void 0:c,as:d},g),ro.set(O,c),y.querySelector(k)!==null||d==="style"&&y.querySelector(q0(O))||d==="script"&&y.querySelector(F0(O))||(d=y.createElement("link"),rs(d,"link",c),Ir(d),y.head.appendChild(d)))}}function xW(c,d){Dc.m(c,d);var g=rp;if(g&&c){var y=d&&typeof d.as=="string"?d.as:"script",k='link[rel="modulepreload"][as="'+Ki(y)+'"][href="'+Ki(c)+'"]',O=k;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=sp(c)}if(!ro.has(O)&&(c=p({rel:"modulepreload",href:c},d),ro.set(O,c),g.querySelector(k)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(F0(O)))return}y=g.createElement("link"),rs(y,"link",c),Ir(y),g.head.appendChild(y)}}}function wW(c,d,g){Dc.S(c,d,g);var y=rp;if(y&&c){var k=Xs(y).hoistableStyles,O=ip(c);d=d||"default";var L=k.get(O);if(!L){var K={loading:0,preload:null};if(L=y.querySelector(q0(O)))K.loading=5;else{c=p({rel:"stylesheet",href:c,"data-precedence":d},g),(g=ro.get(O))&&w_(c,g);var ne=L=y.createElement("link");Ir(ne),rs(ne,"link",c),ne._p=new Promise(function(we,ke){ne.onload=we,ne.onerror=ke}),ne.addEventListener("load",function(){K.loading|=1}),ne.addEventListener("error",function(){K.loading|=2}),K.loading|=4,xy(L,d,y)}L={type:"stylesheet",instance:L,count:1,state:K},k.set(O,L)}}}function SW(c,d){Dc.X(c,d);var g=rp;if(g&&c){var y=Xs(g).hoistableScripts,k=sp(c),O=y.get(k);O||(O=g.querySelector(F0(k)),O||(c=p({src:c,async:!0},d),(d=ro.get(k))&&S_(c,d),O=g.createElement("script"),Ir(O),rs(O,"link",c),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},y.set(k,O))}}function jW(c,d){Dc.M(c,d);var g=rp;if(g&&c){var y=Xs(g).hoistableScripts,k=sp(c),O=y.get(k);O||(O=g.querySelector(F0(k)),O||(c=p({src:c,async:!0,type:"module"},d),(d=ro.get(k))&&S_(c,d),O=g.createElement("script"),Ir(O),rs(O,"link",c),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},y.set(k,O))}}function U8(c,d,g,y){var k=(k=be.current)?yy(k):null;if(!k)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(d=ip(g.href),g=Xs(k).hoistableStyles,y=g.get(d),y||(y={type:"style",instance:null,count:0,state:null},g.set(d,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=ip(g.href);var O=Xs(k).hoistableStyles,L=O.get(c);if(L||(k=k.ownerDocument||k,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(c,L),(O=k.querySelector(q0(c)))&&!O._p&&(L.instance=O,L.state.loading=5),ro.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ro.set(c,g),O||_W(k,c,g,L.state))),d&&y===null)throw Error(r(528,""));return L}if(d&&y!==null)throw Error(r(529,""));return null;case"script":return d=g.async,g=g.src,typeof g=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=sp(g),g=Xs(k).hoistableScripts,y=g.get(d),y||(y={type:"script",instance:null,count:0,state:null},g.set(d,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function ip(c){return'href="'+Ki(c)+'"'}function q0(c){return'link[rel="stylesheet"]['+c+"]"}function Q8(c){return p({},c,{"data-precedence":c.precedence,precedence:null})}function _W(c,d,g,y){c.querySelector('link[rel="preload"][as="style"]['+d+"]")?y.loading=1:(d=c.createElement("link"),y.preload=d,d.addEventListener("load",function(){return y.loading|=1}),d.addEventListener("error",function(){return y.loading|=2}),rs(d,"link",g),Ir(d),c.head.appendChild(d))}function sp(c){return'[src="'+Ki(c)+'"]'}function F0(c){return"script[async]"+c}function W8(c,d,g){if(d.count++,d.instance===null)switch(d.type){case"style":var y=c.querySelector('style[data-href~="'+Ki(g.href)+'"]');if(y)return d.instance=y,Ir(y),y;var k=p({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return y=(c.ownerDocument||c).createElement("style"),Ir(y),rs(y,"style",k),xy(y,g.precedence,c),d.instance=y;case"stylesheet":k=ip(g.href);var O=c.querySelector(q0(k));if(O)return d.state.loading|=4,d.instance=O,Ir(O),O;y=Q8(g),(k=ro.get(k))&&w_(y,k),O=(c.ownerDocument||c).createElement("link"),Ir(O);var L=O;return L._p=new Promise(function(K,ne){L.onload=K,L.onerror=ne}),rs(O,"link",y),d.state.loading|=4,xy(O,g.precedence,c),d.instance=O;case"script":return O=sp(g.src),(k=c.querySelector(F0(O)))?(d.instance=k,Ir(k),k):(y=g,(k=ro.get(O))&&(y=p({},g),S_(y,k)),c=c.ownerDocument||c,k=c.createElement("script"),Ir(k),rs(k,"link",y),c.head.appendChild(k),d.instance=k);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(y=d.instance,d.state.loading|=4,xy(y,g.precedence,c));return d.instance}function xy(c,d,g){for(var y=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=y.length?y[y.length-1]:null,O=k,L=0;L<y.length;L++){var K=y[L];if(K.dataset.precedence===d)O=K;else if(O!==k)break}O?O.parentNode.insertBefore(c,O.nextSibling):(d=g.nodeType===9?g.head:g,d.insertBefore(c,d.firstChild))}function w_(c,d){c.crossOrigin==null&&(c.crossOrigin=d.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=d.referrerPolicy),c.title==null&&(c.title=d.title)}function S_(c,d){c.crossOrigin==null&&(c.crossOrigin=d.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=d.referrerPolicy),c.integrity==null&&(c.integrity=d.integrity)}var wy=null;function Y8(c,d,g){if(wy===null){var y=new Map,k=wy=new Map;k.set(g,y)}else k=wy,y=k.get(g),y||(y=new Map,k.set(g,y));if(y.has(c))return y;for(y.set(c,null),g=g.getElementsByTagName(c),k=0;k<g.length;k++){var O=g[k];if(!(O[vr]||O[$r]||c==="link"&&O.getAttribute("rel")==="stylesheet")&&O.namespaceURI!=="http://www.w3.org/2000/svg"){var L=O.getAttribute(d)||"";L=c+L;var K=y.get(L);K?K.push(O):y.set(L,[O])}}return y}function X8(c,d,g){c=c.ownerDocument||c,c.head.insertBefore(g,d==="title"?c.querySelector("head > title"):null)}function TW(c,d,g){if(g===1||d.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return c=d.disabled,typeof d.precedence=="string"&&c==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function G8(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function CW(c,d,g,y){if(g.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var k=ip(y.href),O=d.querySelector(q0(k));if(O){d=O._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(c.count++,c=Sy.bind(c),d.then(c,c)),g.state.loading|=4,g.instance=O,Ir(O);return}O=d.ownerDocument||d,y=Q8(y),(k=ro.get(k))&&w_(y,k),O=O.createElement("link"),Ir(O);var L=O;L._p=new Promise(function(K,ne){L.onload=K,L.onerror=ne}),rs(O,"link",y),g.instance=O}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,d),(d=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=Sy.bind(c),d.addEventListener("load",g),d.addEventListener("error",g))}}var j_=0;function kW(c,d){return c.stylesheets&&c.count===0&&_y(c,c.stylesheets),0<c.count||0<c.imgCount?function(g){var y=setTimeout(function(){if(c.stylesheets&&_y(c,c.stylesheets),c.unsuspend){var O=c.unsuspend;c.unsuspend=null,O()}},6e4+d);0<c.imgBytes&&j_===0&&(j_=62500*oW());var k=setTimeout(function(){if(c.waitingForImages=!1,c.count===0&&(c.stylesheets&&_y(c,c.stylesheets),c.unsuspend)){var O=c.unsuspend;c.unsuspend=null,O()}},(c.imgBytes>j_?50:800)+d);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(y),clearTimeout(k)}}:null}function Sy(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_y(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var jy=null;function _y(c,d){c.stylesheets=null,c.unsuspend!==null&&(c.count++,jy=new Map,d.forEach(OW,c),jy=null,Sy.call(c))}function OW(c,d){if(!(d.state.loading&4)){var g=jy.get(c);if(g)var y=g.get(null);else{g=new Map,jy.set(c,g);for(var k=c.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O<k.length;O++){var L=k[O];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(g.set(L.dataset.precedence,L),y=L)}y&&g.set(null,y)}k=d.instance,L=k.getAttribute("data-precedence"),O=g.get(L)||y,O===y&&g.set(null,k),g.set(L,k),this.count++,y=Sy.bind(this),k.addEventListener("load",y),k.addEventListener("error",y),O?O.parentNode.insertBefore(k,O.nextSibling):(c=c.nodeType===9?c.head:c,c.insertBefore(k,c.firstChild)),d.state.loading|=4}}var H0={$$typeof:T,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function EW(c,d,g,y,k,O,L,K,ne){this.tag=1,this.containerInfo=c,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=Mn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mn(0),this.hiddenUpdates=Mn(null),this.identifierPrefix=y,this.onUncaughtError=k,this.onCaughtError=O,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function K8(c,d,g,y,k,O,L,K,ne,we,ke,Ie){return c=new EW(c,d,g,L,ne,we,ke,Ie,K),d=1,O===!0&&(d|=24),O=ya(3,null,null,d),c.current=O,O.stateNode=c,d=nj(),d.refCount++,c.pooledCache=d,d.refCount++,O.memoizedState={element:y,isDehydrated:g,cache:d},aj(O),c}function Z8(c){return c?(c=Lf,c):Lf}function J8(c,d,g,y,k,O){k=Z8(k),y.context===null?y.context=k:y.pendingContext=k,y=Ou(d),y.payload={element:g},O=O===void 0?null:O,O!==null&&(y.callback=O),g=Eu(c,y,d),g!==null&&(ra(g,c,d),w0(g,c,d))}function e5(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g<d?g:d}}function __(c,d){e5(c,d),(c=c.alternate)&&e5(c,d)}function t5(c){if(c.tag===13||c.tag===31){var d=ld(c,67108864);d!==null&&ra(d,c,67108864),__(c,67108864)}}function n5(c){if(c.tag===13||c.tag===31){var d=_a();d=Yt(d);var g=ld(c,d);g!==null&&ra(g,c,d),__(c,d)}}var Ty=!0;function AW(c,d,g,y){var k=P.T;P.T=null;var O=I.p;try{I.p=2,T_(c,d,g,y)}finally{I.p=O,P.T=k}}function MW(c,d,g,y){var k=P.T;P.T=null;var O=I.p;try{I.p=8,T_(c,d,g,y)}finally{I.p=O,P.T=k}}function T_(c,d,g,y){if(Ty){var k=C_(y);if(k===null)h_(c,d,y,Cy,g),i5(c,y);else if(DW(k,c,d,g,y))y.stopPropagation();else if(i5(c,y),d&4&&-1<RW.indexOf(c)){for(;k!==null;){var O=Ys(k);if(O!==null)switch(O.tag){case 3:if(O=O.stateNode,O.current.memoizedState.isDehydrated){var L=An(O.pendingLanes);if(L!==0){var K=O;for(K.pendingLanes|=2,K.entangledLanes|=2;L;){var ne=1<<31-Wt(L);K.entanglements[1]|=ne,L&=~ne}_l(O),(Nn&6)===0&&(ly=Ve()+500,$0(0))}}break;case 31:case 13:K=ld(O,2),K!==null&&ra(K,O,2),uy(),__(O,2)}if(O=C_(y),O===null&&h_(c,d,y,Cy,g),O===k)break;k=O}k!==null&&y.stopPropagation()}else h_(c,d,y,null,g)}}function C_(c){return c=Dt(c),k_(c)}var Cy=null;function k_(c){if(Cy=null,c=yn(c),c!==null){var d=s(c);if(d===null)c=null;else{var g=d.tag;if(g===13){if(c=o(d),c!==null)return c;c=null}else if(g===31){if(c=l(d),c!==null)return c;c=null}else if(g===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;c=null}else d!==c&&(c=null)}}return Cy=c,null}function r5(c){switch(c){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(Le()){case Ce:return 2;case ge:return 8;case Kt:case qn:return 32;case Ft:return 268435456;default:return 32}default:return 32}}var O_=!1,zu=null,qu=null,Fu=null,V0=new Map,U0=new Map,Hu=[],RW="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 i5(c,d){switch(c){case"focusin":case"focusout":zu=null;break;case"dragenter":case"dragleave":qu=null;break;case"mouseover":case"mouseout":Fu=null;break;case"pointerover":case"pointerout":V0.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":U0.delete(d.pointerId)}}function Q0(c,d,g,y,k,O){return c===null||c.nativeEvent!==O?(c={blockedOn:d,domEventName:g,eventSystemFlags:y,nativeEvent:O,targetContainers:[k]},d!==null&&(d=Ys(d),d!==null&&t5(d)),c):(c.eventSystemFlags|=y,d=c.targetContainers,k!==null&&d.indexOf(k)===-1&&d.push(k),c)}function DW(c,d,g,y,k){switch(d){case"focusin":return zu=Q0(zu,c,d,g,y,k),!0;case"dragenter":return qu=Q0(qu,c,d,g,y,k),!0;case"mouseover":return Fu=Q0(Fu,c,d,g,y,k),!0;case"pointerover":var O=k.pointerId;return V0.set(O,Q0(V0.get(O)||null,c,d,g,y,k)),!0;case"gotpointercapture":return O=k.pointerId,U0.set(O,Q0(U0.get(O)||null,c,d,g,y,k)),!0}return!1}function s5(c){var d=yn(c.target);if(d!==null){var g=s(d);if(g!==null){if(d=g.tag,d===13){if(d=o(g),d!==null){c.blockedOn=d,oc(c.priority,function(){n5(g)});return}}else if(d===31){if(d=l(g),d!==null){c.blockedOn=d,oc(c.priority,function(){n5(g)});return}}else if(d===3&&g.stateNode.current.memoizedState.isDehydrated){c.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}c.blockedOn=null}function ky(c){if(c.blockedOn!==null)return!1;for(var d=c.targetContainers;0<d.length;){var g=C_(c.nativeEvent);if(g===null){g=c.nativeEvent;var y=new g.constructor(g.type,g);wt=y,g.target.dispatchEvent(y),wt=null}else return d=Ys(g),d!==null&&t5(d),c.blockedOn=g,!1;d.shift()}return!0}function a5(c,d,g){ky(c)&&g.delete(d)}function NW(){O_=!1,zu!==null&&ky(zu)&&(zu=null),qu!==null&&ky(qu)&&(qu=null),Fu!==null&&ky(Fu)&&(Fu=null),V0.forEach(a5),U0.forEach(a5)}function Oy(c,d){c.blockedOn===d&&(c.blockedOn=null,O_||(O_=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,NW)))}var Ey=null;function o5(c){Ey!==c&&(Ey=c,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ey===c&&(Ey=null);for(var d=0;d<c.length;d+=3){var g=c[d],y=c[d+1],k=c[d+2];if(typeof y!="function"){if(k_(y||g)===null)continue;break}var O=Ys(g);O!==null&&(c.splice(d,3),d-=3,Cj(O,{pending:!0,data:k,method:g.method,action:y},y,k))}}))}function ap(c){function d(ne){return Oy(ne,c)}zu!==null&&Oy(zu,c),qu!==null&&Oy(qu,c),Fu!==null&&Oy(Fu,c),V0.forEach(d),U0.forEach(d);for(var g=0;g<Hu.length;g++){var y=Hu[g];y.blockedOn===c&&(y.blockedOn=null)}for(;0<Hu.length&&(g=Hu[0],g.blockedOn===null);)s5(g),g.blockedOn===null&&Hu.shift();if(g=(c.ownerDocument||c).$$reactFormReplay,g!=null)for(y=0;y<g.length;y+=3){var k=g[y],O=g[y+1],L=k[Di]||null;if(typeof O=="function")L||o5(g);else if(L){var K=null;if(O&&O.hasAttribute("formAction")){if(k=O,L=O[Di]||null)K=L.formAction;else if(k_(k)!==null)continue}else K=L.action;typeof K=="function"?g[y+1]=K:(g.splice(y,3),y-=3),o5(g)}}}function l5(){function c(O){O.canIntercept&&O.info==="react-transition"&&O.intercept({handler:function(){return new Promise(function(L){return k=L})},focusReset:"manual",scroll:"manual"})}function d(){k!==null&&(k(),k=null),y||setTimeout(g,20)}function g(){if(!y&&!navigation.transition){var O=navigation.currentEntry;O&&O.url!=null&&navigation.navigate(O.url,{state:O.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,k=null;return navigation.addEventListener("navigate",c),navigation.addEventListener("navigatesuccess",d),navigation.addEventListener("navigateerror",d),setTimeout(g,100),function(){y=!0,navigation.removeEventListener("navigate",c),navigation.removeEventListener("navigatesuccess",d),navigation.removeEventListener("navigateerror",d),k!==null&&(k(),k=null)}}}function E_(c){this._internalRoot=c}Ay.prototype.render=E_.prototype.render=function(c){var d=this._internalRoot;if(d===null)throw Error(r(409));var g=d.current,y=_a();J8(g,y,c,d,null,null)},Ay.prototype.unmount=E_.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var d=c.containerInfo;J8(c.current,2,null,c,null,null),uy(),d[fs]=null}};function Ay(c){this._internalRoot=c}Ay.prototype.unstable_scheduleHydration=function(c){if(c){var d=ds();c={blockedOn:null,target:c,priority:d};for(var g=0;g<Hu.length&&d!==0&&d<Hu[g].priority;g++);Hu.splice(g,0,c),g===0&&s5(c)}};var c5=e.version;if(c5!=="19.2.4")throw Error(r(527,c5,"19.2.4"));I.findDOMNode=function(c){var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(r(188)):(c=Object.keys(c).join(","),Error(r(268,c)));return c=h(d),c=c!==null?f(c):null,c=c===null?null:c.stateNode,c};var PW={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var My=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!My.isDisabled&&My.supportsFiber)try{ln=My.inject(PW),nn=My}catch{}}return Y0.createRoot=function(c,d){if(!i(c))throw Error(r(299));var g=!1,y="",k=gM,O=vM,L=bM;return d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(y=d.identifierPrefix),d.onUncaughtError!==void 0&&(k=d.onUncaughtError),d.onCaughtError!==void 0&&(O=d.onCaughtError),d.onRecoverableError!==void 0&&(L=d.onRecoverableError)),d=K8(c,1,!1,null,null,g,y,null,k,O,L,l5),c[fs]=d.current,u_(c),new E_(d)},Y0.hydrateRoot=function(c,d,g){if(!i(c))throw Error(r(299));var y=!1,k="",O=gM,L=vM,K=bM,ne=null;return g!=null&&(g.unstable_strictMode===!0&&(y=!0),g.identifierPrefix!==void 0&&(k=g.identifierPrefix),g.onUncaughtError!==void 0&&(O=g.onUncaughtError),g.onCaughtError!==void 0&&(L=g.onCaughtError),g.onRecoverableError!==void 0&&(K=g.onRecoverableError),g.formState!==void 0&&(ne=g.formState)),d=K8(c,1,!0,d,g??null,y,k,ne,O,L,K,l5),d.context=Z8(null),g=d.current,y=_a(),y=Yt(y),k=Ou(y),k.callback=null,Eu(g,k,y),g=y,d.current.lanes=g,rn(d,g),_l(d),c[fs]=d.current,u_(c),new Ay(d)},Y0.version="19.2.4",Y0}var x5;function WW(){if(x5)return D_.exports;x5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),D_.exports=QW(),D_.exports}var YW=WW();const XW=dl(YW),GW="_link_88ik9_12",Ry={link:GW},KW="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2016.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20width='115.333px'%20height='114px'%20viewBox='0%200%20115.333%20114'%20enable-background='new%200%200%20115.333%20114'%20xml:space='preserve'%3e%3cg%20id='Layer_2'%3e%3c/g%3e%3cg%3e%3cpath%20fill='%23EEEEEE'%20d='M56.667,0.667C25.372,0.667,0,26.036,0,57.332c0,31.295,25.372,56.666,56.667,56.666%20s56.666-25.371,56.666-56.666C113.333,26.036,87.961,0.667,56.667,0.667z%20M56.667,106.722c-8.904,0-16.123-5.948-16.123-13.283%20H72.79C72.79,100.773,65.571,106.722,56.667,106.722z%20M83.297,89.04H30.034v-9.658h53.264V89.04z%20M83.106,74.411h-52.92%20c-0.176-0.203-0.356-0.403-0.526-0.609c-5.452-6.62-6.736-10.076-7.983-13.598c-0.021-0.116,6.611,1.355,11.314,2.413%20c0,0,2.42,0.56,5.958,1.205c-3.397-3.982-5.414-9.044-5.414-14.218c0-11.359,8.712-21.285,5.569-29.308%20c3.059,0.249,6.331,6.456,6.552,16.161c3.252-4.494,4.613-12.701,4.613-17.733c0-5.21,3.433-11.262,6.867-11.469%20c-3.061,5.045,0.793,9.37,4.219,20.099c1.285,4.03,1.121,10.812,2.113,15.113C63.797,33.534,65.333,20.5,71,16%20c-2.5,5.667,0.37,12.758,2.333,16.167c3.167,5.5,5.087,9.667,5.087,17.548c0,5.284-1.951,10.259-5.242,14.148%20c3.742-0.702,6.326-1.335,6.326-1.335l12.152-2.371C91.657,60.156,89.891,67.418,83.106,74.411z'/%3e%3c/g%3e%3c/svg%3e";var Pl=function(){return Pl=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Pl.apply(this,arguments)};function g7(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function ZW(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var R1="right-scroll-bar-position",D1="width-before-scroll-bar",JW="with-scroll-bars-hidden",eY="--removed-body-scroll-bar-size";function $_(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function tY(t,e){var n=M.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var nY=typeof window<"u"?M.useLayoutEffect:M.useEffect,w5=new WeakMap;function rY(t,e){var n=tY(null,function(r){return t.forEach(function(i){return $_(i,r)})});return nY(function(){var r=w5.get(n);if(r){var i=new Set(r),s=new Set(t),o=n.current;i.forEach(function(l){s.has(l)||$_(l,null)}),s.forEach(function(l){i.has(l)||$_(l,o)})}w5.set(n,t)},[t]),n}function iY(t){return t}function sY(t,e){e===void 0&&(e=iY);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var o=e(s,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(s),o=n}var u=function(){var f=o;o=[],f.forEach(s)},h=function(){return Promise.resolve().then(u)};h(),n={push:function(f){o.push(f),h()},filter:function(f){return o=o.filter(f),n}}}};return i}function aY(t){t===void 0&&(t={});var e=sY(null);return e.options=Pl({async:!0,ssr:!1},t),e}var v7=function(t){var e=t.sideCar,n=g7(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return M.createElement(r,Pl({},n))};v7.isSideCarExport=!0;function oY(t,e){return t.useMedium(e),v7}var b7=aY(),I_=function(){},Dw=M.forwardRef(function(t,e){var n=M.useRef(null),r=M.useState({onScrollCapture:I_,onWheelCapture:I_,onTouchMoveCapture:I_}),i=r[0],s=r[1],o=t.forwardProps,l=t.children,u=t.className,h=t.removeScrollBar,f=t.enabled,p=t.shards,m=t.sideCar,v=t.noRelative,b=t.noIsolation,x=t.inert,w=t.allowPinchZoom,S=t.as,_=S===void 0?"div":S,T=t.gapMode,C=g7(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=m,A=rY([n,e]),E=Pl(Pl({},C),i);return M.createElement(M.Fragment,null,f&&M.createElement(j,{sideCar:b7,removeScrollBar:h,shards:p,noRelative:v,noIsolation:b,inert:x,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:T}),o?M.cloneElement(M.Children.only(l),Pl(Pl({},E),{ref:A})):M.createElement(_,Pl({},E,{className:u,ref:A}),l))});Dw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Dw.classNames={fullWidth:D1,zeroRight:R1};var lY=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cY(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=lY();return e&&t.setAttribute("nonce",e),t}function uY(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function hY(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var dY=function(){var t=0,e=null;return{add:function(n){t==0&&(e=cY())&&(uY(e,n),hY(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},fY=function(){var t=dY();return function(e,n){M.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},y7=function(){var t=fY(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},pY={left:0,top:0,right:0,gap:0},B_=function(t){return parseInt(t||"",10)||0},mY=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[B_(n),B_(r),B_(i)]},gY=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return pY;var e=mY(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},vY=y7(),Ap="data-scroll-locked",bY=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
  .`.concat(JW,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat(Ap,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(s,`px;
    padding-right: `).concat(o,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(l,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(R1,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(D1,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(R1," .").concat(R1,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(D1," .").concat(D1,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Ap,`] {
    `).concat(eY,": ").concat(l,`px;
  }
`)},S5=function(){var t=parseInt(document.body.getAttribute(Ap)||"0",10);return isFinite(t)?t:0},yY=function(){M.useEffect(function(){return document.body.setAttribute(Ap,(S5()+1).toString()),function(){var t=S5()-1;t<=0?document.body.removeAttribute(Ap):document.body.setAttribute(Ap,t.toString())}},[])},xY=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;yY();var s=M.useMemo(function(){return gY(i)},[i]);return M.createElement(vY,{styles:bY(s,!e,i,n?"":"!important")})},ZT=!1;if(typeof window<"u")try{var Dy=Object.defineProperty({},"passive",{get:function(){return ZT=!0,!0}});window.addEventListener("test",Dy,Dy),window.removeEventListener("test",Dy,Dy)}catch{ZT=!1}var op=ZT?{passive:!1}:!1,wY=function(t){return t.tagName==="TEXTAREA"},x7=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!wY(t)&&n[e]==="visible")},SY=function(t){return x7(t,"overflowY")},jY=function(t){return x7(t,"overflowX")},j5=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=w7(t,r);if(i){var s=S7(t,r),o=s[1],l=s[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},_Y=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},TY=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},w7=function(t,e){return t==="v"?SY(e):jY(e)},S7=function(t,e){return t==="v"?_Y(e):TY(e)},CY=function(t,e){return t==="h"&&e==="rtl"?-1:1},kY=function(t,e,n,r,i){var s=CY(t,window.getComputedStyle(e).direction),o=s*r,l=n.target,u=e.contains(l),h=!1,f=o>0,p=0,m=0;do{if(!l)break;var v=S7(t,l),b=v[0],x=v[1],w=v[2],S=x-w-s*b;(b||S)&&w7(t,l)&&(p+=S,m+=b);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(f&&Math.abs(p)<1||!f&&Math.abs(m)<1)&&(h=!0),h},Ny=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},_5=function(t){return[t.deltaX,t.deltaY]},T5=function(t){return t&&"current"in t?t.current:t},OY=function(t,e){return t[0]===e[0]&&t[1]===e[1]},EY=function(t){return`
  .block-interactivity-`.concat(t,` {pointer-events: none;}
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},AY=0,lp=[];function MY(t){var e=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),i=M.useState(AY++)[0],s=M.useState(y7)[0],o=M.useRef(t);M.useEffect(function(){o.current=t},[t]),M.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var x=ZW([t.lockRef.current],(t.shards||[]).map(T5),!0).filter(Boolean);return x.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var l=M.useCallback(function(x,w){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!o.current.allowPinchZoom;var S=Ny(x),_=n.current,T="deltaX"in x?x.deltaX:_[0]-S[0],C="deltaY"in x?x.deltaY:_[1]-S[1],j,A=x.target,E=Math.abs(T)>Math.abs(C)?"h":"v";if("touches"in x&&E==="h"&&A.type==="range")return!1;var R=j5(E,A);if(!R)return!0;if(R?j=E:(j=E==="v"?"h":"v",R=j5(E,A)),!R)return!1;if(!r.current&&"changedTouches"in x&&(T||C)&&(r.current=j),!j)return!0;var N=r.current||j;return kY(N,w,x,N==="h"?T:C)},[]),u=M.useCallback(function(x){var w=x;if(!(!lp.length||lp[lp.length-1]!==s)){var S="deltaY"in w?_5(w):Ny(w),_=e.current.filter(function(j){return j.name===w.type&&(j.target===w.target||w.target===j.shadowParent)&&OY(j.delta,S)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var T=(o.current.shards||[]).map(T5).filter(Boolean).filter(function(j){return j.contains(w.target)}),C=T.length>0?l(w,T[0]):!o.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),h=M.useCallback(function(x,w,S,_){var T={name:x,delta:w,target:S,should:_,shadowParent:RY(S)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(C){return C!==T})},1)},[]),f=M.useCallback(function(x){n.current=Ny(x),r.current=void 0},[]),p=M.useCallback(function(x){h(x.type,_5(x),x.target,l(x,t.lockRef.current))},[]),m=M.useCallback(function(x){h(x.type,Ny(x),x.target,l(x,t.lockRef.current))},[]);M.useEffect(function(){return lp.push(s),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,op),document.addEventListener("touchmove",u,op),document.addEventListener("touchstart",f,op),function(){lp=lp.filter(function(x){return x!==s}),document.removeEventListener("wheel",u,op),document.removeEventListener("touchmove",u,op),document.removeEventListener("touchstart",f,op)}},[]);var v=t.removeScrollBar,b=t.inert;return M.createElement(M.Fragment,null,b?M.createElement(s,{styles:EY(i)}):null,v?M.createElement(xY,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function RY(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const DY=oY(b7,MY);var uf=M.forwardRef(function(t,e){return M.createElement(Dw,Pl({},t,{ref:e,sideCar:DY}))});uf.classNames=Dw.classNames;function Kr(t){return Object.keys(t)}function z_(t){return t&&typeof t=="object"&&!Array.isArray(t)}function _6(t,e){const n={...t},r=e;return z_(t)&&z_(e)&&Object.keys(e).forEach(i=>{z_(r[i])&&i in t?n[i]=_6(n[i],r[i]):n[i]=r[i]}),n}function NY(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function PY(t){var e;return typeof t!="string"||!t.includes("var(--mantine-scale)")?t:(e=t.match(/^calc\((.*?)\)$/))==null?void 0:e[1].split("*")[0].trim()}function Hg(t){const e=PY(t);return typeof e=="number"?e:typeof e=="string"?e.includes("calc")||e.includes("var")?e:e.includes("px")?Number(e.replace("px","")):e.includes("rem")?Number(e.replace("rem",""))*16:e.includes("em")?Number(e.replace("em",""))*16:Number(e):NaN}function C5(t){return t==="0rem"?"0rem":`calc(${t} * var(--mantine-scale))`}function j7(t,{shouldScale:e=!1}={}){function n(r){if(r===0||r==="0")return`0${t}`;if(typeof r=="number"){const i=`${r/16}${t}`;return e?C5(i):i}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(s=>n(s)).join(",");if(r.includes(" "))return r.split(" ").map(s=>n(s)).join(" ");const i=r.replace("px","");if(!Number.isNaN(Number(i))){const s=`${Number(i)/16}${t}`;return e?C5(s):s}}return r}return n}const de=j7("rem",{shouldScale:!0}),As=j7("em");function Pv(t){return Object.keys(t).reduce((e,n)=>(t[n]!==void 0&&(e[n]=t[n]),e),{})}function _7(t){if(typeof t=="number")return!0;if(typeof t=="string"){if(t.startsWith("calc(")||t.startsWith("var(")||t.includes(" ")&&t.trim()!=="")return!0;const e=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return t.trim().split(/\s+/).every(r=>e.test(r))}return!1}function T6(t){return Array.isArray(t)||t===null?!1:typeof t=="object"?t.type!==M.Fragment:!1}function Wi(t){const e=M.createContext(null);return[({children:i,value:s})=>a.jsx(e.Provider,{value:s,children:i}),()=>{const i=M.useContext(e);if(i===null)throw new Error(t);return i}]}function Vh(t=null){const e=M.createContext(t);return[({children:i,value:s})=>a.jsx(e.Provider,{value:s,children:i}),()=>M.useContext(e)]}function mx(t,e){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(e);return`${t}-${n}`}}function gx(t,e){let n=t;for(;(n=n.parentElement)&&!n.matches(e););return n}function LY(t,e,n){for(let r=t-1;r>=0;r-=1)if(!e[r].disabled)return r;if(n){for(let r=e.length-1;r>-1;r-=1)if(!e[r].disabled)return r}return t}function $Y(t,e,n){for(let r=t+1;r<e.length;r+=1)if(!e[r].disabled)return r;if(n){for(let r=0;r<e.length;r+=1)if(!e[r].disabled)return r}return t}function IY(t,e,n){return gx(t,n)===gx(e,n)}function Nw({parentSelector:t,siblingSelector:e,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:s="rtl",orientation:o}){return l=>{var b;n==null||n(l);const u=Array.from(((b=gx(l.currentTarget,t))==null?void 0:b.querySelectorAll(e))||[]).filter(x=>IY(l.currentTarget,x,t)),h=u.findIndex(x=>l.currentTarget===x),f=$Y(h,u,r),p=LY(h,u,r),m=s==="rtl"?p:f,v=s==="rtl"?f:p;switch(l.key){case"ArrowRight":{o==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[m].focus(),i&&u[m].click());break}case"ArrowLeft":{o==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[v].focus(),i&&u[v].click());break}case"ArrowUp":{o==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[p].focus(),i&&u[p].click());break}case"ArrowDown":{o==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[f].focus(),i&&u[f].click());break}case"Home":{l.stopPropagation(),l.preventDefault(),!u[0].disabled&&u[0].focus();break}case"End":{l.stopPropagation(),l.preventDefault();const x=u.length-1;!u[x].disabled&&u[x].focus();break}}}}const BY={app:100,modal:200,popover:300,overlay:400,max:9999};function So(t){return BY[t]}const vx=()=>{};function zY(t,e={active:!0}){return typeof t!="function"||!e.active?e.onKeyDown||vx:n=>{var r;n.key==="Escape"&&(t(n),(r=e.onTrigger)==null||r.call(e))}}function zt(t,e="size",n=!0){if(t!==void 0)return _7(t)?n?de(t):t:`var(--${e}-${t})`}function Hi(t){return zt(t,"mantine-spacing")}function Zn(t){return t===void 0?"var(--mantine-radius-default)":zt(t,"mantine-radius")}function Or(t){return zt(t,"mantine-font-size")}function T7(t){return zt(t,"mantine-line-height",!1)}function C6(t){if(t)return zt(t,"mantine-shadow",!1)}function Vi(t,e){return n=>{t==null||t(n),e==null||e(n)}}function k6(t,e){return t in e?Hg(e[t]):Hg(t)}function JT(t,e){const n=t.map(r=>({value:r,px:k6(r,e)}));return n.sort((r,i)=>r.px-i.px),n}function Mp(t){return typeof t=="object"&&t!==null?"base"in t?t.base:void 0:t}function qY(t,e,n){var r;return n?Array.from(((r=gx(n,e))==null?void 0:r.querySelectorAll(t))||[]).findIndex(i=>i===n):null}function Sh(t,e,n){return e===void 0&&n===void 0?t:e!==void 0&&n===void 0?Math.max(t,e):Math.min(e===void 0&&n!==void 0?t:Math.max(t,e),n)}function dm(t="mantine-"){return`${t}${Math.random().toString(36).slice(2,11)}`}function FY(t,e){if(t===e||Number.isNaN(t)&&Number.isNaN(e))return!0;if(!(t instanceof Object)||!(e instanceof Object))return!1;const n=Object.keys(t),{length:r}=n;if(r!==Object.keys(e).length)return!1;for(let i=0;i<r;i+=1){const s=n[i];if(!(s in e)||t[s]!==e[s]&&!(Number.isNaN(t[s])&&Number.isNaN(e[s])))return!1}return!0}function Md(t){const e=M.useRef(t);return M.useEffect(()=>{e.current=t}),M.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function Pw(t,e){const{delay:n,flushOnUnmount:r,leading:i}=typeof e=="number"?{delay:e,flushOnUnmount:!1,leading:!1}:e,s=Md(t),o=M.useRef(0),l=M.useMemo(()=>{const u=Object.assign((...h)=>{window.clearTimeout(o.current);const f=u._isFirstCall;u._isFirstCall=!1;function p(){window.clearTimeout(o.current),o.current=0,u._isFirstCall=!0}if(i&&f){s(...h);const b=()=>{p()},x=()=>{o.current!==0&&(p(),s(...h))},w=()=>{p()};u.flush=x,u.cancel=w,o.current=window.setTimeout(b,n);return}if(i&&!f){const b=()=>{o.current!==0&&(p(),s(...h))},x=()=>{p()};u.flush=b,u.cancel=x;const w=()=>{p()};o.current=window.setTimeout(w,n);return}const m=()=>{o.current!==0&&(p(),s(...h))},v=()=>{p()};u.flush=m,u.cancel=v,o.current=window.setTimeout(m,n)},{flush:()=>{},cancel:()=>{},_isFirstCall:!0});return u},[s,n,i]);return M.useEffect(()=>()=>{r?l.flush():l.cancel()},[l,r]),l}const HY=["mousedown","touchstart"];function VY(t,e,n){const r=M.useRef(null),i=e||HY;return M.useEffect(()=>{const s=o=>{const{target:l}=o??{};if(Array.isArray(n)){const u=!document.body.contains(l)&&(l==null?void 0:l.tagName)!=="HTML";n.every(f=>!!f&&!o.composedPath().includes(f))&&!u&&t(o)}else r.current&&!r.current.contains(l)&&t(o)};return i.forEach(o=>document.addEventListener(o,s)),()=>{i.forEach(o=>document.removeEventListener(o,s))}},[r,t,n]),r}function C7(t={timeout:2e3}){const[e,n]=M.useState(null),[r,i]=M.useState(!1),[s,o]=M.useState(null),l=f=>{window.clearTimeout(s),o(window.setTimeout(()=>i(!1),t.timeout)),i(f)};return{copy:f=>{"clipboard"in navigator?navigator.clipboard.writeText(f).then(()=>l(!0)).catch(p=>n(p)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{i(!1),n(null),window.clearTimeout(s)},error:e,copied:r}}function UY(t,e){try{return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}catch{return t.addListener(e),()=>t.removeListener(e)}}function QY(t,e){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(t).matches:!1}function k7(t,e,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=M.useState(n?e:QY(t));return M.useEffect(()=>{try{const s=window.matchMedia(t);return i(s.matches),UY(s,o=>i(o.matches))}catch{return}},[t]),r||!1}function O7(t,e){return k7("(prefers-color-scheme: dark)",t==="dark",e)?"dark":"light"}function Lv(t,e,n={leading:!1}){const[r,i]=M.useState(t),s=M.useRef(!1),o=M.useRef(null),l=M.useRef(!1),u=M.useCallback(()=>window.clearTimeout(o.current),[]);return M.useEffect(()=>{s.current&&(!l.current&&n.leading?(l.current=!0,i(t)):(u(),o.current=window.setTimeout(()=>{l.current=!1,i(t)},e)))},[t,n.leading,e]),M.useEffect(()=>(s.current=!0,u),[]),[r,u]}const Sf=typeof document<"u"?M.useLayoutEffect:M.useEffect;function Yl(t,e){const n=M.useRef(!1);M.useEffect(()=>()=>{n.current=!1},[]),M.useEffect(()=>{if(n.current)return t();n.current=!0},e)}function E7({opened:t,shouldReturnFocus:e=!0}){const n=M.useRef(null),r=()=>{var i;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((i=n.current)==null||i.focus({preventScroll:!0}))};return Yl(()=>{let i=-1;const s=o=>{o.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",s),t?n.current=document.activeElement:e&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",s)}},[t,e]),r}const WY=/input|select|textarea|button|object/,A7="a, input, select, textarea, button, object, [tabindex]";function YY(t){return t.style.display==="none"}function XY(t){if(t.getAttribute("aria-hidden")||t.getAttribute("hidden")||t.getAttribute("type")==="hidden")return!1;let n=t;for(;n&&!(n===document.body||n.nodeType===11);){if(YY(n))return!1;n=n.parentNode}return!0}function M7(t){let e=t.getAttribute("tabindex");return e===null&&(e=void 0),parseInt(e,10)}function eC(t){const e=t.nodeName.toLowerCase(),n=!Number.isNaN(M7(t));return(WY.test(e)&&!t.disabled||t instanceof HTMLAnchorElement&&t.href||n)&&XY(t)}function R7(t){const e=M7(t);return(Number.isNaN(e)||e>=0)&&eC(t)}function GY(t){return Array.from(t.querySelectorAll(A7)).filter(R7)}function KY(t,e){const n=GY(t);if(!n.length){e.preventDefault();return}const r=n[e.shiftKey?0:n.length-1],i=t.getRootNode();let s=r===i.activeElement||t===i.activeElement;const o=i.activeElement;if(o.tagName==="INPUT"&&o.getAttribute("type")==="radio"&&(s=n.filter(f=>f.getAttribute("type")==="radio"&&f.getAttribute("name")===o.getAttribute("name")).includes(r)),!s)return;e.preventDefault();const u=n[e.shiftKey?n.length-1:0];u&&u.focus()}function ZY(t=!0){const e=M.useRef(null),n=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const o=Array.from(i.querySelectorAll(A7));s=o.find(R7)||o.find(eC)||null,!s&&eC(i)&&(s=i)}s&&s.focus({preventScroll:!0})},r=M.useCallback(i=>{t&&i!==null&&e.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&n(i)}),e.current=i):e.current=null)},[t]);return M.useEffect(()=>{if(!t)return;e.current&&setTimeout(()=>n(e.current));const i=s=>{s.key==="Tab"&&e.current&&KY(e.current,s)};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]),r}const JY=t=>(t+1)%1e6;function eX(){const[,t]=M.useReducer(JY,0);return t}const tX=_n.useId||(()=>{});function nX(){const t=tX();return t?`mantine-${t.replace(/:/g,"")}`:""}function Ei(t){const e=nX(),[n,r]=M.useState(e);return Sf(()=>{r(dm())},[]),typeof t=="string"?t:typeof window>"u"?e:n}function bx(t,e,n){M.useEffect(()=>(window.addEventListener(t,e,n),()=>window.removeEventListener(t,e,n)),[t,e])}function rX(t,e="use-local-storage"){try{return JSON.stringify(t)}catch{throw new Error(`@mantine/hooks ${e}: Failed to serialize the value`)}}function iX(t){try{return t&&JSON.parse(t)}catch{return t}}function sX(t){return{getItem:i=>{try{return window[t].getItem(i)}catch{return console.warn("use-local-storage: Failed to get value from storage, localStorage is blocked"),null}},setItem:(i,s)=>{try{window[t].setItem(i,s)}catch{console.warn("use-local-storage: Failed to set value to storage, localStorage is blocked")}},removeItem:i=>{try{window[t].removeItem(i)}catch{console.warn("use-local-storage: Failed to remove value from storage, localStorage is blocked")}}}}function aX(t,e){const n="mantine-local-storage",{getItem:r,setItem:i,removeItem:s}=sX(t);return function({key:l,defaultValue:u,getInitialValueInEffect:h=!0,sync:f=!0,deserialize:p=iX,serialize:m=v=>rX(v,e)}){const v=M.useCallback(_=>{let T;try{T=typeof window>"u"||!(t in window)||window[t]===null||!!_}catch{T=!0}if(T)return u;const C=r(l);return C!==null?p(C):u},[l,u]),[b,x]=M.useState(v(h)),w=M.useCallback(_=>{_ instanceof Function?x(T=>{const C=_(T);return i(l,m(C)),queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(n,{detail:{key:l,value:_(T)}}))}),C}):(i(l,m(_)),window.dispatchEvent(new CustomEvent(n,{detail:{key:l,value:_}})),x(_))},[l]),S=M.useCallback(()=>{s(l),x(u),window.dispatchEvent(new CustomEvent(n,{detail:{key:l,value:u}}))},[l,u]);return bx("storage",_=>{f&&_.storageArea===window[t]&&_.key===l&&x(p(_.newValue??void 0))}),bx(n,_=>{f&&_.detail.key===l&&x(_.detail.value)}),M.useEffect(()=>{u!==void 0&&b===void 0&&w(u)},[u,b,w]),M.useEffect(()=>{const _=v();_!==void 0&&w(_)},[l]),[b===void 0?u:b,w,S]}}function $v(t){return aX("localStorage","use-local-storage")(t)}function yx(t,e){if(typeof t=="function")return t(e);typeof t=="object"&&t!==null&&"current"in t&&(t.current=e)}function D7(...t){const e=new Map;return n=>{if(t.forEach(r=>{const i=yx(r,n);i&&e.set(r,i)}),e.size>0)return()=>{t.forEach(r=>{const i=e.get(r);i&&typeof i=="function"?i():yx(r,null)}),e.clear()}}}function cr(...t){return M.useCallback(D7(...t),t)}function Qi({value:t,defaultValue:e,finalValue:n,onChange:r=()=>{}}){const[i,s]=M.useState(e!==void 0?e:n),o=(l,...u)=>{s(l),r==null||r(l,...u)};return t!==void 0?[t,r,!0]:[i,o,!1]}function Uu(t,e){const n=e-t+1;return Array.from({length:n},(r,i)=>i+t)}const Py="dots";function oX({total:t,siblings:e=1,boundaries:n=1,page:r,initialPage:i=1,onChange:s}){const o=Math.max(Math.trunc(t),0),[l,u]=Qi({value:r,onChange:s,defaultValue:i,finalValue:i}),h=x=>{x<=0?u(1):x>o?u(o):u(x)},f=()=>h(l+1),p=()=>h(l-1),m=()=>h(1),v=()=>h(o);return{range:M.useMemo(()=>{if(e*2+3+n*2>=o)return Uu(1,o);const w=Math.max(l-e,n),S=Math.min(l+e,o-n),_=w>n+2,T=S<o-(n+1);if(!_&&T){const C=e*2+n+2;return[...Uu(1,C),Py,...Uu(o-(n-1),o)]}if(_&&!T){const C=n+1+2*e;return[...Uu(1,n),Py,...Uu(o-C,o)]}return[...Uu(1,n),Py,...Uu(w,S),Py,...Uu(o-n+1,o)]},[o,e,l]),active:l,setPage:h,next:f,previous:p,first:m,last:v}}function Lw(t,e){return k7("(prefers-reduced-motion: reduce)",t,e)}const lX={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function cX(t){const e=M.useRef(0),n=M.useRef(null),[r,i]=M.useState(lX),s=M.useMemo(()=>typeof window<"u"?new ResizeObserver(o=>{const l=o[0];l&&(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{var u,h;if(n.current){const f=((u=l.borderBoxSize)==null?void 0:u[0])||((h=l.contentBoxSize)==null?void 0:h[0]);if(f){const p=f.inlineSize,m=f.blockSize;i({width:p,height:m,x:l.contentRect.x,y:l.contentRect.y,top:l.contentRect.top,left:l.contentRect.left,bottom:l.contentRect.bottom,right:l.contentRect.right})}else i(l.contentRect)}}))}):null,[]);return M.useEffect(()=>(n.current&&(s==null||s.observe(n.current,t)),()=>{s==null||s.disconnect(),e.current&&cancelAnimationFrame(e.current)}),[n.current]),[n,r]}function uX(t){const[e,{width:n,height:r}]=cX(t);return{ref:e,width:n,height:r}}function hX(t,e){if(!t||!e)return!1;if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n+=1)if(!FY(t[n],e[n]))return!1;return!0}function dX(t){const e=M.useRef([]),n=M.useRef(0);return hX(e.current,t)||(e.current=t,n.current+=1),[n.current]}function fX(t,e){M.useEffect(t,dX(e))}function Iv(t=!1,e={}){const[n,r]=M.useState(t),i=M.useCallback(()=>{r(l=>{var u;return l||((u=e.onOpen)==null||u.call(e),!0)})},[e.onOpen]),s=M.useCallback(()=>{r(l=>{var u;return l&&((u=e.onClose)==null||u.call(e),!1)})},[e.onClose]),o=M.useCallback(()=>{n?s():i()},[s,i,n]);return[n,{open:i,close:s,toggle:o}]}function pX(t,e,n={autoInvoke:!1}){const r=M.useRef(null),i=M.useCallback((...o)=>{r.current||(r.current=window.setTimeout(()=>{t(o),r.current=null},e))},[e]),s=M.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return M.useEffect(()=>(n.autoInvoke&&i(),s),[s,i]),{start:i,clear:s}}function mX(t){const e=M.useRef(void 0);return M.useEffect(()=>{e.current=t},[t]),e.current}function gX(t,e,n){const r=M.useRef(null),i=M.useRef(null);return M.useEffect(()=>{const s=typeof n=="function"?n():n;return(s||i.current)&&(r.current=new MutationObserver(t),r.current.observe(s||i.current,e)),()=>{var o;(o=r.current)==null||o.disconnect()}},[t,e]),i}function vX(){const[t,e]=M.useState(!1);return M.useEffect(()=>e(!0),[]),t}var bX={};function yX(){return typeof process<"u"&&bX?"production":"development"}function $w(t){var n;const e=_n.version;return typeof _n.version!="string"||e.startsWith("18.")?t==null?void 0:t.ref:(n=t==null?void 0:t.props)==null?void 0:n.ref}function N1(t,e=document){const n=e.querySelector(t);if(n)return n;const r=e.querySelectorAll("*");for(let i=0;i<r.length;i+=1){const s=r[i];if(s.shadowRoot){const o=N1(t,s.shadowRoot);if(o)return o}}return null}function Wu(t,e=document){const n=[],r=e.querySelectorAll(t);n.push(...Array.from(r));const i=e.querySelectorAll("*");for(let s=0;s<i.length;s+=1){const o=i[s];if(o.shadowRoot){const l=Wu(t,o.shadowRoot);n.push(...l)}}return n}function Qu(t){if(!t)return document;const e=t.getRootNode();return e instanceof ShadowRoot||e instanceof Document?e:document}function jf(t){const e=M.Children.toArray(t);return e.length!==1||!T6(e[0])?null:e[0]}function N7(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=N7(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Lr(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=N7(t))&&(r&&(r+=" "),r+=e);return r}const xX={};function wX(t){const e={};return t.forEach(n=>{Object.entries(n).forEach(([r,i])=>{e[r]?e[r]=Lr(e[r],i):e[r]=i})}),e}function Iw({theme:t,classNames:e,props:n,stylesCtx:r}){const s=(Array.isArray(e)?e:[e]).map(o=>typeof o=="function"?o(t,n,r):o||xX);return wX(s)}function xx({theme:t,styles:e,props:n,stylesCtx:r}){return(Array.isArray(e)?e:[e]).reduce((s,o)=>typeof o=="function"?{...s,...o(t,n,r)}:{...s,...o},{})}const O6=M.createContext(null);function ru(){const t=M.useContext(O6);if(!t)throw new Error("[@mantine/core] MantineProvider was not found in tree");return t}function SX(){return ru().cssVariablesResolver}function jX(){return ru().classNamesPrefix}function Bw(){return ru().getStyleNonce}function _X(){return ru().withStaticClasses}function TX(){return ru().headless}function CX(){var t;return(t=ru().stylesTransform)==null?void 0:t.sx}function kX(){var t;return(t=ru().stylesTransform)==null?void 0:t.styles}function zw(){return ru().env||"default"}function OX(t){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(t)}function EX(t){let e=t.replace("#","");if(e.length===3){const o=e.split("");e=[o[0],o[0],o[1],o[1],o[2],o[2]].join("")}if(e.length===8){const o=parseInt(e.slice(6,8),16)/255;return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16),a:o}}const n=parseInt(e,16),r=n>>16&255,i=n>>8&255,s=n&255;return{r,g:i,b:s,a:1}}function AX(t){const[e,n,r,i]=t.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:e,g:n,b:r,a:i===void 0?1:i}}function MX(t){const e=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=t.match(e);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),i=parseInt(n[2],10)/100,s=parseInt(n[3],10)/100,o=n[5]?parseFloat(n[5]):void 0,l=(1-Math.abs(2*s-1))*i,u=r/60,h=l*(1-Math.abs(u%2-1)),f=s-l/2;let p,m,v;return u>=0&&u<1?(p=l,m=h,v=0):u>=1&&u<2?(p=h,m=l,v=0):u>=2&&u<3?(p=0,m=l,v=h):u>=3&&u<4?(p=0,m=h,v=l):u>=4&&u<5?(p=h,m=0,v=l):(p=l,m=0,v=h),{r:Math.round((p+f)*255),g:Math.round((m+f)*255),b:Math.round((v+f)*255),a:o||1}}function qw(t){return OX(t)?EX(t):t.startsWith("rgb")?AX(t):t.startsWith("hsl")?MX(t):{r:0,g:0,b:0,a:1}}function Ly(t,e){if(t.startsWith("var("))return`color-mix(in srgb, ${t}, black ${e*100}%)`;const{r:n,g:r,b:i,a:s}=qw(t),o=1-e,l=u=>Math.round(u*o);return`rgba(${l(n)}, ${l(r)}, ${l(i)}, ${s})`}function Vg(t,e){return typeof t.primaryShade=="number"?t.primaryShade:e==="dark"?t.primaryShade.dark:t.primaryShade.light}function q_(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function RX(t){const e=t.match(/oklch\((.*?)%\s/);return e?parseFloat(e[1]):null}function DX(t){if(t.startsWith("oklch("))return(RX(t)||0)/100;const{r:e,g:n,b:r}=qw(t),i=e/255,s=n/255,o=r/255,l=q_(i),u=q_(s),h=q_(o);return .2126*l+.7152*u+.0722*h}function X0(t,e=.179){return t.startsWith("var(")?!1:DX(t)>e}function iu({color:t,theme:e,colorScheme:n}){if(typeof t!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof t}`);if(t==="bright")return{color:t,value:n==="dark"?e.white:e.black,shade:void 0,isThemeColor:!1,isLight:X0(n==="dark"?e.white:e.black,e.luminanceThreshold),variable:"--mantine-color-bright"};if(t==="dimmed")return{color:t,value:n==="dark"?e.colors.dark[2]:e.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:X0(n==="dark"?e.colors.dark[2]:e.colors.gray[6],e.luminanceThreshold),variable:"--mantine-color-dimmed"};if(t==="white"||t==="black")return{color:t,value:t==="white"?e.white:e.black,shade:void 0,isThemeColor:!1,isLight:X0(t==="white"?e.white:e.black,e.luminanceThreshold),variable:`--mantine-color-${t}`};const[r,i]=t.split("."),s=i?Number(i):void 0,o=r in e.colors;if(o){const l=s!==void 0?e.colors[r][s]:e.colors[r][Vg(e,n||"light")];return{color:r,value:l,shade:s,isThemeColor:o,isLight:X0(l,e.luminanceThreshold),variable:i?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:t,value:t,isThemeColor:o,isLight:X0(t,e.luminanceThreshold),shade:s,variable:void 0}}function hr(t,e){const n=iu({color:t||e.primaryColor,theme:e});return n.variable?`var(${n.variable})`:t}function tC(t,e){const n={from:(t==null?void 0:t.from)||e.defaultGradient.from,to:(t==null?void 0:t.to)||e.defaultGradient.to,deg:(t==null?void 0:t.deg)??e.defaultGradient.deg??0},r=hr(n.from,e),i=hr(n.to,e);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function Al(t,e){if(typeof t!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";if(t.startsWith("var(")){const s=(1-e)*100;return`color-mix(in srgb, ${t}, transparent ${s}%)`}if(t.startsWith("oklch"))return t.includes("/")?t.replace(/\/\s*[\d.]+\s*\)/,`/ ${e})`):t.replace(")",` / ${e})`);const{r:n,g:r,b:i}=qw(t);return`rgba(${n}, ${r}, ${i}, ${e})`}const cp=Al,NX=({color:t,theme:e,variant:n,gradient:r,autoContrast:i})=>{const s=iu({color:t,theme:e}),o=typeof i=="boolean"?i:e.autoContrast;if(n==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(n==="filled"){const l=o&&s.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return s.isThemeColor?s.shade===void 0?{background:`var(--mantine-color-${t}-filled)`,hover:`var(--mantine-color-${t}-filled-hover)`,color:l,border:`${de(1)} solid transparent`}:{background:`var(--mantine-color-${s.color}-${s.shade})`,hover:`var(--mantine-color-${s.color}-${s.shade===9?8:s.shade+1})`,color:l,border:`${de(1)} solid transparent`}:{background:t,hover:Ly(t,.1),color:l,border:`${de(1)} solid transparent`}}if(n==="light"){if(s.isThemeColor){if(s.shade===void 0)return{background:`var(--mantine-color-${t}-light)`,hover:`var(--mantine-color-${t}-light-hover)`,color:`var(--mantine-color-${t}-light-color)`,border:`${de(1)} solid transparent`};const l=e.colors[s.color][s.shade];return{background:Al(l,.1),hover:Al(l,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${de(1)} solid transparent`}}return{background:Al(t,.1),hover:Al(t,.12),color:t,border:`${de(1)} solid transparent`}}if(n==="outline")return s.isThemeColor?s.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${t}-outline-hover)`,color:`var(--mantine-color-${t}-outline)`,border:`${de(1)} solid var(--mantine-color-${t}-outline)`}:{background:"transparent",hover:Al(e.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${de(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:Al(t,.05),color:t,border:`${de(1)} solid ${t}`};if(n==="subtle"){if(s.isThemeColor){if(s.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${t}-light-hover)`,color:`var(--mantine-color-${t}-light-color)`,border:`${de(1)} solid transparent`};const l=e.colors[s.color][s.shade];return{background:"transparent",hover:Al(l,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${de(1)} solid transparent`}}return{background:"transparent",hover:Al(t,.12),color:t,border:`${de(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${t}-light-color)`,border:`${de(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${de(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:t,border:`${de(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:Ly(e.white,.01),color:`var(--mantine-color-${t}-filled)`,border:`${de(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Ly(e.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${de(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Ly(e.white,.01),color:t,border:`${de(1)} solid transparent`}:n==="gradient"?{background:tC(r,e),hover:tC(r,e),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${de(1)} solid var(--mantine-color-default-border)`}:{}},PX={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},k5="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",E6={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:PX,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:NX,autoContrast:!1,luminanceThreshold:.3,fontFamily:k5,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:k5,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:de(34),lineHeight:"1.3"},h2:{fontSize:de(26),lineHeight:"1.35"},h3:{fontSize:de(22),lineHeight:"1.4"},h4:{fontSize:de(18),lineHeight:"1.45"},h5:{fontSize:de(16),lineHeight:"1.5"},h6:{fontSize:de(14),lineHeight:"1.5"}}},fontSizes:{xs:de(12),sm:de(14),md:de(16),lg:de(18),xl:de(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:de(2),sm:de(4),md:de(8),lg:de(16),xl:de(32)},spacing:{xs:de(10),sm:de(12),md:de(16),lg:de(20),xl:de(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${de(1)} ${de(3)} rgba(0, 0, 0, 0.05), 0 ${de(1)} ${de(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${de(1)} ${de(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${de(10)} ${de(15)} ${de(-5)}, rgba(0, 0, 0, 0.04) 0 ${de(7)} ${de(7)} ${de(-5)}`,md:`0 ${de(1)} ${de(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${de(20)} ${de(25)} ${de(-5)}, rgba(0, 0, 0, 0.04) 0 ${de(10)} ${de(10)} ${de(-5)}`,lg:`0 ${de(1)} ${de(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${de(28)} ${de(23)} ${de(-7)}, rgba(0, 0, 0, 0.04) 0 ${de(12)} ${de(12)} ${de(-7)}`,xl:`0 ${de(1)} ${de(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${de(36)} ${de(28)} ${de(-7)}, rgba(0, 0, 0, 0.04) 0 ${de(17)} ${de(17)} ${de(-7)}`},other:{},components:{}};function O5(t){return t==="auto"||t==="dark"||t==="light"}function LX({key:t="mantine-color-scheme-value"}={}){let e;return{get:n=>{if(typeof window>"u")return n;try{const r=window.localStorage.getItem(t);return O5(r)?r:n}catch{return n}},set:n=>{try{window.localStorage.setItem(t,n)}catch(r){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",r)}},subscribe:n=>{e=r=>{r.storageArea===window.localStorage&&r.key===t&&O5(r.newValue)&&n(r.newValue)},window.addEventListener("storage",e)},unsubscribe:()=>{window.removeEventListener("storage",e)},clear:()=>{window.localStorage.removeItem(t)}}}const $X="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",E5="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function F_(t){return t<0||t>9?!1:parseInt(t.toString(),10)===t}function A5(t){if(!(t.primaryColor in t.colors))throw new Error($X);if(typeof t.primaryShade=="object"&&(!F_(t.primaryShade.dark)||!F_(t.primaryShade.light)))throw new Error(E5);if(typeof t.primaryShade=="number"&&!F_(t.primaryShade))throw new Error(E5)}function IX(t,e){var r;if(!e)return A5(t),t;const n=_6(t,e);return e.fontFamily&&!((r=e.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=e.fontFamily),A5(n),n}const A6=M.createContext(null),BX=()=>M.useContext(A6)||E6;function yi(){const t=M.useContext(A6);if(!t)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return t}function P7({theme:t,children:e,inherit:n=!0}){const r=BX(),i=M.useMemo(()=>IX(n?r:E6,t),[t,r,n]);return a.jsx(A6.Provider,{value:i,children:e})}P7.displayName="@mantine/core/MantineThemeProvider";function zX(){const t=yi(),e=Bw(),n=Kr(t.breakpoints).reduce((r,i)=>{const s=t.breakpoints[i].includes("px"),o=Hg(t.breakpoints[i]),l=s?`${o-.1}px`:As(o-.1),u=s?`${o}px`:As(o);return`${r}@media (max-width: ${l}) {.mantine-visible-from-${i} {display: none !important;}}@media (min-width: ${u}) {.mantine-hidden-from-${i} {display: none !important;}}`},"");return a.jsx("style",{"data-mantine-styles":"classes",nonce:e==null?void 0:e(),dangerouslySetInnerHTML:{__html:n}})}function H_(t){return Object.entries(t).map(([e,n])=>`${e}: ${n};`).join("")}function L7(t,e){const n=e?[e]:[":root",":host"],r=H_(t.variables),i=r?`${n.join(", ")}{${r}}`:"",s=H_(t.dark),o=H_(t.light),l=f=>n.map(p=>p===":host"?`${p}([data-mantine-color-scheme="${f}"])`:`${p}[data-mantine-color-scheme="${f}"]`).join(", "),u=s?`${l("dark")}{${s}}`:"",h=o?`${l("light")}{${o}}`:"";return`${i}

${u}

${h}`}function Uh({color:t,theme:e,autoContrast:n}){return(typeof n=="boolean"?n:e.autoContrast)&&iu({color:t||e.primaryColor,theme:e}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function M5(t,e){return Uh({color:t.colors[t.primaryColor][Vg(t,e)],theme:t,autoContrast:null})}function $y({theme:t,color:e,colorScheme:n,name:r=e,withColorValues:i=!0}){if(!t.colors[e])return{};if(n==="light"){const l=Vg(t,"light"),u={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${l===9?8:l+1})`,[`--mantine-color-${r}-light`]:cp(t.colors[e][l],.1),[`--mantine-color-${r}-light-hover`]:cp(t.colors[e][l],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline-hover`]:cp(t.colors[e][l],.05)};return i?{[`--mantine-color-${r}-0`]:t.colors[e][0],[`--mantine-color-${r}-1`]:t.colors[e][1],[`--mantine-color-${r}-2`]:t.colors[e][2],[`--mantine-color-${r}-3`]:t.colors[e][3],[`--mantine-color-${r}-4`]:t.colors[e][4],[`--mantine-color-${r}-5`]:t.colors[e][5],[`--mantine-color-${r}-6`]:t.colors[e][6],[`--mantine-color-${r}-7`]:t.colors[e][7],[`--mantine-color-${r}-8`]:t.colors[e][8],[`--mantine-color-${r}-9`]:t.colors[e][9],...u}:u}const s=Vg(t,"dark"),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${s})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${s===9?8:s+1})`,[`--mantine-color-${r}-light`]:cp(t.colors[e][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:cp(t.colors[e][Math.max(0,s-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(s-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(s-4,0)})`,[`--mantine-color-${r}-outline-hover`]:cp(t.colors[e][Math.max(s-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:t.colors[e][0],[`--mantine-color-${r}-1`]:t.colors[e][1],[`--mantine-color-${r}-2`]:t.colors[e][2],[`--mantine-color-${r}-3`]:t.colors[e][3],[`--mantine-color-${r}-4`]:t.colors[e][4],[`--mantine-color-${r}-5`]:t.colors[e][5],[`--mantine-color-${r}-6`]:t.colors[e][6],[`--mantine-color-${r}-7`]:t.colors[e][7],[`--mantine-color-${r}-8`]:t.colors[e][8],[`--mantine-color-${r}-9`]:t.colors[e][9],...o}:o}function qX(t){return!!t&&typeof t=="object"&&"mantine-virtual-color"in t}function up(t,e,n){Kr(e).forEach(r=>Object.assign(t,{[`--mantine-${n}-${r}`]:e[r]}))}const $7=t=>{const e=Vg(t,"light"),n=t.defaultRadius in t.radius?t.radius[t.defaultRadius]:de(t.defaultRadius),r={variables:{"--mantine-z-index-app":"100","--mantine-z-index-modal":"200","--mantine-z-index-popover":"300","--mantine-z-index-overlay":"400","--mantine-z-index-max":"9999","--mantine-scale":t.scale.toString(),"--mantine-cursor-type":t.cursorType,"--mantine-webkit-font-smoothing":t.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":t.fontSmoothing?"grayscale":"unset","--mantine-color-white":t.white,"--mantine-color-black":t.black,"--mantine-line-height":t.lineHeights.md,"--mantine-font-family":t.fontFamily,"--mantine-font-family-monospace":t.fontFamilyMonospace,"--mantine-font-family-headings":t.headings.fontFamily,"--mantine-heading-font-weight":t.headings.fontWeight,"--mantine-heading-text-wrap":t.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${t.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${t.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${t.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${t.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${t.primaryColor}-light-color)`},light:{"--mantine-color-scheme":"light","--mantine-primary-color-contrast":M5(t,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":t.black,"--mantine-color-body":t.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${t.primaryColor}-${e})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-color-scheme":"dark","--mantine-primary-color-contrast":M5(t,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${t.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-dark-4)"}};up(r.variables,t.breakpoints,"breakpoint"),up(r.variables,t.spacing,"spacing"),up(r.variables,t.fontSizes,"font-size"),up(r.variables,t.lineHeights,"line-height"),up(r.variables,t.shadows,"shadow"),up(r.variables,t.radius,"radius"),t.colors[t.primaryColor].forEach((s,o)=>{r.variables[`--mantine-primary-color-${o}`]=`var(--mantine-color-${t.primaryColor}-${o})`}),Kr(t.colors).forEach(s=>{const o=t.colors[s];if(qX(o)){Object.assign(r.light,$y({theme:t,name:o.name,color:o.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,$y({theme:t,name:o.name,color:o.dark,colorScheme:"dark",withColorValues:!0}));return}o.forEach((l,u)=>{r.variables[`--mantine-color-${s}-${u}`]=l}),Object.assign(r.light,$y({theme:t,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,$y({theme:t,color:s,colorScheme:"dark",withColorValues:!1}))});const i=t.headings.sizes;return Kr(i).forEach(s=>{r.variables[`--mantine-${s}-font-size`]=i[s].fontSize,r.variables[`--mantine-${s}-line-height`]=i[s].lineHeight,r.variables[`--mantine-${s}-font-weight`]=i[s].fontWeight||t.headings.fontWeight}),r};function FX({theme:t,generator:e}){const n=$7(t),r=e==null?void 0:e(t);return r?_6(n,r):n}const V_=$7(E6);function HX(t){const e={variables:{},light:{},dark:{}};return Kr(t.variables).forEach(n=>{V_.variables[n]!==t.variables[n]&&(e.variables[n]=t.variables[n])}),Kr(t.light).forEach(n=>{V_.light[n]!==t.light[n]&&(e.light[n]=t.light[n])}),Kr(t.dark).forEach(n=>{V_.dark[n]!==t.dark[n]&&(e.dark[n]=t.dark[n])}),e}function VX(t){return L7({variables:{},dark:{"--mantine-color-scheme":"dark"},light:{"--mantine-color-scheme":"light"}},t)}function I7({cssVariablesSelector:t,deduplicateCssVariables:e}){const n=yi(),r=Bw(),i=SX(),s=FX({theme:n,generator:i}),o=(t===void 0||t===":root"||t===":host")&&e,l=o?HX(s):s,u=L7(l,t);return u?a.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${u}${o?"":VX(t)}`}}):null}I7.displayName="@mantine/CssVariables";function hp(t,e){var i,s;const n=typeof window<"u"&&"matchMedia"in window&&((i=window.matchMedia("(prefers-color-scheme: dark)"))==null?void 0:i.matches),r=t!=="auto"?t:n?"dark":"light";(s=e())==null||s.setAttribute("data-mantine-color-scheme",r)}function UX({manager:t,defaultColorScheme:e,getRootElement:n,forceColorScheme:r}){const i=M.useRef(null),[s,o]=M.useState(()=>t.get(e)),l=r||s,u=M.useCallback(f=>{r||(hp(f,n),o(f),t.set(f))},[t.set,l,r]),h=M.useCallback(()=>{o(e),hp(e,n),t.clear()},[t.clear,e]);return M.useEffect(()=>(t.subscribe(u),t.unsubscribe),[t.subscribe,t.unsubscribe]),Sf(()=>{hp(t.get(e),n)},[]),M.useEffect(()=>{var p;if(r)return hp(r,n),()=>{};r===void 0&&hp(s,n),typeof window<"u"&&"matchMedia"in window&&(i.current=window.matchMedia("(prefers-color-scheme: dark)"));const f=m=>{s==="auto"&&hp(m.matches?"dark":"light",n)};return(p=i.current)==null||p.addEventListener("change",f),()=>{var m;return(m=i.current)==null?void 0:m.removeEventListener("change",f)}},[s,r]),{colorScheme:l,setColorScheme:u,clearColorScheme:h}}function QX({respectReducedMotion:t,getRootElement:e}){Sf(()=>{var n;t&&((n=e())==null||n.setAttribute("data-respect-reduced-motion","true"))},[t])}function B7({theme:t,children:e,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:s=!0,withCssVariables:o=!0,cssVariablesSelector:l,classNamesPrefix:u="mantine",colorSchemeManager:h=LX(),defaultColorScheme:f="light",getRootElement:p=()=>document.documentElement,cssVariablesResolver:m,forceColorScheme:v,stylesTransform:b,env:x}){const{colorScheme:w,setColorScheme:S,clearColorScheme:_}=UX({defaultColorScheme:f,forceColorScheme:v,manager:h,getRootElement:p});return QX({respectReducedMotion:(t==null?void 0:t.respectReducedMotion)||!1,getRootElement:p}),a.jsx(O6.Provider,{value:{colorScheme:w,setColorScheme:S,clearColorScheme:_,getRootElement:p,classNamesPrefix:u,getStyleNonce:n,cssVariablesResolver:m,cssVariablesSelector:l??":root",withStaticClasses:r,stylesTransform:b,env:x},children:a.jsxs(P7,{theme:t,children:[o&&a.jsx(I7,{cssVariablesSelector:l,deduplicateCssVariables:s}),i&&a.jsx(zX,{}),e]})})}B7.displayName="@mantine/core/MantineProvider";function jo({classNames:t,styles:e,props:n,stylesCtx:r}){const i=yi();return{resolvedClassNames:Iw({theme:i,classNames:t,props:n,stylesCtx:r||void 0}),resolvedStyles:xx({theme:i,styles:e,props:n,stylesCtx:r||void 0})}}const WX={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function YX({theme:t,options:e,unstyled:n}){return Lr((e==null?void 0:e.focusable)&&!n&&(t.focusClassName||WX[t.focusRing]),(e==null?void 0:e.active)&&!n&&t.activeClassName)}function XX({selector:t,stylesCtx:e,options:n,props:r,theme:i}){return Iw({theme:i,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:e})[t]}function R5({selector:t,stylesCtx:e,theme:n,classNames:r,props:i}){return Iw({theme:n,classNames:r,props:i,stylesCtx:e})[t]}function GX({rootSelector:t,selector:e,className:n}){return t===e?n:void 0}function KX({selector:t,classes:e,unstyled:n}){return n?void 0:e[t]}function ZX({themeName:t,classNamesPrefix:e,selector:n,withStaticClass:r}){return r===!1?[]:t.map(i=>`${e}-${i}-${n}`)}function JX({themeName:t,theme:e,selector:n,props:r,stylesCtx:i}){return t.map(s=>{var o,l;return(l=Iw({theme:e,classNames:(o=e.components[s])==null?void 0:o.classNames,props:r,stylesCtx:i}))==null?void 0:l[n]})}function eG({options:t,classes:e,selector:n,unstyled:r}){return t!=null&&t.variant&&!r?e[`${n}--${t.variant}`]:void 0}function tG({theme:t,options:e,themeName:n,selector:r,classNamesPrefix:i,classNames:s,classes:o,unstyled:l,className:u,rootSelector:h,props:f,stylesCtx:p,withStaticClasses:m,headless:v,transformedStyles:b}){return Lr(YX({theme:t,options:e,unstyled:l||v}),JX({theme:t,themeName:n,selector:r,props:f,stylesCtx:p}),eG({options:e,classes:o,selector:r,unstyled:l}),R5({selector:r,stylesCtx:p,theme:t,classNames:s,props:f}),R5({selector:r,stylesCtx:p,theme:t,classNames:b,props:f}),XX({selector:r,stylesCtx:p,options:e,props:f,theme:t}),GX({rootSelector:h,selector:r,className:u}),KX({selector:r,classes:o,unstyled:l||v}),m&&!v&&ZX({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:e==null?void 0:e.withStaticClass}),e==null?void 0:e.className)}function nG({theme:t,themeName:e,props:n,stylesCtx:r,selector:i}){return e.map(s=>{var o;return xx({theme:t,styles:(o=t.components[s])==null?void 0:o.styles,props:n,stylesCtx:r})[i]}).reduce((s,o)=>({...s,...o}),{})}function nC({style:t,theme:e}){return Array.isArray(t)?[...t].reduce((n,r)=>({...n,...nC({style:r,theme:e})}),{}):typeof t=="function"?t(e):t??{}}function rG(t){return t.reduce((e,n)=>(n&&Object.keys(n).forEach(r=>{e[r]={...e[r],...Pv(n[r])}}),e),{})}function iG({vars:t,varsResolver:e,theme:n,props:r,stylesCtx:i,selector:s,themeName:o,headless:l}){var u;return(u=rG([l?{}:e==null?void 0:e(n,r,i),...o.map(h=>{var f,p,m;return(m=(p=(f=n.components)==null?void 0:f[h])==null?void 0:p.vars)==null?void 0:m.call(p,n,r,i)}),t==null?void 0:t(n,r,i)]))==null?void 0:u[s]}function sG({theme:t,themeName:e,selector:n,options:r,props:i,stylesCtx:s,rootSelector:o,styles:l,style:u,vars:h,varsResolver:f,headless:p,withStylesTransform:m}){return{...!m&&nG({theme:t,themeName:e,props:i,stylesCtx:s,selector:n}),...!m&&xx({theme:t,styles:l,props:i,stylesCtx:s})[n],...!m&&xx({theme:t,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||i,stylesCtx:s})[n],...iG({theme:t,props:i,stylesCtx:s,vars:h,varsResolver:f,selector:n,themeName:e,headless:p}),...o===n?nC({style:u,theme:t}):null,...nC({style:r==null?void 0:r.style,theme:t})}}function aG({props:t,stylesCtx:e,themeName:n}){var o;const r=yi(),i=(o=kX())==null?void 0:o();return{getTransformedStyles:l=>i?[...l.map(h=>i(h,{props:t,theme:r,ctx:e})),...n.map(h=>{var f;return i((f=r.components[h])==null?void 0:f.styles,{props:t,theme:r,ctx:e})})].filter(Boolean):[],withStylesTransform:!!i}}function lt({name:t,classes:e,props:n,stylesCtx:r,className:i,style:s,rootSelector:o="root",unstyled:l,classNames:u,styles:h,vars:f,varsResolver:p,attributes:m}){const v=yi(),b=jX(),x=_X(),w=TX(),S=(Array.isArray(t)?t:[t]).filter(C=>C),{withStylesTransform:_,getTransformedStyles:T}=aG({props:n,stylesCtx:r,themeName:S});return(C,j)=>({className:tG({theme:v,options:j,themeName:S,selector:C,classNamesPrefix:b,classNames:u,classes:e,unstyled:l,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:x,headless:w,transformedStyles:T([j==null?void 0:j.styles,h])}),style:sG({theme:v,themeName:S,selector:C,options:j,props:n,stylesCtx:r,rootSelector:o,styles:h,style:s,vars:f,varsResolver:p,headless:w,withStylesTransform:_}),...m==null?void 0:m[C]})}function z7(t,e){if(t.startsWith("var("))return`color-mix(in srgb, ${t}, white ${e*100}%)`;const{r:n,g:r,b:i,a:s}=qw(t),o=l=>Math.round(l+(255-l)*e);return`rgba(${o(n)}, ${o(r)}, ${o(i)}, ${s})`}function Lm(t,e){return typeof t=="boolean"?t:e.autoContrast}function D5(t){const e=document.createElement("style");return e.setAttribute("data-mantine-styles","inline"),e.innerHTML="*, *::before, *::after {transition: none !important;}",e.setAttribute("data-mantine-disable-transition","true"),t&&e.setAttribute("nonce",t),document.head.appendChild(e),()=>document.querySelectorAll("[data-mantine-disable-transition]").forEach(r=>r.remove())}function q7({keepTransitions:t}={}){const e=M.useRef(vx),n=M.useRef(-1),r=M.useContext(O6),i=Bw(),s=M.useRef(i==null?void 0:i());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const o=p=>{r.setColorScheme(p),e.current=t?()=>{}:D5(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var m;(m=e.current)==null||m.call(e)},10)},l=()=>{r.clearColorScheme(),e.current=t?()=>{}:D5(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var p;(p=e.current)==null||p.call(e)},10)},u=O7("light",{getInitialValueInEffect:!1}),h=r.colorScheme==="auto"?u:r.colorScheme,f=M.useCallback(()=>o(h==="light"?"dark":"light"),[o,h]);return M.useEffect(()=>()=>{var p;(p=e.current)==null||p.call(e),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:o,clearColorScheme:l,toggleColorScheme:f}}function Fw(t,e={getInitialValueInEffect:!0}){const n=O7(t,e),{colorScheme:r}=q7();return r==="auto"?n:r}function Se(t,e,n){var o;const r=yi(),i=(o=r.components[t])==null?void 0:o.defaultProps,s=typeof i=="function"?i(r):i;return{...e,...s,...Pv(n)}}function U_(t){return Kr(t).reduce((e,n)=>t[n]!==void 0?`${e}${NY(n)}:${t[n]};`:e,"").trim()}function oG({selector:t,styles:e,media:n,container:r}){const i=e?U_(e):"",s=Array.isArray(n)?n.map(l=>`@media${l.query}{${t}{${U_(l.styles)}}}`):[],o=Array.isArray(r)?r.map(l=>`@container ${l.query}{${t}{${U_(l.styles)}}}`):[];return`${i?`${t}{${i}}`:""}${s.join("")}${o.join("")}`.trim()}function Hw(t){const e=Bw();return a.jsx("style",{"data-mantine-styles":"inline",nonce:e==null?void 0:e(),dangerouslySetInnerHTML:{__html:oG(t)}})}function Bv(t){const{m:e,mx:n,my:r,mt:i,mb:s,ml:o,mr:l,me:u,ms:h,p:f,px:p,py:m,pt:v,pb:b,pl:x,pr:w,pe:S,ps:_,bd:T,bdrs:C,bg:j,c:A,opacity:E,ff:R,fz:N,fw:$,lts:D,ta:F,lh:Q,fs:H,tt:q,td:P,w:I,miw:U,maw:Z,h:X,mih:V,mah:G,bgsz:W,bgp:te,bgr:oe,bga:be,pos:ye,top:Ke,left:Fe,bottom:Pe,right:ae,inset:Te,display:fe,flex:Ee,hiddenFrom:gt,visibleFrom:We,lightHidden:Be,darkHidden:ze,sx:De,...Ye}=t;return{styleProps:Pv({m:e,mx:n,my:r,mt:i,mb:s,ml:o,mr:l,me:u,ms:h,p:f,px:p,py:m,pt:v,pb:b,pl:x,pr:w,pe:S,ps:_,bd:T,bg:j,c:A,opacity:E,ff:R,fz:N,fw:$,lts:D,ta:F,lh:Q,fs:H,tt:q,td:P,w:I,miw:U,maw:Z,h:X,mih:V,mah:G,bgsz:W,bgp:te,bgr:oe,bga:be,pos:ye,top:Ke,left:Fe,bottom:Pe,right:ae,inset:Te,display:fe,flex:Ee,bdrs:C,hiddenFrom:gt,visibleFrom:We,lightHidden:Be,darkHidden:ze,sx:De}),rest:Ye}}const lG={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bdrs:{type:"radius",property:"borderRadius"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function M6(t,e){const n=iu({color:t,theme:e});return n.color==="dimmed"?"var(--mantine-color-dimmed)":n.color==="bright"?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function cG(t,e){const n=iu({color:t,theme:e});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:M6(t,e)}function uG(t,e){if(typeof t=="number")return de(t);if(typeof t=="string"){const[n,r,...i]=t.split(" ").filter(o=>o.trim()!=="");let s=`${de(n)}`;return r&&(s+=` ${r}`),i.length>0&&(s+=` ${M6(i.join(" "),e)}`),s.trim()}return t}const N5={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function hG(t){return typeof t=="string"&&t in N5?N5[t]:t}const dG=["h1","h2","h3","h4","h5","h6"];function fG(t,e){return typeof t=="string"&&t in e.fontSizes?`var(--mantine-font-size-${t})`:typeof t=="string"&&dG.includes(t)?`var(--mantine-${t}-font-size)`:typeof t=="number"||typeof t=="string"?de(t):t}function pG(t){return t}const mG=["h1","h2","h3","h4","h5","h6"];function gG(t,e){return typeof t=="string"&&t in e.lineHeights?`var(--mantine-line-height-${t})`:typeof t=="string"&&mG.includes(t)?`var(--mantine-${t}-line-height)`:t}function vG(t,e){return typeof t=="string"&&t in e.radius?`var(--mantine-radius-${t})`:typeof t=="number"||typeof t=="string"?de(t):t}function bG(t){return typeof t=="number"?de(t):t}function yG(t,e){if(typeof t=="number")return de(t);if(typeof t=="string"){const n=t.replace("-","");if(!(n in e.spacing))return de(t);const r=`--mantine-spacing-${n}`;return t.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return t}const Q_={color:M6,textColor:cG,fontSize:fG,spacing:yG,radius:vG,identity:pG,size:bG,lineHeight:gG,fontFamily:hG,border:uG};function P5(t){return t.replace("(min-width: ","").replace("em)","")}function xG({media:t,...e}){const r=Object.keys(t).sort((i,s)=>Number(P5(i))-Number(P5(s))).map(i=>({query:i,styles:t[i]}));return{...e,media:r}}function wG(t){if(typeof t!="object"||t===null)return!1;const e=Object.keys(t);return!(e.length===1&&e[0]==="base")}function SG(t){return typeof t=="object"&&t!==null?"base"in t?t.base:void 0:t}function jG(t){return typeof t=="object"&&t!==null?Kr(t).filter(e=>e!=="base"):[]}function _G(t,e){return typeof t=="object"&&t!==null&&e in t?t[e]:t}function TG({styleProps:t,data:e,theme:n}){return xG(Kr(t).reduce((r,i)=>{if(i==="hiddenFrom"||i==="visibleFrom"||i==="sx")return r;const s=e[i],o=Array.isArray(s.property)?s.property:[s.property],l=SG(t[i]);if(!wG(t[i]))return o.forEach(h=>{r.inlineStyles[h]=Q_[s.type](l,n)}),r;r.hasResponsiveStyles=!0;const u=jG(t[i]);return o.forEach(h=>{l!=null&&(r.styles[h]=Q_[s.type](l,n)),u.forEach(f=>{const p=`(min-width: ${n.breakpoints[f]})`;r.media[p]={...r.media[p],[h]:Q_[s.type](_G(t[i],f),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function F7(){return`__m__-${M.useId().replace(/[:«»]/g,"")}`}function R6(t,e){return Array.isArray(t)?[...t].reduce((n,r)=>({...n,...R6(r,e)}),{}):typeof t=="function"?t(e):t??{}}function H7(t){return t.startsWith("data-")?t:`data-${t}`}function CG(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];return r===void 0||r===""||r===!1||r===null||(e[H7(n)]=t[n]),e},{})}function V7(t){return t?typeof t=="string"?{[H7(t)]:!0}:Array.isArray(t)?[...t].reduce((e,n)=>({...e,...V7(n)}),{}):CG(t):null}function rC(t,e){return Array.isArray(t)?[...t].reduce((n,r)=>({...n,...rC(r,e)}),{}):typeof t=="function"?t(e):t??{}}function kG({theme:t,style:e,vars:n,styleProps:r}){const i=rC(e,t),s=rC(n,t);return{...i,...s,...r}}const U7=M.forwardRef(({component:t,style:e,__vars:n,className:r,variant:i,mod:s,size:o,hiddenFrom:l,visibleFrom:u,lightHidden:h,darkHidden:f,renderRoot:p,__size:m,...v},b)=>{var R;const x=yi(),w=t||"div",{styleProps:S,rest:_}=Bv(v),T=CX(),C=(R=T==null?void 0:T())==null?void 0:R(S.sx),j=F7(),A=TG({styleProps:S,theme:x,data:lG}),E={ref:b,style:kG({theme:x,style:e,vars:n,styleProps:A.inlineStyles}),className:Lr(r,C,{[j]:A.hasResponsiveStyles,"mantine-light-hidden":h,"mantine-dark-hidden":f,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${u}`]:u}),"data-variant":i,"data-size":_7(o)?void 0:o||void 0,size:m,...V7(s),..._};return a.jsxs(a.Fragment,{children:[A.hasResponsiveStyles&&a.jsx(Hw,{selector:`.${j}`,styles:A.styles,media:A.media}),typeof p=="function"?p(E):a.jsx(w,{...E})]})});U7.displayName="@mantine/core/Box";const ve=U7;function Q7(t){return t}function W7(t){const e=t;return n=>{const r=M.forwardRef((i,s)=>a.jsx(e,{...n,...i,ref:s}));return r.extend=e.extend,r.displayName=`WithProps(${e.displayName})`,r}}function Ae(t){const e=M.forwardRef(t);return e.extend=Q7,e.withProps=n=>{const r=M.forwardRef((i,s)=>a.jsx(e,{...n,...i,ref:s}));return r.extend=e.extend,r.displayName=`WithProps(${e.displayName})`,r},e}function Yi(t){const e=M.forwardRef(t);return e.withProps=n=>{const r=M.forwardRef((i,s)=>a.jsx(e,{...n,...i,ref:s}));return r.extend=e.extend,r.displayName=`WithProps(${e.displayName})`,r},e.extend=Q7,e}const OG=M.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function _f(){return M.useContext(OG)}var Vw=m7();const dg=dl(Vw);function EG(t){if(!t||typeof t=="string")return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function W_(t){return t!=null&&t.current?t.current.scrollHeight:"auto"}const G0=typeof window<"u"&&window.requestAnimationFrame,L5=0,AG=t=>({height:0,overflow:"hidden",...t?{}:{display:"none"}});function MG({transitionDuration:t,transitionTimingFunction:e="ease",onTransitionEnd:n=()=>{},opened:r,keepMounted:i=!1}){const s=M.useRef(null),o=AG(i),[l,u]=M.useState(r?{}:o),h=b=>{Vw.flushSync(()=>u(b))},f=b=>{h(x=>({...x,...b}))};function p(b){const x=t||EG(b);return{transition:`height ${x}ms ${e}, opacity ${x}ms ${e}`}}Yl(()=>{typeof G0=="function"&&G0(r?()=>{f({willChange:"height",display:"block",overflow:"hidden"}),G0(()=>{const b=W_(s);f({...p(b),height:b})})}:()=>{const b=W_(s);f({...p(b),willChange:"height",height:b}),G0(()=>f({height:L5,overflow:"hidden"}))})},[r]);const m=b=>{if(!(b.target!==s.current||b.propertyName!=="height"))if(r){const x=W_(s);x===l.height?h({}):f({height:x}),n()}else l.height===L5&&(h(o),n())};function v({style:b={},refKey:x="ref",...w}={}){const S=w[x],_={"aria-hidden":!r,...w,[x]:D7(s,S),onTransitionEnd:m,style:{boxSizing:"border-box",...b,...l}};return _n.version.startsWith("18")?r||(_.inert=""):_.inert=!r,_}return v}const RG={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0},Uw=Ae((t,e)=>{const{children:n,in:r,transitionDuration:i,transitionTimingFunction:s,style:o,onTransitionEnd:l,animateOpacity:u,keepMounted:h,...f}=Se("Collapse",RG,t),p=yi(),m=Lw(),b=(p.respectReducedMotion?m:!1)?0:i,x=MG({opened:r,transitionDuration:b,transitionTimingFunction:s,onTransitionEnd:l,keepMounted:h});return b===0?r?a.jsx(ve,{...f,children:n}):null:a.jsx(ve,{...x({style:{opacity:r||!u?1:0,transition:u?`opacity ${b}ms ${s}`:"none",...R6(o,p)},ref:e,...f}),children:n})});Uw.displayName="@mantine/core/Collapse";function Qw(){return typeof window<"u"}function $m(t){return Y7(t)?(t.nodeName||"").toLowerCase():"#document"}function fa(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zl(t){var e;return(e=(Y7(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Y7(t){return Qw()?t instanceof Node||t instanceof fa(t).Node:!1}function Cr(t){return Qw()?t instanceof Element||t instanceof fa(t).Element:!1}function qa(t){return Qw()?t instanceof HTMLElement||t instanceof fa(t).HTMLElement:!1}function iC(t){return!Qw()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof fa(t).ShadowRoot}const DG=new Set(["inline","contents"]);function zv(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=yo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!DG.has(i)}const NG=new Set(["table","td","th"]);function PG(t){return NG.has($m(t))}const LG=[":popover-open",":modal"];function Ww(t){return LG.some(e=>{try{return t.matches(e)}catch{return!1}})}const $G=["transform","translate","scale","rotate","perspective"],IG=["transform","translate","scale","rotate","perspective","filter"],BG=["paint","layout","strict","content"];function D6(t){const e=Yw(),n=Cr(t)?yo(t):t;return $G.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||IG.some(r=>(n.willChange||"").includes(r))||BG.some(r=>(n.contain||"").includes(r))}function zG(t){let e=Gc(t);for(;qa(e)&&!Uc(e);){if(D6(e))return e;if(Ww(e))return null;e=Gc(e)}return null}function Yw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const qG=new Set(["html","body","#document"]);function Uc(t){return qG.has($m(t))}function yo(t){return fa(t).getComputedStyle(t)}function Xw(t){return Cr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Gc(t){if($m(t)==="html")return t;const e=t.assignedSlot||t.parentNode||iC(t)&&t.host||Zl(t);return iC(e)?e.host:e}function X7(t){const e=Gc(t);return Uc(e)?t.ownerDocument?t.ownerDocument.body:t.body:qa(e)&&zv(e)?e:X7(e)}function Qc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=X7(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=fa(i);if(s){const l=sC(o);return e.concat(o,o.visualViewport||[],zv(i)?i:[],l&&n?Qc(l):[])}return e.concat(i,Qc(i,[],n))}function sC(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const FG=["top","right","bottom","left"],ol=Math.min,Cs=Math.max,wx=Math.round,Iy=Math.floor,Vl=t=>({x:t,y:t}),HG={left:"right",right:"left",bottom:"top",top:"bottom"},VG={start:"end",end:"start"};function aC(t,e,n){return Cs(t,ol(e,n))}function Xl(t,e){return typeof t=="function"?t(e):t}function ll(t){return t.split("-")[0]}function Im(t){return t.split("-")[1]}function N6(t){return t==="x"?"y":"x"}function P6(t){return t==="y"?"height":"width"}const UG=new Set(["top","bottom"]);function tl(t){return UG.has(ll(t))?"y":"x"}function L6(t){return N6(tl(t))}function QG(t,e,n){n===void 0&&(n=!1);const r=Im(t),i=L6(t),s=P6(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Sx(o)),[o,Sx(o)]}function WG(t){const e=Sx(t);return[oC(t),e,oC(e)]}function oC(t){return t.replace(/start|end/g,e=>VG[e])}const $5=["left","right"],I5=["right","left"],YG=["top","bottom"],XG=["bottom","top"];function GG(t,e,n){switch(t){case"top":case"bottom":return n?e?I5:$5:e?$5:I5;case"left":case"right":return e?YG:XG;default:return[]}}function KG(t,e,n,r){const i=Im(t);let s=GG(ll(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(oC)))),s}function Sx(t){return t.replace(/left|right|bottom|top/g,e=>HG[e])}function ZG(t){return{top:0,right:0,bottom:0,left:0,...t}}function $6(t){return typeof t!="number"?ZG(t):{top:t,right:t,bottom:t,left:t}}function fm(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function JG(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function eK(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:r}=e;return n+"/"+r}).join(" "):navigator.userAgent}function tK(){return/apple/i.test(navigator.vendor)}function nK(){return JG().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function rK(){return eK().includes("jsdom/")}const B5="data-floating-ui-focusable",iK="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function z5(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function Ug(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&iC(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function gp(t){return"composedPath"in t?t.composedPath()[0]:t.target}function Y_(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function sK(t){return t.matches("html,body")}function $d(t){return(t==null?void 0:t.ownerDocument)||document}function aK(t){return qa(t)&&t.matches(iK)}function oK(t){if(!t||rK())return!0;try{return t.matches(":focus-visible")}catch{return!0}}function lK(t){return t?t.hasAttribute(B5)?t:t.querySelector("["+B5+"]")||t:null}function P1(t,e,n){return n===void 0&&(n=!0),t.filter(i=>{var s;return i.parentId===e&&(!n||((s=i.context)==null?void 0:s.open))}).flatMap(i=>[i,...P1(t,i.id,n)])}function cK(t){return"nativeEvent"in t}function lC(t,e){const n=["mouse","pen"];return n.push("",void 0),n.includes(t)}var uK=typeof document<"u",hK=function(){},Ul=uK?M.useLayoutEffect:hK;const dK={...p7};function By(t){const e=M.useRef(t);return Ul(()=>{e.current=t}),e}const fK=dK.useInsertionEffect,pK=fK||(t=>t());function Ll(t){const e=M.useRef(()=>{});return pK(()=>{e.current=t}),M.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}function q5(t,e,n){let{reference:r,floating:i}=t;const s=tl(e),o=L6(e),l=P6(o),u=ll(e),h=s==="y",f=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,m=r[l]/2-i[l]/2;let v;switch(u){case"top":v={x:f,y:r.y-i.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-i.width,y:p};break;default:v={x:r.x,y:r.y}}switch(Im(e)){case"start":v[o]-=m*(n&&h?-1:1);break;case"end":v[o]+=m*(n&&h?-1:1);break}return v}async function mK(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:l,strategy:u}=t,{boundary:h="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=Xl(e,t),b=$6(v),w=l[m?p==="floating"?"reference":"floating":p],S=fm(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:h,rootBoundary:f,strategy:u})),_=p==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),C=await(s.isElement==null?void 0:s.isElement(T))?await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1}:{x:1,y:1},j=fm(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:T,strategy:u}):_);return{top:(S.top-j.top+b.top)/C.y,bottom:(j.bottom-S.bottom+b.bottom)/C.y,left:(S.left-j.left+b.left)/C.x,right:(j.right-S.right+b.right)/C.x}}const gK=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,l=s.filter(Boolean),u=await(o.isRTL==null?void 0:o.isRTL(e));let h=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:p}=q5(h,r,u),m=r,v={},b=0;for(let w=0;w<l.length;w++){var x;const{name:S,fn:_}=l[w],{x:T,y:C,data:j,reset:A}=await _({x:f,y:p,initialPlacement:r,placement:m,strategy:i,middlewareData:v,rects:h,platform:{...o,detectOverflow:(x=o.detectOverflow)!=null?x:mK},elements:{reference:t,floating:e}});f=T??f,p=C??p,v={...v,[S]:{...v[S],...j}},A&&b<=50&&(b++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(h=A.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):A.rects),{x:f,y:p}=q5(h,m,u)),w=-1)}return{x:f,y:p,placement:m,strategy:i,middlewareData:v}},vK=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:l,middlewareData:u}=e,{element:h,padding:f=0}=Xl(t,e)||{};if(h==null)return{};const p=$6(f),m={x:n,y:r},v=L6(i),b=P6(v),x=await o.getDimensions(h),w=v==="y",S=w?"top":"left",_=w?"bottom":"right",T=w?"clientHeight":"clientWidth",C=s.reference[b]+s.reference[v]-m[v]-s.floating[b],j=m[v]-s.reference[v],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(h));let E=A?A[T]:0;(!E||!await(o.isElement==null?void 0:o.isElement(A)))&&(E=l.floating[T]||s.floating[b]);const R=C/2-j/2,N=E/2-x[b]/2-1,$=ol(p[S],N),D=ol(p[_],N),F=$,Q=E-x[b]-D,H=E/2-x[b]/2+R,q=aC(F,H,Q),P=!u.arrow&&Im(i)!=null&&H!==q&&s.reference[b]/2-(H<F?$:D)-x[b]/2<0,I=P?H<F?H-F:H-Q:0;return{[v]:m[v]+I,data:{[v]:q,centerOffset:H-q-I,...P&&{alignmentOffset:I}},reset:P}}}),bK=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:l,platform:u,elements:h}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...w}=Xl(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const S=ll(i),_=tl(l),T=ll(l)===l,C=await(u.isRTL==null?void 0:u.isRTL(h.floating)),j=m||(T||!x?[Sx(l)]:WG(l)),A=b!=="none";!m&&A&&j.push(...KG(l,x,b,C));const E=[l,...j],R=await u.detectOverflow(e,w),N=[];let $=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&N.push(R[S]),p){const H=QG(i,o,C);N.push(R[H[0]],R[H[1]])}if($=[...$,{placement:i,overflows:N}],!N.every(H=>H<=0)){var D,F;const H=(((D=s.flip)==null?void 0:D.index)||0)+1,q=E[H];if(q&&(!(p==="alignment"?_!==tl(q):!1)||$.every(U=>tl(U.placement)===_?U.overflows[0]>0:!0)))return{data:{index:H,overflows:$},reset:{placement:q}};let P=(F=$.filter(I=>I.overflows[0]<=0).sort((I,U)=>I.overflows[1]-U.overflows[1])[0])==null?void 0:F.placement;if(!P)switch(v){case"bestFit":{var Q;const I=(Q=$.filter(U=>{if(A){const Z=tl(U.placement);return Z===_||Z==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(Z=>Z>0).reduce((Z,X)=>Z+X,0)]).sort((U,Z)=>U[1]-Z[1])[0])==null?void 0:Q[0];I&&(P=I);break}case"initialPlacement":P=l;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function F5(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function H5(t){return FG.some(e=>t[e]>=0)}const yK=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...s}=Xl(t,e);switch(i){case"referenceHidden":{const o=await r.detectOverflow(e,{...s,elementContext:"reference"}),l=F5(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:H5(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...s,altBoundary:!0}),l=F5(o,n.floating);return{data:{escapedOffsets:l,escaped:H5(l)}}}default:return{}}}}};function G7(t){const e=ol(...t.map(s=>s.left)),n=ol(...t.map(s=>s.top)),r=Cs(...t.map(s=>s.right)),i=Cs(...t.map(s=>s.bottom));return{x:e,y:n,width:r-e,height:i-n}}function xK(t){const e=t.slice().sort((i,s)=>i.y-s.y),n=[];let r=null;for(let i=0;i<e.length;i++){const s=e[i];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(i=>fm(G7(i)))}const wK=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:r,rects:i,platform:s,strategy:o}=e,{padding:l=2,x:u,y:h}=Xl(t,e),f=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),p=xK(f),m=fm(G7(f)),v=$6(l);function b(){if(p.length===2&&p[0].left>p[1].right&&u!=null&&h!=null)return p.find(w=>u>w.left-v.left&&u<w.right+v.right&&h>w.top-v.top&&h<w.bottom+v.bottom)||m;if(p.length>=2){if(tl(n)==="y"){const $=p[0],D=p[p.length-1],F=ll(n)==="top",Q=$.top,H=D.bottom,q=F?$.left:D.left,P=F?$.right:D.right,I=P-q,U=H-Q;return{top:Q,bottom:H,left:q,right:P,width:I,height:U,x:q,y:Q}}const w=ll(n)==="left",S=Cs(...p.map($=>$.right)),_=ol(...p.map($=>$.left)),T=p.filter($=>w?$.left===_:$.right===S),C=T[0].top,j=T[T.length-1].bottom,A=_,E=S,R=E-A,N=j-C;return{top:C,bottom:j,left:A,right:E,width:R,height:N,x:A,y:C}}return m}const x=await s.getElementRects({reference:{getBoundingClientRect:b},floating:r.floating,strategy:o});return i.reference.x!==x.reference.x||i.reference.y!==x.reference.y||i.reference.width!==x.reference.width||i.reference.height!==x.reference.height?{reset:{rects:x}}:{}}}},K7=new Set(["left","top"]);async function SK(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ll(n),l=Im(n),u=tl(n)==="y",h=K7.has(o)?-1:1,f=s&&u?-1:1,p=Xl(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(v=l==="end"?b*-1:b),u?{x:v*f,y:m*h}:{x:m*h,y:v*f}}const jK=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:l}=e,u=await SK(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:o}}}}},_K=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:S=>{let{x:_,y:T}=S;return{x:_,y:T}}},...h}=Xl(t,e),f={x:n,y:r},p=await s.detectOverflow(e,h),m=tl(ll(i)),v=N6(m);let b=f[v],x=f[m];if(o){const S=v==="y"?"top":"left",_=v==="y"?"bottom":"right",T=b+p[S],C=b-p[_];b=aC(T,b,C)}if(l){const S=m==="y"?"top":"left",_=m==="y"?"bottom":"right",T=x+p[S],C=x-p[_];x=aC(T,x,C)}const w=u.fn({...e,[v]:b,[m]:x});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[v]:o,[m]:l}}}}}},TK=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:l=0,mainAxis:u=!0,crossAxis:h=!0}=Xl(t,e),f={x:n,y:r},p=tl(i),m=N6(p);let v=f[m],b=f[p];const x=Xl(l,e),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const T=m==="y"?"height":"width",C=s.reference[m]-s.floating[T]+w.mainAxis,j=s.reference[m]+s.reference[T]-w.mainAxis;v<C?v=C:v>j&&(v=j)}if(h){var S,_;const T=m==="y"?"width":"height",C=K7.has(ll(i)),j=s.reference[p]-s.floating[T]+(C&&((S=o.offset)==null?void 0:S[p])||0)+(C?0:w.crossAxis),A=s.reference[p]+s.reference[T]+(C?0:((_=o.offset)==null?void 0:_[p])||0)-(C?w.crossAxis:0);b<j?b=j:b>A&&(b=A)}return{[m]:v,[p]:b}}}},CK=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:l}=e,{apply:u=()=>{},...h}=Xl(t,e),f=await o.detectOverflow(e,h),p=ll(i),m=Im(i),v=tl(i)==="y",{width:b,height:x}=s.floating;let w,S;p==="top"||p==="bottom"?(w=p,S=m===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(S=p,w=m==="end"?"top":"bottom");const _=x-f.top-f.bottom,T=b-f.left-f.right,C=ol(x-f[w],_),j=ol(b-f[S],T),A=!e.middlewareData.shift;let E=C,R=j;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=T),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(E=_),A&&!m){const $=Cs(f.left,0),D=Cs(f.right,0),F=Cs(f.top,0),Q=Cs(f.bottom,0);v?R=b-2*($!==0||D!==0?$+D:Cs(f.left,f.right)):E=x-2*(F!==0||Q!==0?F+Q:Cs(f.top,f.bottom))}await u({...e,availableWidth:R,availableHeight:E});const N=await o.getDimensions(l.floating);return b!==N.width||x!==N.height?{reset:{rects:!0}}:{}}}};function Z7(t){const e=yo(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=qa(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,l=wx(n)!==s||wx(r)!==o;return l&&(n=s,r=o),{width:n,height:r,$:l}}function I6(t){return Cr(t)?t:t.contextElement}function Rp(t){const e=I6(t);if(!qa(e))return Vl(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=Z7(e);let o=(s?wx(n.width):n.width)/r,l=(s?wx(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const kK=Vl(0);function J7(t){const e=fa(t);return!Yw()||!e.visualViewport?kK:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function OK(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==fa(t)?!1:e}function hf(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=I6(t);let o=Vl(1);e&&(r?Cr(r)&&(o=Rp(r)):o=Rp(t));const l=OK(s,n,r)?J7(s):Vl(0);let u=(i.left+l.x)/o.x,h=(i.top+l.y)/o.y,f=i.width/o.x,p=i.height/o.y;if(s){const m=fa(s),v=r&&Cr(r)?fa(r):r;let b=m,x=sC(b);for(;x&&r&&v!==b;){const w=Rp(x),S=x.getBoundingClientRect(),_=yo(x),T=S.left+(x.clientLeft+parseFloat(_.paddingLeft))*w.x,C=S.top+(x.clientTop+parseFloat(_.paddingTop))*w.y;u*=w.x,h*=w.y,f*=w.x,p*=w.y,u+=T,h+=C,b=fa(x),x=sC(b)}}return fm({width:f,height:p,x:u,y:h})}function Gw(t,e){const n=Xw(t).scrollLeft;return e?e.left+n:hf(Zl(t)).left+n}function e$(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Gw(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function EK(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Zl(r),l=e?Ww(e.floating):!1;if(r===o||l&&s)return n;let u={scrollLeft:0,scrollTop:0},h=Vl(1);const f=Vl(0),p=qa(r);if((p||!p&&!s)&&(($m(r)!=="body"||zv(o))&&(u=Xw(r)),qa(r))){const v=hf(r);h=Rp(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const m=o&&!p&&!s?e$(o,u):Vl(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-u.scrollLeft*h.x+f.x+m.x,y:n.y*h.y-u.scrollTop*h.y+f.y+m.y}}function AK(t){return Array.from(t.getClientRects())}function MK(t){const e=Zl(t),n=Xw(t),r=t.ownerDocument.body,i=Cs(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Cs(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Gw(t);const l=-n.scrollTop;return yo(r).direction==="rtl"&&(o+=Cs(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:l}}const V5=25;function RK(t,e){const n=fa(t),r=Zl(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,l=0,u=0;if(i){s=i.width,o=i.height;const f=Yw();(!f||f&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}const h=Gw(r);if(h<=0){const f=r.ownerDocument,p=f.body,m=getComputedStyle(p),v=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(r.clientWidth-p.clientWidth-v);b<=V5&&(s-=b)}else h<=V5&&(s+=h);return{width:s,height:o,x:l,y:u}}const DK=new Set(["absolute","fixed"]);function NK(t,e){const n=hf(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=qa(t)?Rp(t):Vl(1),o=t.clientWidth*s.x,l=t.clientHeight*s.y,u=i*s.x,h=r*s.y;return{width:o,height:l,x:u,y:h}}function U5(t,e,n){let r;if(e==="viewport")r=RK(t,n);else if(e==="document")r=MK(Zl(t));else if(Cr(e))r=NK(e,n);else{const i=J7(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return fm(r)}function t$(t,e){const n=Gc(t);return n===e||!Cr(n)||Uc(n)?!1:yo(n).position==="fixed"||t$(n,e)}function PK(t,e){const n=e.get(t);if(n)return n;let r=Qc(t,[],!1).filter(l=>Cr(l)&&$m(l)!=="body"),i=null;const s=yo(t).position==="fixed";let o=s?Gc(t):t;for(;Cr(o)&&!Uc(o);){const l=yo(o),u=D6(o);!u&&l.position==="fixed"&&(i=null),(s?!u&&!i:!u&&l.position==="static"&&!!i&&DK.has(i.position)||zv(o)&&!u&&t$(t,o))?r=r.filter(f=>f!==o):i=l,o=Gc(o)}return e.set(t,r),r}function LK(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?Ww(e)?[]:PK(e,this._c):[].concat(n),r],l=o[0],u=o.reduce((h,f)=>{const p=U5(e,f,i);return h.top=Cs(p.top,h.top),h.right=ol(p.right,h.right),h.bottom=ol(p.bottom,h.bottom),h.left=Cs(p.left,h.left),h},U5(e,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function $K(t){const{width:e,height:n}=Z7(t);return{width:e,height:n}}function IK(t,e,n){const r=qa(e),i=Zl(e),s=n==="fixed",o=hf(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const u=Vl(0);function h(){u.x=Gw(i)}if(r||!r&&!s)if(($m(e)!=="body"||zv(i))&&(l=Xw(e)),r){const v=hf(e,!0,s,e);u.x=v.x+e.clientLeft,u.y=v.y+e.clientTop}else i&&h();s&&!r&&i&&h();const f=i&&!r&&!s?e$(i,l):Vl(0),p=o.left+l.scrollLeft-u.x-f.x,m=o.top+l.scrollTop-u.y-f.y;return{x:p,y:m,width:o.width,height:o.height}}function X_(t){return yo(t).position==="static"}function Q5(t,e){if(!qa(t)||yo(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Zl(t)===n&&(n=n.ownerDocument.body),n}function n$(t,e){const n=fa(t);if(Ww(t))return n;if(!qa(t)){let i=Gc(t);for(;i&&!Uc(i);){if(Cr(i)&&!X_(i))return i;i=Gc(i)}return n}let r=Q5(t,e);for(;r&&PG(r)&&X_(r);)r=Q5(r,e);return r&&Uc(r)&&X_(r)&&!D6(r)?n:r||zG(t)||n}const BK=async function(t){const e=this.getOffsetParent||n$,n=this.getDimensions,r=await n(t.floating);return{reference:IK(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zK(t){return yo(t).direction==="rtl"}const qK={convertOffsetParentRelativeRectToViewportRelativeRect:EK,getDocumentElement:Zl,getClippingRect:LK,getOffsetParent:n$,getElementRects:BK,getClientRects:AK,getDimensions:$K,getScale:Rp,isElement:Cr,isRTL:zK};function r$(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function FK(t,e){let n=null,r;const i=Zl(t);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const h=t.getBoundingClientRect(),{left:f,top:p,width:m,height:v}=h;if(l||e(),!m||!v)return;const b=Iy(p),x=Iy(i.clientWidth-(f+m)),w=Iy(i.clientHeight-(p+v)),S=Iy(f),T={rootMargin:-b+"px "+-x+"px "+-w+"px "+-S+"px",threshold:Cs(0,ol(1,u))||1};let C=!0;function j(A){const E=A[0].intersectionRatio;if(E!==u){if(!C)return o();E?o(!1,E):r=setTimeout(()=>{o(!1,1e-7)},1e3)}E===1&&!r$(h,t.getBoundingClientRect())&&o(),C=!1}try{n=new IntersectionObserver(j,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(j,T)}n.observe(t)}return o(!0),s}function cC(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,h=I6(t),f=i||s?[...h?Qc(h):[],...Qc(e)]:[];f.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),s&&S.addEventListener("resize",n)});const p=h&&l?FK(h,n):null;let m=-1,v=null;o&&(v=new ResizeObserver(S=>{let[_]=S;_&&_.target===h&&v&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=v)==null||T.observe(e)})),n()}),h&&!u&&v.observe(h),v.observe(e));let b,x=u?hf(t):null;u&&w();function w(){const S=hf(t);x&&!r$(x,S)&&n(),x=S,b=requestAnimationFrame(w)}return n(),()=>{var S;f.forEach(_=>{i&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),p==null||p(),(S=v)==null||S.disconnect(),v=null,u&&cancelAnimationFrame(b)}}const i$=jK,s$=_K,a$=bK,HK=CK,VK=yK,W5=vK,UK=wK,QK=TK,o$=(t,e,n)=>{const r=new Map,i={platform:qK,...n},s={...i.platform,_c:r};return gK(t,e,{...i,platform:s})};var WK=typeof document<"u",YK=function(){},L1=WK?M.useLayoutEffect:YK;function jx(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!jx(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!jx(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function l$(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Y5(t,e){const n=l$(t);return Math.round(e*n)/n}function G_(t){const e=M.useRef(t);return L1(()=>{e.current=t}),e}function XK(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:u,open:h}=t,[f,p]=M.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,v]=M.useState(r);jx(m,r)||v(r);const[b,x]=M.useState(null),[w,S]=M.useState(null),_=M.useCallback(U=>{U!==A.current&&(A.current=U,x(U))},[]),T=M.useCallback(U=>{U!==E.current&&(E.current=U,S(U))},[]),C=s||b,j=o||w,A=M.useRef(null),E=M.useRef(null),R=M.useRef(f),N=u!=null,$=G_(u),D=G_(i),F=G_(h),Q=M.useCallback(()=>{if(!A.current||!E.current)return;const U={placement:e,strategy:n,middleware:m};D.current&&(U.platform=D.current),o$(A.current,E.current,U).then(Z=>{const X={...Z,isPositioned:F.current!==!1};H.current&&!jx(R.current,X)&&(R.current=X,Vw.flushSync(()=>{p(X)}))})},[m,e,n,D,F]);L1(()=>{h===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(U=>({...U,isPositioned:!1})))},[h]);const H=M.useRef(!1);L1(()=>(H.current=!0,()=>{H.current=!1}),[]),L1(()=>{if(C&&(A.current=C),j&&(E.current=j),C&&j){if($.current)return $.current(C,j,Q);Q()}},[C,j,Q,$,N]);const q=M.useMemo(()=>({reference:A,floating:E,setReference:_,setFloating:T}),[_,T]),P=M.useMemo(()=>({reference:C,floating:j}),[C,j]),I=M.useMemo(()=>{const U={position:n,left:0,top:0};if(!P.floating)return U;const Z=Y5(P.floating,f.x),X=Y5(P.floating,f.y);return l?{...U,transform:"translate("+Z+"px, "+X+"px)",...l$(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:X}},[n,l,P.floating,f.x,f.y]);return M.useMemo(()=>({...f,update:Q,refs:q,elements:P,floatingStyles:I}),[f,Q,q,P,I])}const GK=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?W5({element:r.current,padding:i}).fn(n):{}:r?W5({element:r,padding:i}).fn(n):{}}}},c$=(t,e)=>({...i$(t),options:[t,e]}),B6=(t,e)=>({...s$(t),options:[t,e]}),X5=(t,e)=>({...QK(t),options:[t,e]}),_x=(t,e)=>({...a$(t),options:[t,e]}),KK=(t,e)=>({...HK(t),options:[t,e]}),ZK=(t,e)=>({...VK(t),options:[t,e]}),Eg=(t,e)=>({...UK(t),options:[t,e]}),u$=(t,e)=>({...GK(t),options:[t,e]});function h$(t){const e=M.useRef(void 0),n=M.useCallback(r=>{const i=t.map(s=>{if(s!=null){if(typeof s=="function"){const o=s,l=o(r);return typeof l=="function"?l:()=>{o(null)}}return s.current=r,()=>{s.current=null}}});return()=>{i.forEach(s=>s==null?void 0:s())}},t);return M.useMemo(()=>t.every(r=>r==null)?null:r=>{e.current&&(e.current(),e.current=void 0),r!=null&&(e.current=n(r))},t)}const JK="data-floating-ui-focusable",G5="active",K5="selected",eZ={...p7};let Z5=!1,tZ=0;const J5=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+tZ++;function nZ(){const[t,e]=M.useState(()=>Z5?J5():void 0);return Ul(()=>{t==null&&e(J5())},[]),M.useEffect(()=>{Z5=!0},[]),t}const rZ=eZ.useId,d$=rZ||nZ;function iZ(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(i=>i(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const sZ=M.createContext(null),aZ=M.createContext(null),z6=()=>{var t;return((t=M.useContext(sZ))==null?void 0:t.id)||null},q6=()=>M.useContext(aZ);function F6(t){return"data-floating-ui-"+t}function io(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}const eR=F6("safe-polygon");function $1(t,e,n){if(n&&!lC(n))return 0;if(typeof t=="number")return t;if(typeof t=="function"){const r=t();return typeof r=="number"?r:r==null?void 0:r[e]}return t==null?void 0:t[e]}function K_(t){return typeof t=="function"?t():t}function oZ(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:i,events:s,elements:o}=t,{enabled:l=!0,delay:u=0,handleClose:h=null,mouseOnly:f=!1,restMs:p=0,move:m=!0}=e,v=q6(),b=z6(),x=By(h),w=By(u),S=By(n),_=By(p),T=M.useRef(),C=M.useRef(-1),j=M.useRef(),A=M.useRef(-1),E=M.useRef(!0),R=M.useRef(!1),N=M.useRef(()=>{}),$=M.useRef(!1),D=Ll(()=>{var I;const U=(I=i.current.openEvent)==null?void 0:I.type;return(U==null?void 0:U.includes("mouse"))&&U!=="mousedown"});M.useEffect(()=>{if(!l)return;function I(U){let{open:Z}=U;Z||(io(C),io(A),E.current=!0,$.current=!1)}return s.on("openchange",I),()=>{s.off("openchange",I)}},[l,s]),M.useEffect(()=>{if(!l||!x.current||!n)return;function I(Z){D()&&r(!1,Z,"hover")}const U=$d(o.floating).documentElement;return U.addEventListener("mouseleave",I),()=>{U.removeEventListener("mouseleave",I)}},[o.floating,n,r,l,x,D]);const F=M.useCallback(function(I,U,Z){U===void 0&&(U=!0),Z===void 0&&(Z="hover");const X=$1(w.current,"close",T.current);X&&!j.current?(io(C),C.current=window.setTimeout(()=>r(!1,I,Z),X)):U&&(io(C),r(!1,I,Z))},[w,r]),Q=Ll(()=>{N.current(),j.current=void 0}),H=Ll(()=>{if(R.current){const I=$d(o.floating).body;I.style.pointerEvents="",I.removeAttribute(eR),R.current=!1}}),q=Ll(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);M.useEffect(()=>{if(!l)return;function I(G){if(io(C),E.current=!1,f&&!lC(T.current)||K_(_.current)>0&&!$1(w.current,"open"))return;const W=$1(w.current,"open",T.current);W?C.current=window.setTimeout(()=>{S.current||r(!0,G,"hover")},W):n||r(!0,G,"hover")}function U(G){if(q()){H();return}N.current();const W=$d(o.floating);if(io(A),$.current=!1,x.current&&i.current.floatingContext){n||io(C),j.current=x.current({...i.current.floatingContext,tree:v,x:G.clientX,y:G.clientY,onClose(){H(),Q(),q()||F(G,!0,"safe-polygon")}});const oe=j.current;W.addEventListener("mousemove",oe),N.current=()=>{W.removeEventListener("mousemove",oe)};return}(T.current==="touch"?!Ug(o.floating,G.relatedTarget):!0)&&F(G)}function Z(G){q()||i.current.floatingContext&&(x.current==null||x.current({...i.current.floatingContext,tree:v,x:G.clientX,y:G.clientY,onClose(){H(),Q(),q()||F(G)}})(G))}function X(){io(C)}function V(G){q()||F(G,!1)}if(Cr(o.domReference)){const G=o.domReference,W=o.floating;return n&&G.addEventListener("mouseleave",Z),m&&G.addEventListener("mousemove",I,{once:!0}),G.addEventListener("mouseenter",I),G.addEventListener("mouseleave",U),W&&(W.addEventListener("mouseleave",Z),W.addEventListener("mouseenter",X),W.addEventListener("mouseleave",V)),()=>{n&&G.removeEventListener("mouseleave",Z),m&&G.removeEventListener("mousemove",I),G.removeEventListener("mouseenter",I),G.removeEventListener("mouseleave",U),W&&(W.removeEventListener("mouseleave",Z),W.removeEventListener("mouseenter",X),W.removeEventListener("mouseleave",V))}}},[o,l,t,f,m,F,Q,H,r,n,S,v,w,x,i,q,_]),Ul(()=>{var I;if(l&&n&&(I=x.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&D()){R.current=!0;const Z=o.floating;if(Cr(o.domReference)&&Z){var U;const X=$d(o.floating).body;X.setAttribute(eR,"");const V=o.domReference,G=v==null||(U=v.nodesRef.current.find(W=>W.id===b))==null||(U=U.context)==null?void 0:U.elements.floating;return G&&(G.style.pointerEvents=""),X.style.pointerEvents="none",V.style.pointerEvents="auto",Z.style.pointerEvents="auto",()=>{X.style.pointerEvents="",V.style.pointerEvents="",Z.style.pointerEvents=""}}}},[l,n,b,o,v,x,D]),Ul(()=>{n||(T.current=void 0,$.current=!1,Q(),H())},[n,Q,H]),M.useEffect(()=>()=>{Q(),io(C),io(A),H()},[l,o.domReference,Q,H]);const P=M.useMemo(()=>{function I(U){T.current=U.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(U){const{nativeEvent:Z}=U;function X(){!E.current&&!S.current&&r(!0,Z,"hover")}f&&!lC(T.current)||n||K_(_.current)===0||$.current&&U.movementX**2+U.movementY**2<2||(io(A),T.current==="touch"?X():($.current=!0,A.current=window.setTimeout(X,K_(_.current))))}}},[f,r,n,S,_]);return M.useMemo(()=>l?{reference:P}:{},[l,P])}const uC=()=>{},f$=M.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:uC,setState:uC,isInstantPhase:!1}),lZ=()=>M.useContext(f$);function cZ(t){const{children:e,delay:n,timeoutMs:r=0}=t,[i,s]=M.useReducer((u,h)=>({...u,...h}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=M.useRef(null),l=M.useCallback(u=>{s({currentId:u})},[]);return Ul(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||s({isInstantPhase:!0}):(i.isInstantPhase&&s({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),a.jsx(f$.Provider,{value:M.useMemo(()=>({...i,setState:s,setCurrentId:l}),[i,l]),children:e})}function uZ(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,floatingId:i}=t,{id:s,enabled:o=!0}=e,l=s??i,u=lZ(),{currentId:h,setCurrentId:f,initialDelay:p,setState:m,timeoutMs:v}=u;return Ul(()=>{o&&h&&(m({delay:{open:1,close:$1(p,"close")}}),h!==l&&r(!1))},[o,l,r,m,h,p]),Ul(()=>{function b(){r(!1),m({delay:p,currentId:null})}if(o&&h&&!n&&h===l){if(v){const x=window.setTimeout(b,v);return()=>{clearTimeout(x)}}b()}},[o,n,m,h,l,r,p,v]),Ul(()=>{o&&(f===uC||!n||f(l))},[o,n,f,l]),u}const hZ={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dZ={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},tR=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t==null?void 0:t.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t==null?void 0:t.outsidePress)!=null?n:!0}};function fZ(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=t,{enabled:o=!0,escapeKey:l=!0,outsidePress:u=!0,outsidePressEvent:h="pointerdown",referencePress:f=!1,referencePressEvent:p="pointerdown",ancestorScroll:m=!1,bubbles:v,capture:b}=e,x=q6(),w=Ll(typeof u=="function"?u:()=>!1),S=typeof u=="function"?w:u,_=M.useRef(!1),{escapeKey:T,outsidePress:C}=tR(v),{escapeKey:j,outsidePress:A}=tR(b),E=M.useRef(!1),R=Ll(H=>{var q;if(!n||!o||!l||H.key!=="Escape"||E.current)return;const P=(q=s.current.floatingContext)==null?void 0:q.nodeId,I=x?P1(x.nodesRef.current,P):[];if(!T&&(H.stopPropagation(),I.length>0)){let U=!0;if(I.forEach(Z=>{var X;if((X=Z.context)!=null&&X.open&&!Z.context.dataRef.current.__escapeKeyBubbles){U=!1;return}}),!U)return}r(!1,cK(H)?H.nativeEvent:H,"escape-key")}),N=Ll(H=>{var q;const P=()=>{var I;R(H),(I=gp(H))==null||I.removeEventListener("keydown",P)};(q=gp(H))==null||q.addEventListener("keydown",P)}),$=Ll(H=>{var q;const P=s.current.insideReactTree;s.current.insideReactTree=!1;const I=_.current;if(_.current=!1,h==="click"&&I||P||typeof S=="function"&&!S(H))return;const U=gp(H),Z="["+F6("inert")+"]",X=$d(i.floating).querySelectorAll(Z);let V=Cr(U)?U:null;for(;V&&!Uc(V);){const oe=Gc(V);if(Uc(oe)||!Cr(oe))break;V=oe}if(X.length&&Cr(U)&&!sK(U)&&!Ug(U,i.floating)&&Array.from(X).every(oe=>!Ug(V,oe)))return;if(qa(U)&&Q){const oe=Uc(U),be=yo(U),ye=/auto|scroll/,Ke=oe||ye.test(be.overflowX),Fe=oe||ye.test(be.overflowY),Pe=Ke&&U.clientWidth>0&&U.scrollWidth>U.clientWidth,ae=Fe&&U.clientHeight>0&&U.scrollHeight>U.clientHeight,Te=be.direction==="rtl",fe=ae&&(Te?H.offsetX<=U.offsetWidth-U.clientWidth:H.offsetX>U.clientWidth),Ee=Pe&&H.offsetY>U.clientHeight;if(fe||Ee)return}const G=(q=s.current.floatingContext)==null?void 0:q.nodeId,W=x&&P1(x.nodesRef.current,G).some(oe=>{var be;return Y_(H,(be=oe.context)==null?void 0:be.elements.floating)});if(Y_(H,i.floating)||Y_(H,i.domReference)||W)return;const te=x?P1(x.nodesRef.current,G):[];if(te.length>0){let oe=!0;if(te.forEach(be=>{var ye;if((ye=be.context)!=null&&ye.open&&!be.context.dataRef.current.__outsidePressBubbles){oe=!1;return}}),!oe)return}r(!1,H,"outside-press")}),D=Ll(H=>{var q;const P=()=>{var I;$(H),(I=gp(H))==null||I.removeEventListener(h,P)};(q=gp(H))==null||q.addEventListener(h,P)});M.useEffect(()=>{if(!n||!o)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=C;let H=-1;function q(X){r(!1,X,"ancestor-scroll")}function P(){window.clearTimeout(H),E.current=!0}function I(){H=window.setTimeout(()=>{E.current=!1},Yw()?5:0)}const U=$d(i.floating);l&&(U.addEventListener("keydown",j?N:R,j),U.addEventListener("compositionstart",P),U.addEventListener("compositionend",I)),S&&U.addEventListener(h,A?D:$,A);let Z=[];return m&&(Cr(i.domReference)&&(Z=Qc(i.domReference)),Cr(i.floating)&&(Z=Z.concat(Qc(i.floating))),!Cr(i.reference)&&i.reference&&i.reference.contextElement&&(Z=Z.concat(Qc(i.reference.contextElement)))),Z=Z.filter(X=>{var V;return X!==((V=U.defaultView)==null?void 0:V.visualViewport)}),Z.forEach(X=>{X.addEventListener("scroll",q,{passive:!0})}),()=>{l&&(U.removeEventListener("keydown",j?N:R,j),U.removeEventListener("compositionstart",P),U.removeEventListener("compositionend",I)),S&&U.removeEventListener(h,A?D:$,A),Z.forEach(X=>{X.removeEventListener("scroll",q)}),window.clearTimeout(H)}},[s,i,l,S,h,n,r,m,o,T,C,R,j,N,$,A,D]),M.useEffect(()=>{s.current.insideReactTree=!1},[s,S,h]);const F=M.useMemo(()=>({onKeyDown:R,...f&&{[hZ[p]]:H=>{r(!1,H.nativeEvent,"reference-press")},...p!=="click"&&{onClick(H){r(!1,H.nativeEvent,"reference-press")}}}}),[R,r,f,p]),Q=M.useMemo(()=>({onKeyDown:R,onMouseDown(){_.current=!0},onMouseUp(){_.current=!0},[dZ[h]]:()=>{s.current.insideReactTree=!0}}),[R,h,s]);return M.useMemo(()=>o?{reference:F,floating:Q}:{},[o,F,Q])}function pZ(t){const{open:e=!1,onOpenChange:n,elements:r}=t,i=d$(),s=M.useRef({}),[o]=M.useState(()=>iZ()),l=z6()!=null,[u,h]=M.useState(r.reference),f=Ll((v,b,x)=>{s.current.openEvent=v?b:void 0,o.emit("openchange",{open:v,event:b,reason:x,nested:l}),n==null||n(v,b,x)}),p=M.useMemo(()=>({setPositionReference:h}),[]),m=M.useMemo(()=>({reference:u||r.reference||null,floating:r.floating||null,domReference:r.reference}),[u,r.reference,r.floating]);return M.useMemo(()=>({dataRef:s,open:e,onOpenChange:f,elements:m,events:o,floatingId:i,refs:p}),[e,f,m,o,i,p])}function H6(t){t===void 0&&(t={});const{nodeId:e}=t,n=pZ({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,i=r.elements,[s,o]=M.useState(null),[l,u]=M.useState(null),f=(i==null?void 0:i.domReference)||s,p=M.useRef(null),m=q6();Ul(()=>{f&&(p.current=f)},[f]);const v=XK({...t,elements:{...i,...l&&{reference:l}}}),b=M.useCallback(T=>{const C=Cr(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;u(C),v.refs.setReference(C)},[v.refs]),x=M.useCallback(T=>{(Cr(T)||T===null)&&(p.current=T,o(T)),(Cr(v.refs.reference.current)||v.refs.reference.current===null||T!==null&&!Cr(T))&&v.refs.setReference(T)},[v.refs]),w=M.useMemo(()=>({...v.refs,setReference:x,setPositionReference:b,domReference:p}),[v.refs,x,b]),S=M.useMemo(()=>({...v.elements,domReference:f}),[v.elements,f]),_=M.useMemo(()=>({...v,...r,refs:w,elements:S,nodeId:e}),[v,w,S,e,r]);return Ul(()=>{r.dataRef.current.floatingContext=_;const T=m==null?void 0:m.nodesRef.current.find(C=>C.id===e);T&&(T.context=_)}),M.useMemo(()=>({...v,context:_,refs:w,elements:S}),[v,w,S,_])}function Z_(){return nK()&&tK()}function mZ(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:o}=t,{enabled:l=!0,visibleOnly:u=!0}=e,h=M.useRef(!1),f=M.useRef(-1),p=M.useRef(!0);M.useEffect(()=>{if(!l)return;const v=fa(o.domReference);function b(){!n&&qa(o.domReference)&&o.domReference===z5($d(o.domReference))&&(h.current=!0)}function x(){p.current=!0}function w(){p.current=!1}return v.addEventListener("blur",b),Z_()&&(v.addEventListener("keydown",x,!0),v.addEventListener("pointerdown",w,!0)),()=>{v.removeEventListener("blur",b),Z_()&&(v.removeEventListener("keydown",x,!0),v.removeEventListener("pointerdown",w,!0))}},[o.domReference,n,l]),M.useEffect(()=>{if(!l)return;function v(b){let{reason:x}=b;(x==="reference-press"||x==="escape-key")&&(h.current=!0)}return i.on("openchange",v),()=>{i.off("openchange",v)}},[i,l]),M.useEffect(()=>()=>{io(f)},[]);const m=M.useMemo(()=>({onMouseLeave(){h.current=!1},onFocus(v){if(h.current)return;const b=gp(v.nativeEvent);if(u&&Cr(b)){if(Z_()&&!v.relatedTarget){if(!p.current&&!aK(b))return}else if(!oK(b))return}r(!0,v.nativeEvent,"focus")},onBlur(v){h.current=!1;const b=v.relatedTarget,x=v.nativeEvent,w=Cr(b)&&b.hasAttribute(F6("focus-guard"))&&b.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{var S;const _=z5(o.domReference?o.domReference.ownerDocument:document);!b&&_===o.domReference||Ug((S=s.current.floatingContext)==null?void 0:S.refs.floating.current,_)||Ug(o.domReference,_)||w||r(!1,x,"focus")})}}),[s,o.domReference,r,u]);return M.useMemo(()=>l?{reference:m}:{},[l,m])}function J_(t,e,n){const r=new Map,i=n==="item";let s=t;if(i&&t){const{[G5]:o,[K5]:l,...u}=t;s=u}return{...n==="floating"&&{tabIndex:-1,[JK]:""},...s,...e.map(o=>{const l=o?o[n]:null;return typeof l=="function"?t?l(t):null:l}).concat(t).reduce((o,l)=>(l&&Object.entries(l).forEach(u=>{let[h,f]=u;if(!(i&&[G5,K5].includes(h)))if(h.indexOf("on")===0){if(r.has(h)||r.set(h,[]),typeof f=="function"){var p;(p=r.get(h))==null||p.push(f),o[h]=function(){for(var m,v=arguments.length,b=new Array(v),x=0;x<v;x++)b[x]=arguments[x];return(m=r.get(h))==null?void 0:m.map(w=>w(...b)).find(w=>w!==void 0)}}}else o[h]=f}),o),{})}}function gZ(t){t===void 0&&(t=[]);const e=t.map(l=>l==null?void 0:l.reference),n=t.map(l=>l==null?void 0:l.floating),r=t.map(l=>l==null?void 0:l.item),i=M.useCallback(l=>J_(l,t,"reference"),e),s=M.useCallback(l=>J_(l,t,"floating"),n),o=M.useCallback(l=>J_(l,t,"item"),r);return M.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:o}),[i,s,o])}const vZ=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function bZ(t,e){var n,r;e===void 0&&(e={});const{open:i,elements:s,floatingId:o}=t,{enabled:l=!0,role:u="dialog"}=e,h=d$(),f=((n=s.domReference)==null?void 0:n.id)||h,p=M.useMemo(()=>{var _;return((_=lK(s.floating))==null?void 0:_.id)||o},[s.floating,o]),m=(r=vZ.get(u))!=null?r:u,b=z6()!=null,x=M.useMemo(()=>m==="tooltip"||u==="label"?{["aria-"+(u==="label"?"labelledby":"describedby")]:i?p:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":m==="alertdialog"?"dialog":m,"aria-controls":i?p:void 0,...m==="listbox"&&{role:"combobox"},...m==="menu"&&{id:f},...m==="menu"&&b&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[m,p,b,i,f,u]),w=M.useMemo(()=>{const _={id:p,...m&&{role:m}};return m==="tooltip"||u==="label"?_:{..._,...m==="menu"&&{"aria-labelledby":f}}},[m,p,f,u]),S=M.useCallback(_=>{let{active:T,selected:C}=_;const j={role:"option",...T&&{id:p+"-fui-option"}};switch(u){case"select":case"combobox":return{...j,"aria-selected":C}}return{}},[p,u]);return M.useMemo(()=>l?{reference:x,floating:w,item:S}:{},[l,x,w,S])}var V6={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const[yZ,_o]=Wi("ScrollArea.Root component was not found in tree");function pm(t,e){const n=Md(e);Sf(()=>{let r=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(t),()=>{window.cancelAnimationFrame(r),i.unobserve(t)}}},[t,n])}const xZ=M.forwardRef((t,e)=>{const{style:n,...r}=t,i=_o(),[s,o]=M.useState(0),[l,u]=M.useState(0),h=!!(s&&l);return pm(i.scrollbarX,()=>{var p;const f=((p=i.scrollbarX)==null?void 0:p.offsetHeight)||0;i.onCornerHeightChange(f),u(f)}),pm(i.scrollbarY,()=>{var p;const f=((p=i.scrollbarY)==null?void 0:p.offsetWidth)||0;i.onCornerWidthChange(f),o(f)}),h?a.jsx("div",{...r,ref:e,style:{...n,width:s,height:l}}):null}),wZ=M.forwardRef((t,e)=>{const n=_o(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(xZ,{...t,ref:e}):null}),SZ={scrollHideDelay:1e3,type:"hover"},p$=M.forwardRef((t,e)=>{const{type:n,scrollHideDelay:r,scrollbars:i,getStyles:s,...o}=Se("ScrollAreaRoot",SZ,t),[l,u]=M.useState(null),[h,f]=M.useState(null),[p,m]=M.useState(null),[v,b]=M.useState(null),[x,w]=M.useState(null),[S,_]=M.useState(0),[T,C]=M.useState(0),[j,A]=M.useState(!1),[E,R]=M.useState(!1),N=cr(e,$=>u($));return a.jsx(yZ,{value:{type:n,scrollHideDelay:r,scrollArea:l,viewport:h,onViewportChange:f,content:p,onContentChange:m,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:j,onScrollbarXEnabledChange:A,scrollbarY:x,onScrollbarYChange:w,scrollbarYEnabled:E,onScrollbarYEnabledChange:R,onCornerWidthChange:_,onCornerHeightChange:C,getStyles:s},children:a.jsx(ve,{...o,ref:N,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${S}px`,"--sa-corner-height":i!=="xy"?"0px":`${T}px`}})})});p$.displayName="@mantine/core/ScrollAreaRoot";function m$(t,e){const n=t/e;return Number.isNaN(n)?0:n}function Kw(t){const e=m$(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function g$(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function jZ(t,[e,n]){return Math.min(n,Math.max(e,t))}function nR(t,e,n="ltr"){const r=Kw(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-i,o=e.content-e.viewport,l=s-r,u=n==="ltr"?[0,o]:[o*-1,0],h=jZ(t,u);return g$([0,o],[0,l])(h)}function _Z(t,e,n,r="ltr"){const i=Kw(n),s=i/2,o=e||s,l=i-o,u=n.scrollbar.paddingStart+o,h=n.scrollbar.size-n.scrollbar.paddingEnd-l,f=n.content-n.viewport,p=r==="ltr"?[0,f]:[f*-1,0];return g$([u,h],p)(t)}function v$(t,e){return t>0&&t<e}function gh(t){return t?parseInt(t,10):0}function nf(t,e,{checkForDefaultPrevented:n=!0}={}){return r=>{t==null||t(r),(n===!1||!r.defaultPrevented)&&(e==null||e(r))}}const[TZ,b$]=Wi("ScrollAreaScrollbar was not found in tree"),y$=M.forwardRef((t,e)=>{const{sizes:n,hasThumb:r,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:o,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:h,onResize:f,...p}=t,m=_o(),[v,b]=M.useState(null),x=cr(e,R=>b(R)),w=M.useRef(null),S=M.useRef(""),{viewport:_}=m,T=n.content-n.viewport,C=Md(h),j=Md(l),A=Pw(f,10),E=R=>{if(w.current){const N=R.clientX-w.current.left,$=R.clientY-w.current.top;u({x:N,y:$})}};return M.useEffect(()=>{const R=N=>{const $=N.target;(v==null?void 0:v.contains($))&&C(N,T)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[_,v,T,C]),M.useEffect(j,[n,j]),pm(v,A),pm(m.content,A),a.jsx(TZ,{value:{scrollbar:v,hasThumb:r,onThumbChange:Md(i),onThumbPointerUp:Md(s),onThumbPositionChange:j,onThumbPointerDown:Md(o)},children:a.jsx("div",{...p,ref:x,"data-mantine-scrollbar":!0,style:{position:"absolute",...p.style},onPointerDown:nf(t.onPointerDown,R=>{R.preventDefault(),R.button===0&&(R.target.setPointerCapture(R.pointerId),w.current=v.getBoundingClientRect(),S.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",E(R))}),onPointerMove:nf(t.onPointerMove,E),onPointerUp:nf(t.onPointerUp,R=>{const N=R.target;N.hasPointerCapture(R.pointerId)&&(R.preventDefault(),N.releasePointerCapture(R.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=S.current,w.current=null}})})}),x$=M.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,style:i,...s}=t,o=_o(),[l,u]=M.useState(),h=M.useRef(null),f=cr(e,h,o.onScrollbarXChange);return M.useEffect(()=>{h.current&&u(getComputedStyle(h.current))},[h]),a.jsx(y$,{"data-orientation":"horizontal",...s,ref:f,sizes:n,style:{...i,"--sa-thumb-width":`${Kw(n)}px`},onThumbPointerDown:p=>t.onThumbPointerDown(p.x),onDragScroll:p=>t.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollLeft+p.deltaX;t.onWheelScroll(v),v$(v,m)&&p.preventDefault()}},onResize:()=>{h.current&&o.viewport&&l&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:gh(l.paddingLeft),paddingEnd:gh(l.paddingRight)}})}})});x$.displayName="@mantine/core/ScrollAreaScrollbarX";const w$=M.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,style:i,...s}=t,o=_o(),[l,u]=M.useState(),h=M.useRef(null),f=cr(e,h,o.onScrollbarYChange);return M.useEffect(()=>{h.current&&u(window.getComputedStyle(h.current))},[]),a.jsx(y$,{...s,"data-orientation":"vertical",ref:f,sizes:n,style:{"--sa-thumb-height":`${Kw(n)}px`,...i},onThumbPointerDown:p=>t.onThumbPointerDown(p.y),onDragScroll:p=>t.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollTop+p.deltaY;t.onWheelScroll(v),v$(v,m)&&p.preventDefault()}},onResize:()=>{h.current&&o.viewport&&l&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:gh(l.paddingTop),paddingEnd:gh(l.paddingBottom)}})}})});w$.displayName="@mantine/core/ScrollAreaScrollbarY";const Zw=M.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,{dir:i}=_f(),s=_o(),o=M.useRef(null),l=M.useRef(0),[u,h]=M.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=m$(u.viewport,u.content),p={...r,sizes:u,onSizesChange:h,hasThumb:f>0&&f<1,onThumbChange:v=>{o.current=v},onThumbPointerUp:()=>{l.current=0},onThumbPointerDown:v=>{l.current=v}},m=(v,b)=>_Z(v,l.current,u,b);return n==="horizontal"?a.jsx(x$,{...p,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const v=s.viewport.scrollLeft,b=nR(v,u,i);o.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:v=>{s.viewport&&(s.viewport.scrollLeft=v)},onDragScroll:v=>{s.viewport&&(s.viewport.scrollLeft=m(v,i))}}):n==="vertical"?a.jsx(w$,{...p,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const v=s.viewport.scrollTop,b=nR(v,u);u.scrollbar.size===0?o.current.style.setProperty("--thumb-opacity","0"):o.current.style.setProperty("--thumb-opacity","1"),o.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:v=>{s.viewport&&(s.viewport.scrollTop=v)},onDragScroll:v=>{s.viewport&&(s.viewport.scrollTop=m(v))}}):null});Zw.displayName="@mantine/core/ScrollAreaScrollbarVisible";const U6=M.forwardRef((t,e)=>{const n=_o(),{forceMount:r,...i}=t,[s,o]=M.useState(!1),l=t.orientation==="horizontal",u=Pw(()=>{if(n.viewport){const h=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?h:f)}},10);return pm(n.viewport,u),pm(n.content,u),r||s?a.jsx(Zw,{"data-state":s?"visible":"hidden",...i,ref:e}):null});U6.displayName="@mantine/core/ScrollAreaScrollbarAuto";const S$=M.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=_o(),[s,o]=M.useState(!1);return M.useEffect(()=>{const{scrollArea:l}=i;let u=0;if(l){const h=()=>{window.clearTimeout(u),o(!0)},f=()=>{u=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",h),l.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",h),l.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),n||s?a.jsx(U6,{"data-state":s?"visible":"hidden",...r,ref:e}):null});S$.displayName="@mantine/core/ScrollAreaScrollbarHover";const CZ=M.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=_o(),s=t.orientation==="horizontal",[o,l]=M.useState("hidden"),u=Pw(()=>l("idle"),100);return M.useEffect(()=>{if(o==="idle"){const h=window.setTimeout(()=>l("hidden"),i.scrollHideDelay);return()=>window.clearTimeout(h)}},[o,i.scrollHideDelay]),M.useEffect(()=>{const{viewport:h}=i,f=s?"scrollLeft":"scrollTop";if(h){let p=h[f];const m=()=>{const v=h[f];p!==v&&(l("scrolling"),u()),p=v};return h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[i.viewport,s,u]),n||o!=="hidden"?a.jsx(Zw,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:nf(t.onPointerEnter,()=>l("interacting")),onPointerLeave:nf(t.onPointerLeave,()=>l("idle"))}):null}),hC=M.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=_o(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:o}=i,l=t.orientation==="horizontal";return M.useEffect(()=>(l?s(!0):o(!0),()=>{l?s(!1):o(!1)}),[l,s,o]),i.type==="hover"?a.jsx(S$,{...r,ref:e,forceMount:n}):i.type==="scroll"?a.jsx(CZ,{...r,ref:e,forceMount:n}):i.type==="auto"?a.jsx(U6,{...r,ref:e,forceMount:n}):i.type==="always"?a.jsx(Zw,{...r,ref:e}):null});hC.displayName="@mantine/core/ScrollAreaScrollbar";function kZ(t,e=()=>{}){let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function i(){const s={left:t.scrollLeft,top:t.scrollTop},o=n.left!==s.left,l=n.top!==s.top;(o||l)&&e(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)}const j$=M.forwardRef((t,e)=>{const{style:n,...r}=t,i=_o(),s=b$(),{onThumbPositionChange:o}=s,l=cr(e,f=>s.onThumbChange(f)),u=M.useRef(void 0),h=Pw(()=>{u.current&&(u.current(),u.current=void 0)},100);return M.useEffect(()=>{const{viewport:f}=i;if(f){const p=()=>{if(h(),!u.current){const m=kZ(f,o);u.current=m,o()}};return o(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,h,o]),a.jsx("div",{"data-state":s.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:nf(t.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),v=f.clientX-m.left,b=f.clientY-m.top;s.onThumbPointerDown({x:v,y:b})}),onPointerUp:nf(t.onPointerUp,s.onThumbPointerUp)})});j$.displayName="@mantine/core/ScrollAreaThumb";const dC=M.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=b$();return n||i.hasThumb?a.jsx(j$,{ref:e,...r}):null});dC.displayName="@mantine/core/ScrollAreaThumb";const _$=M.forwardRef(({children:t,style:e,onWheel:n,...r},i)=>{const s=_o(),o=cr(i,s.onViewportChange),l=u=>{if(n==null||n(u),s.scrollbarXEnabled&&s.viewport&&u.shiftKey){const{scrollTop:h,scrollHeight:f,clientHeight:p,scrollWidth:m,clientWidth:v}=s.viewport,b=h<1,x=h>=f-p-1;m>v&&(b||x)&&u.stopPropagation()}};return a.jsx(ve,{...r,ref:o,onWheel:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e},children:a.jsx("div",{...s.getStyles("content"),ref:s.onContentChange,children:t})})});_$.displayName="@mantine/core/ScrollAreaViewport";const T$={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},OZ=(t,{scrollbarSize:e,overscrollBehavior:n,scrollbars:r})=>{let i=n;return n&&r&&(r==="x"?i=`${n} auto`:r==="y"&&(i=`auto ${n}`)),{root:{"--scrollarea-scrollbar-size":de(e),"--scrollarea-over-scroll-behavior":i}}},Fa=Ae((t,e)=>{const n=Se("ScrollArea",T$,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,scrollbarSize:u,vars:h,type:f,scrollHideDelay:p,viewportProps:m,viewportRef:v,onScrollPositionChange:b,children:x,offsetScrollbars:w,scrollbars:S,onBottomReached:_,onTopReached:T,overscrollBehavior:C,attributes:j,...A}=n,[E,R]=M.useState(!1),[N,$]=M.useState(!1),[D,F]=M.useState(!1),Q=lt({name:"ScrollArea",props:n,classes:V6,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:j,vars:h,varsResolver:OZ}),H=M.useRef(null),q=h$([v,H]);return M.useEffect(()=>{if(!H.current||w!=="present")return;const P=H.current,I=new ResizeObserver(()=>{const{scrollHeight:U,clientHeight:Z,scrollWidth:X,clientWidth:V}=P;$(U>Z),F(X>V)});return I.observe(P),()=>I.disconnect()},[H,w]),a.jsxs(p$,{getStyles:Q,type:f==="never"?"always":f,scrollHideDelay:p,ref:e,scrollbars:S,...Q("root"),...A,children:[a.jsx(_$,{...m,...Q("viewport",{style:m==null?void 0:m.style}),ref:q,"data-offset-scrollbars":w===!0?"xy":w||void 0,"data-scrollbars":S||void 0,"data-horizontal-hidden":w==="present"&&!D?"true":void 0,"data-vertical-hidden":w==="present"&&!N?"true":void 0,onScroll:P=>{var X;(X=m==null?void 0:m.onScroll)==null||X.call(m,P),b==null||b({x:P.currentTarget.scrollLeft,y:P.currentTarget.scrollTop});const{scrollTop:I,scrollHeight:U,clientHeight:Z}=P.currentTarget;I-(U-Z)>=-.8&&(_==null||_()),I===0&&(T==null||T())},children:x}),(S==="xy"||S==="x")&&a.jsx(hC,{...Q("scrollbar"),orientation:"horizontal","data-hidden":f==="never"||w==="present"&&!D?!0:void 0,forceMount:!0,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:a.jsx(dC,{...Q("thumb")})}),(S==="xy"||S==="y")&&a.jsx(hC,{...Q("scrollbar"),orientation:"vertical","data-hidden":f==="never"||w==="present"&&!N?!0:void 0,forceMount:!0,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:a.jsx(dC,{...Q("thumb")})}),a.jsx(wZ,{...Q("corner"),"data-hovered":E||void 0,"data-hidden":f==="never"||void 0})]})});Fa.displayName="@mantine/core/ScrollArea";const Q6=Ae((t,e)=>{const{children:n,classNames:r,styles:i,scrollbarSize:s,scrollHideDelay:o,type:l,dir:u,offsetScrollbars:h,overscrollBehavior:f,viewportRef:p,onScrollPositionChange:m,unstyled:v,variant:b,viewportProps:x,scrollbars:w,style:S,vars:_,onBottomReached:T,onTopReached:C,onOverflowChange:j,...A}=Se("ScrollAreaAutosize",T$,t),E=M.useRef(null),R=h$([p,E]),[N,$]=M.useState(!1),D=M.useRef(!1);return M.useEffect(()=>{if(!j)return;const F=E.current;if(!F)return;const Q=()=>{const q=F.scrollHeight>F.clientHeight;q!==N&&(D.current?j==null||j(q):(D.current=!0,q&&(j==null||j(!0))),$(q))};Q();const H=new ResizeObserver(Q);return H.observe(F),()=>H.disconnect()},[j,N]),a.jsx(ve,{...A,ref:e,style:[{display:"flex",overflow:"hidden"},S],children:a.jsx(ve,{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",...w==="y"&&{minWidth:0},...w==="x"&&{minHeight:0},...w==="xy"&&{minWidth:0,minHeight:0},...w===!1&&{minWidth:0,minHeight:0}},children:a.jsx(Fa,{classNames:r,styles:i,scrollHideDelay:o,scrollbarSize:s,type:l,dir:u,offsetScrollbars:h,overscrollBehavior:f,viewportRef:R,onScrollPositionChange:m,unstyled:v,variant:b,viewportProps:x,vars:_,scrollbars:w,onBottomReached:T,onTopReached:C,"data-autosize":"true",children:n})})})});Fa.classes=V6;Q6.displayName="@mantine/core/ScrollAreaAutosize";Q6.classes=V6;Fa.Autosize=Q6;var C$={root:"m_87cf2631"};const EZ={__staticSelector:"UnstyledButton"},Dr=Yi((t,e)=>{const n=Se("UnstyledButton",EZ,t),{className:r,component:i="button",__staticSelector:s,unstyled:o,classNames:l,styles:u,style:h,attributes:f,...p}=n,m=lt({name:s,props:n,classes:C$,className:r,style:h,classNames:l,styles:u,unstyled:o,attributes:f});return a.jsx(ve,{...m("root",{focusable:!0}),component:i,ref:e,type:i==="button"?"button":void 0,...p})});Dr.classes=C$;Dr.displayName="@mantine/core/UnstyledButton";var k$={root:"m_515a97f8"};const W6=Ae((t,e)=>{const n=Se("VisuallyHidden",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,attributes:h,...f}=n,p=lt({name:"VisuallyHidden",classes:k$,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:h});return a.jsx(ve,{component:"span",ref:e,...p("root"),...f})});W6.classes=k$;W6.displayName="@mantine/core/VisuallyHidden";var O$={root:"m_1b7284a3"};const AZ=(t,{radius:e,shadow:n})=>({root:{"--paper-radius":e===void 0?void 0:Zn(e),"--paper-shadow":C6(n)}}),Jw=Yi((t,e)=>{const n=Se("Paper",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,withBorder:u,vars:h,radius:f,shadow:p,variant:m,mod:v,attributes:b,...x}=n,w=lt({name:"Paper",props:n,classes:O$,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:b,vars:h,varsResolver:AZ});return a.jsx(ve,{ref:e,mod:[{"data-with-border":u},v],...w("root"),variant:m,...x})});Jw.classes=O$;Jw.displayName="@mantine/core/Paper";function rR(t,e,n,r){return t==="center"||r==="center"?{top:e}:t==="end"?{bottom:n}:t==="start"?{top:n}:{}}function iR(t,e,n,r,i){return t==="center"||r==="center"?{left:e}:t==="end"?{[i==="ltr"?"right":"left"]:n}:t==="start"?{[i==="ltr"?"left":"right"]:n}:{}}const MZ={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function RZ({position:t,arrowSize:e,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:s,arrowY:o,dir:l}){const[u,h="center"]=t.split("-"),f={width:e,height:e,transform:"rotate(45deg)",position:"absolute",[MZ[u]]:r},p=-e/2;return u==="left"?{...f,...rR(h,o,n,i),right:p,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:u==="right"?{...f,...rR(h,o,n,i),left:p,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:u==="top"?{...f,...iR(h,s,n,i,l),bottom:p,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:u==="bottom"?{...f,...iR(h,s,n,i,l),top:p,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Tx=M.forwardRef(({position:t,arrowSize:e,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:s,arrowX:o,arrowY:l,style:u,...h},f)=>{const{dir:p}=_f();return s?a.jsx("div",{...h,ref:f,style:{...u,...RZ({position:t,arrowSize:e,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:p,arrowX:o,arrowY:l})}}):null});Tx.displayName="@mantine/core/FloatingArrow";function E$(t,e){if(t==="rtl"&&(e.includes("right")||e.includes("left"))){const[n,r]=e.split("-"),i=n==="right"?"left":"right";return r===void 0?i:`${i}-${r}`}return e}var A$={root:"m_9814e45f"};const DZ={zIndex:So("modal")},NZ=(t,{gradient:e,color:n,backgroundOpacity:r,blur:i,radius:s,zIndex:o})=>({root:{"--overlay-bg":e||(n!==void 0||r!==void 0)&&Al(n||"#000",r??.6)||void 0,"--overlay-filter":i?`blur(${de(i)})`:void 0,"--overlay-radius":s===void 0?void 0:Zn(s),"--overlay-z-index":o==null?void 0:o.toString()}}),mm=Yi((t,e)=>{const n=Se("Overlay",DZ,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,fixed:h,center:f,children:p,radius:m,zIndex:v,gradient:b,blur:x,color:w,backgroundOpacity:S,mod:_,attributes:T,...C}=n,j=lt({name:"Overlay",props:n,classes:A$,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:T,vars:u,varsResolver:NZ});return a.jsx(ve,{ref:e,...j("root"),mod:[{center:f,fixed:h},_],...C,children:p})});mm.classes=A$;mm.displayName="@mantine/core/Overlay";function e3(t){const e=document.createElement("div");return e.setAttribute("data-portal","true"),typeof t.className=="string"&&e.classList.add(...t.className.split(" ").filter(Boolean)),typeof t.style=="object"&&Object.assign(e.style,t.style),typeof t.id=="string"&&e.setAttribute("id",t.id),e}function PZ({target:t,reuseTargetNode:e,...n}){if(t)return typeof t=="string"?document.querySelector(t)||e3(n):t;if(e){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const i=e3(n);return i.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(i),i}return e3(n)}const LZ={reuseTargetNode:!0},M$=Ae((t,e)=>{const{children:n,target:r,reuseTargetNode:i,...s}=Se("Portal",LZ,t),[o,l]=M.useState(!1),u=M.useRef(null);return Sf(()=>(l(!0),u.current=PZ({target:r,reuseTargetNode:i,...s}),yx(e,u.current),!r&&!i&&u.current&&document.body.appendChild(u.current),()=>{!r&&!i&&u.current&&document.body.removeChild(u.current)}),[r]),!o||!u.current?null:Vw.createPortal(a.jsx(a.Fragment,{children:n}),u.current)});M$.displayName="@mantine/core/Portal";const Eh=Ae(({withinPortal:t=!0,children:e,...n},r)=>zw()==="test"||!t?a.jsx(a.Fragment,{children:e}):a.jsx(M$,{ref:r,...n,children:e}));Eh.displayName="@mantine/core/OptionalPortal";const K0=t=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${t==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),zy={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...K0("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...K0("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...K0("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...K0("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...K0("top"),common:{transformOrigin:"top right"}}},sR={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function $Z({transition:t,state:e,duration:n,timingFunction:r}){const i={WebkitBackfaceVisibility:"hidden",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof t=="string"?t in zy?{transitionProperty:zy[t].transitionProperty,...i,...zy[t].common,...zy[t][sR[e]]}:{}:{transitionProperty:t.transitionProperty,...i,...t.common,...t[sR[e]]}}function IZ({duration:t,exitDuration:e,timingFunction:n,mounted:r,onEnter:i,onExit:s,onEntered:o,onExited:l,enterDelay:u,exitDelay:h}){const f=yi(),p=Lw(),m=f.respectReducedMotion?p:!1,[v,b]=M.useState(m?0:t),[x,w]=M.useState(r?"entered":"exited"),S=M.useRef(-1),_=M.useRef(-1),T=M.useRef(-1);function C(){window.clearTimeout(S.current),window.clearTimeout(_.current),cancelAnimationFrame(T.current)}const j=E=>{C();const R=E?i:s,N=E?o:l,$=m?0:E?t:e;b($),$===0?(typeof R=="function"&&R(),typeof N=="function"&&N(),w(E?"entered":"exited")):T.current=requestAnimationFrame(()=>{dg.flushSync(()=>{w(E?"pre-entering":"pre-exiting")}),T.current=requestAnimationFrame(()=>{typeof R=="function"&&R(),w(E?"entering":"exiting"),S.current=window.setTimeout(()=>{typeof N=="function"&&N(),w(E?"entered":"exited")},$)})})},A=E=>{if(C(),typeof(E?u:h)!="number"){j(E);return}_.current=window.setTimeout(()=>{j(E)},E?u:h)};return Yl(()=>{A(r)},[r]),M.useEffect(()=>()=>{C()},[]),{transitionDuration:v,transitionStatus:x,transitionTimingFunction:n||"ease"}}function Gl({keepMounted:t,transition:e="fade",duration:n=250,exitDuration:r=n,mounted:i,children:s,timingFunction:o="ease",onExit:l,onEntered:u,onEnter:h,onExited:f,enterDelay:p,exitDelay:m}){const v=zw(),{transitionDuration:b,transitionStatus:x,transitionTimingFunction:w}=IZ({mounted:i,exitDuration:r,duration:n,timingFunction:o,onExit:l,onEntered:u,onEnter:h,onExited:f,enterDelay:p,exitDelay:m});return b===0||v==="test"?i?a.jsx(a.Fragment,{children:s({})}):t?s({display:"none"}):null:x==="exited"?t?s({display:"none"}):null:a.jsx(a.Fragment,{children:s($Z({transition:e,duration:b,state:x,timingFunction:w}))})}Gl.displayName="@mantine/core/Transition";const[BZ,R$]=Wi("Popover component was not found in the tree");var D$={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};function e2({children:t,active:e=!0,refProp:n="ref",innerRef:r}){const i=ZY(e),s=cr(i,r),o=jf(t);return o?M.cloneElement(o,{[n]:s}):t}function N$(t){return a.jsx(W6,{tabIndex:-1,"data-autofocus":!0,...t})}e2.displayName="@mantine/core/FocusTrap";N$.displayName="@mantine/core/FocusTrapInitialFocus";e2.InitialFocus=N$;const Y6=Ae((t,e)=>{var w,S,_,T;const n=Se("PopoverDropdown",null,t),{className:r,style:i,vars:s,children:o,onKeyDownCapture:l,variant:u,classNames:h,styles:f,...p}=n,m=R$(),v=E7({opened:m.opened,shouldReturnFocus:m.returnFocus}),b=m.withRoles?{"aria-labelledby":m.getTargetId(),id:m.getDropdownId(),role:"dialog",tabIndex:-1}:{},x=cr(e,m.floating);return m.disabled?null:a.jsx(Eh,{...m.portalProps,withinPortal:m.withinPortal,children:a.jsx(Gl,{mounted:m.opened,...m.transitionProps,transition:((w=m.transitionProps)==null?void 0:w.transition)||"fade",duration:((S=m.transitionProps)==null?void 0:S.duration)??150,keepMounted:m.keepMounted,exitDuration:typeof((_=m.transitionProps)==null?void 0:_.exitDuration)=="number"?m.transitionProps.exitDuration:(T=m.transitionProps)==null?void 0:T.duration,children:C=>a.jsx(e2,{active:m.trapFocus&&m.opened,innerRef:x,children:a.jsxs(ve,{...b,...p,variant:u,onKeyDownCapture:zY(()=>{var j,A;(j=m.onClose)==null||j.call(m),(A=m.onDismiss)==null||A.call(m)},{active:m.closeOnEscape,onTrigger:v,onKeyDown:l}),"data-position":m.placement,"data-fixed":m.floatingStrategy==="fixed"||void 0,...m.getStyles("dropdown",{className:r,props:n,classNames:h,styles:f,style:[{...C,zIndex:m.zIndex,top:m.y??0,left:m.x??0,width:m.width==="target"?void 0:de(m.width),...m.referenceHidden?{display:"none"}:null},m.resolvedStyles.dropdown,f==null?void 0:f.dropdown,i]}),children:[o,a.jsx(Tx,{ref:m.arrowRef,arrowX:m.arrowX,arrowY:m.arrowY,visible:m.withArrow,position:m.placement,arrowSize:m.arrowSize,arrowRadius:m.arrowRadius,arrowOffset:m.arrowOffset,arrowPosition:m.arrowPosition,...m.getStyles("arrow",{props:n,classNames:h,styles:f})})]})})})})});Y6.classes=D$;Y6.displayName="@mantine/core/PopoverDropdown";const zZ={refProp:"ref",popupType:"dialog"},P$=Ae((t,e)=>{const{children:n,refProp:r,popupType:i,...s}=Se("PopoverTarget",zZ,t),o=jf(n);if(!o)throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const l=s,u=R$(),h=cr(u.reference,$w(o),e),f=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.opened?u.getDropdownId():void 0,id:u.getTargetId()}:{},p=o.props;return M.cloneElement(o,{...l,...f,...u.targetProps,className:Lr(u.targetProps.className,l.className,p.className),[r]:h,...u.controlled?null:{onClick:()=>{var m;u.onToggle(),(m=p.onClick)==null||m.call(p)}}})});P$.displayName="@mantine/core/PopoverTarget";function qZ(t){if(t===void 0)return{shift:!0,flip:!0};const e={...t};return t.shift===void 0&&(e.shift=!0),t.flip===void 0&&(e.flip=!0),e}function FZ(t,e,n){const r=qZ(t.middlewares),i=[c$(t.offset),ZK()];return t.dropdownVisible&&n!=="test"&&t.preventPositionChangeWhenVisible&&(r.flip=!1),r.flip&&i.push(typeof r.flip=="boolean"?_x():_x(r.flip)),r.shift&&i.push(B6(typeof r.shift=="boolean"?{limiter:X5(),padding:5}:{limiter:X5(),padding:5,...r.shift})),r.inline&&i.push(typeof r.inline=="boolean"?Eg():Eg(r.inline)),i.push(u$({element:t.arrowRef,padding:t.arrowOffset})),(r.size||t.width==="target")&&i.push(KK({...typeof r.size=="boolean"?{}:r.size,apply({rects:s,availableWidth:o,availableHeight:l,...u}){var p;const f=((p=e().refs.floating.current)==null?void 0:p.style)??{};r.size&&(typeof r.size=="object"&&r.size.apply?r.size.apply({rects:s,availableWidth:o,availableHeight:l,...u}):Object.assign(f,{maxWidth:`${o}px`,maxHeight:`${l}px`})),t.width==="target"&&Object.assign(f,{width:`${s.reference.width}px`})}})),i}function HZ(t){const e=zw(),[n,r]=Qi({value:t.opened,defaultValue:t.defaultOpened,finalValue:!1,onChange:t.onChange}),i=M.useRef(n),s=()=>{n&&!t.disabled&&r(!1)},o=()=>{t.disabled||r(!n)},l=H6({strategy:t.strategy,placement:t.preventPositionChangeWhenVisible?t.positionRef.current:t.position,middleware:FZ(t,()=>l,e),whileElementsMounted:t.keepMounted?void 0:cC});return M.useEffect(()=>{if(!(!l.refs.reference.current||!l.refs.floating.current)&&n)return cC(l.refs.reference.current,l.refs.floating.current,l.update)},[n,l.update]),Yl(()=>{var u;(u=t.onPositionChange)==null||u.call(t,l.placement),t.positionRef.current=l.placement},[l.placement,t.preventPositionChangeWhenVisible]),Yl(()=>{var u,h;n!==i.current&&(n?(h=t.onOpen)==null||h.call(t):(u=t.onClose)==null||u.call(t)),i.current=n},[n,t.onClose,t.onOpen]),Sf(()=>{let u=-1;return n&&(u=window.setTimeout(()=>t.setDropdownVisible(!0),4)),()=>{window.clearTimeout(u)}},[n,t.position]),{floating:l,controlled:typeof t.opened=="boolean",opened:n,onClose:s,onToggle:o}}const VZ={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:So("popover"),__staticSelector:"Popover",width:"max-content"},UZ=(t,{radius:e,shadow:n})=>({dropdown:{"--popover-radius":e===void 0?void 0:Zn(e),"--popover-shadow":C6(n)}});function Kn(t){var Zt,ln,nn,Pt,Wt,Ri,yt;const e=Se("Popover",VZ,t),{children:n,position:r,offset:i,onPositionChange:s,positionDependencies:o,opened:l,transitionProps:u,onExitTransitionEnd:h,onEnterTransitionEnd:f,width:p,middlewares:m,withArrow:v,arrowSize:b,arrowOffset:x,arrowRadius:w,arrowPosition:S,unstyled:_,classNames:T,styles:C,closeOnClickOutside:j,withinPortal:A,portalProps:E,closeOnEscape:R,clickOutsideEvents:N,trapFocus:$,onClose:D,onDismiss:F,onOpen:Q,onChange:H,zIndex:q,radius:P,shadow:I,id:U,defaultOpened:Z,__staticSelector:X,withRoles:V,disabled:G,returnFocus:W,variant:te,keepMounted:oe,vars:be,floatingStrategy:ye,withOverlay:Ke,overlayProps:Fe,hideDetached:Pe,attributes:ae,preventPositionChangeWhenVisible:Te,...fe}=e,Ee=lt({name:X,props:e,classes:D$,classNames:T,styles:C,unstyled:_,attributes:ae,rootSelector:"dropdown",vars:be,varsResolver:UZ}),{resolvedStyles:gt}=jo({classNames:T,styles:C,props:e}),[We,Be]=M.useState(l??Z??!1),ze=M.useRef(r),De=M.useRef(null),[Ye,$t]=M.useState(null),[tt,et]=M.useState(null),{dir:Ve}=_f(),Le=zw(),Ce=Ei(U),ge=HZ({middlewares:m,width:p,position:E$(Ve,r),offset:typeof i=="number"?i+(v?b/2:0):i,arrowRef:De,arrowOffset:x,onPositionChange:s,positionDependencies:o,opened:l,defaultOpened:Z,onChange:H,onOpen:Q,onClose:D,onDismiss:F,strategy:ye,dropdownVisible:We,setDropdownVisible:Be,positionRef:ze,disabled:G,preventPositionChangeWhenVisible:Te,keepMounted:oe});VY(()=>{j&&(ge.onClose(),F==null||F())},N,[Ye,tt]);const Kt=M.useCallback(kt=>{$t(kt),ge.floating.refs.setReference(kt)},[ge.floating.refs.setReference]),qn=M.useCallback(kt=>{et(kt),ge.floating.refs.setFloating(kt)},[ge.floating.refs.setFloating]),Ft=M.useCallback(()=>{var kt;(kt=u==null?void 0:u.onExited)==null||kt.call(u),h==null||h(),Be(!1),Te||(ze.current=r)},[u==null?void 0:u.onExited,h,Te,r]),xn=M.useCallback(()=>{var kt;(kt=u==null?void 0:u.onEntered)==null||kt.call(u),f==null||f()},[u==null?void 0:u.onEntered,f]);return a.jsxs(BZ,{value:{returnFocus:W,disabled:G,controlled:ge.controlled,reference:Kt,floating:qn,x:ge.floating.x,y:ge.floating.y,arrowX:(nn=(ln=(Zt=ge.floating)==null?void 0:Zt.middlewareData)==null?void 0:ln.arrow)==null?void 0:nn.x,arrowY:(Ri=(Wt=(Pt=ge.floating)==null?void 0:Pt.middlewareData)==null?void 0:Wt.arrow)==null?void 0:Ri.y,opened:ge.opened,arrowRef:De,transitionProps:{...u,onExited:Ft,onEntered:xn},width:p,withArrow:v,arrowSize:b,arrowOffset:x,arrowRadius:w,arrowPosition:S,placement:ge.floating.placement,trapFocus:$,withinPortal:A,portalProps:E,zIndex:q,radius:P,shadow:I,closeOnEscape:R,onDismiss:F,onClose:ge.onClose,onToggle:ge.onToggle,getTargetId:()=>`${Ce}-target`,getDropdownId:()=>`${Ce}-dropdown`,withRoles:V,targetProps:fe,__staticSelector:X,classNames:T,styles:C,unstyled:_,variant:te,keepMounted:oe,getStyles:Ee,resolvedStyles:gt,floatingStrategy:ye,referenceHidden:Pe&&Le!=="test"?(yt=ge.floating.middlewareData.hide)==null?void 0:yt.referenceHidden:!1},children:[n,Ke&&a.jsx(Gl,{transition:"fade",mounted:ge.opened,duration:(u==null?void 0:u.duration)||250,exitDuration:(u==null?void 0:u.exitDuration)||250,children:kt=>a.jsx(Eh,{withinPortal:A,children:a.jsx(mm,{...Fe,...Ee("overlay",{className:Fe==null?void 0:Fe.className,style:[kt,Fe==null?void 0:Fe.style]})})})})]})}Kn.Target=P$;Kn.Dropdown=Y6;Kn.displayName="@mantine/core/Popover";Kn.extend=t=>t;var nl={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const L$=M.forwardRef(({className:t,...e},n)=>a.jsxs(ve,{component:"span",className:Lr(nl.barsLoader,t),...e,ref:n,children:[a.jsx("span",{className:nl.bar}),a.jsx("span",{className:nl.bar}),a.jsx("span",{className:nl.bar})]}));L$.displayName="@mantine/core/Bars";const $$=M.forwardRef(({className:t,...e},n)=>a.jsxs(ve,{component:"span",className:Lr(nl.dotsLoader,t),...e,ref:n,children:[a.jsx("span",{className:nl.dot}),a.jsx("span",{className:nl.dot}),a.jsx("span",{className:nl.dot})]}));$$.displayName="@mantine/core/Dots";const I$=M.forwardRef(({className:t,...e},n)=>a.jsx(ve,{component:"span",className:Lr(nl.ovalLoader,t),...e,ref:n}));I$.displayName="@mantine/core/Oval";const B$={bars:L$,oval:I$,dots:$$},QZ={loaders:B$,type:"oval"},WZ=(t,{size:e,color:n})=>({root:{"--loader-size":zt(e,"loader-size"),"--loader-color":n?hr(n,t):void 0}}),Kl=Ae((t,e)=>{const n=Se("Loader",QZ,t),{size:r,color:i,type:s,vars:o,className:l,style:u,classNames:h,styles:f,unstyled:p,loaders:m,variant:v,children:b,attributes:x,...w}=n,S=lt({name:"Loader",props:n,classes:nl,className:l,style:u,classNames:h,styles:f,unstyled:p,attributes:x,vars:o,varsResolver:WZ});return b?a.jsx(ve,{...S("root"),ref:e,...w,children:b}):a.jsx(ve,{...S("root"),ref:e,component:m[s],variant:v,size:r,...w})});Kl.defaultLoaders=B$;Kl.classes=nl;Kl.displayName="@mantine/core/Loader";var Bm={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const aR={orientation:"horizontal"},YZ=(t,{borderWidth:e})=>({group:{"--ai-border-width":de(e)}}),X6=Ae((t,e)=>{const n=Se("ActionIconGroup",aR,t),{className:r,style:i,classNames:s,styles:o,unstyled:l,orientation:u,vars:h,borderWidth:f,variant:p,mod:m,attributes:v,...b}=Se("ActionIconGroup",aR,t),x=lt({name:"ActionIconGroup",props:n,classes:Bm,className:r,style:i,classNames:s,styles:o,unstyled:l,attributes:v,vars:h,varsResolver:YZ,rootSelector:"group"});return a.jsx(ve,{...x("group"),ref:e,variant:p,mod:[{"data-orientation":u},m],role:"group",...b})});X6.classes=Bm;X6.displayName="@mantine/core/ActionIconGroup";const XZ=(t,{radius:e,color:n,gradient:r,variant:i,autoContrast:s,size:o})=>{const l=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:s});return{groupSection:{"--section-height":zt(o,"section-height"),"--section-padding-x":zt(o,"section-padding-x"),"--section-fz":Or(o),"--section-radius":e===void 0?void 0:Zn(e),"--section-bg":n||i?l.background:void 0,"--section-color":l.color,"--section-bd":n||i?l.border:void 0}}},G6=Ae((t,e)=>{const n=Se("ActionIconGroupSection",null,t),{className:r,style:i,classNames:s,styles:o,unstyled:l,vars:u,variant:h,gradient:f,radius:p,autoContrast:m,attributes:v,...b}=n,x=lt({name:"ActionIconGroupSection",props:n,classes:Bm,className:r,style:i,classNames:s,styles:o,unstyled:l,attributes:v,vars:u,varsResolver:XZ,rootSelector:"groupSection"});return a.jsx(ve,{...x("groupSection"),ref:e,variant:h,...b})});G6.classes=Bm;G6.displayName="@mantine/core/ActionIconGroupSection";const GZ=(t,{size:e,radius:n,variant:r,gradient:i,color:s,autoContrast:o})=>{const l=t.variantColorResolver({color:s||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:o});return{root:{"--ai-size":zt(e,"ai-size"),"--ai-radius":n===void 0?void 0:Zn(n),"--ai-bg":s||r?l.background:void 0,"--ai-hover":s||r?l.hover:void 0,"--ai-hover-color":s||r?l.hoverColor:void 0,"--ai-color":l.color,"--ai-bd":s||r?l.border:void 0}}},Nr=Yi((t,e)=>{const n=Se("ActionIcon",null,t),{className:r,unstyled:i,variant:s,classNames:o,styles:l,style:u,loading:h,loaderProps:f,size:p,color:m,radius:v,__staticSelector:b,gradient:x,vars:w,children:S,disabled:_,"data-disabled":T,autoContrast:C,mod:j,attributes:A,...E}=n,R=lt({name:["ActionIcon",b],props:n,className:r,style:u,classes:Bm,classNames:o,styles:l,unstyled:i,attributes:A,vars:w,varsResolver:GZ});return a.jsxs(Dr,{...R("root",{active:!_&&!h&&!T}),...E,unstyled:i,variant:s,size:p,disabled:_||h,ref:e,mod:[{loading:h,disabled:_||T},j],children:[typeof h=="boolean"&&a.jsx(Gl,{mounted:h,transition:"slide-down",duration:150,children:N=>a.jsx(ve,{component:"span",...R("loader",{style:N}),"aria-hidden":!0,children:a.jsx(Kl,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...f})})}),a.jsx(ve,{component:"span",mod:{loading:h},...R("icon"),children:S})]})});Nr.classes=Bm;Nr.displayName="@mantine/core/ActionIcon";Nr.Group=X6;Nr.GroupSection=G6;const z$=M.forwardRef(({size:t="var(--cb-icon-size, 70%)",style:e,...n},r)=>a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:t,height:t},ref:r,...n,children:a.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));z$.displayName="@mantine/core/CloseIcon";var q$={root:"m_86a44da5","root--subtle":"m_220c80f2"};const KZ={variant:"subtle"},ZZ=(t,{size:e,radius:n,iconSize:r})=>({root:{"--cb-size":zt(e,"cb-size"),"--cb-radius":n===void 0?void 0:Zn(n),"--cb-icon-size":de(r)}}),Jl=Yi((t,e)=>{const n=Se("CloseButton",KZ,t),{iconSize:r,children:i,vars:s,radius:o,className:l,classNames:u,style:h,styles:f,unstyled:p,"data-disabled":m,disabled:v,variant:b,icon:x,mod:w,attributes:S,__staticSelector:_,...T}=n,C=lt({name:_||"CloseButton",props:n,className:l,style:h,classes:q$,classNames:u,styles:f,unstyled:p,attributes:S,vars:s,varsResolver:ZZ});return a.jsxs(Dr,{ref:e,...T,unstyled:p,variant:b,disabled:v,mod:[{disabled:v||m},w],...C("root",{variant:b,active:!v&&!m}),children:[x||a.jsx(z$,{}),i]})});Jl.classes=q$;Jl.displayName="@mantine/core/CloseButton";function JZ(t){return M.Children.toArray(t).filter(Boolean)}var F$={root:"m_4081bf90"};const eJ={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},tJ=(t,{grow:e,preventGrowOverflow:n,gap:r,align:i,justify:s,wrap:o},{childWidth:l})=>({root:{"--group-child-width":e&&n?l:void 0,"--group-gap":Hi(r),"--group-align":i,"--group-justify":s,"--group-wrap":o}}),ht=Ae((t,e)=>{const n=Se("Group",eJ,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,children:u,gap:h,align:f,justify:p,wrap:m,grow:v,preventGrowOverflow:b,vars:x,variant:w,__size:S,mod:_,attributes:T,...C}=n,j=JZ(u),A=j.length,E=Hi(h??"md"),N={childWidth:`calc(${100/A}% - (${E} - ${E} / ${A}))`},$=lt({name:"Group",props:n,stylesCtx:N,className:i,style:s,classes:F$,classNames:r,styles:o,unstyled:l,attributes:T,vars:x,varsResolver:tJ});return a.jsx(ve,{...$("root"),ref:e,variant:w,mod:[{grow:v},_],size:S,...C,children:j})});ht.classes=F$;ht.displayName="@mantine/core/Group";const[nJ,su]=Wi("ModalBase component was not found in tree");function rJ({opened:t,transitionDuration:e}){const[n,r]=M.useState(t),i=M.useRef(-1),o=Lw()?0:e;return M.useEffect(()=>(t?(r(!0),window.clearTimeout(i.current)):o===0?r(!1):i.current=window.setTimeout(()=>r(!1),o),()=>window.clearTimeout(i.current)),[t,o]),n}function iJ({id:t,transitionProps:e,opened:n,trapFocus:r,closeOnEscape:i,onClose:s,returnFocus:o}){const l=Ei(t),[u,h]=M.useState(!1),[f,p]=M.useState(!1),m=typeof(e==null?void 0:e.duration)=="number"?e==null?void 0:e.duration:200,v=rJ({opened:n,transitionDuration:m});return bx("keydown",b=>{var x;b.key==="Escape"&&i&&!b.isComposing&&n&&((x=b.target)==null?void 0:x.getAttribute("data-mantine-stop-propagation"))!=="true"&&s()},{capture:!0}),E7({opened:n,shouldReturnFocus:r&&o}),{_id:l,titleMounted:u,bodyMounted:f,shouldLockScroll:v,setTitleMounted:h,setBodyMounted:p}}const H$=M.forwardRef(({keepMounted:t,opened:e,onClose:n,id:r,transitionProps:i,onExitTransitionEnd:s,onEnterTransitionEnd:o,trapFocus:l,closeOnEscape:u,returnFocus:h,closeOnClickOutside:f,withinPortal:p,portalProps:m,lockScroll:v,children:b,zIndex:x,shadow:w,padding:S,__vars:_,unstyled:T,removeScrollProps:C,...j},A)=>{const{_id:E,titleMounted:R,bodyMounted:N,shouldLockScroll:$,setTitleMounted:D,setBodyMounted:F}=iJ({id:r,transitionProps:i,opened:e,trapFocus:l,closeOnEscape:u,onClose:n,returnFocus:h}),{key:Q,...H}=C||{};return a.jsx(Eh,{...m,withinPortal:p,children:a.jsx(nJ,{value:{opened:e,onClose:n,closeOnClickOutside:f,onExitTransitionEnd:s,onEnterTransitionEnd:o,transitionProps:{...i,keepMounted:t},getTitleId:()=>`${E}-title`,getBodyId:()=>`${E}-body`,titleMounted:R,bodyMounted:N,setTitleMounted:D,setBodyMounted:F,trapFocus:l,closeOnEscape:u,zIndex:x,unstyled:T},children:a.jsx(uf,{enabled:$&&v,...H,children:a.jsx(ve,{ref:A,...j,__vars:{..._,"--mb-z-index":(x||So("modal")).toString(),"--mb-shadow":C6(w),"--mb-padding":Hi(S)},children:b})},Q)})})});H$.displayName="@mantine/core/ModalBase";var gm={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};function sJ(){const t=su();return M.useEffect(()=>(t.setBodyMounted(!0),()=>t.setBodyMounted(!1)),[]),t.getBodyId()}const V$=M.forwardRef(({className:t,...e},n)=>{const r=sJ(),i=su();return a.jsx(ve,{ref:n,...e,id:r,className:Lr({[gm.body]:!i.unstyled},t)})});V$.displayName="@mantine/core/ModalBaseBody";const U$=M.forwardRef(({className:t,onClick:e,...n},r)=>{const i=su();return a.jsx(Jl,{ref:r,...n,onClick:s=>{i.onClose(),e==null||e(s)},className:Lr({[gm.close]:!i.unstyled},t),unstyled:i.unstyled})});U$.displayName="@mantine/core/ModalBaseCloseButton";const Q$=M.forwardRef(({transitionProps:t,className:e,innerProps:n,onKeyDown:r,style:i,...s},o)=>{const l=su();return a.jsx(Gl,{mounted:l.opened,transition:"pop",...l.transitionProps,onExited:()=>{var u,h,f;(u=l.onExitTransitionEnd)==null||u.call(l),(f=(h=l.transitionProps)==null?void 0:h.onExited)==null||f.call(h)},onEntered:()=>{var u,h,f;(u=l.onEnterTransitionEnd)==null||u.call(l),(f=(h=l.transitionProps)==null?void 0:h.onEntered)==null||f.call(h)},...t,children:u=>a.jsx("div",{...n,className:Lr({[gm.inner]:!l.unstyled},n.className),children:a.jsx(e2,{active:l.opened&&l.trapFocus,innerRef:o,children:a.jsx(Jw,{...s,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":l.bodyMounted?l.getBodyId():void 0,"aria-labelledby":l.titleMounted?l.getTitleId():void 0,style:[i,u],className:Lr({[gm.content]:!l.unstyled},e),unstyled:l.unstyled,children:s.children})})})})});Q$.displayName="@mantine/core/ModalBaseContent";const W$=M.forwardRef(({className:t,...e},n)=>{const r=su();return a.jsx(ve,{component:"header",ref:n,className:Lr({[gm.header]:!r.unstyled},t),...e})});W$.displayName="@mantine/core/ModalBaseHeader";const aJ={duration:200,timingFunction:"ease",transition:"fade"};function oJ(t){const e=su();return{...aJ,...e.transitionProps,...t}}const Y$=M.forwardRef(({onClick:t,transitionProps:e,style:n,visible:r,...i},s)=>{const o=su(),l=oJ(e);return a.jsx(Gl,{mounted:r!==void 0?r:o.opened,...l,transition:"fade",children:u=>a.jsx(mm,{ref:s,fixed:!0,style:[n,u],zIndex:o.zIndex,unstyled:o.unstyled,onClick:h=>{t==null||t(h),o.closeOnClickOutside&&o.onClose()},...i})})});Y$.displayName="@mantine/core/ModalBaseOverlay";function lJ(){const t=su();return M.useEffect(()=>(t.setTitleMounted(!0),()=>t.setTitleMounted(!1)),[]),t.getTitleId()}const X$=M.forwardRef(({className:t,...e},n)=>{const r=lJ(),i=su();return a.jsx(ve,{component:"h2",ref:n,className:Lr({[gm.title]:!i.unstyled},t),...e,id:r})});X$.displayName="@mantine/core/ModalBaseTitle";function cJ({children:t}){return a.jsx(a.Fragment,{children:t})}const[uJ,hJ]=Vh({size:"sm"});var To={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const G$=Ae((t,e)=>{const n=Se("InputClearButton",null,t),{size:r,variant:i,vars:s,classNames:o,styles:l,...u}=n,h=hJ(),{resolvedClassNames:f,resolvedStyles:p}=jo({classNames:o,styles:l,props:n});return a.jsx(Jl,{variant:i||"transparent",ref:e,size:r||(h==null?void 0:h.size)||"sm",classNames:f,styles:p,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...u.style},...u})});G$.displayName="@mantine/core/InputClearButton";const dJ={xs:7,sm:8,md:10,lg:12,xl:15};function fJ({__clearable:t,__clearSection:e,rightSection:n,__defaultRightSection:r,size:i="sm"}){const s=t&&e;return s&&(n||r)?a.jsxs("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:dJ[i]},children:[s,n||r]}):n===null?null:n||s||r}const[pJ,zm]=Vh({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0}),mJ=(t,{size:e})=>({description:{"--input-description-size":e===void 0?void 0:`calc(${Or(e)} - ${de(2)})`}}),t2=Ae((t,e)=>{const n=Se("InputDescription",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,size:h,__staticSelector:f,__inheritStyles:p=!0,attributes:m,variant:v,...b}=Se("InputDescription",null,n),x=zm(),w=lt({name:["InputWrapper",f],props:n,classes:To,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:m,rootSelector:"description",vars:u,varsResolver:mJ}),S=p&&(x==null?void 0:x.getStyles)||w;return a.jsx(ve,{component:"p",ref:e,variant:v,size:h,...S("description",x!=null&&x.getStyles?{className:i,style:s}:void 0),...b})});t2.classes=To;t2.displayName="@mantine/core/InputDescription";const gJ=(t,{size:e})=>({error:{"--input-error-size":e===void 0?void 0:`calc(${Or(e)} - ${de(2)})`}}),n2=Ae((t,e)=>{const n=Se("InputError",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,size:h,attributes:f,__staticSelector:p,__inheritStyles:m=!0,variant:v,...b}=n,x=lt({name:["InputWrapper",p],props:n,classes:To,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:f,rootSelector:"error",vars:u,varsResolver:gJ}),w=zm(),S=m&&(w==null?void 0:w.getStyles)||x;return a.jsx(ve,{component:"p",ref:e,variant:v,size:h,...S("error",w!=null&&w.getStyles?{className:i,style:s}:void 0),...b})});n2.classes=To;n2.displayName="@mantine/core/InputError";const oR={labelElement:"label"},vJ=(t,{size:e})=>({label:{"--input-label-size":Or(e),"--input-asterisk-color":void 0}}),r2=Ae((t,e)=>{const n=Se("InputLabel",oR,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,labelElement:h,size:f,required:p,htmlFor:m,onMouseDown:v,children:b,__staticSelector:x,variant:w,mod:S,attributes:_,...T}=Se("InputLabel",oR,n),C=lt({name:["InputWrapper",x],props:n,classes:To,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:_,rootSelector:"label",vars:u,varsResolver:vJ}),j=zm(),A=(j==null?void 0:j.getStyles)||C;return a.jsxs(ve,{...A("label",j!=null&&j.getStyles?{className:i,style:s}:void 0),component:h,variant:w,size:f,ref:e,htmlFor:h==="label"?m:void 0,mod:[{required:p},S],onMouseDown:E=>{v==null||v(E),!E.defaultPrevented&&E.detail>1&&E.preventDefault()},...T,children:[b,p&&a.jsx("span",{...A("required"),"aria-hidden":!0,children:" *"})]})});r2.classes=To;r2.displayName="@mantine/core/InputLabel";const K6=Ae((t,e)=>{const n=Se("InputPlaceholder",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,__staticSelector:h,variant:f,error:p,mod:m,attributes:v,...b}=n,x=lt({name:["InputPlaceholder",h],props:n,classes:To,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:v,rootSelector:"placeholder"});return a.jsx(ve,{...x("placeholder"),mod:[{error:!!p},m],component:"span",variant:f,ref:e,...b})});K6.classes=To;K6.displayName="@mantine/core/InputPlaceholder";function bJ(t,{hasDescription:e,hasError:n}){const r=t.findIndex(u=>u==="input"),i=t.slice(0,r),s=t.slice(r+1),o=e&&i.includes("description")||n&&i.includes("error");return{offsetBottom:e&&s.includes("description")||n&&s.includes("error"),offsetTop:o}}const yJ={labelElement:"label",inputContainer:t=>t,inputWrapperOrder:["label","description","input","error"]},xJ=(t,{size:e})=>({label:{"--input-label-size":Or(e),"--input-asterisk-color":void 0},error:{"--input-error-size":e===void 0?void 0:`calc(${Or(e)} - ${de(2)})`},description:{"--input-description-size":e===void 0?void 0:`calc(${Or(e)} - ${de(2)})`}}),Z6=Ae((t,e)=>{const n=Se("InputWrapper",yJ,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,size:h,variant:f,__staticSelector:p,inputContainer:m,inputWrapperOrder:v,label:b,error:x,description:w,labelProps:S,descriptionProps:_,errorProps:T,labelElement:C,children:j,withAsterisk:A,id:E,required:R,__stylesApiProps:N,mod:$,attributes:D,...F}=n,Q=lt({name:["InputWrapper",p],props:N||n,classes:To,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:D,vars:u,varsResolver:xJ}),H={size:h,variant:f,__staticSelector:p},q=Ei(E),P=typeof A=="boolean"?A:R,I=(T==null?void 0:T.id)||`${q}-error`,U=(_==null?void 0:_.id)||`${q}-description`,Z=q,X=!!x&&typeof x!="boolean",V=!!w,G=`${X?I:""} ${V?U:""}`,W=G.trim().length>0?G.trim():void 0,te=(S==null?void 0:S.id)||`${q}-label`,oe=b&&a.jsx(r2,{labelElement:C,id:te,htmlFor:Z,required:P,...H,...S,children:b},"label"),be=V&&a.jsx(t2,{..._,...H,size:(_==null?void 0:_.size)||H.size,id:(_==null?void 0:_.id)||U,children:w},"description"),ye=a.jsx(M.Fragment,{children:m(j)},"input"),Ke=X&&M.createElement(n2,{...T,...H,size:(T==null?void 0:T.size)||H.size,key:"error",id:(T==null?void 0:T.id)||I},x),Fe=v.map(Pe=>{switch(Pe){case"label":return oe;case"input":return ye;case"description":return be;case"error":return Ke;default:return null}});return a.jsx(pJ,{value:{getStyles:Q,describedBy:W,inputId:Z,labelId:te,...bJ(v,{hasDescription:V,hasError:X})},children:a.jsx(ve,{ref:e,variant:f,size:h,mod:[{error:!!x},$],...Q("root"),...F,children:Fe})})});Z6.classes=To;Z6.displayName="@mantine/core/InputWrapper";const wJ={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm"},SJ=(t,e,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":zt(e.size,"input-height"),"--input-fz":Or(e.size),"--input-radius":e.radius===void 0?void 0:Zn(e.radius),"--input-left-section-width":e.leftSectionWidth!==void 0?de(e.leftSectionWidth):void 0,"--input-right-section-width":e.rightSectionWidth!==void 0?de(e.rightSectionWidth):void 0,"--input-padding-y":e.multiline?zt(e.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":e.leftSectionPointerEvents,"--input-right-section-pointer-events":e.rightSectionPointerEvents}}),Mr=Yi((t,e)=>{const n=Se("Input",wJ,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,required:u,__staticSelector:h,__stylesApiProps:f,size:p,wrapperProps:m,error:v,disabled:b,leftSection:x,leftSectionProps:w,leftSectionWidth:S,rightSection:_,rightSectionProps:T,rightSectionWidth:C,rightSectionPointerEvents:j,leftSectionPointerEvents:A,variant:E,vars:R,pointer:N,multiline:$,radius:D,id:F,withAria:Q,withErrorStyles:H,mod:q,inputSize:P,attributes:I,__clearSection:U,__clearable:Z,__defaultRightSection:X,...V}=n,{styleProps:G,rest:W}=Bv(V),te=zm(),oe={offsetBottom:te==null?void 0:te.offsetBottom,offsetTop:te==null?void 0:te.offsetTop},be=lt({name:["Input",h],props:f||n,classes:To,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:I,stylesCtx:oe,rootSelector:"wrapper",vars:R,varsResolver:SJ}),ye=Q?{required:u,disabled:b,"aria-invalid":!!v,"aria-describedby":te==null?void 0:te.describedBy,id:(te==null?void 0:te.inputId)||F}:{},Ke=fJ({__clearable:Z,__clearSection:U,rightSection:_,__defaultRightSection:X,size:p});return a.jsx(uJ,{value:{size:p||"sm"},children:a.jsxs(ve,{...be("wrapper"),...G,...m,mod:[{error:!!v&&H,pointer:N,disabled:b,multiline:$,"data-with-right-section":!!Ke,"data-with-left-section":!!x},q],variant:E,size:p,children:[x&&a.jsx("div",{...w,"data-position":"left",...be("section",{className:w==null?void 0:w.className,style:w==null?void 0:w.style}),children:x}),a.jsx(ve,{component:"input",...W,...ye,ref:e,required:u,mod:{disabled:b,error:!!v&&H},variant:E,__size:P,...be("input")}),Ke&&a.jsx("div",{...T,"data-position":"right",...be("section",{className:T==null?void 0:T.className,style:T==null?void 0:T.style}),children:Ke})]})})});Mr.classes=To;Mr.Wrapper=Z6;Mr.Label=r2;Mr.Error=n2;Mr.Description=t2;Mr.Placeholder=K6;Mr.ClearButton=G$;Mr.displayName="@mantine/core/Input";function K$(t,e,n){const r=Se(t,e,n),{label:i,description:s,error:o,required:l,classNames:u,styles:h,className:f,unstyled:p,__staticSelector:m,__stylesApiProps:v,errorProps:b,labelProps:x,descriptionProps:w,wrapperProps:S,id:_,size:T,style:C,inputContainer:j,inputWrapperOrder:A,withAsterisk:E,variant:R,vars:N,mod:$,attributes:D,...F}=r,{styleProps:Q,rest:H}=Bv(F),q={label:i,description:s,error:o,required:l,classNames:u,className:f,__staticSelector:m,__stylesApiProps:v||r,errorProps:b,labelProps:x,descriptionProps:w,unstyled:p,styles:h,size:T,style:C,inputContainer:j,inputWrapperOrder:A,withAsterisk:E,variant:R,id:_,mod:$,attributes:D,...S};return{...H,classNames:u,styles:h,unstyled:p,wrapperProps:{...q,...Q},inputProps:{required:l,classNames:u,styles:h,unstyled:p,size:T,__staticSelector:m,__stylesApiProps:v||r,error:o,variant:R,id:_,attributes:D}}}const jJ={__staticSelector:"InputBase",withAria:!0,size:"sm"},Ha=Yi((t,e)=>{const{inputProps:n,wrapperProps:r,...i}=K$("InputBase",jJ,t);return a.jsx(Mr.Wrapper,{...r,children:a.jsx(Mr,{...n,...i,ref:e})})});Ha.classes={...Mr.classes,...Mr.Wrapper.classes};Ha.displayName="@mantine/core/InputBase";var Z$={root:"m_96b553a6"};function _J(t,e){if(!e||!t)return!1;let n=e.parentNode;for(;n!=null;){if(n===t)return!0;n=n.parentNode}return!1}function TJ({target:t,parent:e,ref:n,displayAfterTransitionEnd:r}){const i=M.useRef(-1),[s,o]=M.useState(!1),[l,u]=M.useState(typeof r=="boolean"?r:!1),h=()=>{if(!t||!e||!n.current)return;const v=t.getBoundingClientRect(),b=e.getBoundingClientRect(),x=window.getComputedStyle(t),w=window.getComputedStyle(e),S=gh(x.borderTopWidth)+gh(w.borderTopWidth),_=gh(x.borderLeftWidth)+gh(w.borderLeftWidth),T={top:v.top-b.top-S,left:v.left-b.left-_,width:v.width,height:v.height};n.current.style.transform=`translateY(${T.top}px) translateX(${T.left}px)`,n.current.style.width=`${T.width}px`,n.current.style.height=`${T.height}px`},f=()=>{window.clearTimeout(i.current),n.current&&(n.current.style.transitionDuration="0ms"),h(),i.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},p=M.useRef(null),m=M.useRef(null);return M.useEffect(()=>{if(h(),t)return p.current=new ResizeObserver(f),p.current.observe(t),e&&(m.current=new ResizeObserver(f),m.current.observe(e)),()=>{var v,b;(v=p.current)==null||v.disconnect(),(b=m.current)==null||b.disconnect()}},[e,t]),M.useEffect(()=>{if(e){const v=b=>{_J(b.target,e)&&(f(),u(!1))};return e.addEventListener("transitionend",v),()=>{e.removeEventListener("transitionend",v)}}},[e]),pX(()=>{yX()!=="test"&&o(!0)},20,{autoInvoke:!0}),gX(v=>{v.forEach(b=>{b.type==="attributes"&&b.attributeName==="dir"&&f()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:s,hidden:l}}const CJ=(t,{transitionDuration:e})=>({root:{"--transition-duration":typeof e=="number"?`${e}ms`:e}}),J6=Ae((t,e)=>{const n=Se("FloatingIndicator",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,target:h,parent:f,transitionDuration:p,mod:m,displayAfterTransitionEnd:v,attributes:b,...x}=n,w=lt({name:"FloatingIndicator",classes:Z$,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:b,vars:u,varsResolver:CJ}),S=M.useRef(null),{initialized:_,hidden:T}=TJ({target:h,parent:f,ref:S,displayAfterTransitionEnd:v}),C=cr(e,S);return!h||!f?null:a.jsx(ve,{ref:C,mod:[{initialized:_,hidden:T},m],...w("root"),...x})});J6.displayName="@mantine/core/FloatingIndicator";J6.classes=Z$;function J$({open:t,close:e,openDelay:n,closeDelay:r}){const i=M.useRef(-1),s=M.useRef(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(s.current)},l=()=>{o(),n===0||n===void 0?t():i.current=window.setTimeout(t,n)},u=()=>{o(),r===0||r===void 0?e():s.current=window.setTimeout(e,r)};return M.useEffect(()=>o,[]),{openDropdown:l,closeDropdown:u}}function Cx({style:t,size:e=16,...n}){return a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:de(e),height:de(e),display:"block"},...n,children:a.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}Cx.displayName="@mantine/core/AccordionChevron";var eI={root:"m_66836ed3",wrapper:"m_a5d60502",body:"m_667c2793",title:"m_6a03f287",label:"m_698f4f23",icon:"m_667f2a6a",message:"m_7fa78076",closeButton:"m_87f54839"};const kJ=(t,{radius:e,color:n,variant:r,autoContrast:i})=>{const s=t.variantColorResolver({color:n||t.primaryColor,theme:t,variant:r||"light",autoContrast:i});return{root:{"--alert-radius":e===void 0?void 0:Zn(e),"--alert-bg":n||r?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||r?s.border:void 0}}},Nt=Ae((t,e)=>{const n=Se("Alert",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,radius:h,color:f,title:p,children:m,id:v,icon:b,withCloseButton:x,onClose:w,closeButtonLabel:S,variant:_,autoContrast:T,role:C,attributes:j,...A}=n,E=lt({name:"Alert",classes:eI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:j,vars:u,varsResolver:kJ}),R=Ei(v),N=p&&`${R}-title`||void 0,$=`${R}-body`;return a.jsx(ve,{id:R,...E("root",{variant:_}),variant:_,ref:e,role:C||"alert",...A,"aria-describedby":m?$:void 0,"aria-labelledby":p?N:void 0,children:a.jsxs("div",{...E("wrapper"),children:[b&&a.jsx("div",{...E("icon"),children:b}),a.jsxs("div",{...E("body"),children:[p&&a.jsx("div",{...E("title"),"data-with-close-button":x||void 0,children:a.jsx("span",{id:N,...E("label"),children:p})}),m&&a.jsx("div",{id:$,...E("message"),"data-variant":_,children:m})]}),x&&a.jsx(Jl,{...E("closeButton"),onClick:w,variant:"transparent",size:16,iconSize:16,"aria-label":S,unstyled:l})]})})});Nt.classes=eI;Nt.displayName="@mantine/core/Alert";var tI={root:"m_b6d8b162"};function OJ(t){if(t==="start")return"start";if(t==="end"||t)return"end"}const EJ={inherit:!1},AJ=(t,{variant:e,lineClamp:n,gradient:r,size:i,color:s})=>({root:{"--text-fz":Or(i),"--text-lh":T7(i),"--text-gradient":e==="gradient"?tC(r,t):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?hr(s,t):void 0}}),ut=Yi((t,e)=>{const n=Se("Text",EJ,t),{lineClamp:r,truncate:i,inline:s,inherit:o,gradient:l,span:u,__staticSelector:h,vars:f,className:p,style:m,classNames:v,styles:b,unstyled:x,variant:w,mod:S,size:_,attributes:T,...C}=n,j=lt({name:["Text",h],props:n,classes:tI,className:p,style:m,classNames:v,styles:b,unstyled:x,attributes:T,vars:f,varsResolver:AJ});return a.jsx(ve,{...j("root",{focusable:!0}),ref:e,component:u?"span":"p",variant:w,mod:[{"data-truncate":OJ(i),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":o},S],size:_,...C})});ut.classes=tI;ut.displayName="@mantine/core/Text";var nI={root:"m_849cf0da"};const MJ={underline:"hover"},qr=Yi((t,e)=>{const{underline:n,className:r,unstyled:i,mod:s,...o}=Se("Anchor",MJ,t);return a.jsx(ut,{component:"a",ref:e,className:Lr({[nI.root]:!i},r),...o,mod:[{underline:n},s],__staticSelector:"Anchor",unstyled:i})});qr.classes=nI;qr.displayName="@mantine/core/Anchor";const[RJ,qm]=Wi("AppShell was not found in tree");var Qh={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const eO=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,withBorder:u,zIndex:h,mod:f,...p}=Se("AppShellAside",null,t),m=qm();return m.disabled?null:a.jsx(ve,{component:"aside",ref:e,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("aside",{className:Lr({[uf.classNames.zeroRight]:m.offsetScrollbars},r),classNames:n,styles:s,style:i}),...p,__vars:{"--app-shell-aside-z-index":`calc(${h??m.zIndex} + 1)`}})});eO.classes=Qh;eO.displayName="@mantine/core/AppShellAside";const tO=Ae((t,e)=>{var v;const{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,withBorder:u,zIndex:h,mod:f,...p}=Se("AppShellFooter",null,t),m=qm();return m.disabled?null:a.jsx(ve,{component:"footer",ref:e,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("footer",{className:Lr({[uf.classNames.zeroRight]:m.offsetScrollbars},r),classNames:n,styles:s,style:i}),...p,__vars:{"--app-shell-footer-z-index":(v=h??m.zIndex)==null?void 0:v.toString()}})});tO.classes=Qh;tO.displayName="@mantine/core/AppShellFooter";const nO=Ae((t,e)=>{var v;const{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,withBorder:u,zIndex:h,mod:f,...p}=Se("AppShellHeader",null,t),m=qm();return m.disabled?null:a.jsx(ve,{component:"header",ref:e,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("header",{className:Lr({[uf.classNames.zeroRight]:m.offsetScrollbars},r),classNames:n,styles:s,style:i}),...p,__vars:{"--app-shell-header-z-index":(v=h??m.zIndex)==null?void 0:v.toString()}})});nO.classes=Qh;nO.displayName="@mantine/core/AppShellHeader";const rO=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,...l}=Se("AppShellMain",null,t),u=qm();return a.jsx(ve,{component:"main",ref:e,...u.getStyles("main",{className:r,style:i,classNames:n,styles:s}),...l})});rO.classes=Qh;rO.displayName="@mantine/core/AppShellMain";function qv(t){return typeof t=="object"?t.base:t}function Fv(t){const e=typeof t=="object"&&t!==null&&typeof t.base<"u"&&Object.keys(t).length===1;return typeof t=="number"||typeof t=="string"||e}function Hv(t){return!(typeof t!="object"||t===null||Object.keys(t).length===1&&"base"in t)}function DJ({baseStyles:t,minMediaStyles:e,maxMediaStyles:n,aside:r,theme:i,mode:s}){var h,f,p;const o=r==null?void 0:r.width,l="translateX(var(--app-shell-aside-width))",u="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((h=r==null?void 0:r.collapsed)!=null&&h.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},s==="fixed"?(n[r==null?void 0:r.breakpoint]["--app-shell-aside-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-aside-offset"]="0px"):(n[r==null?void 0:r.breakpoint]["--app-shell-aside-width"]="0px",n[r==null?void 0:r.breakpoint]["--app-shell-aside-offset"]="0px")),Fv(o)){const m=de(qv(o));t["--app-shell-aside-width"]=m,t["--app-shell-aside-offset"]=m}if(Hv(o)&&(typeof o.base<"u"&&(t["--app-shell-aside-width"]=de(o.base),t["--app-shell-aside-offset"]=de(o.base)),Kr(o).forEach(m=>{m!=="base"&&(e[m]=e[m]||{},e[m]["--app-shell-aside-width"]=de(o[m]),e[m]["--app-shell-aside-offset"]=de(o[m]))})),r!=null&&r.breakpoint&&s==="static"&&(e[r.breakpoint]=e[r.breakpoint]||{},e[r.breakpoint]["--app-shell-aside-position"]="sticky",e[r.breakpoint]["--app-shell-aside-grid-row"]="2",e[r.breakpoint]["--app-shell-aside-grid-column"]="3",e[r.breakpoint]["--app-shell-main-column-end"]="3"),(f=r==null?void 0:r.collapsed)!=null&&f.desktop){const m=r.breakpoint;e[m]=e[m]||{},e[m]["--app-shell-aside-transform"]=l,e[m]["--app-shell-aside-transform-rtl"]=u,s==="fixed"?e[m]["--app-shell-aside-offset"]="0px !important":(e[m]["--app-shell-aside-width"]="0px",e[m]["--app-shell-aside-display"]="none",e[m]["--app-shell-main-column-end"]="-1"),e[m]["--app-shell-aside-scroll-locked-visibility"]="hidden"}if((p=r==null?void 0:r.collapsed)!=null&&p.mobile){const m=k6(r.breakpoint,i.breakpoints)-.1;n[m]=n[m]||{},s==="fixed"?(n[m]["--app-shell-aside-width"]="100%",n[m]["--app-shell-aside-offset"]="0px"):n[m]["--app-shell-aside-width"]="0px",n[m]["--app-shell-aside-transform"]=l,n[m]["--app-shell-aside-transform-rtl"]=u,n[m]["--app-shell-aside-scroll-locked-visibility"]="hidden"}}function NJ({baseStyles:t,minMediaStyles:e,footer:n,mode:r}){const i=n==null?void 0:n.height,s="translateY(var(--app-shell-footer-height))",o=r==="static"?!0:(n==null?void 0:n.offset)??!0;if(r==="static"&&n&&(t["--app-shell-footer-position"]="sticky",t["--app-shell-footer-grid-column"]="1 / -1",t["--app-shell-footer-grid-row"]="3"),Fv(i)){const l=de(qv(i));t["--app-shell-footer-height"]=l,o&&(t["--app-shell-footer-offset"]=l)}Hv(i)&&(typeof i.base<"u"&&(t["--app-shell-footer-height"]=de(i.base),o&&(t["--app-shell-footer-offset"]=de(i.base))),Kr(i).forEach(l=>{l!=="base"&&(e[l]=e[l]||{},e[l]["--app-shell-footer-height"]=de(i[l]),o&&(e[l]["--app-shell-footer-offset"]=de(i[l])))})),n!=null&&n.collapsed&&(t["--app-shell-footer-transform"]=s,r==="fixed"&&(t["--app-shell-footer-offset"]="0px !important"))}function PJ({baseStyles:t,minMediaStyles:e,header:n,mode:r}){const i=n==null?void 0:n.height,s="translateY(calc(var(--app-shell-header-height) * -1))",o=r==="static"?!0:(n==null?void 0:n.offset)??!0;if(r==="static"&&n&&(t["--app-shell-header-position"]="sticky",t["--app-shell-header-grid-column"]="1 / -1",t["--app-shell-header-grid-row"]="1"),Fv(i)){const l=de(qv(i));t["--app-shell-header-height"]=l,o&&(t["--app-shell-header-offset"]=l)}Hv(i)&&(typeof i.base<"u"&&(t["--app-shell-header-height"]=de(i.base),o&&(t["--app-shell-header-offset"]=de(i.base))),Kr(i).forEach(l=>{l!=="base"&&(e[l]=e[l]||{},e[l]["--app-shell-header-height"]=de(i[l]),o&&(e[l]["--app-shell-header-offset"]=de(i[l])))})),n!=null&&n.collapsed&&(t["--app-shell-header-transform"]=s,r==="fixed"&&(t["--app-shell-header-offset"]="0px !important"))}function LJ({baseStyles:t,minMediaStyles:e,maxMediaStyles:n,navbar:r,theme:i,mode:s}){var h,f,p;const o=r==null?void 0:r.width,l="translateX(calc(var(--app-shell-navbar-width) * -1))",u="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((h=r==null?void 0:r.collapsed)!=null&&h.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-navbar-offset"]="0px",n[r==null?void 0:r.breakpoint]["--app-shell-navbar-width"]="100%",s==="static"&&(n[r==null?void 0:r.breakpoint]["--app-shell-navbar-grid-width"]="0px")),Fv(o)){const m=de(qv(o));t["--app-shell-navbar-width"]=m,t["--app-shell-navbar-offset"]=m,s==="static"&&(t["--app-shell-navbar-grid-width"]=m)}if(Hv(o)&&(typeof o.base<"u"&&(t["--app-shell-navbar-width"]=de(o.base),t["--app-shell-navbar-offset"]=de(o.base),s==="static"&&(t["--app-shell-navbar-grid-width"]=de(o.base))),Kr(o).forEach(m=>{m!=="base"&&(e[m]=e[m]||{},e[m]["--app-shell-navbar-width"]=de(o[m]),e[m]["--app-shell-navbar-offset"]=de(o[m]),s==="static"&&(e[m]["--app-shell-navbar-grid-width"]=de(o[m])))})),r!=null&&r.breakpoint&&s==="static"&&(e[r.breakpoint]=e[r.breakpoint]||{},e[r.breakpoint]["--app-shell-navbar-position"]="sticky",e[r.breakpoint]["--app-shell-navbar-grid-row"]="2",e[r.breakpoint]["--app-shell-navbar-grid-column"]="1",e[r.breakpoint]["--app-shell-main-column-start"]="2"),(f=r==null?void 0:r.collapsed)!=null&&f.desktop){const m=r.breakpoint;e[m]=e[m]||{},e[m]["--app-shell-navbar-transform"]=l,e[m]["--app-shell-navbar-transform-rtl"]=u,s==="fixed"?e[m]["--app-shell-navbar-offset"]="0px !important":(e[m]["--app-shell-navbar-width"]="0px",e[m]["--app-shell-navbar-display"]="none",e[m]["--app-shell-main-column-start"]="1")}if((p=r==null?void 0:r.collapsed)!=null&&p.mobile){const m=k6(r.breakpoint,i.breakpoints)-.1;n[m]=n[m]||{},n[m]["--app-shell-navbar-width"]="100%",n[m]["--app-shell-navbar-offset"]="0px",s==="static"&&(n[m]["--app-shell-navbar-grid-width"]="0px"),n[m]["--app-shell-navbar-transform"]=l,n[m]["--app-shell-navbar-transform-rtl"]=u}}function t3(t){return Number(t)===0?"0px":Hi(t)}function $J({padding:t,baseStyles:e,minMediaStyles:n}){Fv(t)&&(e["--app-shell-padding"]=t3(qv(t))),Hv(t)&&(t.base&&(e["--app-shell-padding"]=t3(t.base)),Kr(t).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=t3(t[r]))}))}function IJ({navbar:t,header:e,footer:n,aside:r,padding:i,theme:s,mode:o}){const l={},u={},h={};o==="static"&&(h["--app-shell-main-grid-column"]="1 / -1",h["--app-shell-main-grid-row"]="2"),LJ({baseStyles:h,minMediaStyles:l,maxMediaStyles:u,navbar:t,theme:s,mode:o}),DJ({baseStyles:h,minMediaStyles:l,maxMediaStyles:u,aside:r,theme:s,mode:o}),PJ({baseStyles:h,minMediaStyles:l,header:e,mode:o}),NJ({baseStyles:h,minMediaStyles:l,footer:n,mode:o}),$J({baseStyles:h,minMediaStyles:l,padding:i});const f=JT(Kr(l),s.breakpoints).map(v=>({query:`(min-width: ${As(v.px)})`,styles:l[v.value]})),p=JT(Kr(u),s.breakpoints).map(v=>({query:`(max-width: ${As(v.px)})`,styles:u[v.value]})),m=[...f,...p];return{baseStyles:h,media:m}}function BJ({navbar:t,header:e,aside:n,footer:r,padding:i,mode:s,selector:o}){const l=yi(),u=ru(),{media:h,baseStyles:f}=IJ({navbar:t,header:e,footer:r,aside:n,padding:i,theme:l,mode:s});return a.jsx(Hw,{media:h,styles:f,selector:o||u.cssVariablesSelector})}const iO=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,withBorder:u,zIndex:h,mod:f,...p}=Se("AppShellNavbar",null,t),m=qm();return m.disabled?null:a.jsx(ve,{component:"nav",ref:e,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("navbar",{className:r,classNames:n,styles:s,style:i}),...p,__vars:{"--app-shell-navbar-z-index":`calc(${h??m.zIndex} + 1)`}})});iO.classes=Qh;iO.displayName="@mantine/core/AppShellNavbar";const sO=Yi((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,grow:l,mod:u,...h}=Se("AppShellSection",null,t),f=qm();return a.jsx(ve,{ref:e,mod:[{grow:l},u],...f.getStyles("section",{className:r,style:i,classNames:n,styles:s}),...h})});sO.classes=Qh;sO.displayName="@mantine/core/AppShellSection";function zJ({transitionDuration:t,disabled:e}){const[n,r]=M.useState(!0),i=M.useRef(-1),s=M.useRef(-1);return bx("resize",()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>M.startTransition(()=>{r(!1)}),200)}),Sf(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>M.startTransition(()=>{r(!1)}),t||0)},[e,t]),n}const qJ={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:So("app"),mode:"fixed"},FJ=(t,{transitionDuration:e,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${e}ms`,"--app-shell-transition-timing-function":n}}),fo=Ae((t,e)=>{const n=Se("AppShell",qJ,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,navbar:h,withBorder:f,padding:p,transitionDuration:m,transitionTimingFunction:v,header:b,zIndex:x,layout:w,disabled:S,aside:_,footer:T,offsetScrollbars:C=!0,mode:j,mod:A,attributes:E,id:R,...N}=n,$=lt({name:"AppShell",classes:Qh,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:E,vars:u,varsResolver:FJ}),D=zJ({disabled:S,transitionDuration:m}),F=Ei(R);return a.jsxs(RJ,{value:{getStyles:$,withBorder:f,zIndex:x,disabled:S,offsetScrollbars:C,mode:j},children:[a.jsx(BJ,{navbar:h,header:b,aside:_,footer:T,padding:p,mode:j,selector:j==="static"?`#${F}`:void 0}),a.jsx(ve,{ref:e,...$("root"),mod:[{resizing:D,layout:w,disabled:S,mode:j},A],id:F,...N})]})});fo.classes=Qh;fo.displayName="@mantine/core/AppShell";fo.Navbar=iO;fo.Header=nO;fo.Main=rO;fo.Aside=eO;fo.Footer=tO;fo.Section=sO;function rI(t){return typeof t=="string"?{value:t,label:t}:"value"in t&&!("label"in t)?{value:t.value,label:t.value,disabled:t.disabled}:typeof t=="number"?{value:t.toString(),label:t.toString()}:"group"in t?{group:t.group,items:t.items.map(e=>rI(e))}:t}function iI(t){return t?t.map(e=>rI(e)):[]}function aO(t){return t.reduce((e,n)=>"group"in n?{...e,...aO(n.items)}:(e[n.value]=n,e),{})}var Us={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2",optionsDropdownCheckPlaceholder:"m_a530ee0a"};const HJ={error:null},VJ=(t,{size:e,color:n})=>({chevron:{"--combobox-chevron-size":zt(e,"combobox-chevron-size"),"--combobox-chevron-color":n?hr(n,t):void 0}}),i2=Ae((t,e)=>{const n=Se("ComboboxChevron",HJ,t),{size:r,error:i,style:s,className:o,classNames:l,styles:u,unstyled:h,vars:f,mod:p,...m}=n,v=lt({name:"ComboboxChevron",classes:Us,props:n,style:s,className:o,classNames:l,styles:u,unstyled:h,vars:f,varsResolver:VJ,rootSelector:"chevron"});return a.jsx(ve,{component:"svg",...m,...v("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:i},p],ref:e,children:a.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});i2.classes=Us;i2.displayName="@mantine/core/ComboboxChevron";const[UJ,Co]=Wi("Combobox component was not found in tree"),oO=M.forwardRef(({size:t,onMouseDown:e,onClick:n,onClear:r,...i},s)=>a.jsx(Mr.ClearButton,{ref:s,tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:o=>{o.preventDefault(),e==null||e(o)},onClick:o=>{r(),n==null||n(o)}}));oO.displayName="@mantine/core/ComboboxClearButton";const lO=Ae((t,e)=>{const{classNames:n,styles:r,className:i,style:s,hidden:o,...l}=Se("ComboboxDropdown",null,t),u=Co();return a.jsx(Kn.Dropdown,{...l,ref:e,role:"presentation","data-hidden":o||void 0,...u.getStyles("dropdown",{className:i,style:s,classNames:n,styles:r})})});lO.classes=Us;lO.displayName="@mantine/core/ComboboxDropdown";const QJ={refProp:"ref"},sI=Ae((t,e)=>{const{children:n,refProp:r}=Se("ComboboxDropdownTarget",QJ,t);if(Co(),!T6(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return a.jsx(Kn.Target,{ref:e,refProp:r,children:n})});sI.displayName="@mantine/core/ComboboxDropdownTarget";const cO=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,...l}=Se("ComboboxEmpty",null,t),u=Co();return a.jsx(ve,{ref:e,...u.getStyles("empty",{className:r,classNames:n,styles:s,style:i}),...l})});cO.classes=Us;cO.displayName="@mantine/core/ComboboxEmpty";function uO({onKeyDown:t,withKeyboardNavigation:e,withAriaAttributes:n,withExpandedAttribute:r,targetType:i,autoComplete:s}){const o=Co(),[l,u]=M.useState(null),h=p=>{if(t==null||t(p),!o.readOnly&&e){if(p.nativeEvent.isComposing)return;if(p.nativeEvent.code==="ArrowDown"&&(p.preventDefault(),o.store.dropdownOpened?u(o.store.selectNextOption()):(o.store.openDropdown("keyboard"),u(o.store.selectActiveOption()),o.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),p.nativeEvent.code==="ArrowUp"&&(p.preventDefault(),o.store.dropdownOpened?u(o.store.selectPreviousOption()):(o.store.openDropdown("keyboard"),u(o.store.selectActiveOption()),o.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),p.nativeEvent.code==="Enter"||p.nativeEvent.code==="NumpadEnter"){if(p.nativeEvent.keyCode===229)return;const m=o.store.getSelectedOptionIndex();o.store.dropdownOpened&&m!==-1?(p.preventDefault(),o.store.clickSelectedOption()):i==="button"&&(p.preventDefault(),o.store.openDropdown("keyboard"))}p.key==="Escape"&&o.store.closeDropdown("keyboard"),p.nativeEvent.code==="Space"&&i==="button"&&(p.preventDefault(),o.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r?!!(o.store.listId&&o.store.dropdownOpened):void 0,"aria-controls":o.store.dropdownOpened&&o.store.listId?o.store.listId:void 0,"aria-activedescendant":o.store.dropdownOpened&&l||void 0,autoComplete:s,"data-expanded":o.store.dropdownOpened||void 0,"data-mantine-stop-propagation":o.store.dropdownOpened||void 0}:{},onKeyDown:h}}const WJ={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},aI=Ae((t,e)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:s,withExpandedAttribute:o,targetType:l,autoComplete:u,...h}=Se("ComboboxEventsTarget",WJ,t),f=jf(n);if(!f)throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const p=Co(),m=uO({targetType:l,withAriaAttributes:s,withKeyboardNavigation:i,withExpandedAttribute:o,onKeyDown:f.props.onKeyDown,autoComplete:u});return M.cloneElement(f,{...m,...h,[r]:cr(e,p.store.targetRef,$w(f))})});aI.displayName="@mantine/core/ComboboxEventsTarget";const hO=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,...l}=Se("ComboboxFooter",null,t),u=Co();return a.jsx(ve,{ref:e,...u.getStyles("footer",{className:r,classNames:n,style:i,styles:s}),...l,onMouseDown:h=>{h.preventDefault()}})});hO.classes=Us;hO.displayName="@mantine/core/ComboboxFooter";const dO=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,children:l,label:u,id:h,...f}=Se("ComboboxGroup",null,t),p=Co(),m=Ei(h);return a.jsxs(ve,{ref:e,role:"group","aria-labelledby":u?m:void 0,...p.getStyles("group",{className:r,classNames:n,style:i,styles:s}),...f,children:[u&&a.jsx("div",{id:m,...p.getStyles("groupLabel",{classNames:n,styles:s}),children:u}),l]})});dO.classes=Us;dO.displayName="@mantine/core/ComboboxGroup";const fO=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,...l}=Se("ComboboxHeader",null,t),u=Co();return a.jsx(ve,{ref:e,...u.getStyles("header",{className:r,classNames:n,style:i,styles:s}),...l,onMouseDown:h=>{h.preventDefault()}})});fO.classes=Us;fO.displayName="@mantine/core/ComboboxHeader";function oI({value:t,valuesDivider:e=",",...n}){return a.jsx("input",{type:"hidden",value:Array.isArray(t)?t.join(e):t||"",...n})}oI.displayName="@mantine/core/ComboboxHiddenInput";const pO=Ae((t,e)=>{const n=Se("ComboboxOption",null,t),{classNames:r,className:i,style:s,styles:o,vars:l,onClick:u,id:h,active:f,onMouseDown:p,onMouseOver:m,disabled:v,selected:b,mod:x,...w}=n,S=Co(),_=M.useId(),T=h||_;return a.jsx(ve,{...S.getStyles("option",{className:i,classNames:r,styles:o,style:s}),...w,ref:e,id:T,mod:["combobox-option",{"combobox-active":f,"combobox-disabled":v,"combobox-selected":b},x],role:"option",onClick:C=>{var j;v?C.preventDefault():((j=S.onOptionSubmit)==null||j.call(S,n.value,n),u==null||u(C))},onMouseDown:C=>{C.preventDefault(),p==null||p(C)},onMouseOver:C=>{S.resetSelectionOnOptionHover&&S.store.resetSelectedOption(),m==null||m(C)}})});pO.classes=Us;pO.displayName="@mantine/core/ComboboxOption";const mO=Ae((t,e)=>{const n=Se("ComboboxOptions",null,t),{classNames:r,className:i,style:s,styles:o,id:l,onMouseDown:u,labelledBy:h,...f}=n,p=Co(),m=Ei(l);return M.useEffect(()=>{p.store.setListId(m)},[m]),a.jsx(ve,{ref:e,...p.getStyles("options",{className:i,style:s,classNames:r,styles:o}),...f,id:m,role:"listbox","aria-labelledby":h,onMouseDown:v=>{v.preventDefault(),u==null||u(v)}})});mO.classes=Us;mO.displayName="@mantine/core/ComboboxOptions";const YJ={withAriaAttributes:!0,withKeyboardNavigation:!0},gO=Ae((t,e)=>{const n=Se("ComboboxSearch",YJ,t),{classNames:r,styles:i,unstyled:s,vars:o,withAriaAttributes:l,onKeyDown:u,withKeyboardNavigation:h,size:f,...p}=n,m=Co(),v=m.getStyles("search"),b=uO({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:h,withExpandedAttribute:!1,onKeyDown:u,autoComplete:"off"});return a.jsx(Mr,{ref:cr(e,m.store.searchRef),classNames:[{input:v.className},r],styles:[{input:v.style},i],size:f||m.size,...b,...p,__staticSelector:"Combobox"})});gO.classes=Us;gO.displayName="@mantine/core/ComboboxSearch";const XJ={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},lI=Ae((t,e)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:s,withExpandedAttribute:o,targetType:l,autoComplete:u,...h}=Se("ComboboxTarget",XJ,t),f=jf(n);if(!f)throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const p=Co(),m=uO({targetType:l,withAriaAttributes:s,withKeyboardNavigation:i,withExpandedAttribute:o,onKeyDown:f.props.onKeyDown,autoComplete:u}),v=M.cloneElement(f,{...m,...h});return a.jsx(Kn.Target,{ref:cr(e,p.store.targetRef),children:v})});lI.displayName="@mantine/core/ComboboxTarget";function GJ(t,e,n){for(let r=t-1;r>=0;r-=1)if(!e[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=e.length-1;r>-1;r-=1)if(!e[r].hasAttribute("data-combobox-disabled"))return r}return t}function KJ(t,e,n){for(let r=t+1;r<e.length;r+=1)if(!e[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=0;r<e.length;r+=1)if(!e[r].hasAttribute("data-combobox-disabled"))return r}return t}function ZJ(t){for(let e=0;e<t.length;e+=1)if(!t[e].hasAttribute("data-combobox-disabled"))return e;return-1}function s2({defaultOpened:t,opened:e,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:i,loop:s=!0,scrollBehavior:o="instant"}={}){const[l,u]=Qi({value:e,defaultValue:t,finalValue:!1,onChange:n}),h=M.useRef(null),f=M.useRef(-1),p=M.useRef(null),m=M.useRef(null),v=M.useRef(-1),b=M.useRef(-1),x=M.useRef(-1),w=M.useCallback((P="unknown")=>{l||(u(!0),i==null||i(P))},[u,i,l]),S=M.useCallback((P="unknown")=>{l&&(u(!1),r==null||r(P))},[u,r,l]),_=M.useCallback((P="unknown")=>{l?S(P):w(P)},[S,w,l]),T=M.useCallback(()=>{const P=Qu(m.current),I=N1(`#${h.current} [data-combobox-selected]`,P);I==null||I.removeAttribute("data-combobox-selected"),I==null||I.removeAttribute("aria-selected")},[]),C=M.useCallback(P=>{const I=Qu(m.current),U=N1(`#${h.current}`,I),Z=U?Wu("[data-combobox-option]",U):null;if(!Z)return null;const X=P>=Z.length?0:P<0?Z.length-1:P;return f.current=X,Z!=null&&Z[X]&&!Z[X].hasAttribute("data-combobox-disabled")?(T(),Z[X].setAttribute("data-combobox-selected","true"),Z[X].setAttribute("aria-selected","true"),Z[X].scrollIntoView({block:"nearest",behavior:o}),Z[X].id):null},[o,T]),j=M.useCallback(()=>{const P=Qu(m.current),I=N1(`#${h.current} [data-combobox-active]`,P);if(I){const Z=Wu(`#${h.current} [data-combobox-option]`,P).findIndex(X=>X===I);return C(Z)}return C(0)},[C]),A=M.useCallback(()=>{const P=Qu(m.current),I=Wu(`#${h.current} [data-combobox-option]`,P);return C(KJ(f.current,I,s))},[C,s]),E=M.useCallback(()=>{const P=Qu(m.current),I=Wu(`#${h.current} [data-combobox-option]`,P);return C(GJ(f.current,I,s))},[C,s]),R=M.useCallback(()=>{const P=Qu(m.current),I=Wu(`#${h.current} [data-combobox-option]`,P);return C(ZJ(I))},[C]),N=M.useCallback((P="selected",I)=>{x.current=window.setTimeout(()=>{var V;const U=Qu(m.current),Z=Wu(`#${h.current} [data-combobox-option]`,U),X=Z.findIndex(G=>G.hasAttribute(`data-combobox-${P}`));f.current=X,I!=null&&I.scrollIntoView&&((V=Z[X])==null||V.scrollIntoView({block:"nearest",behavior:o}))},0)},[]),$=M.useCallback(()=>{f.current=-1,T()},[T]),D=M.useCallback(()=>{const P=Qu(m.current),I=Wu(`#${h.current} [data-combobox-option]`,P),U=I==null?void 0:I[f.current];U==null||U.click()},[]),F=M.useCallback(P=>{h.current=P},[]),Q=M.useCallback(()=>{v.current=window.setTimeout(()=>{var P;return(P=p.current)==null?void 0:P.focus()},0)},[]),H=M.useCallback(()=>{b.current=window.setTimeout(()=>{var P;return(P=m.current)==null?void 0:P.focus()},0)},[]),q=M.useCallback(()=>f.current,[]);return M.useEffect(()=>()=>{window.clearTimeout(v.current),window.clearTimeout(b.current),window.clearTimeout(x.current)},[]),{dropdownOpened:l,openDropdown:w,closeDropdown:S,toggleDropdown:_,selectedOptionIndex:f.current,getSelectedOptionIndex:q,selectOption:C,selectFirstOption:R,selectActiveOption:j,selectNextOption:A,selectPreviousOption:E,resetSelectedOption:$,updateSelectedOptionIndex:N,listId:h.current,setListId:F,clickSelectedOption:D,searchRef:p,focusSearchInput:Q,targetRef:m,focusTarget:H}}const JJ={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},eee=(t,{size:e,dropdownPadding:n})=>({options:{"--combobox-option-fz":Or(e),"--combobox-option-padding":zt(e,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:de(n),"--combobox-option-fz":Or(e),"--combobox-option-padding":zt(e,"combobox-option-padding")}});function an(t){const e=Se("Combobox",JJ,t),{classNames:n,styles:r,unstyled:i,children:s,store:o,vars:l,onOptionSubmit:u,onClose:h,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:v,readOnly:b,attributes:x,...w}=e,S=s2(),_=o||S,T=lt({name:v||"Combobox",classes:Us,props:e,classNames:n,styles:r,unstyled:i,attributes:x,vars:l,varsResolver:eee}),C=()=>{h==null||h(),_.closeDropdown()};return a.jsx(UJ,{value:{getStyles:T,store:_,onOptionSubmit:u,size:f,resetSelectionOnOptionHover:m,readOnly:b},children:a.jsx(Kn,{opened:_.dropdownOpened,preventPositionChangeWhenVisible:!1,...w,onChange:j=>!j&&C(),withRoles:!1,unstyled:i,children:s})})}const tee=t=>t;an.extend=tee;an.classes=Us;an.displayName="@mantine/core/Combobox";an.Target=lI;an.Dropdown=lO;an.Options=mO;an.Option=pO;an.Search=gO;an.Empty=cO;an.Chevron=i2;an.Footer=hO;an.Header=fO;an.EventsTarget=aI;an.DropdownTarget=sI;an.Group=dO;an.ClearButton=oO;an.HiddenInput=oI;var cI={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const uI=cI,vO=M.forwardRef(({__staticSelector:t,__stylesApiProps:e,className:n,classNames:r,styles:i,unstyled:s,children:o,label:l,description:u,id:h,disabled:f,error:p,size:m,labelPosition:v="left",bodyElement:b="div",labelElement:x="label",variant:w,style:S,vars:_,mod:T,attributes:C,...j},A)=>{const E=lt({name:t,props:e,className:n,style:S,classes:cI,classNames:r,styles:i,unstyled:s,attributes:C});return a.jsx(ve,{...E("root"),ref:A,__vars:{"--label-fz":Or(m),"--label-lh":zt(m,"label-lh")},mod:[{"label-position":v},T],variant:w,size:m,...j,children:a.jsxs(ve,{component:b,htmlFor:b==="label"?h:void 0,...E("body"),children:[o,a.jsxs("div",{...E("labelWrapper"),"data-disabled":f||void 0,children:[l&&a.jsx(ve,{component:x,htmlFor:x==="label"?h:void 0,...E("label"),"data-disabled":f||void 0,children:l}),u&&a.jsx(Mr.Description,{size:m,__inheritStyles:!1,...E("description"),children:u}),p&&typeof p!="boolean"&&a.jsx(Mr.Error,{size:m,__inheritStyles:!1,...E("error"),children:p})]})]})})});vO.displayName="@mantine/core/InlineInput";var hI={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const dI=M.createContext(null),nee=dI.Provider,fI=()=>M.useContext(dI),[ree,iee]=Vh();var pI={card:"m_26775b0a"};const see={withBorder:!0},aee=(t,{radius:e})=>({card:{"--card-radius":Zn(e)}}),bO=Ae((t,e)=>{const n=Se("CheckboxCard",see,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,checked:h,mod:f,withBorder:p,value:m,onClick:v,defaultChecked:b,onChange:x,attributes:w,...S}=n,_=lt({name:"CheckboxCard",classes:pI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:w,vars:u,varsResolver:aee,rootSelector:"card"}),T=fI(),C=typeof h=="boolean"?h:T?T.value.includes(m||""):void 0,[j,A]=Qi({value:C,defaultValue:b,finalValue:!1,onChange:x});return a.jsx(ree,{value:{checked:j},children:a.jsx(Dr,{ref:e,mod:[{"with-border":p,checked:j},f],..._("card"),...S,role:"checkbox","aria-checked":j,onClick:E=>{v==null||v(E),T==null||T.onChange(m||""),A(!j)}})})});bO.displayName="@mantine/core/CheckboxCard";bO.classes=pI;function mI({children:t,role:e}){const n=zm();return n?a.jsx("div",{role:e,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:t}):a.jsx(a.Fragment,{children:t})}const yO=Ae((t,e)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:o,children:l,readOnly:u,disabled:h,...f}=Se("CheckboxGroup",null,t),[p,m]=Qi({value:n,defaultValue:r,finalValue:[],onChange:i}),v=b=>{const x=typeof b=="string"?b:b.currentTarget.value;!u&&m(p.includes(x)?p.filter(w=>w!==x):[...p,x])};return a.jsx(nee,{value:{value:p,onChange:v,size:s,disabled:h},children:a.jsx(Mr.Wrapper,{size:s,ref:e,...o,...f,labelElement:"div",__staticSelector:"CheckboxGroup",children:a.jsx(mI,{role:"group",children:l})})})});yO.classes=Mr.Wrapper.classes;yO.displayName="@mantine/core/CheckboxGroup";function a2({size:t,style:e,...n}){const r=t!==void 0?{width:de(t),height:de(t),...e}:e;return a.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:a.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function gI({indeterminate:t,...e}){return t?a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...e,children:a.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):a.jsx(a2,{...e})}var vI={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const oee={icon:gI,variant:"filled"},lee=(t,{radius:e,color:n,size:r,iconColor:i,variant:s,autoContrast:o})=>{const l=iu({color:n||t.primaryColor,theme:t}),u=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--checkbox-size":zt(r,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:Zn(e),"--checkbox-color":s==="outline"?u:hr(n,t),"--checkbox-icon-color":i?hr(i,t):Lm(o,t)?Uh({color:n,theme:t,autoContrast:o}):void 0}}},xO=Ae((t,e)=>{const n=Se("CheckboxIndicator",oee,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,icon:h,indeterminate:f,radius:p,color:m,iconColor:v,autoContrast:b,checked:x,mod:w,variant:S,disabled:_,attributes:T,...C}=n,j=lt({name:"CheckboxIndicator",classes:vI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:T,vars:u,varsResolver:lee,rootSelector:"indicator"}),A=iee(),E=typeof x=="boolean"||typeof f=="boolean"?x||f:(A==null?void 0:A.checked)||!1;return a.jsx(ve,{ref:e,...j("indicator",{variant:S}),variant:S,mod:[{checked:E,disabled:_},w],...C,children:a.jsx(h,{indeterminate:f,...j("icon")})})});xO.displayName="@mantine/core/CheckboxIndicator";xO.classes=vI;const cee={labelPosition:"right",icon:gI,variant:"filled"},uee=(t,{radius:e,color:n,size:r,iconColor:i,variant:s,autoContrast:o})=>{const l=iu({color:n||t.primaryColor,theme:t}),u=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--checkbox-size":zt(r,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:Zn(e),"--checkbox-color":s==="outline"?u:hr(n,t),"--checkbox-icon-color":i?hr(i,t):Lm(o,t)?Uh({color:n,theme:t,autoContrast:o}):void 0}}},aa=Ae((t,e)=>{const n=Se("Checkbox",cee,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,color:h,label:f,id:p,size:m,radius:v,wrapperProps:b,checked:x,labelPosition:w,description:S,error:_,disabled:T,variant:C,indeterminate:j,icon:A,rootRef:E,iconColor:R,onChange:N,autoContrast:$,mod:D,attributes:F,...Q}=n,H=fI(),q=m||(H==null?void 0:H.size),P=lt({name:"Checkbox",props:n,classes:hI,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:F,vars:u,varsResolver:uee}),{styleProps:I,rest:U}=Bv(Q),Z=Ei(p),X={checked:(H==null?void 0:H.value.includes(U.value))??x,onChange:W=>{H==null||H.onChange(W),N==null||N(W)},disabled:(H==null?void 0:H.disabled)??T},V=M.useRef(null),G=e||V;return M.useEffect(()=>{G&&"current"in G&&G.current&&(G.current.indeterminate=j||!1,j?G.current.setAttribute("data-indeterminate","true"):G.current.removeAttribute("data-indeterminate"))},[j,G]),a.jsx(vO,{...P("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:Z,size:q,labelPosition:w,label:f,description:S,error:_,disabled:X.disabled,classNames:r,styles:o,unstyled:l,"data-checked":X.checked||x||void 0,variant:C,ref:E,mod:D,...I,...b,children:a.jsxs(ve,{...P("inner"),mod:{"data-label-position":w},children:[a.jsx(ve,{component:"input",id:Z,ref:G,mod:{error:!!_},...P("input",{focusable:!0,variant:C}),...U,...X,type:"checkbox"}),a.jsx(A,{indeterminate:j,...P("icon")})]})})});aa.classes={...hI,...uI};aa.displayName="@mantine/core/Checkbox";aa.Group=yO;aa.Indicator=xO;aa.Card=bO;function Qg(t){return"group"in t}function bI({options:t,search:e,limit:n}){const r=e.trim().toLowerCase(),i=[];for(let s=0;s<t.length;s+=1){const o=t[s];if(i.length===n)return i;Qg(o)&&i.push({group:o.group,items:bI({options:o.items,search:e,limit:n-i.length})}),Qg(o)||o.label.toLowerCase().includes(r)&&i.push(o)}return i}function hee(t){if(t.length===0)return!0;for(const e of t)if(!("group"in e)||e.items.length>0)return!1;return!0}function yI(t,e=new Set){if(Array.isArray(t))for(const n of t)if(Qg(n))yI(n.items,e);else{if(typeof n.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof n.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof n.value}`);if(e.has(n.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);e.add(n.value)}}function dee(t,e){return Array.isArray(t)?t.includes(e):t===e}function xI({data:t,withCheckIcon:e,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:s,renderOption:o}){if(!Qg(t)){const u=dee(r,t.value),h=e&&(u?a.jsx(a2,{className:Us.optionsDropdownCheckIcon}):n?a.jsx("div",{className:Us.optionsDropdownCheckPlaceholder}):null),f=a.jsxs(a.Fragment,{children:[i==="left"&&h,a.jsx("span",{children:t.label}),i==="right"&&h]});return a.jsx(an.Option,{value:t.value,disabled:t.disabled,className:Lr({[Us.optionsDropdownOption]:!s}),"data-reverse":i==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof o=="function"?o({option:t,checked:u}):f})}const l=t.items.map(u=>a.jsx(xI,{data:u,value:r,unstyled:s,withCheckIcon:e,withAlignedLabels:n,checkIconPosition:i,renderOption:o},u.value));return a.jsx(an.Group,{label:t.group,children:l})}function wI({data:t,hidden:e,hiddenWhenEmpty:n,filter:r,search:i,limit:s,maxDropdownHeight:o,withScrollArea:l=!0,filterOptions:u=!0,withCheckIcon:h=!1,withAlignedLabels:f=!1,value:p,checkIconPosition:m,nothingFoundMessage:v,unstyled:b,labelId:x,renderOption:w,scrollAreaProps:S,"aria-label":_}){yI(t);const C=typeof i=="string"?(r||bI)({options:t,search:u?i:"",limit:s??1/0}):t,j=hee(C),A=C.map(E=>a.jsx(xI,{data:E,withCheckIcon:h,withAlignedLabels:f,value:p,checkIconPosition:m,unstyled:b,renderOption:w},Qg(E)?E.group:E.value));return a.jsx(an.Dropdown,{hidden:e||n&&j,"data-composed":!0,children:a.jsxs(an.Options,{labelledBy:x,"aria-label":_,children:[l?a.jsx(Fa.Autosize,{mah:o??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...S,children:A}):A,j&&v&&a.jsx(an.Empty,{children:v})]})})}const wO=Ae((t,e)=>{const n=Se("Autocomplete",null,t),{classNames:r,styles:i,unstyled:s,vars:o,dropdownOpened:l,defaultDropdownOpened:u,onDropdownClose:h,onDropdownOpen:f,onFocus:p,onBlur:m,onClick:v,onChange:b,data:x,value:w,defaultValue:S,selectFirstOptionOnChange:_,selectFirstOptionOnDropdownOpen:T,onOptionSubmit:C,comboboxProps:j,readOnly:A,disabled:E,filter:R,limit:N,withScrollArea:$,maxDropdownHeight:D,size:F,id:Q,renderOption:H,autoComplete:q,scrollAreaProps:P,onClear:I,clearButtonProps:U,error:Z,clearable:X,rightSection:V,autoSelectOnBlur:G,openOnFocus:W=!0,attributes:te,...oe}=n,be=Ei(Q),ye=iI(x),Ke=aO(ye),[Fe,Pe]=Qi({value:w,defaultValue:S,finalValue:"",onChange:b}),ae=s2({opened:l,defaultOpened:u,onDropdownOpen:()=>{f==null||f(),T&&ae.selectFirstOption()},onDropdownClose:()=>{h==null||h(),setTimeout(ae.resetSelectedOption,0)}}),Te=We=>{Pe(We),ae.resetSelectedOption()},{resolvedClassNames:fe,resolvedStyles:Ee}=jo({props:n,styles:i,classNames:r});M.useEffect(()=>{_&&ae.selectFirstOption()},[_,Fe]);const gt=a.jsx(an.ClearButton,{...U,onClear:()=>{Te(""),I==null||I()}});return a.jsxs(an,{store:ae,__staticSelector:"Autocomplete",classNames:fe,styles:Ee,unstyled:s,readOnly:A,size:F,attributes:te,keepMounted:G,onOptionSubmit:We=>{C==null||C(We),Te(Ke[We].label),ae.closeDropdown()},...j,children:[a.jsx(an.Target,{autoComplete:q,children:a.jsx(Ha,{ref:e,...oe,size:F,__staticSelector:"Autocomplete",__clearSection:gt,__clearable:X&&!!Fe&&!E&&!A,rightSection:V,disabled:E,readOnly:A,value:Fe,error:Z,onChange:We=>{Te(We.currentTarget.value),ae.openDropdown(),_&&ae.selectFirstOption()},onFocus:We=>{W&&ae.openDropdown(),p==null||p(We)},onBlur:We=>{G&&ae.clickSelectedOption(),ae.closeDropdown(),m==null||m(We)},onClick:We=>{ae.openDropdown(),v==null||v(We)},classNames:fe,styles:Ee,unstyled:s,attributes:te,id:be})}),a.jsx(wI,{data:ye,hidden:A||E,filter:R,search:Fe,limit:N,hiddenWhenEmpty:!0,withScrollArea:$,maxDropdownHeight:D,unstyled:s,labelId:oe.label?`${be}-label`:void 0,"aria-label":oe.label?void 0:oe["aria-label"],renderOption:H,scrollAreaProps:P})]})});wO.classes={...Ha.classes,...an.classes};wO.displayName="@mantine/core/Autocomplete";var SI={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const fee=(t,{radius:e,color:n,gradient:r,variant:i,size:s,autoContrast:o,circle:l})=>{const u=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:o});return{root:{"--badge-height":zt(s,"badge-height"),"--badge-padding-x":zt(s,"badge-padding-x"),"--badge-fz":zt(s,"badge-fz"),"--badge-radius":l||e===void 0?void 0:Zn(e),"--badge-bg":n||i?u.background:void 0,"--badge-color":n||i?u.color:void 0,"--badge-bd":n||i?u.border:void 0,"--badge-dot-color":i==="dot"?hr(n,t):void 0}}},zr=Yi((t,e)=>{const n=Se("Badge",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,radius:h,color:f,gradient:p,leftSection:m,rightSection:v,children:b,variant:x,fullWidth:w,autoContrast:S,circle:_,mod:T,attributes:C,...j}=n,A=lt({name:"Badge",props:n,classes:SI,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:C,vars:u,varsResolver:fee});return a.jsxs(ve,{variant:x,mod:[{block:w,circle:_,"with-right-section":!!v,"with-left-section":!!m},T],...A("root",{variant:x}),ref:e,...j,children:[m&&a.jsx("span",{...A("section"),"data-position":"left",children:m}),a.jsx("span",{...A("label"),children:b}),v&&a.jsx("span",{...A("section"),"data-position":"right",children:v})]})});zr.classes=SI;zr.displayName="@mantine/core/Badge";var jI={root:"m_fea6bf1a",burger:"m_d4fb9cad"};const pee=(t,{color:e,size:n,lineSize:r,transitionDuration:i,transitionTimingFunction:s})=>({root:{"--burger-color":e?hr(e,t):void 0,"--burger-size":zt(n,"burger-size"),"--burger-line-size":r?de(r):void 0,"--burger-transition-duration":i===void 0?void 0:`${i}ms`,"--burger-transition-timing-function":s}}),SO=Ae((t,e)=>{const n=Se("Burger",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,opened:h,children:f,transitionDuration:p,transitionTimingFunction:m,lineSize:v,attributes:b,...x}=n,w=lt({name:"Burger",classes:jI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:b,vars:u,varsResolver:pee});return a.jsxs(Dr,{...w("root"),ref:e,...x,children:[a.jsx(ve,{mod:["reduce-motion",{opened:h}],...w("burger")}),f]})});SO.classes=jI;SO.displayName="@mantine/core/Burger";var Fm={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const lR={orientation:"horizontal"},mee=(t,{borderWidth:e})=>({group:{"--button-border-width":de(e)}}),jO=Ae((t,e)=>{const n=Se("ButtonGroup",lR,t),{className:r,style:i,classNames:s,styles:o,unstyled:l,orientation:u,vars:h,borderWidth:f,variant:p,mod:m,attributes:v,...b}=Se("ButtonGroup",lR,t),x=lt({name:"ButtonGroup",props:n,classes:Fm,className:r,style:i,classNames:s,styles:o,unstyled:l,attributes:v,vars:h,varsResolver:mee,rootSelector:"group"});return a.jsx(ve,{...x("group"),ref:e,variant:p,mod:[{"data-orientation":u},m],role:"group",...b})});jO.classes=Fm;jO.displayName="@mantine/core/ButtonGroup";const gee=(t,{radius:e,color:n,gradient:r,variant:i,autoContrast:s,size:o})=>{const l=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:s});return{groupSection:{"--section-height":zt(o,"section-height"),"--section-padding-x":zt(o,"section-padding-x"),"--section-fz":o!=null&&o.includes("compact")?Or(o.replace("compact-","")):Or(o),"--section-radius":e===void 0?void 0:Zn(e),"--section-bg":n||i?l.background:void 0,"--section-color":l.color,"--section-bd":n||i?l.border:void 0}}},_O=Ae((t,e)=>{const n=Se("ButtonGroupSection",null,t),{className:r,style:i,classNames:s,styles:o,unstyled:l,vars:u,variant:h,gradient:f,radius:p,autoContrast:m,attributes:v,...b}=n,x=lt({name:"ButtonGroupSection",props:n,classes:Fm,className:r,style:i,classNames:s,styles:o,unstyled:l,attributes:v,vars:u,varsResolver:gee,rootSelector:"groupSection"});return a.jsx(ve,{...x("groupSection"),ref:e,variant:h,...b})});_O.classes=Fm;_O.displayName="@mantine/core/ButtonGroupSection";const vee={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${de(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},bee=(t,{radius:e,color:n,gradient:r,variant:i,size:s,justify:o,autoContrast:l})=>{const u=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:l});return{root:{"--button-justify":o,"--button-height":zt(s,"button-height"),"--button-padding-x":zt(s,"button-padding-x"),"--button-fz":s!=null&&s.includes("compact")?Or(s.replace("compact-","")):Or(s),"--button-radius":e===void 0?void 0:Zn(e),"--button-bg":n||i?u.background:void 0,"--button-hover":n||i?u.hover:void 0,"--button-color":u.color,"--button-bd":n||i?u.border:void 0,"--button-hover-color":n||i?u.hoverColor:void 0}}},ks=Yi((t,e)=>{const n=Se("Button",null,t),{style:r,vars:i,className:s,color:o,disabled:l,children:u,leftSection:h,rightSection:f,fullWidth:p,variant:m,radius:v,loading:b,loaderProps:x,gradient:w,classNames:S,styles:_,unstyled:T,"data-disabled":C,autoContrast:j,mod:A,attributes:E,...R}=n,N=lt({name:"Button",props:n,classes:Fm,className:s,style:r,classNames:S,styles:_,unstyled:T,attributes:E,vars:i,varsResolver:bee}),$=!!h,D=!!f;return a.jsxs(Dr,{ref:e,...N("root",{active:!l&&!b&&!C}),unstyled:T,variant:m,disabled:l||b,mod:[{disabled:l||C,loading:b,block:p,"with-left-section":$,"with-right-section":D},A],...R,children:[typeof b=="boolean"&&a.jsx(Gl,{mounted:b,transition:vee,duration:150,children:F=>a.jsx(ve,{component:"span",...N("loader",{style:F}),"aria-hidden":!0,children:a.jsx(Kl,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...x})})}),a.jsxs("span",{...N("inner"),children:[h&&a.jsx(ve,{component:"span",...N("section"),mod:{position:"left"},children:h}),a.jsx(ve,{component:"span",mod:{loading:b},...N("label"),children:u}),f&&a.jsx(ve,{component:"span",...N("section"),mod:{position:"right"},children:f})]})]})});ks.classes=Fm;ks.displayName="@mantine/core/Button";ks.Group=jO;ks.GroupSection=_O;const[yee,xee]=Wi("Card component was not found in tree");var TO={root:"m_e615b15f",section:"m_599a2148"};const o2=Yi((t,e)=>{const n=Se("CardSection",null,t),{classNames:r,className:i,style:s,styles:o,vars:l,withBorder:u,inheritPadding:h,mod:f,...p}=n,m=xee();return a.jsx(ve,{ref:e,mod:[{"with-border":u,"inherit-padding":h},f],...m.getStyles("section",{className:i,style:s,styles:o,classNames:r}),...p})});o2.classes=TO;o2.displayName="@mantine/core/CardSection";const wee=(t,{padding:e})=>({root:{"--card-padding":Hi(e)}}),Gr=Yi((t,e)=>{const n=Se("Card",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,children:h,padding:f,attributes:p,...m}=n,v=lt({name:"Card",props:n,classes:TO,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:p,vars:u,varsResolver:wee}),b=M.Children.toArray(h),x=b.map((w,S)=>typeof w=="object"&&w&&"type"in w&&w.type===o2?M.cloneElement(w,{"data-first-section":S===0||void 0,"data-last-section":S===b.length-1||void 0}):w);return a.jsx(yee,{value:{getStyles:v},children:a.jsx(Jw,{ref:e,unstyled:l,...v("root"),...m,children:x})})});Gr.classes=TO;Gr.displayName="@mantine/core/Card";Gr.Section=o2;var _I={root:"m_4451eb3a"};const Wg=Yi((t,e)=>{const n=Se("Center",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,inline:h,mod:f,attributes:p,...m}=n,v=lt({name:"Center",props:n,classes:_I,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:p,vars:u});return a.jsx(ve,{ref:e,mod:[{inline:h},f],...v("root"),...m})});Wg.classes=_I;Wg.displayName="@mantine/core/Center";var TI={root:"m_b183c0a2"};const See=(t,{color:e})=>({root:{"--code-bg":e?hr(e,t):void 0}}),CO=Ae((t,e)=>{const n=Se("Code",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,color:h,block:f,variant:p,mod:m,attributes:v,...b}=n,x=lt({name:"Code",props:n,classes:TI,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:v,vars:u,varsResolver:See});return a.jsx(ve,{component:f?"pre":"code",variant:p,ref:e,mod:[{block:f},m],...x("root"),...b,dir:"ltr"})});CO.classes=TI;CO.displayName="@mantine/core/Code";const jee={timeout:1e3};function kO(t){const{children:e,timeout:n,value:r,...i}=Se("CopyButton",jee,t),s=C7({timeout:n}),o=()=>s.copy(r);return a.jsx(a.Fragment,{children:e({copy:o,copied:s.copied,...i})})}kO.displayName="@mantine/core/CopyButton";var CI={root:"m_3eebeb36",label:"m_9e365f20"};const _ee={orientation:"horizontal"},Tee=(t,{color:e,variant:n,size:r})=>({root:{"--divider-color":e?hr(e,t):void 0,"--divider-border-style":n,"--divider-size":zt(r,"divider-size")}}),Vv=Ae((t,e)=>{const n=Se("Divider",_ee,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,color:h,orientation:f,label:p,labelPosition:m,mod:v,attributes:b,...x}=n,w=lt({name:"Divider",classes:CI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:b,vars:u,varsResolver:Tee});return a.jsx(ve,{ref:e,mod:[{orientation:f,"with-label":!!p},v],...w("root"),...x,role:"separator",children:p&&a.jsx(ve,{component:"span",mod:{position:m},...w("label"),children:p})})});Vv.classes=CI;Vv.displayName="@mantine/core/Divider";var kI={root:"m_e9408a47","root--default":"m_84c9523a","root--filled":"m_ef274e49","root--unstyled":"m_eda993d3",legend:"m_90794832","legend--unstyled":"m_74ca27fe"};const Cee={variant:"default"},kee=(t,{radius:e})=>({root:{"--fieldset-radius":e===void 0?void 0:Zn(e)}}),jp=Ae((t,e)=>{const n=Se("Fieldset",Cee,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,legend:h,variant:f,children:p,attributes:m,...v}=n,b=lt({name:"Fieldset",classes:kI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:m,vars:u,varsResolver:kee});return a.jsxs(ve,{component:"fieldset",ref:e,variant:f,...b("root",{variant:f}),...v,children:[h&&a.jsx("legend",{...b("legend",{variant:f}),children:h}),p]})});jp.classes=kI;jp.displayName="@mantine/core/Fieldset";function Oee(t="top-end",e=0){const n={"--indicator-top":void 0,"--indicator-bottom":void 0,"--indicator-left":void 0,"--indicator-right":void 0,"--indicator-translate-x":void 0,"--indicator-translate-y":void 0},r=de(e),[i,s]=t.split("-");return i==="top"&&(n["--indicator-top"]=r,n["--indicator-translate-y"]="-50%"),i==="middle"&&(n["--indicator-top"]="50%",n["--indicator-translate-y"]="-50%"),i==="bottom"&&(n["--indicator-bottom"]=r,n["--indicator-translate-y"]="50%"),s==="start"&&(n["--indicator-left"]=r,n["--indicator-translate-x"]="-50%"),s==="center"&&(n["--indicator-left"]="50%",n["--indicator-translate-x"]="-50%"),s==="end"&&(n["--indicator-right"]=r,n["--indicator-translate-x"]="50%"),n}var OI={root:"m_e5262200",indicator:"m_760d1fb1",processing:"m_885901b1"};const Eee={position:"top-end",offset:0},Aee=(t,{color:e,position:n,offset:r,size:i,radius:s,zIndex:o,autoContrast:l})=>({root:{"--indicator-color":e?hr(e,t):void 0,"--indicator-text-color":Lm(l,t)?Uh({color:e,theme:t,autoContrast:l}):void 0,"--indicator-size":de(i),"--indicator-radius":s===void 0?void 0:Zn(s),"--indicator-z-index":o==null?void 0:o.toString(),...Oee(n,r)}}),OO=Ae((t,e)=>{const n=Se("Indicator",Eee,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,children:h,position:f,offset:p,inline:m,label:v,radius:b,color:x,withBorder:w,disabled:S,processing:_,zIndex:T,autoContrast:C,mod:j,attributes:A,...E}=n,R=lt({name:"Indicator",classes:OI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:A,vars:u,varsResolver:Aee});return a.jsxs(ve,{ref:e,...R("root"),mod:[{inline:m},j],...E,children:[!S&&a.jsx(ve,{mod:{"with-label":!!v,"with-border":w,processing:_},...R("indicator"),children:v}),h]})});OO.classes=OI;OO.displayName="@mantine/core/Indicator";function kx(){return kx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},kx.apply(null,arguments)}function EO(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}const[Mee,Ree]=Wi("List component was not found in tree");var AO={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const MO=Ae((t,e)=>{const n=Se("ListItem",null,t),{classNames:r,className:i,style:s,styles:o,vars:l,icon:u,children:h,mod:f,...p}=n,m=Ree(),v=u||m.icon,b={classNames:r,styles:o};return a.jsx(ve,{...m.getStyles("item",{...b,className:i,style:s}),component:"li",mod:[{"with-icon":!!v,centered:m.center},f],ref:e,...p,children:a.jsxs("div",{...m.getStyles("itemWrapper",b),children:[v&&a.jsx("span",{...m.getStyles("itemIcon",b),children:v}),a.jsx("span",{...m.getStyles("itemLabel",b),children:h})]})})});MO.classes=AO;MO.displayName="@mantine/core/ListItem";const Dee={type:"unordered"},Nee=(t,{size:e,spacing:n})=>({root:{"--list-fz":Or(e),"--list-lh":T7(e),"--list-spacing":Hi(n)}}),rr=Ae((t,e)=>{const n=Se("List",Dee,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,children:h,type:f,withPadding:p,icon:m,spacing:v,center:b,listStyleType:x,mod:w,attributes:S,..._}=n,T=lt({name:"List",classes:AO,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:S,vars:u,varsResolver:Nee});return a.jsx(Mee,{value:{center:b,icon:m,getStyles:T},children:a.jsx(ve,{...T("root",{style:{listStyleType:x}}),component:f==="unordered"?"ul":"ol",mod:[{"with-padding":p,type:m?"none":x},w],ref:e,..._,children:h})})});rr.classes=AO;rr.displayName="@mantine/core/List";rr.Item=MO;var EI={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const cR={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:So("overlay")},Pee=(t,{zIndex:e})=>({root:{"--lo-z-index":e==null?void 0:e.toString()}}),RO=Ae((t,e)=>{const n=Se("LoadingOverlay",cR,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,transitionProps:h,loaderProps:f,overlayProps:p,visible:m,zIndex:v,attributes:b,...x}=n,w=yi(),S=lt({name:"LoadingOverlay",classes:EI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:b,vars:u,varsResolver:Pee}),_={...cR.overlayProps,...p};return a.jsx(Gl,{transition:"fade",...h,mounted:!!m,children:T=>a.jsxs(ve,{...S("root",{style:T}),ref:e,...x,children:[a.jsx(Kl,{...S("loader"),unstyled:l,...f}),a.jsx(mm,{..._,...S("overlay"),darkHidden:!0,unstyled:l,color:(p==null?void 0:p.color)||w.white}),a.jsx(mm,{..._,...S("overlay"),lightHidden:!0,unstyled:l,color:(p==null?void 0:p.color)||w.colors.dark[5]})]})})});RO.classes=EI;RO.displayName="@mantine/core/LoadingOverlay";const[Lee,Wh]=Wi("Menu component was not found in the tree");var Yh={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const DO=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,...l}=Se("MenuDivider",null,t),u=Wh();return a.jsx(ve,{ref:e,...u.getStyles("divider",{className:r,style:i,styles:s,classNames:n}),...l})});DO.classes=Yh;DO.displayName="@mantine/core/MenuDivider";const NO=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,onMouseEnter:l,onMouseLeave:u,onKeyDown:h,children:f,...p}=Se("MenuDropdown",null,t),m=M.useRef(null),v=Wh(),b=Vi(h,S=>{var _,T;(S.key==="ArrowUp"||S.key==="ArrowDown")&&(S.preventDefault(),(T=(_=m.current)==null?void 0:_.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||T.focus())}),x=Vi(l,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.openDropdown()),w=Vi(u,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.closeDropdown());return a.jsxs(Kn.Dropdown,{...p,onMouseEnter:x,onMouseLeave:w,role:"menu","aria-orientation":"vertical",ref:cr(e,m),...v.getStyles("dropdown",{className:r,style:i,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:[v.withInitialFocusPlaceholder&&a.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),f]})});NO.classes=Yh;NO.displayName="@mantine/core/MenuDropdown";const[$ee,l2]=Vh(),PO=Yi((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,color:l,closeMenuOnClick:u,leftSection:h,rightSection:f,children:p,disabled:m,"data-disabled":v,...b}=Se("MenuItem",null,t),x=Wh(),w=l2(),S=yi(),{dir:_}=_f(),T=M.useRef(null),C=b,j=Vi(C.onClick,()=>{v||(typeof u=="boolean"?u&&x.closeDropdownImmediately():x.closeOnItemClick&&x.closeDropdownImmediately())}),A=l?S.variantColorResolver({color:l,theme:S,variant:"light"}):void 0,E=l?iu({color:l,theme:S}):null,R=Vi(C.onKeyDown,N=>{N.key==="ArrowLeft"&&w&&(w.close(),w.focusParentItem())});return a.jsxs(Dr,{onMouseDown:N=>N.preventDefault(),...b,unstyled:x.unstyled,tabIndex:x.menuItemTabIndex,...x.getStyles("item",{className:r,style:i,styles:s,classNames:n}),ref:cr(T,e),role:"menuitem",disabled:m,"data-menu-item":!0,"data-disabled":m||v||void 0,"data-mantine-stop-propagation":!0,onClick:j,onKeyDown:Nw({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:x.loop,dir:_,orientation:"vertical",onKeyDown:R}),__vars:{"--menu-item-color":E!=null&&E.isThemeColor&&(E==null?void 0:E.shade)===void 0?`var(--mantine-color-${E.color}-6)`:A==null?void 0:A.color,"--menu-item-hover":A==null?void 0:A.hover},children:[h&&a.jsx("div",{...x.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:h}),p&&a.jsx("div",{...x.getStyles("itemLabel",{styles:s,classNames:n}),children:p}),f&&a.jsx("div",{...x.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:f})]})});PO.classes=Yh;PO.displayName="@mantine/core/MenuItem";const LO=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,...l}=Se("MenuLabel",null,t),u=Wh();return a.jsx(ve,{ref:e,...u.getStyles("label",{className:r,style:i,styles:s,classNames:n}),...l})});LO.classes=Yh;LO.displayName="@mantine/core/MenuLabel";const $O=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,onMouseEnter:l,onMouseLeave:u,onKeyDown:h,children:f,...p}=Se("MenuSubDropdown",null,t),m=M.useRef(null),v=Wh(),b=l2(),x=Vi(l,b==null?void 0:b.open),w=Vi(u,b==null?void 0:b.close);return a.jsx(Kn.Dropdown,{...p,onMouseEnter:x,onMouseLeave:w,role:"menu","aria-orientation":"vertical",ref:cr(e,m),...v.getStyles("dropdown",{className:r,style:i,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:f})});$O.classes=Yh;$O.displayName="@mantine/core/MenuSubDropdown";const IO=Yi((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,color:l,leftSection:u,rightSection:h,children:f,disabled:p,"data-disabled":m,closeMenuOnClick:v,...b}=Se("MenuSubItem",null,t),x=Wh(),w=l2(),S=yi(),{dir:_}=_f(),T=M.useRef(null),C=b,j=l?S.variantColorResolver({color:l,theme:S,variant:"light"}):void 0,A=l?iu({color:l,theme:S}):null,E=Vi(C.onKeyDown,D=>{D.key==="ArrowRight"&&(w==null||w.open(),w==null||w.focusFirstItem()),D.key==="ArrowLeft"&&(w!=null&&w.parentContext)&&(w.parentContext.close(),w.parentContext.focusParentItem())}),R=Vi(C.onClick,()=>{!m&&v&&x.closeDropdownImmediately()}),N=Vi(C.onMouseEnter,w==null?void 0:w.open),$=Vi(C.onMouseLeave,w==null?void 0:w.close);return a.jsxs(Dr,{onMouseDown:D=>D.preventDefault(),...b,unstyled:x.unstyled,tabIndex:x.menuItemTabIndex,...x.getStyles("item",{className:r,style:i,styles:s,classNames:n}),ref:cr(T,e),role:"menuitem",disabled:p,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":p||m||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:N,onMouseLeave:$,onClick:R,onKeyDown:Nw({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:x.loop,dir:_,orientation:"vertical",onKeyDown:E}),__vars:{"--menu-item-color":A!=null&&A.isThemeColor&&(A==null?void 0:A.shade)===void 0?`var(--mantine-color-${A.color}-6)`:j==null?void 0:j.color,"--menu-item-hover":j==null?void 0:j.hover},children:[u&&a.jsx("div",{...x.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:u}),f&&a.jsx("div",{...x.getStyles("itemLabel",{styles:s,classNames:n}),children:f}),a.jsx("div",{...x.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:h||a.jsx(Cx,{...x.getStyles("chevron"),size:14})})]})});IO.classes=Yh;IO.displayName="@mantine/core/MenuSubItem";function AI({children:t,refProp:e}){if(!T6(t))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return Wh(),a.jsx(Kn.Target,{refProp:e,popupType:"menu",children:t})}AI.displayName="@mantine/core/MenuSubTarget";const Iee={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function Hm(t){const{children:e,closeDelay:n,openDelay:r,...i}=Se("MenuSub",Iee,t),s=Ei(),[o,{open:l,close:u}]=Iv(!1),h=l2(),{openDropdown:f,closeDropdown:p}=J$({open:l,close:u,closeDelay:n,openDelay:r}),m=()=>window.setTimeout(()=>{var b,x;(x=(b=document.getElementById(`${s}-dropdown`))==null?void 0:b.querySelectorAll("[data-menu-item]:not([data-disabled])")[0])==null||x.focus()},16),v=()=>window.setTimeout(()=>{var b;(b=document.getElementById(`${s}-target`))==null||b.focus()},16);return a.jsx($ee,{value:{opened:o,close:p,open:f,focusFirstItem:m,focusParentItem:v,parentContext:h},children:a.jsx(Kn,{opened:o,withinPortal:!1,withArrow:!1,id:s,...i,children:e})})}Hm.extend=t=>t;Hm.displayName="@mantine/core/MenuSub";Hm.Target=AI;Hm.Dropdown=$O;Hm.Item=IO;const Bee={refProp:"ref"},MI=M.forwardRef((t,e)=>{const{children:n,refProp:r,...i}=Se("MenuTarget",Bee,t),s=jf(n);if(!s)throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const o=Wh(),l=s.props,u=Vi(l.onClick,()=>{o.trigger==="click"?o.toggleDropdown():o.trigger==="click-hover"&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),h=Vi(l.onMouseEnter,()=>(o.trigger==="hover"||o.trigger==="click-hover")&&o.openDropdown()),f=Vi(l.onMouseLeave,()=>{(o.trigger==="hover"||o.trigger==="click-hover"&&!o.openedViaClick)&&o.closeDropdown()});return a.jsx(Kn.Target,{refProp:r,popupType:"menu",ref:e,...i,children:M.cloneElement(s,{onClick:u,onMouseEnter:h,onMouseLeave:f,"data-expanded":o.opened?!0:void 0})})});MI.displayName="@mantine/core/MenuTarget";const zee={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function Xn(t){const e=Se("Menu",zee,t),{children:n,onOpen:r,onClose:i,opened:s,defaultOpened:o,trapFocus:l,onChange:u,closeOnItemClick:h,loop:f,closeOnEscape:p,trigger:m,openDelay:v,closeDelay:b,classNames:x,styles:w,unstyled:S,variant:_,vars:T,menuItemTabIndex:C,keepMounted:j,withInitialFocusPlaceholder:A,attributes:E,...R}=e,N=lt({name:"Menu",classes:Yh,props:e,classNames:x,styles:w,unstyled:S,attributes:E}),[$,D]=Qi({value:s,defaultValue:o,finalValue:!1,onChange:u}),[F,Q]=M.useState(!1),H=()=>{D(!1),Q(!1),$&&(i==null||i())},q=()=>{D(!0),!$&&(r==null||r())},P=()=>{$?H():q()},{openDropdown:I,closeDropdown:U}=J$({open:q,close:H,closeDelay:b,openDelay:v}),Z=G=>qY("[data-menu-item]","[data-menu-dropdown]",G),{resolvedClassNames:X,resolvedStyles:V}=jo({classNames:x,styles:w,props:e});return a.jsx(Lee,{value:{getStyles:N,opened:$,toggleDropdown:P,getItemIndex:Z,openedViaClick:F,setOpenedViaClick:Q,closeOnItemClick:h,closeDropdown:m==="click"?H:U,openDropdown:m==="click"?q:I,closeDropdownImmediately:H,loop:f,trigger:m,unstyled:S,menuItemTabIndex:C,withInitialFocusPlaceholder:A},children:a.jsx(Kn,{returnFocus:!0,...R,opened:$,onChange:P,defaultOpened:o,trapFocus:j?!1:l,closeOnEscape:p,__staticSelector:"Menu",classNames:X,styles:V,unstyled:S,variant:_,keepMounted:j,children:n})})}Xn.extend=t=>t;Xn.withProps=W7(Xn);Xn.classes=Yh;Xn.displayName="@mantine/core/Menu";Xn.Item=PO;Xn.Label=LO;Xn.Dropdown=NO;Xn.Target=MI;Xn.Divider=DO;Xn.Sub=Hm;var au={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const[qee,Vm]=Wi("Modal component was not found in tree"),c2=Ae((t,e)=>{const n=Se("ModalBody",null,t),{classNames:r,className:i,style:s,styles:o,vars:l,...u}=n,h=Vm();return a.jsx(V$,{ref:e,...h.getStyles("body",{classNames:r,style:s,styles:o,className:i}),...u})});c2.classes=au;c2.displayName="@mantine/core/ModalBody";const u2=Ae((t,e)=>{const n=Se("ModalCloseButton",null,t),{classNames:r,className:i,style:s,styles:o,vars:l,...u}=n,h=Vm();return a.jsx(U$,{ref:e,...h.getStyles("close",{classNames:r,style:s,styles:o,className:i}),...u})});u2.classes=au;u2.displayName="@mantine/core/ModalCloseButton";const h2=Ae((t,e)=>{const n=Se("ModalContent",null,t),{classNames:r,className:i,style:s,styles:o,vars:l,children:u,__hidden:h,...f}=n,p=Vm(),m=p.scrollAreaComponent||cJ;return a.jsx(Q$,{...p.getStyles("content",{className:i,style:s,styles:o,classNames:r}),innerProps:p.getStyles("inner",{className:i,style:s,styles:o,classNames:r}),"data-full-screen":p.fullScreen||void 0,"data-modal-content":!0,"data-hidden":h||void 0,ref:e,...f,children:a.jsx(m,{style:{maxHeight:p.fullScreen?"100dvh":`calc(100dvh - (${de(p.yOffset)} * 2))`},children:u})})});h2.classes=au;h2.displayName="@mantine/core/ModalContent";const d2=Ae((t,e)=>{const n=Se("ModalHeader",null,t),{classNames:r,className:i,style:s,styles:o,vars:l,...u}=n,h=Vm();return a.jsx(W$,{ref:e,...h.getStyles("header",{classNames:r,style:s,styles:o,className:i}),...u})});d2.classes=au;d2.displayName="@mantine/core/ModalHeader";const f2=Ae((t,e)=>{const n=Se("ModalOverlay",null,t),{classNames:r,className:i,style:s,styles:o,vars:l,...u}=n,h=Vm();return a.jsx(Y$,{ref:e,...h.getStyles("overlay",{classNames:r,style:s,styles:o,className:i}),...u})});f2.classes=au;f2.displayName="@mantine/core/ModalOverlay";const Fee={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:So("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},Hee=(t,{radius:e,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":e===void 0?void 0:Zn(e),"--modal-size":zt(n,"modal-size"),"--modal-y-offset":de(r),"--modal-x-offset":de(i)}}),p2=Ae((t,e)=>{const n=Se("ModalRoot",Fee,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,yOffset:h,scrollAreaComponent:f,radius:p,fullScreen:m,centered:v,xOffset:b,__staticSelector:x,attributes:w,...S}=n,_=lt({name:x,classes:au,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:w,vars:u,varsResolver:Hee});return a.jsx(qee,{value:{yOffset:h,scrollAreaComponent:f,getStyles:_,fullScreen:m},children:a.jsx(H$,{ref:e,..._("root"),"data-full-screen":m||void 0,"data-centered":v||void 0,"data-offset-scrollbars":f===Fa.Autosize||void 0,unstyled:l,...S})})});p2.classes=au;p2.displayName="@mantine/core/ModalRoot";const[Vee,Uee]=Vh();function RI({children:t}){const[e,n]=M.useState([]),[r,i]=M.useState(So("modal"));return a.jsx(Vee,{value:{stack:e,addModal:(s,o)=>{n(l=>[...new Set([...l,s])]),i(l=>typeof o=="number"&&typeof l=="number"?Math.max(l,o):l)},removeModal:s=>n(o=>o.filter(l=>l!==s)),getZIndex:s=>`calc(${r} + ${e.indexOf(s)} + 1)`,currentId:e[e.length-1],maxZIndex:r},children:t})}RI.displayName="@mantine/core/ModalStack";const m2=Ae((t,e)=>{const n=Se("ModalTitle",null,t),{classNames:r,className:i,style:s,styles:o,vars:l,...u}=n,h=Vm();return a.jsx(X$,{ref:e,...h.getStyles("title",{classNames:r,style:s,styles:o,className:i}),...u})});m2.classes=au;m2.displayName="@mantine/core/ModalTitle";const Qee={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:So("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Va=Ae((t,e)=>{const{title:n,withOverlay:r,overlayProps:i,withCloseButton:s,closeButtonProps:o,children:l,radius:u,opened:h,stackId:f,zIndex:p,...m}=Se("Modal",Qee,t),v=Uee(),b=!!n||s,x=v&&f?{closeOnEscape:v.currentId===f,trapFocus:v.currentId===f,zIndex:v.getZIndex(f)}:{},w=r===!1?!1:f&&v?v.currentId===f:h;return M.useEffect(()=>{v&&f&&(h?v.addModal(f,p||So("modal")):v.removeModal(f))},[h,f,p]),a.jsxs(p2,{ref:e,radius:u,opened:h,zIndex:v&&f?v.getZIndex(f):p,...m,...x,children:[r&&a.jsx(f2,{visible:w,transitionProps:v&&f?{duration:0}:void 0,...i}),a.jsxs(h2,{radius:u,__hidden:v&&f&&h?f!==v.currentId:!1,children:[b&&a.jsxs(d2,{children:[n&&a.jsx(m2,{children:n}),s&&a.jsx(u2,{...o})]}),a.jsx(c2,{children:l})]})]})});Va.classes=au;Va.displayName="@mantine/core/Modal";Va.Root=p2;Va.Overlay=f2;Va.Content=h2;Va.Body=c2;Va.Header=d2;Va.Title=m2;Va.CloseButton=u2;Va.Stack=RI;const[Wee,BO]=Vh();var g2={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const[Yee,Xee]=Vh(),Gee=(t,{gap:e},{size:n})=>({group:{"--pg-gap":e!==void 0?zt(e):zt(n,"pg-gap")}}),zO=Ae((t,e)=>{const n=Se("PillGroup",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,size:h,disabled:f,attributes:p,...m}=n,v=BO(),b=(v==null?void 0:v.size)||h||void 0,x=lt({name:"PillGroup",classes:g2,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:p,vars:u,varsResolver:Gee,stylesCtx:{size:b},rootSelector:"group"});return a.jsx(Yee,{value:{size:b,disabled:f},children:a.jsx(ve,{ref:e,size:b,...x("group"),...m})})});zO.classes=g2;zO.displayName="@mantine/core/PillGroup";const Kee={variant:"default"},Zee=(t,{radius:e},{size:n})=>({root:{"--pill-fz":zt(n,"pill-fz"),"--pill-height":zt(n,"pill-height"),"--pill-radius":e===void 0?void 0:Zn(e)}}),Hc=Ae((t,e)=>{const n=Se("Pill",Kee,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,variant:h,children:f,withRemoveButton:p,onRemove:m,removeButtonProps:v,radius:b,size:x,disabled:w,mod:S,attributes:_,...T}=n,C=Xee(),j=BO(),A=x||(C==null?void 0:C.size)||void 0,E=(j==null?void 0:j.variant)==="filled"?"contrast":h||"default",R=lt({name:"Pill",classes:g2,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:_,vars:u,varsResolver:Zee,stylesCtx:{size:A}});return a.jsxs(ve,{component:"span",ref:e,variant:E,size:A,...R("root",{variant:E}),mod:[{"with-remove":p&&!w,disabled:w||(C==null?void 0:C.disabled)},S],...T,children:[a.jsx("span",{...R("label"),children:f}),p&&a.jsx(Jl,{variant:"transparent",radius:b,tabIndex:-1,"aria-hidden":!0,unstyled:l,...v,...R("remove",{className:v==null?void 0:v.className,style:v==null?void 0:v.style}),onMouseDown:N=>{var $;N.preventDefault(),N.stopPropagation(),($=v==null?void 0:v.onMouseDown)==null||$.call(v,N)},onClick:N=>{var $;N.stopPropagation(),m==null||m(),($=v==null?void 0:v.onClick)==null||$.call(v,N)}})]})});Hc.classes=g2;Hc.displayName="@mantine/core/Pill";Hc.Group=zO;var DI={field:"m_45c4369d"};const Jee={type:"visible"},qO=Ae((t,e)=>{const n=Se("PillsInputField",Jee,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,type:h,disabled:f,id:p,pointer:m,mod:v,attributes:b,...x}=n,w=BO(),S=zm(),_=lt({name:"PillsInputField",classes:DI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:b,rootSelector:"field"}),T=f||(w==null?void 0:w.disabled);return a.jsx(ve,{component:"input",ref:cr(e,w==null?void 0:w.fieldRef),"data-type":h,disabled:T,mod:[{disabled:T,pointer:m},v],..._("field"),...x,id:(S==null?void 0:S.inputId)||p,"aria-invalid":w==null?void 0:w.hasError,"aria-describedby":S==null?void 0:S.describedBy,type:"text",onMouseDown:C=>!m&&C.stopPropagation()})});qO.classes=DI;qO.displayName="@mantine/core/PillsInputField";const ete={size:"sm"},Ag=Ae((t,e)=>{const n=Se("PillsInput",ete,t),{children:r,onMouseDown:i,onClick:s,size:o,disabled:l,__staticSelector:u,error:h,variant:f,...p}=n,m=M.useRef(null);return a.jsx(Wee,{value:{fieldRef:m,size:o,disabled:l,hasError:!!h,variant:f},children:a.jsx(Ha,{size:o,error:h,variant:f,component:"div",ref:e,"data-no-overflow":!0,onMouseDown:v=>{var b;v.preventDefault(),i==null||i(v),(b=m.current)==null||b.focus()},onClick:v=>{var x;v.preventDefault();const b=v.currentTarget.closest("fieldset");b!=null&&b.disabled||((x=m.current)==null||x.focus(),s==null||s(v))},...p,multiline:!0,disabled:l,__staticSelector:u||"PillsInput",withAria:!1,children:r})})});Ag.displayName="@mantine/core/PillsInput";Ag.Field=qO;var NI={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const tte={withCloseButton:!0},nte=(t,{radius:e,color:n})=>({root:{"--notification-radius":e===void 0?void 0:Zn(e),"--notification-color":n?hr(n,t):void 0}}),FO=Ae((t,e)=>{const n=Se("Notification",tte,t),{className:r,color:i,radius:s,loading:o,withCloseButton:l,withBorder:u,title:h,icon:f,children:p,onClose:m,closeButtonProps:v,classNames:b,style:x,styles:w,unstyled:S,vars:_,mod:T,loaderProps:C,role:j,attributes:A,...E}=n,R=lt({name:"Notification",classes:NI,props:n,className:r,style:x,classNames:b,styles:w,unstyled:S,attributes:A,vars:_,varsResolver:nte});return a.jsxs(ve,{...R("root"),mod:[{"data-with-icon":!!f||o,"data-with-border":u},T],ref:e,role:j||"alert",...E,children:[f&&!o&&a.jsx("div",{...R("icon"),children:f}),o&&a.jsx(Kl,{size:28,color:i,...C,...R("loader")}),a.jsxs("div",{...R("body"),children:[h&&a.jsx("div",{...R("title"),children:h}),a.jsx(ve,{...R("description"),mod:{"data-with-title":!!h},children:p})]}),l&&a.jsx(Jl,{iconSize:16,color:"gray",...v,unstyled:S,onClick:m,...R("closeButton")})]})});FO.classes=NI;FO.displayName="@mantine/core/Notification";function PI(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}var Yg;(function(t){t.event="event",t.props="prop"})(Yg||(Yg={}));function sh(){}function rte(t){var e,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return e&&r.length===e.length&&r.every(function(s,o){return s===e[o]})||(e=r,n=t.apply(void 0,r)),n}}function Xg(t){return!!(t||"").match(/\d/)}function Dp(t){return t==null}function ite(t){return typeof t=="number"&&isNaN(t)}function LI(t){return Dp(t)||ite(t)||typeof t=="number"&&!isFinite(t)}function $I(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function ste(t){switch(t){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function ate(t,e,n){var r=ste(n),i=t.search(/[1-9]/);return i=i===-1?t.length:i,t.substring(0,i)+t.substring(i,t.length).replace(r,"$1"+e)}function ote(t){var e=M.useRef(t);e.current=t;var n=M.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return e.current.apply(e,r)});return n.current}function HO(t,e){e===void 0&&(e=!0);var n=t[0]==="-",r=n&&e;t=t.replace("-","");var i=t.split("."),s=i[0],o=i[1]||"";return{beforeDecimal:s,afterDecimal:o,hasNegation:n,addNegation:r}}function lte(t){if(!t)return t;var e=t[0]==="-";e&&(t=t.substring(1,t.length));var n=t.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(e?"-":"")+r+(i?"."+i:"")}function II(t,e,n){for(var r="",i=n?"0":"",s=0;s<=e-1;s++)r+=t[s]||i;return r}function uR(t,e){return Array(e+1).join(t)}function BI(t){var e=t+"",n=e[0]==="-"?"-":"";n&&(e=e.substring(1));var r=e.split(/[eE]/g),i=r[0],s=r[1];if(s=Number(s),!s)return n+i;i=i.replace(".","");var o=1+s,l=i.length;return o<0?i="0."+uR("0",Math.abs(o))+i:o>=l?i=i+uR("0",o-l):i=(i.substring(0,o)||"0")+"."+i.substring(o),n+i}function hR(t,e,n){if(["","-"].indexOf(t)!==-1)return t;var r=(t.indexOf(".")!==-1||n)&&e,i=HO(t),s=i.beforeDecimal,o=i.afterDecimal,l=i.hasNegation,u=parseFloat("0."+(o||"0")),h=o.length<=e?"0."+o:u.toFixed(e),f=h.split("."),p=s;s&&Number(f[0])&&(p=s.split("").reverse().reduce(function(x,w,S){return x.length>S?(Number(x[0])+Number(w)).toString()+x.substring(1,x.length):w+x},f[0]));var m=II(f[1]||"",e,n),v=l?"-":"",b=r?".":"";return""+v+p+b+m}function Rd(t,e){if(t.value=t.value,t!==null){if(t.createTextRange){var n=t.createTextRange();return n.move("character",e),n.select(),!0}return t.selectionStart||t.selectionStart===0?(t.focus(),t.setSelectionRange(e,e),!0):(t.focus(),!1)}}var zI=rte(function(t,e){for(var n=0,r=0,i=t.length,s=e.length;t[n]===e[n]&&n<i;)n++;for(;t[i-1-r]===e[s-1-r]&&s-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:s-r}}}),cte=function(t,e){var n=Math.min(t.selectionStart,e);return{from:{start:n,end:t.selectionEnd},to:{start:n,end:e}}};function ute(t,e,n){return Math.min(Math.max(t,e),n)}function n3(t){return Math.max(t.selectionStart,t.selectionEnd)}function hte(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function dte(t){return{from:{start:0,end:0},to:{start:0,end:t.length},lastValue:""}}function fte(t){var e=t.currentValue,n=t.formattedValue,r=t.currentValueIndex,i=t.formattedValueIndex;return e[r]===n[i]}function pte(t,e,n,r,i,s,o){o===void 0&&(o=fte);var l=i.findIndex(function(C){return C}),u=t.slice(0,l);!e&&!n.startsWith(u)&&(e=u,n=u+n,r=r+u.length);for(var h=n.length,f=t.length,p={},m=new Array(h),v=0;v<h;v++){m[v]=-1;for(var b=0,x=f;b<x;b++){var w=o({currentValue:n,lastValue:e,formattedValue:t,currentValueIndex:v,formattedValueIndex:b});if(w&&p[b]!==!0){m[v]=b,p[b]=!0;break}}}for(var S=r;S<h&&(m[S]===-1||!s(n[S]));)S++;var _=S===h||m[S]===-1?f:m[S];for(S=r-1;S>0&&m[S]===-1;)S--;var T=S===-1||m[S]===-1?0:m[S]+1;return T>_?_:r-T<_-r?T:_}function dR(t,e,n,r){var i=t.length;if(e=ute(e,0,i),r==="left"){for(;e>=0&&!n[e];)e--;e===-1&&(e=n.indexOf(!0))}else{for(;e<=i&&!n[e];)e++;e>i&&(e=n.lastIndexOf(!0))}return e===-1&&(e=i),e}function mte(t){for(var e=Array.from({length:t.length+1}).map(function(){return!0}),n=0,r=e.length;n<r;n++)e[n]=!!(Xg(t[n])||Xg(t[n-1]));return e}function qI(t,e,n,r,i,s){s===void 0&&(s=sh);var o=ote(function(b,x){var w,S;return LI(b)?(S="",w=""):typeof b=="number"||x?(S=typeof b=="number"?BI(b):b,w=r(S)):(S=i(b,void 0),w=r(S)),{formattedValue:w,numAsString:S}}),l=M.useState(function(){return o(Dp(t)?e:t,n)}),u=l[0],h=l[1],f=function(b,x){b.formattedValue!==u.formattedValue&&h({formattedValue:b.formattedValue,numAsString:b.value}),s(b,x)},p=t,m=n;Dp(t)&&(p=u.numAsString,m=!0);var v=o(p,m);return M.useMemo(function(){h(v)},[v.formattedValue]),[u,f]}function gte(t){return t.replace(/[^0-9]/g,"")}function vte(t){return t}function bte(t){var e=t.type;e===void 0&&(e="text");var n=t.displayType;n===void 0&&(n="input");var r=t.customInput,i=t.renderText,s=t.getInputRef,o=t.format;o===void 0&&(o=vte);var l=t.removeFormatting;l===void 0&&(l=gte);var u=t.defaultValue,h=t.valueIsNumericString,f=t.onValueChange,p=t.isAllowed,m=t.onChange;m===void 0&&(m=sh);var v=t.onKeyDown;v===void 0&&(v=sh);var b=t.onMouseUp;b===void 0&&(b=sh);var x=t.onFocus;x===void 0&&(x=sh);var w=t.onBlur;w===void 0&&(w=sh);var S=t.value,_=t.getCaretBoundary;_===void 0&&(_=mte);var T=t.isValidInputCharacter;T===void 0&&(T=Xg);var C=t.isCharacterSame,j=PI(t,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),A=qI(S,u,!!h,o,l,f),E=A[0],R=E.formattedValue,N=E.numAsString,$=A[1],D=M.useRef(),F=M.useRef({formattedValue:R,numAsString:N}),Q=function(Be,ze){F.current={formattedValue:Be.formattedValue,numAsString:Be.value},$(Be,ze)},H=M.useState(!1),q=H[0],P=H[1],I=M.useRef(null),U=M.useRef({setCaretTimeout:null,focusTimeout:null});M.useEffect(function(){return P(!0),function(){clearTimeout(U.current.setCaretTimeout),clearTimeout(U.current.focusTimeout)}},[]);var Z=o,X=function(Be,ze){var De=parseFloat(ze);return{formattedValue:Be,value:ze,floatValue:isNaN(De)?void 0:De}},V=function(Be,ze,De){Be.selectionStart===0&&Be.selectionEnd===Be.value.length||(Rd(Be,ze),U.current.setCaretTimeout=setTimeout(function(){Be.value===De&&Be.selectionStart!==ze&&Rd(Be,ze)},0))},G=function(Be,ze,De){return dR(Be,ze,_(Be),De)},W=function(Be,ze,De){var Ye=_(ze),$t=pte(ze,R,Be,De,Ye,T,C);return $t=dR(ze,$t,Ye),$t},te=function(Be){var ze=Be.formattedValue;ze===void 0&&(ze="");var De=Be.input,Ye=Be.source,$t=Be.event,tt=Be.numAsString,et;if(De){var Ve=Be.inputValue||De.value,Le=n3(De);De.value=ze,et=W(Ve,ze,Le),et!==void 0&&V(De,et,ze)}ze!==R&&Q(X(ze,tt),{event:$t,source:Ye})};M.useEffect(function(){var Be=F.current,ze=Be.formattedValue,De=Be.numAsString;(R!==ze||N!==De)&&Q(X(R,N),{event:void 0,source:Yg.props})},[R,N]);var oe=I.current?n3(I.current):void 0,be=typeof window<"u"?M.useLayoutEffect:M.useEffect;be(function(){var Be=I.current;if(R!==F.current.formattedValue&&Be){var ze=W(F.current.formattedValue,R,oe);Be.value=R,V(Be,ze,R)}},[R]);var ye=function(Be,ze,De){var Ye=ze.target,$t=D.current?cte(D.current,Ye.selectionEnd):zI(R,Be),tt=Object.assign(Object.assign({},$t),{lastValue:R}),et=l(Be,tt),Ve=Z(et);if(et=l(Ve,void 0),p&&!p(X(Ve,et))){var Le=ze.target,Ce=n3(Le),ge=W(Be,R,Ce);return Le.value=R,V(Le,ge,R),!1}return te({formattedValue:Ve,numAsString:et,inputValue:Be,event:ze,source:De,input:ze.target}),!0},Ke=function(Be,ze){ze===void 0&&(ze=0);var De=Be.selectionStart,Ye=Be.selectionEnd;D.current={selectionStart:De,selectionEnd:Ye+ze}},Fe=function(Be){var ze=Be.target,De=ze.value,Ye=ye(De,Be,Yg.event);Ye&&m(Be),D.current=void 0},Pe=function(Be){var ze=Be.target,De=Be.key,Ye=ze.selectionStart,$t=ze.selectionEnd,tt=ze.value;tt===void 0&&(tt="");var et;De==="ArrowLeft"||De==="Backspace"?et=Math.max(Ye-1,0):De==="ArrowRight"?et=Math.min(Ye+1,tt.length):De==="Delete"&&(et=Ye);var Ve=0;De==="Delete"&&Ye===$t&&(Ve=1);var Le=De==="ArrowLeft"||De==="ArrowRight";if(et===void 0||Ye!==$t&&!Le){v(Be),Ke(ze,Ve);return}var Ce=et;if(Le){var ge=De==="ArrowLeft"?"left":"right";Ce=G(tt,et,ge),Ce!==et&&Be.preventDefault()}else De==="Delete"&&!T(tt[et])?Ce=G(tt,et,"right"):De==="Backspace"&&!T(tt[et])&&(Ce=G(tt,et,"left"));Ce!==et&&V(ze,Ce,tt),v(Be),Ke(ze,Ve)},ae=function(Be){var ze=Be.target,De=function(){var Ye=ze.selectionStart,$t=ze.selectionEnd,tt=ze.value;if(tt===void 0&&(tt=""),Ye===$t){var et=G(tt,Ye);et!==Ye&&V(ze,et,tt)}};De(),requestAnimationFrame(function(){De()}),b(Be),Ke(ze)},Te=function(Be){Be.persist&&Be.persist();var ze=Be.target,De=Be.currentTarget;I.current=ze,U.current.focusTimeout=setTimeout(function(){var Ye=ze.selectionStart,$t=ze.selectionEnd,tt=ze.value;tt===void 0&&(tt="");var et=G(tt,Ye);et!==Ye&&!(Ye===0&&$t===tt.length)&&V(ze,et,tt),x(Object.assign(Object.assign({},Be),{currentTarget:De}))},0)},fe=function(Be){I.current=null,clearTimeout(U.current.focusTimeout),clearTimeout(U.current.setCaretTimeout),w(Be)},Ee=q&&hte()?"numeric":void 0,gt=Object.assign({inputMode:Ee},j,{type:e,value:R,onChange:Fe,onKeyDown:Pe,onMouseUp:ae,onFocus:Te,onBlur:fe});if(n==="text")return i?_n.createElement(_n.Fragment,null,i(R,j)||null):_n.createElement("span",Object.assign({},j,{ref:s}),R);if(r){var We=r;return _n.createElement(We,Object.assign({},gt,{ref:s}))}return _n.createElement("input",Object.assign({},gt,{ref:s}))}function fR(t,e){var n=e.decimalScale,r=e.fixedDecimalScale,i=e.prefix;i===void 0&&(i="");var s=e.suffix;s===void 0&&(s="");var o=e.allowNegative,l=e.thousandsGroupStyle;if(l===void 0&&(l="thousand"),t===""||t==="-")return t;var u=v2(e),h=u.thousandSeparator,f=u.decimalSeparator,p=n!==0&&t.indexOf(".")!==-1||n&&r,m=HO(t,o),v=m.beforeDecimal,b=m.afterDecimal,x=m.addNegation;return n!==void 0&&(b=II(b,n,!!r)),h&&(v=ate(v,h,l)),i&&(v=i+v),s&&(b=b+s),x&&(v="-"+v),t=v+(p&&f||"")+b,t}function v2(t){var e=t.decimalSeparator;e===void 0&&(e=".");var n=t.thousandSeparator,r=t.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:r}}function yte(t,e){t===void 0&&(t="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(t),s=r.test(t);return t=t.replace(/-/g,""),i&&!s&&e&&(t="-"+t),t}function xte(t,e){return new RegExp("(^-)|[0-9]|"+$I(t),"g")}function wte(t,e,n){return t===""?!0:!(e!=null&&e.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof t=="string"&&!isNaN(Number(t))}function Ste(t,e,n){var r;e===void 0&&(e=dte(t));var i=n.allowNegative,s=n.prefix;s===void 0&&(s="");var o=n.suffix;o===void 0&&(o="");var l=n.decimalScale,u=e.from,h=e.to,f=h.start,p=h.end,m=v2(n),v=m.allowedDecimalSeparators,b=m.decimalSeparator,x=t[p]===b;if(Xg(t)&&(t===s||t===o)&&e.lastValue==="")return t;if(p-f===1&&v.indexOf(t[f])!==-1){var w=l===0?"":b;t=t.substring(0,f)+w+t.substring(f+1,t.length)}var S=function(I,U,Z){var X=!1,V=!1;s.startsWith("-")?X=!1:I.startsWith("--")?(X=!1,V=!0):o.startsWith("-")&&I.length===o.length?X=!1:I[0]==="-"&&(X=!0);var G=X?1:0;return V&&(G=2),G&&(I=I.substring(G),U-=G,Z-=G),{value:I,start:U,end:Z,hasNegation:X}},_=S(t,f,p),T=_.hasNegation;r=_,t=r.value,f=r.start,p=r.end;var C=S(e.lastValue,u.start,u.end),j=C.start,A=C.end,E=C.value,R=t.substring(f,p);t.length&&E.length&&(j>E.length-o.length||A<s.length)&&!(R&&o.startsWith(R))&&(t=E);var N=0;t.startsWith(s)?N+=s.length:f<s.length&&(N=f),t=t.substring(N),p-=N;var $=t.length,D=t.length-o.length;t.endsWith(o)?$=D:(p>D||p>t.length-o.length)&&($=p),t=t.substring(0,$),t=yte(T?"-"+t:t,i),t=(t.match(xte(b))||[]).join("");var F=t.indexOf(b);t=t.replace(new RegExp($I(b),"g"),function(I,U){return U===F?".":""});var Q=HO(t,i),H=Q.beforeDecimal,q=Q.afterDecimal,P=Q.addNegation;return h.end-h.start<u.end-u.start&&H===""&&x&&!parseFloat(q)&&(t=P?"-":""),t}function jte(t,e){var n=e.prefix;n===void 0&&(n="");var r=e.suffix;r===void 0&&(r="");var i=Array.from({length:t.length+1}).map(function(){return!0}),s=t[0]==="-";i.fill(!1,0,n.length+(s?1:0));var o=t.length;return i.fill(!1,o-r.length+1,o+1),i}function _te(t){var e=v2(t),n=e.thousandSeparator,r=e.decimalSeparator,i=t.prefix;i===void 0&&(i="");var s=t.allowNegative;if(s===void 0&&(s=!0),n===r)throw new Error(`
        Decimal separator can't be same as thousand separator.
        thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
        decimalSeparator: `+r+` (default value for decimalSeparator is .)
     `);return i.startsWith("-")&&s&&(console.error(`
      Prefix can't start with '-' when allowNegative is true.
      prefix: `+i+`
      allowNegative: `+s+`
    `),s=!1),Object.assign(Object.assign({},t),{allowNegative:s})}function Tte(t){t=_te(t),t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle;var e=t.suffix,n=t.allowNegative,r=t.allowLeadingZeros,i=t.onKeyDown;i===void 0&&(i=sh);var s=t.onBlur;s===void 0&&(s=sh);var o=t.thousandSeparator,l=t.decimalScale,u=t.fixedDecimalScale,h=t.prefix;h===void 0&&(h="");var f=t.defaultValue,p=t.value,m=t.valueIsNumericString,v=t.onValueChange,b=PI(t,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),x=v2(t),w=x.decimalSeparator,S=x.allowedDecimalSeparators,_=function(P){return fR(P,t)},T=function(P,I){return Ste(P,I,t)},C=Dp(p)?f:p,j=m??wte(C,h,e);Dp(p)?Dp(f)||(j=j||typeof f=="number"):j=j||typeof p=="number";var A=function(P){return LI(P)?P:(typeof P=="number"&&(P=BI(P)),j&&typeof l=="number"?hR(P,l,!!u):P)},E=qI(A(p),A(f),!!j,_,T,v),R=E[0],N=R.numAsString,$=R.formattedValue,D=E[1],F=function(P){var I=P.target,U=P.key,Z=I.selectionStart,X=I.selectionEnd,V=I.value;if(V===void 0&&(V=""),(U==="Backspace"||U==="Delete")&&X<h.length){P.preventDefault();return}if(Z!==X){i(P);return}U==="Backspace"&&V[0]==="-"&&Z===h.length+1&&n&&Rd(I,1),l&&u&&(U==="Backspace"&&V[Z-1]===w?(Rd(I,Z-1),P.preventDefault()):U==="Delete"&&V[Z]===w&&P.preventDefault()),S!=null&&S.includes(U)&&V[Z]===w&&Rd(I,Z+1);var G=o===!0?",":o;U==="Backspace"&&V[Z-1]===G&&Rd(I,Z-1),U==="Delete"&&V[Z]===G&&Rd(I,Z+1),i(P)},Q=function(P){var I=N;if(I.match(/\d/g)||(I=""),r||(I=lte(I)),u&&l&&(I=hR(I,l,u)),I!==N){var U=fR(I,t);D({formattedValue:U,value:I,floatValue:parseFloat(I)},{event:P,source:Yg.event})}s(P)},H=function(P){return P===w?!0:Xg(P)},q=function(P){var I=P.currentValue,U=P.lastValue,Z=P.formattedValue,X=P.currentValueIndex,V=P.formattedValueIndex,G=I[X],W=Z[V],te=zI(U,I),oe=te.to,be=function(ye){return T(ye).indexOf(".")+h.length};return p===0&&u&&l&&I[oe.start]===w&&be(I)<X&&be(Z)>V?!1:X>=oe.start&&X<oe.end&&S&&S.includes(G)&&W===w?!0:G===W};return Object.assign(Object.assign({},b),{value:$,valueIsNumericString:!1,isValidInputCharacter:H,isCharacterSame:q,onValueChange:D,format:_,removeFormatting:T,getCaretBoundary:function(P){return jte(P,t)},onKeyDown:F,onBlur:Q})}function Cte(t){var e=Tte(t);return _n.createElement(bte,Object.assign({},e))}var fC={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};function pR({direction:t,style:e,...n}){return a.jsx("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:t==="up"?"rotate(180deg)":void 0,...e},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:a.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}const kte=/^(0\.0*|-0(\.0*)?)$/,Ote=/^-?0\d+(\.\d+)?\.?$/,Ete=/\.\d*0$/,FI=/^-?\d+\.$/;function pC(t){return typeof t=="string"&&t!==""&&!Number.isNaN(Number(t))}function r3(t){return typeof t=="number"?t<Number.MAX_SAFE_INTEGER:t===""||pC(t)&&Number(t)<Number.MAX_SAFE_INTEGER}function Ate(t){return t.toString().replace(".","").length}function Mte(t,e){return(typeof t=="number"?t<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(t)))&&!Number.isNaN(t)&&Ate(e)<14&&e!==""}function mR(t,e,n){if(t===void 0)return!0;const r=e===void 0||t>=e,i=n===void 0||t<=n;return r&&i}const Rte={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[".",","]},Dte=(t,{size:e})=>({controls:{"--ni-chevron-size":zt(e,"ni-chevron-size")}});function Nte(t,e,n){const r=t.toString(),i=FI.test(r),s=r.replace(/^0+(?=\d)/,""),o=parseFloat(s);if(Number.isNaN(o))return s;if(o>Number.MAX_SAFE_INTEGER)return e!==void 0?e:s;const l=Sh(o,n,e);return i?`${l.toString().replace(/^0+(?=\d)/,"")}.`:l}const Ox=Ae((t,e)=>{const n=Se("NumberInput",Rte,t),{className:r,classNames:i,styles:s,unstyled:o,vars:l,onChange:u,onValueChange:h,value:f,defaultValue:p,max:m,min:v,step:b,hideControls:x,rightSection:w,isAllowed:S,clampBehavior:_,onBlur:T,allowDecimal:C,decimalScale:j,onKeyDown:A,onKeyDownCapture:E,handlersRef:R,startValue:N,disabled:$,rightSectionPointerEvents:D,allowNegative:F,readOnly:Q,size:H,rightSectionWidth:q,stepHoldInterval:P,stepHoldDelay:I,allowLeadingZeros:U,withKeyboardEvents:Z,trimLeadingZeroesOnBlur:X,allowedDecimalSeparators:V,attributes:G,...W}=n,te=lt({name:"NumberInput",classes:fC,props:n,classNames:i,styles:s,unstyled:o,attributes:G,vars:l,varsResolver:Dte}),{resolvedClassNames:oe,resolvedStyles:be}=jo({classNames:i,styles:s,props:n}),[ye,Ke]=Qi({value:f,defaultValue:p,finalValue:"",onChange:u}),Fe=I!==void 0&&P!==void 0,Pe=M.useRef(null),ae=M.useRef(null),Te=M.useRef(0),fe=(Ce,ge)=>{ge.source==="event"&&Ke(Mte(Ce.floatValue,Ce.value)&&!kte.test(Ce.value)&&!(U&&Ote.test(Ce.value))&&!Ete.test(Ce.value)&&!FI.test(Ce.value)?Ce.floatValue:Ce.value),h==null||h(Ce,ge)},Ee=Ce=>{const ge=String(Ce).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return ge?Math.max(0,(ge[1]?ge[1].length:0)-(ge[2]?+ge[2]:0)):0},gt=Ce=>{Pe.current&&typeof Ce<"u"&&Pe.current.setSelectionRange(Ce,Ce)},We=M.useRef(vx);We.current=()=>{if(!r3(ye))return;let Ce;const ge=Ee(ye),Kt=Ee(b),qn=Math.max(ge,Kt),Ft=10**qn;if(!pC(ye)&&(typeof ye!="number"||Number.isNaN(ye)))Ce=Sh(N,v,m);else if(m!==void 0){const Zt=(Math.round(Number(ye)*Ft)+Math.round(b*Ft))/Ft;Ce=Zt<=m?Zt:m}else Ce=(Math.round(Number(ye)*Ft)+Math.round(b*Ft))/Ft;const xn=Ce.toFixed(qn);Ke(parseFloat(xn)),h==null||h({floatValue:parseFloat(xn),formattedValue:xn,value:xn},{source:"increment"}),setTimeout(()=>{var Zt;return gt((Zt=Pe.current)==null?void 0:Zt.value.length)},0)};const Be=M.useRef(vx);Be.current=()=>{if(!r3(ye))return;let Ce;const ge=v!==void 0?v:F?Number.MIN_SAFE_INTEGER:0,Kt=Ee(ye),qn=Ee(b),Ft=Math.max(Kt,qn),xn=10**Ft;if(!pC(ye)&&typeof ye!="number"||Number.isNaN(ye))Ce=Sh(N,ge,m);else{const ln=(Math.round(Number(ye)*xn)-Math.round(b*xn))/xn;Ce=ge!==void 0&&ln<ge?ge:ln}const Zt=Ce.toFixed(Ft);Ke(parseFloat(Zt)),h==null||h({floatValue:parseFloat(Zt),formattedValue:Zt,value:Zt},{source:"decrement"}),setTimeout(()=>{var ln;return gt((ln=Pe.current)==null?void 0:ln.value.length)},0)};const ze=Ce=>{var ge,Kt;A==null||A(Ce),!(Q||!Z)&&(Ce.key==="ArrowUp"&&(Ce.preventDefault(),(ge=We.current)==null||ge.call(We)),Ce.key==="ArrowDown"&&(Ce.preventDefault(),(Kt=Be.current)==null||Kt.call(Be)))},De=Ce=>{if(E==null||E(Ce),Ce.key==="Backspace"){const ge=Pe.current;ge&&ge.selectionStart===0&&ge.selectionStart===ge.selectionEnd&&(Ce.preventDefault(),window.setTimeout(()=>gt(0),0))}},Ye=Ce=>{let ge=ye;_==="blur"&&typeof ge=="number"&&(ge=Sh(ge,v,m)),X&&typeof ge=="string"&&Ee(ge)<15&&(ge=Nte(ge,m,v)),ye!==ge&&Ke(ge),T==null||T(Ce)};yx(R,{increment:We.current,decrement:Be.current});const $t=Ce=>{var ge,Kt;Ce?(ge=We.current)==null||ge.call(We):(Kt=Be.current)==null||Kt.call(Be),Te.current+=1},tt=Ce=>{if($t(Ce),Fe){const ge=typeof P=="number"?P:P(Te.current);ae.current=window.setTimeout(()=>tt(Ce),ge)}},et=(Ce,ge)=>{var Kt;Ce.preventDefault(),(Kt=Pe.current)==null||Kt.focus(),$t(ge),Fe&&(ae.current=window.setTimeout(()=>tt(ge),I))},Ve=()=>{ae.current&&window.clearTimeout(ae.current),ae.current=null,Te.current=0},Le=a.jsxs("div",{...te("controls"),children:[a.jsx(Dr,{...te("control"),tabIndex:-1,"aria-hidden":!0,disabled:$||typeof ye=="number"&&m!==void 0&&ye>=m,mod:{direction:"up"},onMouseDown:Ce=>Ce.preventDefault(),onPointerDown:Ce=>{et(Ce,!0)},onPointerUp:Ve,onPointerLeave:Ve,children:a.jsx(pR,{direction:"up"})}),a.jsx(Dr,{...te("control"),tabIndex:-1,"aria-hidden":!0,disabled:$||typeof ye=="number"&&v!==void 0&&ye<=v,mod:{direction:"down"},onMouseDown:Ce=>Ce.preventDefault(),onPointerDown:Ce=>{et(Ce,!1)},onPointerUp:Ve,onPointerLeave:Ve,children:a.jsx(pR,{direction:"down"})})]});return a.jsx(Ha,{component:Cte,allowNegative:F,className:Lr(fC.root,r),size:H,inputMode:"decimal",...W,readOnly:Q,disabled:$,value:ye,getInputRef:cr(e,Pe),onValueChange:fe,rightSection:x||Q||!r3(ye)?w:w||Le,classNames:oe,styles:be,unstyled:o,__staticSelector:"NumberInput",decimalScale:C?j:0,onKeyDown:ze,onKeyDownCapture:De,rightSectionPointerEvents:D??($?"none":void 0),rightSectionWidth:q??`var(--ni-right-section-width-${H||"sm"})`,allowLeadingZeros:U,allowedDecimalSeparators:V,onBlur:Ye,attributes:G,isAllowed:Ce=>_==="strict"?S?S(Ce)&&mR(Ce.floatValue,v,m):mR(Ce.floatValue,v,m):S?S(Ce):!0})});Ox.classes={...Ha.classes,...fC};Ox.displayName="@mantine/core/NumberInput";var Uv={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const[Pte,b2]=Wi("Pagination.Root component was not found in tree"),Lte={withPadding:!0},Qv=Ae((t,e)=>{const n=Se("PaginationControl",Lte,t),{classNames:r,className:i,style:s,styles:o,vars:l,active:u,disabled:h,withPadding:f,mod:p,...m}=n,v=b2(),b=h||v.disabled;return a.jsx(Dr,{ref:e,disabled:b,mod:[{active:u,disabled:b,"with-padding":f},p],...v.getStyles("control",{className:i,style:s,classNames:r,styles:o,active:!b}),...m})});Qv.classes=Uv;Qv.displayName="@mantine/core/PaginationControl";function Wv({style:t,children:e,path:n,...r}){return a.jsx("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)",...t},...r,children:a.jsx("path",{d:n,fill:"currentColor"})})}const $te=t=>a.jsx(Wv,{...t,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),Ite=t=>a.jsx(Wv,{...t,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),Bte=t=>a.jsx(Wv,{...t,path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"}),zte=t=>a.jsx(Wv,{...t,path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"}),qte=t=>a.jsx(Wv,{...t,path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}),Fte={icon:qte},y2=Ae((t,e)=>{const n=Se("PaginationDots",Fte,t),{classNames:r,className:i,style:s,styles:o,vars:l,icon:u,...h}=n,f=b2();return a.jsx(ve,{ref:e,...f.getStyles("dots",{className:i,style:s,styles:o,classNames:r}),...h,children:a.jsx(u,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});y2.classes=Uv;y2.displayName="@mantine/core/PaginationDots";function x2({icon:t,name:e,action:n,type:r}){const i={icon:t},s=M.forwardRef((o,l)=>{const{icon:u,...h}=Se(e,i,o),f=b2(),p=r==="next"?f.active===f.total:f.active===1;return a.jsx(Qv,{disabled:f.disabled||p,ref:l,onClick:f[n],withPadding:!1,...h,children:a.jsx(u,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return s.displayName=`@mantine/core/${e}`,s}const HI=x2({icon:$te,name:"PaginationNext",action:"onNext",type:"next"}),VI=x2({icon:Ite,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),UI=x2({icon:Bte,name:"PaginationFirst",action:"onFirst",type:"previous"}),QI=x2({icon:zte,name:"PaginationLast",action:"onLast",type:"next"});function VO({dotsIcon:t}){const e=b2(),n=e.range.map((r,i)=>{var s,o,l;return r==="dots"?a.jsx(y2,{icon:t},i):a.jsx(Qv,{active:r===e.active,"aria-current":r===e.active?"page":void 0,onClick:()=>e.onChange(r),disabled:e.disabled,...(s=e.getItemProps)==null?void 0:s.call(e,r),children:((l=(o=e.getItemProps)==null?void 0:o.call(e,r))==null?void 0:l.children)??r},i)});return a.jsx(a.Fragment,{children:n})}VO.displayName="@mantine/core/PaginationItems";const Hte={siblings:1,boundaries:1},Vte=(t,{size:e,radius:n,color:r,autoContrast:i})=>({root:{"--pagination-control-radius":n===void 0?void 0:Zn(n),"--pagination-control-size":zt(e,"pagination-control-size"),"--pagination-control-fz":Or(e),"--pagination-active-bg":r?hr(r,t):void 0,"--pagination-active-color":Lm(i,t)?Uh({color:r,theme:t,autoContrast:i}):void 0}}),w2=Ae((t,e)=>{const n=Se("PaginationRoot",Hte,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,total:h,value:f,defaultValue:p,onChange:m,disabled:v,siblings:b,boundaries:x,color:w,radius:S,onNextPage:_,onPreviousPage:T,onFirstPage:C,onLastPage:j,getItemProps:A,autoContrast:E,attributes:R,...N}=n,$=lt({name:"Pagination",classes:Uv,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:R,vars:u,varsResolver:Vte}),{range:D,setPage:F,next:Q,previous:H,active:q,first:P,last:I}=oX({page:f,initialPage:p,onChange:m,total:h,siblings:b,boundaries:x}),U=Vi(_,Q),Z=Vi(T,H),X=Vi(C,P),V=Vi(j,I);return a.jsx(Pte,{value:{total:h,range:D,active:q,disabled:v,getItemProps:A,onChange:F,onNext:U,onPrevious:Z,onFirst:X,onLast:V,getStyles:$},children:a.jsx(ve,{ref:e,...$("root"),...N})})});w2.classes=Uv;w2.displayName="@mantine/core/PaginationRoot";const Ute={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},ko=Ae((t,e)=>{const n=Se("Pagination",Ute,t),{withEdges:r,withControls:i,getControlProps:s,nextIcon:o,previousIcon:l,lastIcon:u,firstIcon:h,dotsIcon:f,total:p,gap:m,hideWithOnePage:v,withPages:b,...x}=n;return p<=0||v&&p===1?null:a.jsx(w2,{ref:e,total:p,...x,children:a.jsxs(ht,{gap:m,children:[r&&a.jsx(UI,{icon:h,...s==null?void 0:s("first")}),i&&a.jsx(VI,{icon:l,...s==null?void 0:s("previous")}),b&&a.jsx(VO,{dotsIcon:f}),i&&a.jsx(HI,{icon:o,...s==null?void 0:s("next")}),r&&a.jsx(QI,{icon:u,...s==null?void 0:s("last")})]})})});ko.classes=Uv;ko.displayName="@mantine/core/Pagination";ko.Root=w2;ko.Control=Qv;ko.Dots=y2;ko.First=UI;ko.Last=QI;ko.Next=HI;ko.Previous=VI;ko.Items=VO;var Yv={root:"m_db6d6462",section:"m_2242eb65","stripes-animation":"m_81a374bd","stripes-animation-vertical":"m_e0fb7a86",label:"m_91e40b74"};const[Qte,WI]=Wi("Progress.Root component was not found in tree"),UO=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,...l}=Se("ProgressLabel",null,t),u=WI();return a.jsx(ve,{ref:e,...u.getStyles("label",{className:r,style:i,classNames:n,styles:s}),...l})});UO.classes=Yv;UO.displayName="@mantine/core/ProgressLabel";const Wte=(t,{size:e,radius:n,transitionDuration:r})=>({root:{"--progress-size":zt(e,"progress-size"),"--progress-radius":n===void 0?void 0:Zn(n),"--progress-transition-duration":typeof r=="number"?`${r}ms`:void 0}}),S2=Ae((t,e)=>{const n=Se("ProgressRoot",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,autoContrast:h,transitionDuration:f,orientation:p,attributes:m,mod:v,...b}=n,x=lt({name:"Progress",classes:Yv,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:m,vars:u,varsResolver:Wte});return a.jsx(Qte,{value:{getStyles:x,autoContrast:h},children:a.jsx(ve,{ref:e,mod:[{orientation:p},v],...x("root"),...b})})});S2.classes=Yv;S2.displayName="@mantine/core/ProgressRoot";const Yte={withAria:!0},j2=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,value:l,withAria:u,color:h,striped:f,animated:p,mod:m,...v}=Se("ProgressSection",Yte,t),b=WI(),x=yi(),w=u?{role:"progressbar","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":l,"aria-valuetext":`${l}%`}:{};return a.jsx(ve,{ref:e,...b.getStyles("section",{className:r,classNames:n,styles:s,style:i}),...v,...w,mod:[{striped:f||p,animated:p},m],__vars:{"--progress-section-size":`${l}%`,"--progress-section-color":hr(h,x),"--progress-label-color":Lm(b.autoContrast,x)?Uh({color:h,theme:x,autoContrast:b.autoContrast}):void 0}})});j2.classes=Yv;j2.displayName="@mantine/core/ProgressSection";const Um=Ae((t,e)=>{const n=Se("Progress",null,t),{value:r,classNames:i,styles:s,vars:o,color:l,striped:u,animated:h,"aria-label":f,...p}=n,{resolvedClassNames:m,resolvedStyles:v}=jo({classNames:i,styles:s,props:n});return a.jsx(S2,{ref:e,classNames:m,styles:v,vars:o,...p,children:a.jsx(j2,{value:r,color:l,striped:u,animated:h,"aria-label":f})})});Um.classes=Yv;Um.displayName="@mantine/core/Progress";Um.Section=j2;Um.Root=S2;Um.Label=UO;const Xte={duration:100,transition:"fade"};function gR(t,e){return{...Xte,...e,...t}}var _2={tooltip:"m_1b3c8819",arrow:"m_f898399f"};function Gte({offset:t,position:e,defaultOpened:n}){const[r,i]=M.useState(n),s=M.useRef(null),{x:o,y:l,elements:u,refs:h,update:f,placement:p}=H6({placement:e,middleware:[B6({crossAxis:!0,padding:5,rootBoundary:"document"})]}),m=p.includes("right")?t:e.includes("left")?t*-1:0,v=p.includes("bottom")?t:e.includes("top")?t*-1:0,b=M.useCallback(({clientX:x,clientY:w})=>{h.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x,y:w,left:x+m,top:w+v,right:x,bottom:w}}})},[u.reference]);return M.useEffect(()=>{if(h.floating.current){const x=s.current;x.addEventListener("mousemove",b);const w=Qc(h.floating.current);return w.forEach(S=>{S.addEventListener("scroll",f)}),()=>{x.removeEventListener("mousemove",b),w.forEach(S=>{S.removeEventListener("scroll",f)})}}},[u.reference,h.floating.current,f,b,r]),{handleMouseMove:b,x:o,y:l,opened:r,setOpened:i,boundaryRef:s,floating:h.setFloating}}const Kte={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:So("popover")},Zte=(t,{radius:e,color:n})=>({tooltip:{"--tooltip-radius":e===void 0?void 0:Zn(e),"--tooltip-bg":n?hr(n,t):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),QO=Ae((t,e)=>{const n=Se("TooltipFloating",Kte,t),{children:r,refProp:i,withinPortal:s,style:o,className:l,classNames:u,styles:h,unstyled:f,radius:p,color:m,label:v,offset:b,position:x,multiline:w,zIndex:S,disabled:_,defaultOpened:T,variant:C,vars:j,portalProps:A,attributes:E,...R}=n,N=yi(),$=lt({name:"TooltipFloating",props:n,classes:_2,className:l,style:o,classNames:u,styles:h,unstyled:f,attributes:E,rootSelector:"tooltip",vars:j,varsResolver:Zte}),{handleMouseMove:D,x:F,y:Q,opened:H,boundaryRef:q,floating:P,setOpened:I}=Gte({offset:b,position:x,defaultOpened:T}),U=jf(r);if(!U)throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const Z=cr(q,$w(U),e),X=U.props,V=W=>{var te;(te=X.onMouseEnter)==null||te.call(X,W),D(W),I(!0)},G=W=>{var te;(te=X.onMouseLeave)==null||te.call(X,W),I(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(Eh,{...A,withinPortal:s,children:a.jsx(ve,{...R,...$("tooltip",{style:{...R6(o,N),zIndex:S,display:!_&&H?"block":"none",top:(Q&&Math.round(Q))??"",left:(F&&Math.round(F))??""}}),variant:C,ref:P,mod:{multiline:w},children:v})}),M.cloneElement(U,{...X,[i]:Z,onMouseEnter:V,onMouseLeave:G})]})});QO.classes=_2;QO.displayName="@mantine/core/TooltipFloating";const YI=M.createContext(!1),Jte=YI.Provider,ene=()=>M.useContext(YI),tne={openDelay:0,closeDelay:0};function WO(t){const{openDelay:e,closeDelay:n,children:r}=Se("TooltipGroup",tne,t);return a.jsx(Jte,{value:!0,children:a.jsx(cZ,{delay:{open:e,close:n},children:r})})}WO.displayName="@mantine/core/TooltipGroup";WO.extend=t=>t;function nne(t){if(t===void 0)return{shift:!0,flip:!0};const e={...t};return t.shift===void 0&&(e.shift=!0),t.flip===void 0&&(e.flip=!0),e}function rne(t){const e=nne(t.middlewares),n=[c$(t.offset)];return e.shift&&n.push(B6(typeof e.shift=="boolean"?{padding:8}:{padding:8,...e.shift})),e.flip&&n.push(typeof e.flip=="boolean"?_x():_x(e.flip)),n.push(u$({element:t.arrowRef,padding:t.arrowOffset})),e.inline?n.push(typeof e.inline=="boolean"?Eg():Eg(e.inline)):t.inline&&n.push(Eg()),n}function ine(t){var j,A,E;const[e,n]=M.useState(t.defaultOpened),i=typeof t.opened=="boolean"?t.opened:e,s=ene(),o=Ei(),l=M.useCallback(R=>{n(R),R&&S(o)},[o]),{x:u,y:h,context:f,refs:p,placement:m,middlewareData:{arrow:{x:v,y:b}={}}}=H6({strategy:t.strategy,placement:t.position,open:i,onOpenChange:l,middleware:rne(t),whileElementsMounted:cC}),{delay:x,currentId:w,setCurrentId:S}=uZ(f,{id:o}),{getReferenceProps:_,getFloatingProps:T}=gZ([oZ(f,{enabled:(j=t.events)==null?void 0:j.hover,delay:s?x:{open:t.openDelay,close:t.closeDelay},mouseOnly:!((A=t.events)!=null&&A.touch)}),mZ(f,{enabled:(E=t.events)==null?void 0:E.focus,visibleOnly:!0}),bZ(f,{role:"tooltip"}),fZ(f,{enabled:typeof t.opened>"u"})]);Yl(()=>{var R;(R=t.onPositionChange)==null||R.call(t,m)},[m]);const C=i&&w&&w!==o;return{x:u,y:h,arrowX:v,arrowY:b,reference:p.setReference,floating:p.setFloating,getFloatingProps:T,getReferenceProps:_,isGroupPhase:C,opened:i,placement:m}}const vR={position:"top",refProp:"ref",withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:So("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},sne=(t,{radius:e,color:n,variant:r,autoContrast:i})=>{const s=t.variantColorResolver({theme:t,color:n||t.primaryColor,autoContrast:i,variant:r||"filled"});return{tooltip:{"--tooltip-radius":e===void 0?void 0:Zn(e),"--tooltip-bg":n?s.background:void 0,"--tooltip-color":n?s.color:void 0}}},Xr=Ae((t,e)=>{const n=Se("Tooltip",vR,t),{children:r,position:i,refProp:s,label:o,openDelay:l,closeDelay:u,onPositionChange:h,opened:f,defaultOpened:p,withinPortal:m,radius:v,color:b,classNames:x,styles:w,unstyled:S,style:_,className:T,withArrow:C,arrowSize:j,arrowOffset:A,arrowRadius:E,arrowPosition:R,offset:N,transitionProps:$,multiline:D,events:F,zIndex:Q,disabled:H,positionDependencies:q,onClick:P,onMouseEnter:I,onMouseLeave:U,inline:Z,variant:X,keepMounted:V,vars:G,portalProps:W,mod:te,floatingStrategy:oe,middlewares:be,autoContrast:ye,attributes:Ke,target:Fe,...Pe}=Se("Tooltip",vR,n),{dir:ae}=_f(),Te=M.useRef(null),fe=ine({position:E$(ae,i),closeDelay:u,openDelay:l,onPositionChange:h,opened:f,defaultOpened:p,events:F,arrowRef:Te,arrowOffset:A,offset:typeof N=="number"?N+(C?j/2:0):N,positionDependencies:[...q,Fe??r],inline:Z,strategy:oe,middlewares:be});M.useEffect(()=>{const De=Fe instanceof HTMLElement?Fe:typeof Fe=="string"?document.querySelector(Fe):(Fe==null?void 0:Fe.current)||null;De&&fe.reference(De)},[Fe,fe]);const Ee=lt({name:"Tooltip",props:n,classes:_2,className:T,style:_,classNames:x,styles:w,unstyled:S,attributes:Ke,rootSelector:"tooltip",vars:G,varsResolver:sne}),gt=jf(r);if(!Fe&&!gt)return null;if(Fe){const De=gR($,{duration:100,transition:"fade"});return a.jsx(a.Fragment,{children:a.jsx(Eh,{...W,withinPortal:m,children:a.jsx(Gl,{...De,keepMounted:V,mounted:!H&&!!fe.opened,duration:fe.isGroupPhase?10:De.duration,children:Ye=>a.jsxs(ve,{...Pe,"data-fixed":oe==="fixed"||void 0,variant:X,mod:[{multiline:D},te],...fe.getFloatingProps({ref:fe.floating,className:Ee("tooltip").className,style:{...Ee("tooltip").style,...Ye,zIndex:Q,top:fe.y??0,left:fe.x??0}}),children:[o,a.jsx(Tx,{ref:Te,arrowX:fe.arrowX,arrowY:fe.arrowY,visible:C,position:fe.placement,arrowSize:j,arrowOffset:A,arrowRadius:E,arrowPosition:R,...Ee("arrow")})]})})})})}const We=gt.props,Be=cr(fe.reference,$w(gt),e),ze=gR($,{duration:100,transition:"fade"});return a.jsxs(a.Fragment,{children:[a.jsx(Eh,{...W,withinPortal:m,children:a.jsx(Gl,{...ze,keepMounted:V,mounted:!H&&!!fe.opened,duration:fe.isGroupPhase?10:ze.duration,children:De=>a.jsxs(ve,{...Pe,"data-fixed":oe==="fixed"||void 0,variant:X,mod:[{multiline:D},te],...fe.getFloatingProps({ref:fe.floating,className:Ee("tooltip").className,style:{...Ee("tooltip").style,...De,zIndex:Q,top:fe.y??0,left:fe.x??0}}),children:[o,a.jsx(Tx,{ref:Te,arrowX:fe.arrowX,arrowY:fe.arrowY,visible:C,position:fe.placement,arrowSize:j,arrowOffset:A,arrowRadius:E,arrowPosition:R,...Ee("arrow")})]})})}),M.cloneElement(gt,fe.getReferenceProps({onClick:P,onMouseEnter:I,onMouseLeave:U,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,...We,className:Lr(T,We.className),[s]:Be}))]})});Xr.classes=_2;Xr.displayName="@mantine/core/Tooltip";Xr.Floating=QO;Xr.Group=WO;function ane({size:t,thickness:e,sum:n,value:r,root:i,offset:s}){const o=(t*.9-e*2)/2,l=Math.PI*o*2/100,u=i||r===void 0?`${(100-n)*l}, ${n*l}`:`${r*l}, ${(100-r)*l}`;return{strokeWidth:Number.isNaN(e)?12:e,cx:t/2||0,cy:t/2||0,r:o||0,transform:i?`scale(1, -1) translate(0, -${t})`:void 0,strokeDasharray:u,strokeDashoffset:i?0:s||0}}function XI({size:t,value:e,offset:n,sum:r,thickness:i,root:s,color:o,lineRoundCaps:l,tooltip:u,getStyles:h,display:f,...p}){const m=yi();return a.jsx(Xr.Floating,{disabled:!u,label:u,children:a.jsx(ve,{component:"circle",...p,...h("curve"),__vars:{"--curve-color":o?hr(o,m):void 0},fill:"none",strokeLinecap:l?"round":"butt",...ane({sum:r,size:t,thickness:i,value:e,offset:n,root:s})})})}XI.displayName="@mantine/core/Curve";function one({size:t,thickness:e,sections:n,renderRoundedLineCaps:r,rootColor:i}){const s=n.reduce((f,p)=>f+p.value,0),o=Math.PI*((t*.9-e*2)/2)*2;let l=o;const u=[],h=[];for(let f=0;f<n.length;f+=1)u.push({sum:s,offset:l,data:n[f],root:!1}),l-=n[f].value/100*o;if(u.push({sum:s,offset:l,data:{color:i},root:!0}),h.push({...u[u.length-1],lineRoundCaps:!1}),u.length>2){h.push({...u[0],lineRoundCaps:r}),h.push({...u[u.length-2],lineRoundCaps:r});for(let f=1;f<=u.length-3;f+=1)h.push({...u[f],lineRoundCaps:!1})}else h.push({...u[0],lineRoundCaps:r});return h}var GI={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function lne(t,e){return Math.min(t||12,(e||120)/4)}const cne={size:120,thickness:12},une=(t,{size:e,thickness:n,transitionDuration:r})=>({root:{"--rp-size":de(e),"--rp-label-offset":de(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),T2=Ae((t,e)=>{const n=Se("RingProgress",cne,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,label:h,sections:f,size:p,thickness:m,roundCaps:v,rootColor:b,transitionDuration:x,attributes:w,...S}=n,_=lt({name:"RingProgress",classes:GI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:w,vars:u,varsResolver:une}),T=lne(m,p),C=one({size:p,thickness:T,sections:f,renderRoundedLineCaps:v,rootColor:b}).map(({data:j,sum:A,root:E,lineRoundCaps:R,offset:N},$)=>M.createElement(XI,{...j,key:$,size:p,thickness:T,sum:A,offset:N,color:j==null?void 0:j.color,root:E,lineRoundCaps:R,getStyles:_}));return a.jsxs(ve,{..._("root"),size:p,ref:e,...S,children:[a.jsx("svg",{..._("svg"),children:C}),h&&a.jsx("div",{..._("label"),children:h})]})});T2.classes=GI;T2.displayName="@mantine/core/RingProgress";var KI={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const hne={withItemsBorders:!0},dne=(t,{radius:e,color:n,transitionDuration:r,size:i,transitionTimingFunction:s})=>({root:{"--sc-radius":e===void 0?void 0:Zn(e),"--sc-color":n?hr(n,t):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":s,"--sc-padding":zt(i,"sc-padding"),"--sc-font-size":Or(i)}}),Xv=Ae((t,e)=>{var Fe,Pe;const n=Se("SegmentedControl",hne,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,data:h,value:f,defaultValue:p,onChange:m,size:v,name:b,disabled:x,readOnly:w,fullWidth:S,orientation:_,radius:T,color:C,transitionDuration:j,transitionTimingFunction:A,variant:E,autoContrast:R,withItemsBorders:N,mod:$,attributes:D,...F}=n,Q=lt({name:"SegmentedControl",props:n,classes:KI,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:D,vars:u,varsResolver:dne}),H=yi(),q=h.map(ae=>typeof ae=="string"?{label:ae,value:ae}:ae),P=vX(),[I,U]=M.useState(dm()),[Z,X]=M.useState(null),[V,G]=M.useState({}),W=(ae,Te)=>{V[Te]=ae,G(V)},[te,oe]=Qi({value:f,defaultValue:p,finalValue:Array.isArray(h)?((Fe=q.find(ae=>!ae.disabled))==null?void 0:Fe.value)??((Pe=h[0])==null?void 0:Pe.value)??null:null,onChange:m}),be=Ei(b),ye=q.map(ae=>M.createElement(ve,{...Q("control"),mod:{active:te===ae.value,orientation:_},key:ae.value},M.createElement("input",{...Q("input"),disabled:x||ae.disabled,type:"radio",name:be,value:ae.value,id:`${be}-${ae.value}`,checked:te===ae.value,onChange:()=>!w&&oe(ae.value),"data-focus-ring":H.focusRing,key:`${ae.value}-input`}),M.createElement(ve,{component:"label",...Q("label"),mod:{active:te===ae.value&&!(x||ae.disabled),disabled:x||ae.disabled,"read-only":w},htmlFor:`${be}-${ae.value}`,ref:Te=>W(Te,ae.value),__vars:{"--sc-label-color":C!==void 0?Uh({color:C,theme:H,autoContrast:R}):void 0},key:`${ae.value}-label`},a.jsx("span",{...Q("innerLabel"),children:ae.label})))),Ke=cr(e,ae=>X(ae));return fX(()=>{U(dm())},[h.length]),h.length===0?null:a.jsxs(ve,{...Q("root"),variant:E,size:v,ref:Ke,mod:[{"full-width":S,orientation:_,initialized:P,"with-items-borders":N},$],...F,role:"radiogroup","data-disabled":x,children:[typeof te=="string"&&a.jsx(J6,{target:V[te],parent:Z,component:"span",transitionDuration:"var(--sc-transition-duration)",...Q("indicator")},I),ye]})});Xv.classes=KI;Xv.displayName="@mantine/core/SegmentedControl";const fne={withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left",openOnFocus:!0},Qm=Ae((t,e)=>{const n=Se("Select",fne,t),{classNames:r,styles:i,unstyled:s,vars:o,dropdownOpened:l,defaultDropdownOpened:u,onDropdownClose:h,onDropdownOpen:f,onFocus:p,onBlur:m,onClick:v,onChange:b,data:x,value:w,defaultValue:S,selectFirstOptionOnChange:_,selectFirstOptionOnDropdownOpen:T,onOptionSubmit:C,comboboxProps:j,readOnly:A,disabled:E,filter:R,limit:N,withScrollArea:$,maxDropdownHeight:D,size:F,searchable:Q,rightSection:H,checkIconPosition:q,withCheckIcon:P,withAlignedLabels:I,nothingFoundMessage:U,name:Z,form:X,searchValue:V,defaultSearchValue:G,onSearchChange:W,allowDeselect:te,error:oe,rightSectionPointerEvents:be,id:ye,clearable:Ke,clearButtonProps:Fe,hiddenInputProps:Pe,renderOption:ae,onClear:Te,autoComplete:fe,scrollAreaProps:Ee,__defaultRightSection:gt,__clearSection:We,__clearable:Be,chevronColor:ze,autoSelectOnBlur:De,openOnFocus:Ye,attributes:$t,...tt}=n,et=M.useMemo(()=>iI(x),[x]),Ve=M.useRef({}),Le=M.useMemo(()=>aO(et),[et]),Ce=Ei(ye),[ge,Kt,qn]=Qi({value:w,defaultValue:S,finalValue:null,onChange:b}),Ft=typeof ge=="string"?ge in Le?Le[ge]:Ve.current[ge]:void 0,xn=mX(Ft),[Zt,ln,nn]=Qi({value:V,defaultValue:G,finalValue:Ft?Ft.label:"",onChange:W}),Pt=s2({opened:l,defaultOpened:u,onDropdownOpen:()=>{f==null||f(),T?Pt.selectFirstOption():Pt.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{h==null||h(),setTimeout(Pt.resetSelectedOption,0)}}),Wt=It=>{ln(It),Pt.resetSelectedOption()},{resolvedClassNames:Ri,resolvedStyles:yt}=jo({props:n,styles:i,classNames:r});M.useEffect(()=>{_&&Pt.selectFirstOption()},[_,Zt]),M.useEffect(()=>{w===null&&Wt(""),typeof w=="string"&&Ft&&((xn==null?void 0:xn.value)!==Ft.value||(xn==null?void 0:xn.label)!==Ft.label)&&Wt(Ft.label)},[w,Ft]),M.useEffect(()=>{var It,dr;!qn&&!nn&&Wt(typeof ge=="string"?ge in Le?(It=Le[ge])==null?void 0:It.label:((dr=Ve.current[ge])==null?void 0:dr.label)||"":"")},[Le,ge]),M.useEffect(()=>{ge&&ge in Le&&(Ve.current[ge]=Le[ge])},[Le,ge]);const kt=a.jsx(an.ClearButton,{...Fe,onClear:()=>{Kt(null,null),Wt(""),Te==null||Te()}}),ir=Ke&&!!ge&&!E&&!A;return a.jsxs(a.Fragment,{children:[a.jsxs(an,{store:Pt,__staticSelector:"Select",classNames:Ri,styles:yt,unstyled:s,readOnly:A,size:F,attributes:$t,keepMounted:De,onOptionSubmit:It=>{C==null||C(It);const dr=te&&Le[It].value===ge?null:Le[It],An=dr?dr.value:null;An!==ge&&Kt(An,dr),!qn&&Wt(typeof An=="string"&&(dr==null?void 0:dr.label)||""),Pt.closeDropdown()},...j,children:[a.jsx(an.Target,{targetType:Q?"input":"button",autoComplete:fe,children:a.jsx(Ha,{id:Ce,ref:e,__defaultRightSection:a.jsx(an.Chevron,{size:F,error:oe,unstyled:s,color:ze}),__clearSection:kt,__clearable:ir,rightSection:H,rightSectionPointerEvents:be||"none",...tt,size:F,__staticSelector:"Select",disabled:E,readOnly:A||!Q,value:Zt,onChange:It=>{Wt(It.currentTarget.value),Pt.openDropdown(),_&&Pt.selectFirstOption()},onFocus:It=>{Ye&&Q&&Pt.openDropdown(),p==null||p(It)},onBlur:It=>{De&&Pt.clickSelectedOption(),Q&&Pt.closeDropdown();const dr=typeof ge=="string"&&(ge in Le?Le[ge]:Ve.current[ge]);Wt(dr&&dr.label||""),m==null||m(It)},onClick:It=>{Q?Pt.openDropdown():Pt.toggleDropdown(),v==null||v(It)},classNames:Ri,styles:yt,unstyled:s,pointer:!Q,error:oe,attributes:$t})}),a.jsx(wI,{data:et,hidden:A||E,filter:R,search:Zt,limit:N,hiddenWhenEmpty:!U,withScrollArea:$,maxDropdownHeight:D,filterOptions:!!Q&&(Ft==null?void 0:Ft.label)!==Zt,value:ge,checkIconPosition:q,withCheckIcon:P,withAlignedLabels:I,nothingFoundMessage:U,unstyled:s,labelId:tt.label?`${Ce}-label`:void 0,"aria-label":tt.label?void 0:tt["aria-label"],renderOption:ae,scrollAreaProps:Ee})]}),a.jsx(an.HiddenInput,{value:ge,name:Z,form:X,disabled:E,...Pe})]})});Qm.classes={...Ha.classes,...an.classes};Qm.displayName="@mantine/core/Select";var ZI={container:"m_925c2d2c",root:"m_2415a157"};function pne({spacing:t,verticalSpacing:e,cols:n,selector:r}){var f;const i=yi(),s=e===void 0?t:e,o=Pv({"--sg-spacing-x":Hi(Mp(t)),"--sg-spacing-y":Hi(Mp(s)),"--sg-cols":(f=Mp(n))==null?void 0:f.toString()}),l=Kr(i.breakpoints).reduce((p,m)=>(p[m]||(p[m]={}),typeof t=="object"&&t[m]!==void 0&&(p[m]["--sg-spacing-x"]=Hi(t[m])),typeof s=="object"&&s[m]!==void 0&&(p[m]["--sg-spacing-y"]=Hi(s[m])),typeof n=="object"&&n[m]!==void 0&&(p[m]["--sg-cols"]=n[m]),p),{}),h=JT(Kr(l),i.breakpoints).filter(p=>Kr(l[p.value]).length>0).map(p=>({query:`(min-width: ${i.breakpoints[p.value]})`,styles:l[p.value]}));return a.jsx(Hw,{styles:o,media:h,selector:r})}function i3(t){return typeof t=="object"&&t!==null?Kr(t):[]}function mne(t){return t.sort((e,n)=>Hg(e)-Hg(n))}function gne({spacing:t,verticalSpacing:e,cols:n}){const r=Array.from(new Set([...i3(t),...i3(e),...i3(n)]));return mne(r)}function vne({spacing:t,verticalSpacing:e,cols:n,selector:r}){var h;const i=e===void 0?t:e,s=Pv({"--sg-spacing-x":Hi(Mp(t)),"--sg-spacing-y":Hi(Mp(i)),"--sg-cols":(h=Mp(n))==null?void 0:h.toString()}),o=gne({spacing:t,verticalSpacing:e,cols:n}),l=o.reduce((f,p)=>(f[p]||(f[p]={}),typeof t=="object"&&t[p]!==void 0&&(f[p]["--sg-spacing-x"]=Hi(t[p])),typeof i=="object"&&i[p]!==void 0&&(f[p]["--sg-spacing-y"]=Hi(i[p])),typeof n=="object"&&n[p]!==void 0&&(f[p]["--sg-cols"]=n[p]),f),{}),u=o.map(f=>({query:`simple-grid (min-width: ${f})`,styles:l[f]}));return a.jsx(Hw,{styles:s,container:u,selector:r})}const bne={cols:1,spacing:"md",type:"media"},C2=Ae((t,e)=>{const n=Se("SimpleGrid",bne,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,cols:h,verticalSpacing:f,spacing:p,type:m,attributes:v,...b}=n,x=lt({name:"SimpleGrid",classes:ZI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:v,vars:u}),w=F7();return m==="container"?a.jsxs(a.Fragment,{children:[a.jsx(vne,{...n,selector:`.${w}`}),a.jsx("div",{...x("container"),children:a.jsx(ve,{ref:e,...x("root",{className:w}),...b})})]}):a.jsxs(a.Fragment,{children:[a.jsx(pne,{...n,selector:`.${w}`}),a.jsx(ve,{ref:e,...x("root",{className:w}),...b})]})});C2.classes=ZI;C2.displayName="@mantine/core/SimpleGrid";var JI={root:"m_18320242","skeleton-fade":"m_299c329c"};const yne={visible:!0,animate:!0},xne=(t,{width:e,height:n,radius:r,circle:i})=>({root:{"--skeleton-height":de(n),"--skeleton-width":de(i?n:e),"--skeleton-radius":i?"1000px":r===void 0?void 0:Zn(r)}}),xo=Ae((t,e)=>{const n=Se("Skeleton",yne,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,width:h,height:f,circle:p,visible:m,radius:v,animate:b,mod:x,attributes:w,...S}=n,_=lt({name:"Skeleton",classes:JI,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:w,vars:u,varsResolver:xne});return a.jsx(ve,{ref:e,..._("root"),mod:[{visible:m,animate:b},x],...S})});xo.classes=JI;xo.displayName="@mantine/core/Skeleton";const eB=Ae((t,e)=>{const{w:n,h:r,miw:i,mih:s,...o}=Se("Space",null,t);return a.jsx(ve,{ref:e,...o,w:n,miw:i??n,h:r,mih:s??r})});eB.displayName="@mantine/core/Space";var tB={root:"m_6d731127"};const wne={gap:"md",align:"stretch",justify:"flex-start"},Sne=(t,{gap:e,align:n,justify:r})=>({root:{"--stack-gap":Hi(e),"--stack-align":n,"--stack-justify":r}}),En=Ae((t,e)=>{const n=Se("Stack",wne,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,align:h,justify:f,gap:p,variant:m,attributes:v,...b}=n,x=lt({name:"Stack",props:n,classes:tB,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:v,vars:u,varsResolver:Sne});return a.jsx(ve,{ref:e,...x("root"),variant:m,...b})});En.classes=tB;En.displayName="@mantine/core/Stack";var nB={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const rB=M.createContext(null),jne=rB.Provider,_ne=()=>M.useContext(rB),YO=Ae((t,e)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:o,children:l,readOnly:u,disabled:h,...f}=Se("SwitchGroup",null,t),[p,m]=Qi({value:n,defaultValue:r,finalValue:[],onChange:i}),v=b=>{const x=b.currentTarget.value;!u&&m(p.includes(x)?p.filter(w=>w!==x):[...p,x])};return a.jsx(jne,{value:{value:p,onChange:v,size:s,disabled:h},children:a.jsx(Mr.Wrapper,{size:s,ref:e,...o,...f,labelElement:"div",__staticSelector:"SwitchGroup",children:a.jsx(mI,{role:"group",children:l})})})});YO.classes=Mr.Wrapper.classes;YO.displayName="@mantine/core/SwitchGroup";const Tne={labelPosition:"right",withThumbIndicator:!0},Cne=(t,{radius:e,color:n,size:r})=>({root:{"--switch-radius":e===void 0?void 0:Zn(e),"--switch-height":zt(r,"switch-height"),"--switch-width":zt(r,"switch-width"),"--switch-thumb-size":zt(r,"switch-thumb-size"),"--switch-label-font-size":zt(r,"switch-label-font-size"),"--switch-track-label-padding":zt(r,"switch-track-label-padding"),"--switch-color":n?hr(n,t):void 0}}),k2=Ae((t,e)=>{const n=Se("Switch",Tne,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,color:h,label:f,offLabel:p,onLabel:m,id:v,size:b,radius:x,wrapperProps:w,thumbIcon:S,checked:_,defaultChecked:T,onChange:C,labelPosition:j,description:A,error:E,disabled:R,variant:N,rootRef:$,mod:D,withThumbIndicator:F,attributes:Q,...H}=n,q=_ne(),P=b||(q==null?void 0:q.size),I=lt({name:"Switch",props:n,classes:nB,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:Q,vars:u,varsResolver:Cne}),{styleProps:U,rest:Z}=Bv(H),X=Ei(v),V={checked:(q==null?void 0:q.value.includes(Z.value))??_,onChange:te=>{q==null||q.onChange(te),C==null||C(te)},disabled:(q==null?void 0:q.disabled)??R},[G,W]=Qi({value:V.checked??_,defaultValue:T,finalValue:!1});return a.jsxs(vO,{...I("root"),__staticSelector:"Switch",__stylesApiProps:n,id:X,size:P,labelPosition:j,label:f,description:A,error:E,disabled:V.disabled,bodyElement:"label",labelElement:"span",classNames:r,styles:o,unstyled:l,"data-checked":V.checked,variant:N,ref:$,mod:D,...U,...w,children:[a.jsx("input",{...Z,...V,checked:G,"data-checked":V.checked,onChange:te=>{var oe;(oe=V.onChange)==null||oe.call(V,te),W(te.currentTarget.checked)},id:X,ref:e,type:"checkbox",role:"switch",...I("input")}),a.jsxs(ve,{"aria-hidden":"true",component:"span",mod:{error:E,"label-position":j,"without-labels":!m&&!p},...I("track"),children:[a.jsx(ve,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":F&&!S},...I("thumb"),children:S}),a.jsx("span",{...I("trackLabel"),children:G?m:p})]})]})});k2.classes={...nB,...uI};k2.displayName="@mantine/core/Switch";k2.Group=YO;const[kne,One]=Wi("Table component was not found in the tree");var Gv={table:"m_b23fa0ef",th:"m_4e7aa4f3",tr:"m_4e7aa4fd",td:"m_4e7aa4ef",tbody:"m_b2404537",thead:"m_b242d975",caption:"m_9e5a3ac7",scrollContainer:"m_a100c15",scrollContainerInner:"m_62259741"};function Ene(t,e){if(!e)return;const n={};return e.columnBorder&&t.withColumnBorders&&(n["data-with-column-border"]=!0),e.rowBorder&&t.withRowBorders&&(n["data-with-row-border"]=!0),e.striped&&t.striped&&(n["data-striped"]=t.striped),e.highlightOnHover&&t.highlightOnHover&&(n["data-hover"]=!0),e.captionSide&&t.captionSide&&(n["data-side"]=t.captionSide),e.stickyHeader&&t.stickyHeader&&(n["data-sticky"]=!0),n}function Tf(t,e){const n=`Table${t.charAt(0).toUpperCase()}${t.slice(1)}`,r=Ae((i,s)=>{const o=Se(n,{},i),{classNames:l,className:u,style:h,styles:f,...p}=o,m=One();return a.jsx(ve,{component:t,ref:s,...Ene(m,e),...m.getStyles(t,{className:u,classNames:l,style:h,styles:f,props:o}),...p})});return r.displayName=`@mantine/core/${n}`,r.classes=Gv,r}const mC=Tf("th",{columnBorder:!0}),iB=Tf("td",{columnBorder:!0}),I1=Tf("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),sB=Tf("thead",{stickyHeader:!0}),aB=Tf("tbody"),oB=Tf("tfoot"),lB=Tf("caption",{captionSide:!0});function XO({data:t}){return a.jsxs(a.Fragment,{children:[t.caption&&a.jsx(lB,{children:t.caption}),t.head&&a.jsx(sB,{children:a.jsx(I1,{children:t.head.map((e,n)=>a.jsx(mC,{children:e},n))})}),t.body&&a.jsx(aB,{children:t.body.map((e,n)=>a.jsx(I1,{children:e.map((r,i)=>a.jsx(iB,{children:r},i))},n))}),t.foot&&a.jsx(oB,{children:a.jsx(I1,{children:t.foot.map((e,n)=>a.jsx(mC,{children:e},n))})})]})}XO.displayName="@mantine/core/TableDataRenderer";const Ane={type:"scrollarea"},Mne=(t,{minWidth:e,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":de(e),"--table-max-height":de(n),"--table-overflow":r==="native"?"auto":void 0}}),GO=Ae((t,e)=>{const n=Se("TableScrollContainer",Ane,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,children:h,minWidth:f,maxHeight:p,type:m,scrollAreaProps:v,attributes:b,...x}=n,w=lt({name:"TableScrollContainer",classes:Gv,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:b,vars:u,varsResolver:Mne,rootSelector:"scrollContainer"});return a.jsx(ve,{component:m==="scrollarea"?Fa:"div",...m==="scrollarea"?p?{offsetScrollbars:"xy",...v}:{offsetScrollbars:"x",...v}:{},ref:e,...w("scrollContainer"),...x,children:a.jsx("div",{...w("scrollContainerInner"),children:h})})});GO.classes=Gv;GO.displayName="@mantine/core/TableScrollContainer";const Rne={withRowBorders:!0,verticalSpacing:7},Dne=(t,{layout:e,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:s,stripedColor:o,highlightOnHoverColor:l,striped:u,highlightOnHover:h,stickyHeaderOffset:f,stickyHeader:p})=>({table:{"--table-layout":e,"--table-caption-side":n,"--table-horizontal-spacing":Hi(r),"--table-vertical-spacing":Hi(i),"--table-border-color":s?hr(s,t):void 0,"--table-striped-color":u&&o?hr(o,t):void 0,"--table-highlight-on-hover-color":h&&l?hr(l,t):void 0,"--table-sticky-header-offset":p?de(f):void 0}}),re=Ae((t,e)=>{const n=Se("Table",Rne,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,horizontalSpacing:h,verticalSpacing:f,captionSide:p,stripedColor:m,highlightOnHoverColor:v,striped:b,highlightOnHover:x,withColumnBorders:w,withRowBorders:S,withTableBorder:_,borderColor:T,layout:C,variant:j,data:A,children:E,stickyHeader:R,stickyHeaderOffset:N,mod:$,tabularNums:D,attributes:F,...Q}=n,H=lt({name:"Table",props:n,className:i,style:s,classes:Gv,classNames:r,styles:o,unstyled:l,attributes:F,rootSelector:"table",vars:u,varsResolver:Dne});return a.jsx(kne,{value:{getStyles:H,stickyHeader:R,striped:b===!0?"odd":b||void 0,highlightOnHover:x,withColumnBorders:w,withRowBorders:S,captionSide:p||"bottom"},children:a.jsx(ve,{component:"table",variant:j,ref:e,mod:[{"data-with-table-border":_,"data-tabular-nums":D},$],...H("table"),...Q,children:E||!!A&&a.jsx(XO,{data:A})})})});re.classes=Gv;re.displayName="@mantine/core/Table";re.Td=iB;re.Th=mC;re.Tr=I1;re.Thead=sB;re.Tbody=aB;re.Tfoot=oB;re.Caption=lB;re.ScrollContainer=GO;re.DataRenderer=XO;const[Nne,KO]=Wi("Tabs component was not found in the tree");var Kv={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",tab:"m_4ec4dce6",panel:"m_b0c91715",tabSection:"m_fc420b1f",tabLabel:"m_42bbd1ae","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const ZO=Ae((t,e)=>{const n=Se("TabsList",null,t),{children:r,className:i,grow:s,justify:o,classNames:l,styles:u,style:h,mod:f,...p}=n,m=KO();return a.jsx(ve,{...p,...m.getStyles("list",{className:i,style:h,classNames:l,styles:u,props:n,variant:m.variant}),ref:e,role:"tablist",variant:m.variant,mod:[{grow:s,orientation:m.orientation,placement:m.orientation==="vertical"&&m.placement,inverted:m.inverted},f],"aria-orientation":m.orientation,__vars:{"--tabs-justify":o},children:r})});ZO.classes=Kv;ZO.displayName="@mantine/core/TabsList";const JO=Ae((t,e)=>{const n=Se("TabsPanel",null,t),{children:r,className:i,value:s,classNames:o,styles:l,style:u,mod:h,keepMounted:f,...p}=n,m=KO(),v=m.value===s,b=m.keepMounted||f||v?r:null;return a.jsx(ve,{...m.getStyles("panel",{className:i,classNames:o,styles:l,style:[u,v?void 0:{display:"none"}],props:n}),ref:e,mod:[{orientation:m.orientation},h],role:"tabpanel",id:m.getPanelId(s),"aria-labelledby":m.getTabId(s),...p,children:b})});JO.classes=Kv;JO.displayName="@mantine/core/TabsPanel";const e4=Ae((t,e)=>{const n=Se("TabsTab",null,t),{className:r,children:i,rightSection:s,leftSection:o,value:l,onClick:u,onKeyDown:h,disabled:f,color:p,style:m,classNames:v,styles:b,vars:x,mod:w,tabIndex:S,..._}=n,T=yi(),{dir:C}=_f(),j=KO(),A=l===j.value,E=N=>{j.onChange(j.allowTabDeactivation&&l===j.value?null:l),u==null||u(N)},R={classNames:v,styles:b,props:n};return a.jsxs(Dr,{...j.getStyles("tab",{className:r,style:m,variant:j.variant,...R}),disabled:f,unstyled:j.unstyled,variant:j.variant,mod:[{active:A,disabled:f,orientation:j.orientation,inverted:j.inverted,placement:j.orientation==="vertical"&&j.placement},w],ref:e,role:"tab",id:j.getTabId(l),"aria-selected":A,tabIndex:S!==void 0?S:A||j.value===null?0:-1,"aria-controls":j.getPanelId(l),onClick:E,__vars:{"--tabs-color":p?hr(p,T):void 0},onKeyDown:Nw({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:j.activateTabWithKeyboard,loop:j.loop,orientation:j.orientation||"horizontal",dir:C,onKeyDown:h}),..._,children:[o&&a.jsx("span",{...j.getStyles("tabSection",R),"data-position":"left",children:o}),i&&a.jsx("span",{...j.getStyles("tabLabel",R),children:i}),s&&a.jsx("span",{...j.getStyles("tabSection",R),"data-position":"right",children:s})]})});e4.classes=Kv;e4.displayName="@mantine/core/TabsTab";const bR="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",Pne={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},Lne=(t,{radius:e,color:n,autoContrast:r})=>({root:{"--tabs-radius":Zn(e),"--tabs-color":hr(n,t),"--tabs-text-color":Lm(r,t)?Uh({color:n,theme:t,autoContrast:r}):void 0}}),Pa=Ae((t,e)=>{const n=Se("Tabs",Pne,t),{defaultValue:r,value:i,onChange:s,orientation:o,children:l,loop:u,id:h,activateTabWithKeyboard:f,allowTabDeactivation:p,variant:m,color:v,radius:b,inverted:x,placement:w,keepMounted:S,classNames:_,styles:T,unstyled:C,className:j,style:A,vars:E,autoContrast:R,mod:N,attributes:$,...D}=n,F=Ei(h),[Q,H]=Qi({value:i,defaultValue:r,finalValue:null,onChange:s}),q=lt({name:"Tabs",props:n,classes:Kv,className:j,style:A,classNames:_,styles:T,unstyled:C,attributes:$,vars:E,varsResolver:Lne});return a.jsx(Nne,{value:{placement:w,value:Q,orientation:o,id:F,loop:u,activateTabWithKeyboard:f,getTabId:mx(`${F}-tab`,bR),getPanelId:mx(`${F}-panel`,bR),onChange:H,allowTabDeactivation:p,variant:m,color:v,radius:b,inverted:x,keepMounted:S,unstyled:C,getStyles:q},children:a.jsx(ve,{ref:e,id:F,variant:m,mod:[{orientation:o,inverted:o==="horizontal"&&x,placement:o==="vertical"&&w},N],...q("root"),...D,children:l})})});Pa.classes=Kv;Pa.displayName="@mantine/core/Tabs";Pa.Tab=e4;Pa.Panel=JO;Pa.List=ZO;const ec=Ae((t,e)=>{const n=Se("TextInput",null,t);return a.jsx(Ha,{component:"input",ref:e,...n,__staticSelector:"TextInput"})});ec.classes=Ha.classes;ec.displayName="@mantine/core/TextInput";/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var $ne={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const St=(t,e,n,r)=>{const i=M.forwardRef(({color:s="currentColor",size:o=24,stroke:l=2,title:u,className:h,children:f,...p},m)=>M.createElement("svg",{ref:m,...$ne[t],width:o,height:o,className:["tabler-icon",`tabler-icon-${e}`,h].join(" "),...t==="filled"?{fill:s}:{strokeWidth:l,stroke:s},...p},[u&&M.createElement("title",{key:"svg-title"},u),...r.map(([v,b])=>M.createElement(v,b)),...Array.isArray(f)?f:[f]]));return i.displayName=`${n}`,i};/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ine=[["path",{d:"M12 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M6 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M15 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]],Bne=St("outline","adjustments-horizontal","AdjustmentsHorizontal",Ine);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const zne=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],qne=St("outline","alert-circle","AlertCircle",zne);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fne=[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],Ui=St("outline","alert-triangle","AlertTriangle",Fne);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hne=[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l12 0",key:"svg-2"}]],Vne=St("outline","align-justified","AlignJustified",Hne);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Une=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]],yR=St("outline","arrow-down","ArrowDown",Une);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qne=[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M5 12l6 6",key:"svg-1"}],["path",{d:"M5 12l6 -6",key:"svg-2"}]],Wne=St("outline","arrow-left","ArrowLeft",Qne);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yne=[["path",{d:"M9.346 5.353c.21 -.129 .428 -.246 .654 -.353a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3m-1 3h-13a4 4 0 0 0 2 -3v-3a6.996 6.996 0 0 1 1.273 -3.707",key:"svg-0"}],["path",{d:"M9 17v1a3 3 0 0 0 6 0v-1",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]],Xne=St("outline","bell-off","BellOff",Yne);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gne=[["path",{d:"M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6",key:"svg-0"}],["path",{d:"M9 17v1a3 3 0 0 0 6 0v-1",key:"svg-1"}]],t4=St("outline","bell","Bell",Gne);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kne=[["path",{d:"M6 20a2 2 0 1 0 -4 0a2 2 0 0 0 4 0",key:"svg-0"}],["path",{d:"M16 4a2 2 0 1 0 -4 0a2 2 0 0 0 4 0",key:"svg-1"}],["path",{d:"M16 20a2 2 0 1 0 -4 0a2 2 0 0 0 4 0",key:"svg-2"}],["path",{d:"M11 12a2 2 0 1 0 -4 0a2 2 0 0 0 4 0",key:"svg-3"}],["path",{d:"M21 12a2 2 0 1 0 -4 0a2 2 0 0 0 4 0",key:"svg-4"}],["path",{d:"M5.058 18.306l2.88 -4.606",key:"svg-5"}],["path",{d:"M10.061 10.303l2.877 -4.604",key:"svg-6"}],["path",{d:"M10.065 13.705l2.876 4.6",key:"svg-7"}],["path",{d:"M15.063 5.7l2.881 4.61",key:"svg-8"}]],Zne=St("outline","binary-tree","BinaryTree",Kne);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jne=[["path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0",key:"svg-0"}],["path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0",key:"svg-1"}],["path",{d:"M3 6l0 13",key:"svg-2"}],["path",{d:"M12 6l0 13",key:"svg-3"}],["path",{d:"M21 6l0 13",key:"svg-4"}]],ere=St("outline","book","Book",Jne);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const tre=[["path",{d:"M4 19l16 0",key:"svg-0"}],["path",{d:"M4 15l4 -6l4 2l4 -5l4 4",key:"svg-1"}]],nre=St("outline","chart-line","ChartLine",tre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const rre=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],cB=St("outline","check","Check",rre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ire=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],Gg=St("outline","chevron-down","ChevronDown",ire);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const sre=[["path",{d:"M15 6l-6 6l6 6",key:"svg-0"}]],are=St("outline","chevron-left","ChevronLeft",sre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ore=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],uB=St("outline","chevron-right","ChevronRight",ore);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const lre=[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]],n4=St("outline","chevron-up","ChevronUp",lre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const cre=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]],ure=St("outline","circle-minus","CircleMinus",cre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const hre=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]],dre=St("outline","circle-plus","CirclePlus",hre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const fre=[["path",{d:"M20.942 13.018a9 9 0 1 0 -7.909 7.922",key:"svg-0"}],["path",{d:"M12 7v5l2 2",key:"svg-1"}],["path",{d:"M17 17v5",key:"svg-2"}],["path",{d:"M21 17v5",key:"svg-3"}]],pre=St("outline","clock-pause","ClockPause",fre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const mre=[["path",{d:"M12 7v5l2 2",key:"svg-0"}],["path",{d:"M17 22l5 -3l-5 -3l0 6",key:"svg-1"}],["path",{d:"M13.017 20.943a9 9 0 1 1 7.831 -7.292",key:"svg-2"}]],gre=St("outline","clock-play","ClockPlay",mre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const vre=[["path",{d:"M5 9.897c0 -1.714 1.46 -3.104 3.26 -3.104c.275 -1.22 1.255 -2.215 2.572 -2.611c1.317 -.397 2.77 -.134 3.811 .69c1.042 .822 1.514 2.08 1.239 3.3h.693a2.42 2.42 0 0 1 2.425 2.414a2.42 2.42 0 0 1 -2.425 2.414h-8.315c-1.8 0 -3.26 -1.39 -3.26 -3.103",key:"svg-0"}],["path",{d:"M12 13v3",key:"svg-1"}],["path",{d:"M10 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-2"}],["path",{d:"M14 18h7",key:"svg-3"}],["path",{d:"M3 18h7",key:"svg-4"}]],bre=St("outline","cloud-data-connection","CloudDataConnection",vre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const yre=[["path",{d:"M9 12h6",key:"svg-0"}],["path",{d:"M12 9v6",key:"svg-1"}],["path",{d:"M6 19a2 2 0 0 1 -2 -2v-4l-1 -1l1 -1v-4a2 2 0 0 1 2 -2",key:"svg-2"}],["path",{d:"M18 19a2 2 0 0 0 2 -2v-4l1 -1l-1 -1v-4a2 2 0 0 0 -2 -2",key:"svg-3"}]],hB=St("outline","code-plus","CodePlus",yre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const xre=[["path",{d:"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],r4=St("outline","copy","Copy",xre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const wre=[["path",{d:"M4 6a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]],Sre=St("outline","database","Database",wre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const jre=[["path",{d:"M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1l0 -10",key:"svg-0"}],["path",{d:"M7 20h10",key:"svg-1"}],["path",{d:"M9 16v4",key:"svg-2"}],["path",{d:"M15 16v4",key:"svg-3"}],["path",{d:"M9 12v-4",key:"svg-4"}],["path",{d:"M12 12v-1",key:"svg-5"}],["path",{d:"M15 12v-2",key:"svg-6"}],["path",{d:"M12 12v-1",key:"svg-7"}]],_re=St("outline","device-desktop-analytics","DeviceDesktopAnalytics",jre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tre=[["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M11 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],Cre=St("outline","dots-vertical","DotsVertical",Tre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const kre=[["path",{d:"M5 5a5 5 0 0 1 7 0a5 5 0 0 0 7 0v9a5 5 0 0 1 -7 0a5 5 0 0 0 -7 0v-9",key:"svg-0"}],["path",{d:"M5 21v-7",key:"svg-1"}]],Ore=St("outline","flag","Flag",kre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ere=[["path",{d:"M4 18v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2",key:"svg-0"}],["path",{d:"M7 14l3 -3l2 2l3 -3l2 2",key:"svg-1"}]],Are=St("outline","graph","Graph",Ere);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mre=[["path",{d:"M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1l0 -10",key:"svg-0"}],["path",{d:"M7 20h10",key:"svg-1"}],["path",{d:"M9 16v4",key:"svg-2"}],["path",{d:"M15 16v4",key:"svg-3"}],["path",{d:"M7 10h2l2 3l2 -6l1 3h3",key:"svg-4"}]],dB=St("outline","heart-rate-monitor","HeartRateMonitor",Mre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rre=[["path",{d:"M6.5 7h11",key:"svg-0"}],["path",{d:"M6.5 17h11",key:"svg-1"}],["path",{d:"M6 20v-2a6 6 0 1 1 12 0v2a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1",key:"svg-2"}],["path",{d:"M6 4v2a6 6 0 1 0 12 0v-2a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1",key:"svg-3"}]],gC=St("outline","hourglass","Hourglass",Rre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dre=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 9h.01",key:"svg-1"}],["path",{d:"M11 12h1v4h1",key:"svg-2"}]],Gn=St("outline","info-circle","InfoCircle",Dre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nre=[["path",{d:"M4 18v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2",key:"svg-0"}],["path",{d:"M4 9h16",key:"svg-1"}],["path",{d:"M10 16l2 -2l2 2",key:"svg-2"}]],fB=St("outline","layout-navbar-collapse","LayoutNavbarCollapse",Nre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pre=[["path",{d:"M4 18v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2",key:"svg-0"}],["path",{d:"M4 9h16",key:"svg-1"}],["path",{d:"M10 14l2 2l2 -2",key:"svg-2"}]],pB=St("outline","layout-navbar-expand","LayoutNavbarExpand",Pre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lre=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M15 18h-2l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v5.5",key:"svg-2"}],["path",{d:"M19 16v3",key:"svg-3"}],["path",{d:"M19 22v.01",key:"svg-4"}]],$re=St("outline","message-exclamation","MessageExclamation",Lre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ire=[["path",{d:"M5 12l14 0",key:"svg-0"}]],Bre=St("outline","minus","Minus",Ire);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const zre=[["path",{d:"M6.528 6.536a6 6 0 0 0 7.942 7.933m2.247 -1.76a6 6 0 0 0 -8.427 -8.425",key:"svg-0"}],["path",{d:"M12 3c1.333 .333 2 2.333 2 6c0 .337 -.006 .66 -.017 .968m-.55 3.473c-.333 .884 -.81 1.403 -1.433 1.559",key:"svg-1"}],["path",{d:"M12 3c-.936 .234 -1.544 1.29 -1.822 3.167m-.16 3.838c.116 3.029 .776 4.695 1.982 4.995",key:"svg-2"}],["path",{d:"M6 9h3m4 0h5",key:"svg-3"}],["path",{d:"M3 20h7",key:"svg-4"}],["path",{d:"M14 20h7",key:"svg-5"}],["path",{d:"M10 20a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-6"}],["path",{d:"M12 15v3",key:"svg-7"}],["path",{d:"M3 3l18 18",key:"svg-8"}]],qre=St("outline","network-off","NetworkOff",zre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fre=[["path",{d:"M20 16l-4 4",key:"svg-0"}],["path",{d:"M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5",key:"svg-1"}],["path",{d:"M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5",key:"svg-2"}],["path",{d:"M3 21l2.5 -2.5",key:"svg-3"}],["path",{d:"M18.5 5.5l2.5 -2.5",key:"svg-4"}],["path",{d:"M10 11l-2 2",key:"svg-5"}],["path",{d:"M13 14l-2 2",key:"svg-6"}],["path",{d:"M16 16l4 4",key:"svg-7"}]],Hre=St("outline","plug-connected-x","PlugConnectedX",Fre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vre=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],mB=St("outline","plus","Plus",Vre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ure=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],vC=St("outline","refresh","Refresh",Ure);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qre=[["path",{d:"M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3",key:"svg-0"}],["path",{d:"M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3",key:"svg-1"}]],gB=St("outline","repeat","Repeat",Qre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wre=[["path",{d:"M3 4a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4",key:"svg-0"}],["path",{d:"M15 16a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4",key:"svg-1"}],["path",{d:"M21 11v-3a2 2 0 0 0 -2 -2h-6l3 3m0 -6l-3 3",key:"svg-2"}],["path",{d:"M3 13v3a2 2 0 0 0 2 2h6l-3 -3m0 6l3 -3",key:"svg-3"}]],vB=St("outline","replace","Replace",Wre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yre=[["path",{d:"M12 4a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M4 17l5 1l.75 -1.5",key:"svg-1"}],["path",{d:"M15 21l0 -4l-4 -3l1 -6",key:"svg-2"}],["path",{d:"M7 12l0 -3l5 -1l3 3l3 1",key:"svg-3"}]],Xre=St("outline","run","Run",Yre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gre=[["path",{d:"M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],Xh=St("outline","search","Search",Gre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kre=[["path",{d:"M8 9l4 -4l4 4",key:"svg-0"}],["path",{d:"M16 15l-4 4l-4 -4",key:"svg-1"}]],Zre=St("outline","selector","Selector",Kre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jre=[["path",{d:"M3 7a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-2",key:"svg-0"}],["path",{d:"M12 20h-6a3 3 0 0 1 -3 -3v-2a3 3 0 0 1 3 -3h10.5",key:"svg-1"}],["path",{d:"M16 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-2"}],["path",{d:"M18 14.5v1.5",key:"svg-3"}],["path",{d:"M18 20v1.5",key:"svg-4"}],["path",{d:"M21.032 16.25l-1.299 .75",key:"svg-5"}],["path",{d:"M16.27 19l-1.3 .75",key:"svg-6"}],["path",{d:"M14.97 16.25l1.3 .75",key:"svg-7"}],["path",{d:"M19.733 19l1.3 .75",key:"svg-8"}],["path",{d:"M7 8v.01",key:"svg-9"}],["path",{d:"M7 16v.01",key:"svg-10"}]],eie=St("outline","server-cog","ServerCog",Jre);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const tie=[["path",{d:"M3 7a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3",key:"svg-0"}],["path",{d:"M3 15a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3l0 -2",key:"svg-1"}],["path",{d:"M7 8l0 .01",key:"svg-2"}],["path",{d:"M7 16l0 .01",key:"svg-3"}]],nie=St("outline","server","Server",tie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const rie=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],iie=St("outline","settings","Settings",rie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const sie=[["path",{d:"M3 11h18",key:"svg-0"}],["path",{d:"M5 11v-4a3 3 0 0 1 3 -3h8a3 3 0 0 1 3 3v4",key:"svg-1"}],["path",{d:"M4 17a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}],["path",{d:"M14 17a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-3"}],["path",{d:"M10 17h4",key:"svg-4"}]],aie=St("outline","spy","Spy",sie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const oie=[["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}]],bB=St("outline","table","Table",oie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const lie=[["path",{d:"M3 8v4.172a2 2 0 0 0 .586 1.414l5.71 5.71a2.41 2.41 0 0 0 3.408 0l3.592 -3.592a2.41 2.41 0 0 0 0 -3.408l-5.71 -5.71a2 2 0 0 0 -1.414 -.586h-4.172a2 2 0 0 0 -2 2",key:"svg-0"}],["path",{d:"M18 19l1.592 -1.592a4.82 4.82 0 0 0 0 -6.816l-4.592 -4.592",key:"svg-1"}],["path",{d:"M7 10h-.01",key:"svg-2"}]],cie=St("outline","tags","Tags",lie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const uie=[["path",{d:"M5 7l5 5l-5 5",key:"svg-0"}],["path",{d:"M12 19l7 0",key:"svg-1"}]],hie=St("outline","terminal","Terminal",uie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const die=[["path",{d:"M4 16l6 -7l5 5l5 -6",key:"svg-0"}],["path",{d:"M14 14a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M9 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M3 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}],["path",{d:"M19 8a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}]],fie=St("outline","timeline","Timeline",die);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const pie=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],mie=St("outline","trash","Trash",pie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const gie=[["path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12",key:"svg-0"}],["path",{d:"M4 8h16",key:"svg-1"}],["path",{d:"M20 12h-16",key:"svg-2"}],["path",{d:"M4 16h16",key:"svg-3"}],["path",{d:"M9 4v4",key:"svg-4"}],["path",{d:"M14 8v4",key:"svg-5"}],["path",{d:"M8 12v4",key:"svg-6"}],["path",{d:"M16 12v4",key:"svg-7"}],["path",{d:"M11 16v4",key:"svg-8"}]],vie=St("outline","wall","Wall",gie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const bie=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],yie=St("outline","x","X",bie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const xie=[["path",{d:"M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}],["path",{d:"M8 8l-2 2l2 2",key:"svg-2"}],["path",{d:"M12 8l2 2l-2 2",key:"svg-3"}]],wie=St("outline","zoom-code","ZoomCode",xie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sie=[["path",{d:"M14.235 19c.865 0 1.322 1.024 .745 1.668a3.992 3.992 0 0 1 -2.98 1.332a3.992 3.992 0 0 1 -2.98 -1.332c-.552 -.616 -.158 -1.579 .634 -1.661l.11 -.006h4.471z",key:"svg-0"}],["path",{d:"M12 2c1.358 0 2.506 .903 2.875 2.141l.046 .171l.008 .043a8.013 8.013 0 0 1 4.024 6.069l.028 .287l.019 .289v2.931l.021 .136a3 3 0 0 0 1.143 1.847l.167 .117l.162 .099c.86 .487 .56 1.766 -.377 1.864l-.116 .006h-16c-1.028 0 -1.387 -1.364 -.493 -1.87a3 3 0 0 0 1.472 -2.063l.021 -.143l.001 -2.97a8 8 0 0 1 3.821 -6.454l.248 -.146l.01 -.043a3.003 3.003 0 0 1 2.562 -2.29l.182 -.017l.176 -.004z",key:"svg-1"}]],jie=St("filled","bell-filled","BellFilled",Sie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const _ie=[["path",{d:"M17 3.34a10 10 0 1 1 -15 8.66l.005 -.324a10 10 0 0 1 14.995 -8.336m-9 1.732a8 8 0 0 0 4.001 14.928l-.001 -16a8 8 0 0 0 -4 1.072",key:"svg-0"}]],Tie=St("filled","brightness-filled","BrightnessFilled",_ie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cie=[["path",{d:"M20 18a1 1 0 0 1 .117 1.993l-.117 .007h-16a1 1 0 0 1 -.117 -1.993l.117 -.007h16z",key:"svg-0"}],["path",{d:"M15.22 5.375a1 1 0 0 1 1.393 -.165l.094 .083l4 4a1 1 0 0 1 .284 .576l.009 .131v5a1 1 0 0 1 -.883 .993l-.117 .007h-16.022l-.11 -.009l-.11 -.02l-.107 -.034l-.105 -.046l-.1 -.059l-.094 -.07l-.06 -.055l-.072 -.082l-.064 -.089l-.054 -.096l-.016 -.035l-.04 -.103l-.027 -.106l-.015 -.108l-.004 -.11l.009 -.11l.019 -.105c.01 -.04 .022 -.077 .035 -.112l.046 -.105l.059 -.1l4 -6a1 1 0 0 1 1.165 -.39l.114 .05l3.277 1.638l3.495 -4.369z",key:"svg-1"}]],kie=St("filled","chart-area-filled","ChartAreaFilled",Cie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Oie=[["path",{d:"M12 1.992a10 10 0 1 0 9.236 13.838c.341 -.82 -.476 -1.644 -1.298 -1.31a6.5 6.5 0 0 1 -6.864 -10.787l.077 -.08c.551 -.63 .113 -1.653 -.758 -1.653h-.266l-.068 -.006l-.06 -.002z",key:"svg-0"}]],Eie=St("filled","moon-filled","MoonFilled",Oie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Aie=[["path",{d:"M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z",key:"svg-0"}]],s3=St("filled","point-filled","PointFilled",Aie);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mie=[["path",{d:"M12 19a1 1 0 0 1 .993 .883l.007 .117v1a1 1 0 0 1 -1.993 .117l-.007 -.117v-1a1 1 0 0 1 1 -1z",key:"svg-0"}],["path",{d:"M18.313 16.91l.094 .083l.7 .7a1 1 0 0 1 -1.32 1.497l-.094 -.083l-.7 -.7a1 1 0 0 1 1.218 -1.567l.102 .07z",key:"svg-1"}],["path",{d:"M7.007 16.993a1 1 0 0 1 .083 1.32l-.083 .094l-.7 .7a1 1 0 0 1 -1.497 -1.32l.083 -.094l.7 -.7a1 1 0 0 1 1.414 0z",key:"svg-2"}],["path",{d:"M4 11a1 1 0 0 1 .117 1.993l-.117 .007h-1a1 1 0 0 1 -.117 -1.993l.117 -.007h1z",key:"svg-3"}],["path",{d:"M21 11a1 1 0 0 1 .117 1.993l-.117 .007h-1a1 1 0 0 1 -.117 -1.993l.117 -.007h1z",key:"svg-4"}],["path",{d:"M6.213 4.81l.094 .083l.7 .7a1 1 0 0 1 -1.32 1.497l-.094 -.083l-.7 -.7a1 1 0 0 1 1.217 -1.567l.102 .07z",key:"svg-5"}],["path",{d:"M19.107 4.893a1 1 0 0 1 .083 1.32l-.083 .094l-.7 .7a1 1 0 0 1 -1.497 -1.32l.083 -.094l.7 -.7a1 1 0 0 1 1.414 0z",key:"svg-6"}],["path",{d:"M12 2a1 1 0 0 1 .993 .883l.007 .117v1a1 1 0 0 1 -1.993 .117l-.007 -.117v-1a1 1 0 0 1 1 -1z",key:"svg-7"}],["path",{d:"M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z",key:"svg-8"}]],Rie=St("filled","sun-filled","SunFilled",Mie);/**
 * react-router v7.13.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var xR="popstate";function Die(t={}){function e(r,i){let{pathname:s,search:o,hash:l}=r.location;return bC("",{pathname:s,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Kg(i)}return Pie(e,n,null,t)}function Pr(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function cl(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Nie(){return Math.random().toString(36).substring(2,10)}function wR(t,e){return{usr:t.state,key:t.key,idx:e}}function bC(t,e,n=null,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Wm(e):e,state:n,key:e&&e.key||r||Nie()}}function Kg({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Wm(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function Pie(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,l="POP",u=null,h=f();h==null&&(h=0,o.replaceState({...o.state,idx:h},""));function f(){return(o.state||{idx:null}).idx}function p(){l="POP";let w=f(),S=w==null?null:w-h;h=w,u&&u({action:l,location:x.location,delta:S})}function m(w,S){l="PUSH";let _=bC(x.location,w,S);h=f()+1;let T=wR(_,h),C=x.createHref(_);try{o.pushState(T,"",C)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(C)}s&&u&&u({action:l,location:x.location,delta:1})}function v(w,S){l="REPLACE";let _=bC(x.location,w,S);h=f();let T=wR(_,h),C=x.createHref(_);o.replaceState(T,"",C),s&&u&&u({action:l,location:x.location,delta:0})}function b(w){return Lie(w)}let x={get action(){return l},get location(){return t(i,o)},listen(w){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(xR,p),u=w,()=>{i.removeEventListener(xR,p),u=null}},createHref(w){return e(i,w)},createURL:b,encodeLocation(w){let S=b(w);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:m,replace:v,go(w){return o.go(w)}};return x}function Lie(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Pr(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:Kg(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function yB(t,e,n="/"){return $ie(t,e,n,!1)}function $ie(t,e,n,r){let i=typeof e=="string"?Wm(e):e,s=Kc(i.pathname||"/",n);if(s==null)return null;let o=xB(t);Iie(o);let l=null;for(let u=0;l==null&&u<o.length;++u){let h=Xie(s);l=Wie(o[u],h,r)}return l}function xB(t,e=[],n=[],r="",i=!1){let s=(o,l,u=i,h)=>{let f={relativePath:h===void 0?o.path||"":h,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&u)return;Pr(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let p=Wc([r,f.relativePath]),m=n.concat(f);o.children&&o.children.length>0&&(Pr(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),xB(o.children,e,m,p,u)),!(o.path==null&&!o.index)&&e.push({path:p,score:Uie(p,o.index),routesMeta:m})};return t.forEach((o,l)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))s(o,l);else for(let h of wB(o.path))s(o,l,!0,h)}),e}function wB(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=wB(r.join("/")),l=[];return l.push(...o.map(u=>u===""?s:[s,u].join("/"))),i&&l.push(...o),l.map(u=>t.startsWith("/")&&u===""?"/":u)}function Iie(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:Qie(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Bie=/^:[\w-]+$/,zie=3,qie=2,Fie=1,Hie=10,Vie=-2,SR=t=>t==="*";function Uie(t,e){let n=t.split("/"),r=n.length;return n.some(SR)&&(r+=Vie),e&&(r+=qie),n.filter(i=>!SR(i)).reduce((i,s)=>i+(Bie.test(s)?zie:s===""?Fie:Hie),r)}function Qie(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function Wie(t,e,n=!1){let{routesMeta:r}=t,i={},s="/",o=[];for(let l=0;l<r.length;++l){let u=r[l],h=l===r.length-1,f=s==="/"?e:e.slice(s.length)||"/",p=Ex({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},f),m=u.route;if(!p&&h&&n&&!r[r.length-1].route.index&&(p=Ex({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!p)return null;Object.assign(i,p.params),o.push({params:i,pathname:Wc([s,p.pathname]),pathnameBase:Jie(Wc([s,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(s=Wc([s,p.pathnameBase]))}return o}function Ex(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=Yie(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((h,{paramName:f,isOptional:p},m)=>{if(f==="*"){let b=l[m]||"";o=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const v=l[m];return p&&!v?h[f]=void 0:h[f]=(v||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:o,pattern:t}}function Yie(t,e=!1,n=!0){cl(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function Xie(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return cl(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function Kc(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}var Gie=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Kie(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Wm(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=jR(n.substring(1),"/"):s=jR(n,e)):s=e,{pathname:s,search:ese(r),hash:tse(i)}}function jR(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function a3(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` 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 Zie(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function i4(t){let e=Zie(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function s4(t,e,n,r=!1){let i;typeof t=="string"?i=Wm(t):(i={...t},Pr(!i.pathname||!i.pathname.includes("?"),a3("?","pathname","search",i)),Pr(!i.pathname||!i.pathname.includes("#"),a3("#","pathname","hash",i)),Pr(!i.search||!i.search.includes("#"),a3("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,l;if(o==null)l=n;else{let p=e.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),p-=1;i.pathname=m.join("/")}l=p>=0?e[p]:"/"}let u=Kie(i,l),h=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(h||f)&&(u.pathname+="/"),u}var Wc=t=>t.join("/").replace(/\/\/+/g,"/"),Jie=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),ese=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,tse=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,nse=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function rse(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function ise(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var SB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jB(t,e){let n=t;if(typeof n!="string"||!Gie.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(SB)try{let s=new URL(window.location.href),o=n.startsWith("//")?new URL(s.protocol+n):new URL(n),l=Kc(o.pathname,e);o.origin===s.origin&&l!=null?n=l+o.search+o.hash:i=!0}catch{cl(!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 _B=["POST","PUT","PATCH","DELETE"];new Set(_B);var sse=["GET",..._B];new Set(sse);var Cf=M.createContext(null);Cf.displayName="DataRouter";var O2=M.createContext(null);O2.displayName="DataRouterState";var ase=M.createContext(!1),TB=M.createContext({isTransitioning:!1});TB.displayName="ViewTransition";var ose=M.createContext(new Map);ose.displayName="Fetchers";var lse=M.createContext(null);lse.displayName="Await";var ma=M.createContext(null);ma.displayName="Navigation";var Zv=M.createContext(null);Zv.displayName="Location";var tc=M.createContext({outlet:null,matches:[],isDataRoute:!1});tc.displayName="Route";var a4=M.createContext(null);a4.displayName="RouteError";var CB="REACT_ROUTER_ERROR",cse="REDIRECT",use="ROUTE_ERROR_RESPONSE";function hse(t){if(t.startsWith(`${CB}:${cse}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function dse(t){if(t.startsWith(`${CB}:${use}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new nse(e.status,e.statusText,e.data)}catch{}}function fse(t,{relative:e}={}){Pr(Ym(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=M.useContext(ma),{hash:i,pathname:s,search:o}=Jv(t,{relative:e}),l=s;return n!=="/"&&(l=s==="/"?n:Wc([n,s])),r.createHref({pathname:l,search:o,hash:i})}function Ym(){return M.useContext(Zv)!=null}function nc(){return Pr(Ym(),"useLocation() may be used only in the context of a <Router> component."),M.useContext(Zv).location}var kB="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function OB(t){M.useContext(ma).static||M.useLayoutEffect(t)}function o4(){let{isDataRoute:t}=M.useContext(tc);return t?Cse():pse()}function pse(){Pr(Ym(),"useNavigate() may be used only in the context of a <Router> component.");let t=M.useContext(Cf),{basename:e,navigator:n}=M.useContext(ma),{matches:r}=M.useContext(tc),{pathname:i}=nc(),s=JSON.stringify(i4(r)),o=M.useRef(!1);return OB(()=>{o.current=!0}),M.useCallback((u,h={})=>{if(cl(o.current,kB),!o.current)return;if(typeof u=="number"){n.go(u);return}let f=s4(u,JSON.parse(s),i,h.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Wc([e,f.pathname])),(h.replace?n.replace:n.push)(f,h.state,h)},[e,n,s,i,t])}M.createContext(null);function Jv(t,{relative:e}={}){let{matches:n}=M.useContext(tc),{pathname:r}=nc(),i=JSON.stringify(i4(n));return M.useMemo(()=>s4(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function mse(t,e){return EB(t,e)}function EB(t,e,n,r,i){var _;Pr(Ym(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=M.useContext(ma),{matches:o}=M.useContext(tc),l=o[o.length-1],u=l?l.params:{},h=l?l.pathname:"/",f=l?l.pathnameBase:"/",p=l&&l.route;{let T=p&&p.path||"";MB(h,!p||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${T}">) 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.

Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let m=nc(),v;if(e){let T=typeof e=="string"?Wm(e):e;Pr(f==="/"||((_=T.pathname)==null?void 0:_.startsWith(f)),`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 "${f}" but pathname "${T.pathname}" was given in the \`location\` prop.`),v=T}else v=m;let b=v.pathname||"/",x=b;if(f!=="/"){let T=f.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(T.length).join("/")}let w=yB(t,{pathname:x});cl(p||w!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),cl(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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 S=xse(w&&w.map(T=>Object.assign({},T,{params:Object.assign({},u,T.params),pathname:Wc([f,s.encodeLocation?s.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?f:Wc([f,s.encodeLocation?s.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),o,n,r,i);return e&&S?M.createElement(Zv.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},S):S}function gse(){let t=Tse(),e=rse(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=M.createElement(M.Fragment,null,M.createElement("p",null,"💿 Hey developer 👋"),M.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",M.createElement("code",{style:s},"ErrorBoundary")," or"," ",M.createElement("code",{style:s},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},e),n?M.createElement("pre",{style:i},n):null,o)}var vse=M.createElement(gse,null),AB=class extends M.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=dse(t.digest);n&&(t=n)}let e=t!==void 0?M.createElement(tc.Provider,{value:this.props.routeContext},M.createElement(a4.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?M.createElement(bse,{error:t},e):e}};AB.contextType=ase;var o3=new WeakMap;function bse({children:t,error:e}){let{basename:n}=M.useContext(ma);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=hse(e.digest);if(r){let i=o3.get(e);if(i)throw i;let s=jB(r.location,n);if(SB&&!o3.get(e))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw o3.set(e,o),o}return M.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function yse({routeContext:t,match:e,children:n}){let r=M.useContext(Cf);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),M.createElement(tc.Provider,{value:t},n)}function xse(t,e=[],n=null,r=null,i=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,o=n==null?void 0:n.errors;if(o!=null){let f=s.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);Pr(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,f+1))}let l=!1,u=-1;if(n)for(let f=0;f<s.length;f++){let p=s[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=f),p.route.id){let{loaderData:m,errors:v}=n,b=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||b){l=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}let h=n&&r?(f,p)=>{var m,v;r(f,{location:n.location,params:((v=(m=n.matches)==null?void 0:m[0])==null?void 0:v.params)??{},unstable_pattern:ise(n.matches),errorInfo:p})}:void 0;return s.reduceRight((f,p,m)=>{let v,b=!1,x=null,w=null;n&&(v=o&&p.route.id?o[p.route.id]:void 0,x=p.route.errorElement||vse,l&&(u<0&&m===0?(MB("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,w=null):u===m&&(b=!0,w=p.route.hydrateFallbackElement||null)));let S=e.concat(s.slice(0,m+1)),_=()=>{let T;return v?T=x:b?T=w:p.route.Component?T=M.createElement(p.route.Component,null):p.route.element?T=p.route.element:T=f,M.createElement(yse,{match:p,routeContext:{outlet:f,matches:S,isDataRoute:n!=null},children:T})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?M.createElement(AB,{location:n.location,revalidation:n.revalidation,component:x,error:v,children:_(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:h}):_()},null)}function l4(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function wse(t){let e=M.useContext(Cf);return Pr(e,l4(t)),e}function Sse(t){let e=M.useContext(O2);return Pr(e,l4(t)),e}function jse(t){let e=M.useContext(tc);return Pr(e,l4(t)),e}function c4(t){let e=jse(t),n=e.matches[e.matches.length-1];return Pr(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function _se(){return c4("useRouteId")}function Tse(){var r;let t=M.useContext(a4),e=Sse("useRouteError"),n=c4("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function Cse(){let{router:t}=wse("useNavigate"),e=c4("useNavigate"),n=M.useRef(!1);return OB(()=>{n.current=!0}),M.useCallback(async(i,s={})=>{cl(n.current,kB),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var _R={};function MB(t,e,n){!e&&!_R[t]&&(_R[t]=!0,cl(!1,n))}M.memo(kse);function kse({routes:t,future:e,state:n,onError:r}){return EB(t,void 0,n,r,e)}function Ose({to:t,replace:e,state:n,relative:r}){Pr(Ym(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=M.useContext(ma);cl(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=M.useContext(tc),{pathname:o}=nc(),l=o4(),u=s4(t,i4(s),o,r==="path"),h=JSON.stringify(u);return M.useEffect(()=>{l(JSON.parse(h),{replace:e,state:n,relative:r})},[l,h,r,e,n]),null}function Yu(t){Pr(!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 Ese({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:o}){Pr(!Ym(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),u=M.useMemo(()=>({basename:l,navigator:i,static:s,unstable_useTransitions:o,future:{}}),[l,i,s,o]);typeof n=="string"&&(n=Wm(n));let{pathname:h="/",search:f="",hash:p="",state:m=null,key:v="default"}=n,b=M.useMemo(()=>{let x=Kc(h,l);return x==null?null:{location:{pathname:x,search:f,hash:p,state:m,key:v},navigationType:r}},[l,h,f,p,m,v,r]);return cl(b!=null,`<Router basename="${l}"> is not able to match the URL "${h}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:M.createElement(ma.Provider,{value:u},M.createElement(Zv.Provider,{children:e,value:b}))}function TR({children:t,location:e}){return mse(yC(t),e)}function yC(t,e=[]){let n=[];return M.Children.forEach(t,(r,i)=>{if(!M.isValidElement(r))return;let s=[...e,i];if(r.type===M.Fragment){n.push.apply(n,yC(r.props.children,s));return}Pr(r.type===Yu,`[${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>`),Pr(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||s.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&&(o.children=yC(r.props.children,s)),n.push(o)}),n}var B1="get",z1="application/x-www-form-urlencoded";function E2(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Ase(t){return E2(t)&&t.tagName.toLowerCase()==="button"}function Mse(t){return E2(t)&&t.tagName.toLowerCase()==="form"}function Rse(t){return E2(t)&&t.tagName.toLowerCase()==="input"}function Dse(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Nse(t,e){return t.button===0&&(!e||e==="_self")&&!Dse(t)}var qy=null;function Pse(){if(qy===null)try{new FormData(document.createElement("form"),0),qy=!1}catch{qy=!0}return qy}var Lse=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function l3(t){return t!=null&&!Lse.has(t)?(cl(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${z1}"`),null):t}function $se(t,e){let n,r,i,s,o;if(Mse(t)){let l=t.getAttribute("action");r=l?Kc(l,e):null,n=t.getAttribute("method")||B1,i=l3(t.getAttribute("enctype"))||z1,s=new FormData(t)}else if(Ase(t)||Rse(t)&&(t.type==="submit"||t.type==="image")){let l=t.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||l.getAttribute("action");if(r=u?Kc(u,e):null,n=t.getAttribute("formmethod")||l.getAttribute("method")||B1,i=l3(t.getAttribute("formenctype"))||l3(l.getAttribute("enctype"))||z1,s=new FormData(l,t),!Pse()){let{name:h,type:f,value:p}=t;if(f==="image"){let m=h?`${h}.`:"";s.append(`${m}x`,"0"),s.append(`${m}y`,"0")}else h&&s.append(h,p)}}else{if(E2(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=B1,r=null,i=z1,o=t}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function u4(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Ise(t,e,n,r){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:e&&Kc(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function Bse(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function zse(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function qse(t,e,n){let r=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];if(s){let o=await Bse(s,n);return o.links?o.links():[]}return[]}));return Use(r.flat(1).filter(zse).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function CR(t,e,n,r,i,s){let o=(u,h)=>n[h]?u.route.id!==n[h].route.id:!0,l=(u,h)=>{var f;return n[h].pathname!==u.pathname||((f=n[h].route.path)==null?void 0:f.endsWith("*"))&&n[h].params["*"]!==u.params["*"]};return s==="assets"?e.filter((u,h)=>o(u,h)||l(u,h)):s==="data"?e.filter((u,h)=>{var p;let f=r.routes[u.route.id];if(!f||!f.hasLoader)return!1;if(o(u,h)||l(u,h))return!0;if(u.route.shouldRevalidate){let m=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function Fse(t,e,{includeHydrateFallback:n}={}){return Hse(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function Hse(t){return[...new Set(t)]}function Vse(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function Use(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let s=JSON.stringify(Vse(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function RB(){let t=M.useContext(Cf);return u4(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Qse(){let t=M.useContext(O2);return u4(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var h4=M.createContext(void 0);h4.displayName="FrameworkContext";function DB(){let t=M.useContext(h4);return u4(t,"You must render this element inside a <HydratedRouter> element"),t}function Wse(t,e){let n=M.useContext(h4),[r,i]=M.useState(!1),[s,o]=M.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:h,onMouseLeave:f,onTouchStart:p}=e,m=M.useRef(null);M.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let x=S=>{S.forEach(_=>{o(_.isIntersecting)})},w=new IntersectionObserver(x,{threshold:.5});return m.current&&w.observe(m.current),()=>{w.disconnect()}}},[t]),M.useEffect(()=>{if(r){let x=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(x)}}},[r]);let v=()=>{i(!0)},b=()=>{i(!1),o(!1)};return n?t!=="intent"?[s,m,{}]:[s,m,{onFocus:Z0(l,v),onBlur:Z0(u,b),onMouseEnter:Z0(h,v),onMouseLeave:Z0(f,b),onTouchStart:Z0(p,v)}]:[!1,m,{}]}function Z0(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function Yse({page:t,...e}){let{router:n}=RB(),r=M.useMemo(()=>yB(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?M.createElement(Gse,{page:t,matches:r,...e}):null}function Xse(t){let{manifest:e,routeModules:n}=DB(),[r,i]=M.useState([]);return M.useEffect(()=>{let s=!1;return qse(t,e,n).then(o=>{s||i(o)}),()=>{s=!0}},[t,e,n]),r}function Gse({page:t,matches:e,...n}){let r=nc(),{future:i,manifest:s,routeModules:o}=DB(),{basename:l}=RB(),{loaderData:u,matches:h}=Qse(),f=M.useMemo(()=>CR(t,e,h,s,r,"data"),[t,e,h,s,r]),p=M.useMemo(()=>CR(t,e,h,s,r,"assets"),[t,e,h,s,r]),m=M.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let x=new Set,w=!1;if(e.forEach(_=>{var C;let T=s.routes[_.route.id];!T||!T.hasLoader||(!f.some(j=>j.route.id===_.route.id)&&_.route.id in u&&((C=o[_.route.id])!=null&&C.shouldRevalidate)||T.hasClientLoader?w=!0:x.add(_.route.id))}),x.size===0)return[];let S=Ise(t,l,i.unstable_trailingSlashAwareDataRequests,"data");return w&&x.size>0&&S.searchParams.set("_routes",e.filter(_=>x.has(_.route.id)).map(_=>_.route.id).join(",")),[S.pathname+S.search]},[l,i.unstable_trailingSlashAwareDataRequests,u,r,s,f,e,t,o]),v=M.useMemo(()=>Fse(p,s),[p,s]),b=Xse(p);return M.createElement(M.Fragment,null,m.map(x=>M.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),v.map(x=>M.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),b.map(({key:x,link:w})=>M.createElement("link",{key:x,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function Kse(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var Zse=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Zse&&(window.__reactRouterVersion="7.13.0")}catch{}function Jse({basename:t,children:e,unstable_useTransitions:n,window:r}){let i=M.useRef();i.current==null&&(i.current=Die({window:r,v5Compat:!0}));let s=i.current,[o,l]=M.useState({action:s.action,location:s.location}),u=M.useCallback(h=>{n===!1?l(h):M.startTransition(()=>l(h))},[n]);return M.useLayoutEffect(()=>s.listen(u),[s,u]),M.createElement(Ese,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:s,unstable_useTransitions:n})}var NB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,d4=M.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:l,target:u,to:h,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:m,...v},b){let{basename:x,unstable_useTransitions:w}=M.useContext(ma),S=typeof h=="string"&&NB.test(h),_=jB(h,x);h=_.to;let T=fse(h,{relative:i}),[C,j,A]=Wse(r,v),E=nae(h,{replace:o,state:l,target:u,preventScrollReset:f,relative:i,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:w});function R($){e&&e($),$.defaultPrevented||E($)}let N=M.createElement("a",{...v,...A,href:_.absoluteURL||T,onClick:_.isExternal||s?e:R,ref:Kse(b,j),target:u,"data-discover":!S&&n==="render"?"true":void 0});return C&&!S?M.createElement(M.Fragment,null,N,M.createElement(Yse,{page:T})):N});d4.displayName="Link";var fg=M.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:l,children:u,...h},f){let p=Jv(o,{relative:h.relative}),m=nc(),v=M.useContext(O2),{navigator:b,basename:x}=M.useContext(ma),w=v!=null&&oae(p)&&l===!0,S=b.encodeLocation?b.encodeLocation(p).pathname:p.pathname,_=m.pathname,T=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(_=_.toLowerCase(),T=T?T.toLowerCase():null,S=S.toLowerCase()),T&&x&&(T=Kc(T,x)||T);const C=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let j=_===S||!i&&_.startsWith(S)&&_.charAt(C)==="/",A=T!=null&&(T===S||!i&&T.startsWith(S)&&T.charAt(S.length)==="/"),E={isActive:j,isPending:A,isTransitioning:w},R=j?e:void 0,N;typeof r=="function"?N=r(E):N=[r,j?"active":null,A?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let $=typeof s=="function"?s(E):s;return M.createElement(d4,{...h,"aria-current":R,className:N,ref:f,style:$,to:o,viewTransition:l},typeof u=="function"?u(E):u)});fg.displayName="NavLink";var eae=M.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:s,method:o=B1,action:l,onSubmit:u,relative:h,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:m,...v},b)=>{let{unstable_useTransitions:x}=M.useContext(ma),w=sae(),S=aae(l,{relative:h}),_=o.toLowerCase()==="get"?"get":"post",T=typeof l=="string"&&NB.test(l),C=j=>{if(u&&u(j),j.defaultPrevented)return;j.preventDefault();let A=j.nativeEvent.submitter,E=(A==null?void 0:A.getAttribute("formmethod"))||o,R=()=>w(A||j.currentTarget,{fetcherKey:e,method:E,navigate:n,replace:i,state:s,relative:h,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:m});x&&n!==!1?M.startTransition(()=>R()):R()};return M.createElement("form",{ref:b,method:_,action:S,onSubmit:r?u:C,...v,"data-discover":!T&&t==="render"?"true":void 0})});eae.displayName="Form";function tae(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function PB(t){let e=M.useContext(Cf);return Pr(e,tae(t)),e}function nae(t,{target:e,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let h=o4(),f=nc(),p=Jv(t,{relative:s});return M.useCallback(m=>{if(Nse(m,e)){m.preventDefault();let v=n!==void 0?n:Kg(f)===Kg(p),b=()=>h(t,{replace:v,state:r,preventScrollReset:i,relative:s,viewTransition:o,unstable_defaultShouldRevalidate:l});u?M.startTransition(()=>b()):b()}},[f,h,p,n,r,e,t,i,s,o,l,u])}var rae=0,iae=()=>`__${String(++rae)}__`;function sae(){let{router:t}=PB("useSubmit"),{basename:e}=M.useContext(ma),n=_se(),r=t.fetch,i=t.navigate;return M.useCallback(async(s,o={})=>{let{action:l,method:u,encType:h,formData:f,body:p}=$se(s,e);if(o.navigate===!1){let m=o.fetcherKey||iae();await r(m,n,o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||u,formEncType:o.encType||h,flushSync:o.flushSync})}else await i(o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||u,formEncType:o.encType||h,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,e,n])}function aae(t,{relative:e}={}){let{basename:n}=M.useContext(ma),r=M.useContext(tc);Pr(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Jv(t||".",{relative:e})},o=nc();if(t==null){s.search=o.search;let l=new URLSearchParams(s.search),u=l.getAll("index");if(u.some(f=>f==="")){l.delete("index"),u.filter(p=>p).forEach(p=>l.append("index",p));let f=l.toString();s.search=f?`?${f}`:""}}return(!t||t===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Wc([n,s.pathname])),Kg(s)}function oae(t,{relative:e}={}){let n=M.useContext(TB);Pr(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=PB("useViewTransitionState"),i=Jv(t,{relative:e});if(!n.isTransitioning)return!1;let s=Kc(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Kc(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ex(i.pathname,o)!=null||Ex(i.pathname,s)!=null}var eb=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},lae={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},oh,j6,e7,cae=(e7=class{constructor(){Je(this,oh,lae);Je(this,j6,!1)}setTimeoutProvider(t){Me(this,oh,t)}setTimeout(t,e){return B(this,oh).setTimeout(t,e)}clearTimeout(t){B(this,oh).clearTimeout(t)}setInterval(t,e){return B(this,oh).setInterval(t,e)}clearInterval(t){B(this,oh).clearInterval(t)}},oh=new WeakMap,j6=new WeakMap,e7),Id=new cae;function uae(t){setTimeout(t,0)}var df=typeof window>"u"||"Deno"in globalThis;function oa(){}function hae(t,e){return typeof t=="function"?t(e):t}function xC(t){return typeof t=="number"&&t>=0&&t!==1/0}function LB(t,e){return Math.max(t+(e||0)-Date.now(),0)}function jh(t,e){return typeof t=="function"?t(e):t}function co(t,e){return typeof t=="function"?t(e):t}function kR(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==f4(o,e.options))return!1}else if(!Jg(e.queryKey,o))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||i&&i!==e.state.fetchStatus||s&&!s(e))}function OR(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Zg(e.options.mutationKey)!==Zg(s))return!1}else if(!Jg(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function f4(t,e){return((e==null?void 0:e.queryKeyHashFn)||Zg)(t)}function Zg(t){return JSON.stringify(t,(e,n)=>SC(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Jg(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Jg(t[n],e[n])):!1}var dae=Object.prototype.hasOwnProperty;function $B(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=ER(t)&&ER(e);if(!r&&!(SC(t)&&SC(e)))return e;const s=(r?t:Object.keys(t)).length,o=r?e:Object.keys(e),l=o.length,u=r?new Array(l):{};let h=0;for(let f=0;f<l;f++){const p=r?f:o[f],m=t[p],v=e[p];if(m===v){u[p]=m,(r?f<s:dae.call(t,p))&&h++;continue}if(m===null||v===null||typeof m!="object"||typeof v!="object"){u[p]=v;continue}const b=$B(m,v,n+1);u[p]=b,b===m&&h++}return s===l&&h===s?t:u}function wC(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function ER(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function SC(t){if(!AR(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!AR(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function AR(t){return Object.prototype.toString.call(t)==="[object Object]"}function fae(t){return new Promise(e=>{Id.setTimeout(e,t)})}function jC(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?$B(t,e):e}function pae(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function mae(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var p4=Symbol();function IB(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===p4?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function BB(t,e){return typeof t=="function"?t(...e):!!t}function gae(t,e,n){let r=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var Vd,lh,Xp,t7,vae=(t7=class extends eb{constructor(){super();Je(this,Vd);Je(this,lh);Je(this,Xp);Me(this,Xp,e=>{if(!df&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){B(this,lh)||this.setEventListener(B(this,Xp))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,lh))==null||e.call(this),Me(this,lh,void 0))}setEventListener(e){var n;Me(this,Xp,e),(n=B(this,lh))==null||n.call(this),Me(this,lh,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){B(this,Vd)!==e&&(Me(this,Vd,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof B(this,Vd)=="boolean"?B(this,Vd):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Vd=new WeakMap,lh=new WeakMap,Xp=new WeakMap,t7),m4=new vae;function _C(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});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}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}var bae=uae;function yae(){let t=[],e=0,n=l=>{l()},r=l=>{l()},i=bae;const s=l=>{e?t.push(l):i(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&i(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;e++;try{u=l()}finally{e--,e||o()}return u},batchCalls:l=>(...u)=>{s(()=>{l(...u)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var ls=yae(),Gp,ch,Kp,n7,xae=(n7=class extends eb{constructor(){super();Je(this,Gp,!0);Je(this,ch);Je(this,Kp);Me(this,Kp,e=>{if(!df&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){B(this,ch)||this.setEventListener(B(this,Kp))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,ch))==null||e.call(this),Me(this,ch,void 0))}setEventListener(e){var n;Me(this,Kp,e),(n=B(this,ch))==null||n.call(this),Me(this,ch,e(this.setOnline.bind(this)))}setOnline(e){B(this,Gp)!==e&&(Me(this,Gp,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return B(this,Gp)}},Gp=new WeakMap,ch=new WeakMap,Kp=new WeakMap,n7),Ax=new xae;function wae(t){return Math.min(1e3*2**t,3e4)}function zB(t){return(t??"online")==="online"?Ax.isOnline():!0}var TC=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function qB(t){let e=!1,n=0,r;const i=_C(),s=()=>i.status!=="pending",o=x=>{var w;if(!s()){const S=new TC(x);m(S),(w=t.onCancel)==null||w.call(t,S)}},l=()=>{e=!0},u=()=>{e=!1},h=()=>m4.isFocused()&&(t.networkMode==="always"||Ax.isOnline())&&t.canRun(),f=()=>zB(t.networkMode)&&t.canRun(),p=x=>{s()||(r==null||r(),i.resolve(x))},m=x=>{s()||(r==null||r(),i.reject(x))},v=()=>new Promise(x=>{var w;r=S=>{(s()||h())&&x(S)},(w=t.onPause)==null||w.call(t)}).then(()=>{var x;r=void 0,s()||(x=t.onContinue)==null||x.call(t)}),b=()=>{if(s())return;let x;const w=n===0?t.initialPromise:void 0;try{x=w??t.fn()}catch(S){x=Promise.reject(S)}Promise.resolve(x).then(p).catch(S=>{var A;if(s())return;const _=t.retry??(df?0:3),T=t.retryDelay??wae,C=typeof T=="function"?T(n,S):T,j=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,S);if(e||!j){m(S);return}n++,(A=t.onFail)==null||A.call(t,n,S),fae(C).then(()=>h()?void 0:v()).then(()=>{e?m(S):b()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:u,canStart:f,start:()=>(f()?b():v().then(b),i)}}var Ud,r7,FB=(r7=class{constructor(){Je(this,Ud)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xC(this.gcTime)&&Me(this,Ud,Id.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(df?1/0:5*60*1e3))}clearGcTimeout(){B(this,Ud)&&(Id.clearTimeout(B(this,Ud)),Me(this,Ud,void 0))}},Ud=new WeakMap,r7),Qd,Zp,oo,Wd,Bi,kv,Yd,zo,Lc,i7,Sae=(i7=class extends FB{constructor(e){super();Je(this,zo);Je(this,Qd);Je(this,Zp);Je(this,oo);Je(this,Wd);Je(this,Bi);Je(this,kv);Je(this,Yd);Me(this,Yd,!1),Me(this,kv,e.defaultOptions),this.setOptions(e.options),this.observers=[],Me(this,Wd,e.client),Me(this,oo,B(this,Wd).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Me(this,Qd,RR(this.options)),this.state=e.state??B(this,Qd),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=B(this,Bi))==null?void 0:e.promise}setOptions(e){if(this.options={...B(this,kv),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=RR(this.options);n.data!==void 0&&(this.setState(MR(n.data,n.dataUpdatedAt)),Me(this,Qd,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&B(this,oo).remove(this)}setData(e,n){const r=jC(this.state.data,e,this.options);return Ue(this,zo,Lc).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Ue(this,zo,Lc).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=B(this,Bi))==null?void 0:r.promise;return(i=B(this,Bi))==null||i.cancel(e),n?n.then(oa).catch(oa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(B(this,Qd))}isActive(){return this.observers.some(e=>co(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===p4||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>jh(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:!LB(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=B(this,Bi))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=B(this,Bi))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),B(this,oo).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(B(this,Bi)&&(B(this,Yd)?B(this,Bi).cancel({revert:!0}):B(this,Bi).cancelRetry()),this.scheduleGc()),B(this,oo).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ue(this,zo,Lc).call(this,{type:"invalidate"})}async fetch(e,n){var u,h,f,p,m,v,b,x,w,S,_,T;if(this.state.fetchStatus!=="idle"&&((u=B(this,Bi))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(B(this,Bi))return B(this,Bi).continueRetry(),B(this,Bi).promise}if(e&&this.setOptions(e),!this.options.queryFn){const C=this.observers.find(j=>j.options.queryFn);C&&this.setOptions(C.options)}const r=new AbortController,i=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(Me(this,Yd,!0),r.signal)})},s=()=>{const C=IB(this.options,n),A=(()=>{const E={client:B(this,Wd),queryKey:this.queryKey,meta:this.meta};return i(E),E})();return Me(this,Yd,!1),this.options.persister?this.options.persister(C,A,this):C(A)},l=(()=>{const C={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:B(this,Wd),state:this.state,fetchFn:s};return i(C),C})();(h=this.options.behavior)==null||h.onFetch(l,this),Me(this,Zp,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&Ue(this,zo,Lc).call(this,{type:"fetch",meta:(p=l.fetchOptions)==null?void 0:p.meta}),Me(this,Bi,qB({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:C=>{C instanceof TC&&C.revert&&this.setState({...B(this,Zp),fetchStatus:"idle"}),r.abort()},onFail:(C,j)=>{Ue(this,zo,Lc).call(this,{type:"failed",failureCount:C,error:j})},onPause:()=>{Ue(this,zo,Lc).call(this,{type:"pause"})},onContinue:()=>{Ue(this,zo,Lc).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const C=await B(this,Bi).start();if(C===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(C),(v=(m=B(this,oo).config).onSuccess)==null||v.call(m,C,this),(x=(b=B(this,oo).config).onSettled)==null||x.call(b,C,this.state.error,this),C}catch(C){if(C instanceof TC){if(C.silent)return B(this,Bi).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw Ue(this,zo,Lc).call(this,{type:"error",error:C}),(S=(w=B(this,oo).config).onError)==null||S.call(w,C,this),(T=(_=B(this,oo).config).onSettled)==null||T.call(_,this.state.data,C,this),C}finally{this.scheduleGc()}}},Qd=new WeakMap,Zp=new WeakMap,oo=new WeakMap,Wd=new WeakMap,Bi=new WeakMap,kv=new WeakMap,Yd=new WeakMap,zo=new WeakSet,Lc=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...HB(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...MR(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Me(this,Zp,e.manual?i:void 0),i;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),ls.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),B(this,oo).notify({query:this,type:"updated",action:e})})},i7);function HB(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zB(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function MR(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function RR(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,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 sa,bn,Ov,Is,Xd,Jp,Bc,uh,Ev,em,tm,Gd,Kd,hh,nm,zn,pg,CC,kC,OC,EC,AC,MC,RC,UB,s7,VB=(s7=class extends eb{constructor(e,n){super();Je(this,zn);Je(this,sa);Je(this,bn);Je(this,Ov);Je(this,Is);Je(this,Xd);Je(this,Jp);Je(this,Bc);Je(this,uh);Je(this,Ev);Je(this,em);Je(this,tm);Je(this,Gd);Je(this,Kd);Je(this,hh);Je(this,nm,new Set);this.options=n,Me(this,sa,e),Me(this,uh,null),Me(this,Bc,_C()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(B(this,bn).addObserver(this),DR(B(this,bn),this.options)?Ue(this,zn,pg).call(this):this.updateResult(),Ue(this,zn,EC).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return DC(B(this,bn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return DC(B(this,bn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ue(this,zn,AC).call(this),Ue(this,zn,MC).call(this),B(this,bn).removeObserver(this)}setOptions(e){const n=this.options,r=B(this,bn);if(this.options=B(this,sa).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof co(this.options.enabled,B(this,bn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ue(this,zn,RC).call(this),B(this,bn).setOptions(this.options),n._defaulted&&!wC(this.options,n)&&B(this,sa).getQueryCache().notify({type:"observerOptionsUpdated",query:B(this,bn),observer:this});const i=this.hasListeners();i&&NR(B(this,bn),r,this.options,n)&&Ue(this,zn,pg).call(this),this.updateResult(),i&&(B(this,bn)!==r||co(this.options.enabled,B(this,bn))!==co(n.enabled,B(this,bn))||jh(this.options.staleTime,B(this,bn))!==jh(n.staleTime,B(this,bn)))&&Ue(this,zn,CC).call(this);const s=Ue(this,zn,kC).call(this);i&&(B(this,bn)!==r||co(this.options.enabled,B(this,bn))!==co(n.enabled,B(this,bn))||s!==B(this,hh))&&Ue(this,zn,OC).call(this,s)}getOptimisticResult(e){const n=B(this,sa).getQueryCache().build(B(this,sa),e),r=this.createResult(n,e);return _ae(this,r)&&(Me(this,Is,r),Me(this,Jp,this.options),Me(this,Xd,B(this,bn).state)),r}getCurrentResult(){return B(this,Is)}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&B(this,Bc).status==="pending"&&B(this,Bc).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){B(this,nm).add(e)}getCurrentQuery(){return B(this,bn)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=B(this,sa).defaultQueryOptions(e),r=B(this,sa).getQueryCache().build(B(this,sa),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Ue(this,zn,pg).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),B(this,Is)))}createResult(e,n){var N;const r=B(this,bn),i=this.options,s=B(this,Is),o=B(this,Xd),l=B(this,Jp),h=e!==r?e.state:B(this,Ov),{state:f}=e;let p={...f},m=!1,v;if(n._optimisticResults){const $=this.hasListeners(),D=!$&&DR(e,n),F=$&&NR(e,r,n,i);(D||F)&&(p={...p,...HB(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:b,errorUpdatedAt:x,status:w}=p;v=p.data;let S=!1;if(n.placeholderData!==void 0&&v===void 0&&w==="pending"){let $;s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?($=s.data,S=!0):$=typeof n.placeholderData=="function"?n.placeholderData((N=B(this,tm))==null?void 0:N.state.data,B(this,tm)):n.placeholderData,$!==void 0&&(w="success",v=jC(s==null?void 0:s.data,$,n),m=!0)}if(n.select&&v!==void 0&&!S)if(s&&v===(o==null?void 0:o.data)&&n.select===B(this,Ev))v=B(this,em);else try{Me(this,Ev,n.select),v=n.select(v),v=jC(s==null?void 0:s.data,v,n),Me(this,em,v),Me(this,uh,null)}catch($){Me(this,uh,$)}B(this,uh)&&(b=B(this,uh),v=B(this,em),x=Date.now(),w="error");const _=p.fetchStatus==="fetching",T=w==="pending",C=w==="error",j=T&&_,A=v!==void 0,R={status:w,fetchStatus:p.fetchStatus,isPending:T,isSuccess:w==="success",isError:C,isInitialLoading:j,isLoading:j,data:v,dataUpdatedAt:p.dataUpdatedAt,error:b,errorUpdatedAt:x,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>h.dataUpdateCount||p.errorUpdateCount>h.errorUpdateCount,isFetching:_,isRefetching:_&&!T,isLoadingError:C&&!A,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&A,isStale:g4(e,n),refetch:this.refetch,promise:B(this,Bc),isEnabled:co(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const $=R.data!==void 0,D=R.status==="error"&&!$,F=q=>{D?q.reject(R.error):$&&q.resolve(R.data)},Q=()=>{const q=Me(this,Bc,R.promise=_C());F(q)},H=B(this,Bc);switch(H.status){case"pending":e.queryHash===r.queryHash&&F(H);break;case"fulfilled":(D||R.data!==H.value)&&Q();break;case"rejected":(!D||R.error!==H.reason)&&Q();break}}return R}updateResult(){const e=B(this,Is),n=this.createResult(B(this,bn),this.options);if(Me(this,Xd,B(this,bn).state),Me(this,Jp,this.options),B(this,Xd).data!==void 0&&Me(this,tm,B(this,bn)),wC(n,e))return;Me(this,Is,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!B(this,nm).size)return!0;const o=new Set(s??B(this,nm));return this.options.throwOnError&&o.add("error"),Object.keys(B(this,Is)).some(l=>{const u=l;return B(this,Is)[u]!==e[u]&&o.has(u)})};Ue(this,zn,UB).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ue(this,zn,EC).call(this)}},sa=new WeakMap,bn=new WeakMap,Ov=new WeakMap,Is=new WeakMap,Xd=new WeakMap,Jp=new WeakMap,Bc=new WeakMap,uh=new WeakMap,Ev=new WeakMap,em=new WeakMap,tm=new WeakMap,Gd=new WeakMap,Kd=new WeakMap,hh=new WeakMap,nm=new WeakMap,zn=new WeakSet,pg=function(e){Ue(this,zn,RC).call(this);let n=B(this,bn).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(oa)),n},CC=function(){Ue(this,zn,AC).call(this);const e=jh(this.options.staleTime,B(this,bn));if(df||B(this,Is).isStale||!xC(e))return;const r=LB(B(this,Is).dataUpdatedAt,e)+1;Me(this,Gd,Id.setTimeout(()=>{B(this,Is).isStale||this.updateResult()},r))},kC=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(B(this,bn)):this.options.refetchInterval)??!1},OC=function(e){Ue(this,zn,MC).call(this),Me(this,hh,e),!(df||co(this.options.enabled,B(this,bn))===!1||!xC(B(this,hh))||B(this,hh)===0)&&Me(this,Kd,Id.setInterval(()=>{(this.options.refetchIntervalInBackground||m4.isFocused())&&Ue(this,zn,pg).call(this)},B(this,hh)))},EC=function(){Ue(this,zn,CC).call(this),Ue(this,zn,OC).call(this,Ue(this,zn,kC).call(this))},AC=function(){B(this,Gd)&&(Id.clearTimeout(B(this,Gd)),Me(this,Gd,void 0))},MC=function(){B(this,Kd)&&(Id.clearInterval(B(this,Kd)),Me(this,Kd,void 0))},RC=function(){const e=B(this,sa).getQueryCache().build(B(this,sa),this.options);if(e===B(this,bn))return;const n=B(this,bn);Me(this,bn,e),Me(this,Ov,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},UB=function(e){ls.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(B(this,Is))}),B(this,sa).getQueryCache().notify({query:B(this,bn),type:"observerResultsUpdated"})})},s7);function jae(t,e){return co(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function DR(t,e){return jae(t,e)||t.state.data!==void 0&&DC(t,e,e.refetchOnMount)}function DC(t,e,n){if(co(e.enabled,t)!==!1&&jh(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&g4(t,e)}return!1}function NR(t,e,n,r){return(t!==e||co(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&g4(t,n)}function g4(t,e){return co(e.enabled,t)!==!1&&t.isStaleByTime(jh(e.staleTime,t))}function _ae(t,e){return!wC(t.getCurrentResult(),e)}function PR(t){return{onFetch:(e,n)=>{var f,p,m,v,b;const r=e.options,i=(m=(p=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,s=((v=e.state.data)==null?void 0:v.pages)||[],o=((b=e.state.data)==null?void 0:b.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const h=async()=>{let x=!1;const w=T=>{gae(T,()=>e.signal,()=>x=!0)},S=IB(e.options,e.fetchOptions),_=async(T,C,j)=>{if(x)return Promise.reject();if(C==null&&T.pages.length)return Promise.resolve(T);const E=(()=>{const D={client:e.client,queryKey:e.queryKey,pageParam:C,direction:j?"backward":"forward",meta:e.options.meta};return w(D),D})(),R=await S(E),{maxPages:N}=e.options,$=j?mae:pae;return{pages:$(T.pages,R,N),pageParams:$(T.pageParams,C,N)}};if(i&&s.length){const T=i==="backward",C=T?Tae:LR,j={pages:s,pageParams:o},A=C(r,j);l=await _(j,A,T)}else{const T=t??s.length;do{const C=u===0?o[0]??r.initialPageParam:LR(r,l);if(u>0&&C==null)break;l=await _(l,C),u++}while(u<T)}return l};e.options.persister?e.fetchFn=()=>{var x,w;return(w=(x=e.options).persister)==null?void 0:w.call(x,h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=h}}}function LR(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function Tae(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Av,Rl,js,Zd,Dl,Xu,a7,Cae=(a7=class extends FB{constructor(e){super();Je(this,Dl);Je(this,Av);Je(this,Rl);Je(this,js);Je(this,Zd);Me(this,Av,e.client),this.mutationId=e.mutationId,Me(this,js,e.mutationCache),Me(this,Rl,[]),this.state=e.state||kae(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){B(this,Rl).includes(e)||(B(this,Rl).push(e),this.clearGcTimeout(),B(this,js).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Me(this,Rl,B(this,Rl).filter(n=>n!==e)),this.scheduleGc(),B(this,js).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){B(this,Rl).length||(this.state.status==="pending"?this.scheduleGc():B(this,js).remove(this))}continue(){var e;return((e=B(this,Zd))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,l,u,h,f,p,m,v,b,x,w,S,_,T,C,j,A,E;const n=()=>{Ue(this,Dl,Xu).call(this,{type:"continue"})},r={client:B(this,Av),meta:this.options.meta,mutationKey:this.options.mutationKey};Me(this,Zd,qB({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,N)=>{Ue(this,Dl,Xu).call(this,{type:"failed",failureCount:R,error:N})},onPause:()=>{Ue(this,Dl,Xu).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>B(this,js).canRun(this)}));const i=this.state.status==="pending",s=!B(this,Zd).canStart();try{if(i)n();else{Ue(this,Dl,Xu).call(this,{type:"pending",variables:e,isPaused:s}),B(this,js).config.onMutate&&await B(this,js).config.onMutate(e,this,r);const N=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,e,r));N!==this.state.context&&Ue(this,Dl,Xu).call(this,{type:"pending",context:N,variables:e,isPaused:s})}const R=await B(this,Zd).start();return await((h=(u=B(this,js).config).onSuccess)==null?void 0:h.call(u,R,e,this.state.context,this,r)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,R,e,this.state.context,r)),await((v=(m=B(this,js).config).onSettled)==null?void 0:v.call(m,R,null,this.state.variables,this.state.context,this,r)),await((x=(b=this.options).onSettled)==null?void 0:x.call(b,R,null,e,this.state.context,r)),Ue(this,Dl,Xu).call(this,{type:"success",data:R}),R}catch(R){try{await((S=(w=B(this,js).config).onError)==null?void 0:S.call(w,R,e,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((T=(_=this.options).onError)==null?void 0:T.call(_,R,e,this.state.context,r))}catch(N){Promise.reject(N)}try{await((j=(C=B(this,js).config).onSettled)==null?void 0:j.call(C,void 0,R,this.state.variables,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((E=(A=this.options).onSettled)==null?void 0:E.call(A,void 0,R,e,this.state.context,r))}catch(N){Promise.reject(N)}throw Ue(this,Dl,Xu).call(this,{type:"error",error:R}),R}finally{B(this,js).runNext(this)}}},Av=new WeakMap,Rl=new WeakMap,js=new WeakMap,Zd=new WeakMap,Dl=new WeakSet,Xu=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ls.batch(()=>{B(this,Rl).forEach(r=>{r.onMutationUpdate(e)}),B(this,js).notify({mutation:this,type:"updated",action:e})})},a7);function kae(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zc,qo,Mv,o7,Oae=(o7=class extends eb{constructor(e={}){super();Je(this,zc);Je(this,qo);Je(this,Mv);this.config=e,Me(this,zc,new Set),Me(this,qo,new Map),Me(this,Mv,0)}build(e,n,r){const i=new Cae({client:e,mutationCache:this,mutationId:++wd(this,Mv)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){B(this,zc).add(e);const n=Fy(e);if(typeof n=="string"){const r=B(this,qo).get(n);r?r.push(e):B(this,qo).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(B(this,zc).delete(e)){const n=Fy(e);if(typeof n=="string"){const r=B(this,qo).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&B(this,qo).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Fy(e);if(typeof n=="string"){const r=B(this,qo).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=Fy(e);if(typeof n=="string"){const i=(r=B(this,qo).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ls.batch(()=>{B(this,zc).forEach(e=>{this.notify({type:"removed",mutation:e})}),B(this,zc).clear(),B(this,qo).clear()})}getAll(){return Array.from(B(this,zc))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>OR(n,r))}findAll(e={}){return this.getAll().filter(n=>OR(e,n))}notify(e){ls.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return ls.batch(()=>Promise.all(e.map(n=>n.continue().catch(oa))))}},zc=new WeakMap,qo=new WeakMap,Mv=new WeakMap,o7);function Fy(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Nl,l7,Eae=(l7=class extends eb{constructor(e={}){super();Je(this,Nl);this.config=e,Me(this,Nl,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??f4(i,n);let o=this.get(s);return o||(o=new Sae({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){B(this,Nl).has(e.queryHash)||(B(this,Nl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=B(this,Nl).get(e.queryHash);n&&(e.destroy(),n===e&&B(this,Nl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ls.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return B(this,Nl).get(e)}getAll(){return[...B(this,Nl).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>kR(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>kR(e,r)):n}notify(e){ls.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){ls.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ls.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Nl=new WeakMap,l7),Wr,dh,fh,rm,im,ph,sm,am,c7,Aae=(c7=class{constructor(t={}){Je(this,Wr);Je(this,dh);Je(this,fh);Je(this,rm);Je(this,im);Je(this,ph);Je(this,sm);Je(this,am);Me(this,Wr,t.queryCache||new Eae),Me(this,dh,t.mutationCache||new Oae),Me(this,fh,t.defaultOptions||{}),Me(this,rm,new Map),Me(this,im,new Map),Me(this,ph,0)}mount(){wd(this,ph)._++,B(this,ph)===1&&(Me(this,sm,m4.subscribe(async t=>{t&&(await this.resumePausedMutations(),B(this,Wr).onFocus())})),Me(this,am,Ax.subscribe(async t=>{t&&(await this.resumePausedMutations(),B(this,Wr).onOnline())})))}unmount(){var t,e;wd(this,ph)._--,B(this,ph)===0&&((t=B(this,sm))==null||t.call(this),Me(this,sm,void 0),(e=B(this,am))==null||e.call(this),Me(this,am,void 0))}isFetching(t){return B(this,Wr).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return B(this,dh).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=B(this,Wr).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=B(this,Wr).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(jh(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return B(this,Wr).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=B(this,Wr).get(r.queryHash),s=i==null?void 0:i.state.data,o=hae(e,s);if(o!==void 0)return B(this,Wr).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return ls.batch(()=>B(this,Wr).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=B(this,Wr).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=B(this,Wr);ls.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=B(this,Wr);return ls.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=ls.batch(()=>B(this,Wr).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(oa).catch(oa)}invalidateQueries(t,e={}){return ls.batch(()=>(B(this,Wr).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=ls.batch(()=>B(this,Wr).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(oa)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(oa)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=B(this,Wr).build(this,e);return n.isStaleByTime(jh(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(oa).catch(oa)}fetchInfiniteQuery(t){return t.behavior=PR(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(oa).catch(oa)}ensureInfiniteQueryData(t){return t.behavior=PR(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ax.isOnline()?B(this,dh).resumePausedMutations():Promise.resolve()}getQueryCache(){return B(this,Wr)}getMutationCache(){return B(this,dh)}getDefaultOptions(){return B(this,fh)}setDefaultOptions(t){Me(this,fh,t)}setQueryDefaults(t,e){B(this,rm).set(Zg(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...B(this,rm).values()],n={};return e.forEach(r=>{Jg(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){B(this,im).set(Zg(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...B(this,im).values()],n={};return e.forEach(r=>{Jg(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...B(this,fh).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=f4(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===p4&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...B(this,fh).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){B(this,Wr).clear(),B(this,dh).clear()}},Wr=new WeakMap,dh=new WeakMap,fh=new WeakMap,rm=new WeakMap,im=new WeakMap,ph=new WeakMap,sm=new WeakMap,am=new WeakMap,c7),QB=M.createContext(void 0),Mae=t=>{const e=M.useContext(QB);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Rae=({client:t,children:e})=>(M.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),a.jsx(QB.Provider,{value:t,children:e})),WB=M.createContext(!1),Dae=()=>M.useContext(WB);WB.Provider;function Nae(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Pae=M.createContext(Nae()),Lae=()=>M.useContext(Pae),$ae=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?BB(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},Iae=t=>{M.useEffect(()=>{t.clearReset()},[t])},Bae=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||BB(n,[t.error,r])),zae=(t,e)=>e.state.data===void 0,qae=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Fae=(t,e)=>t.isLoading&&t.isFetching&&!e,Hae=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,$R=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function YB(t,e,n){var m,v,b,x;const r=Dae(),i=Lae(),s=Mae(),o=s.defaultQueryOptions(t);(v=(m=s.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||v.call(m,o);const l=s.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",qae(o),$ae(o,i,l),Iae(i);const u=!s.getQueryCache().get(o.queryHash),[h]=M.useState(()=>new e(s,o)),f=h.getOptimisticResult(o),p=!r&&t.subscribed!==!1;if(M.useSyncExternalStore(M.useCallback(w=>{const S=p?h.subscribe(ls.batchCalls(w)):oa;return h.updateResult(),S},[h,p]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),M.useEffect(()=>{h.setOptions(o)},[o,h]),Hae(o,f))throw $R(o,h,i);if(Bae({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;if((x=(b=s.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||x.call(b,o,f),o.experimental_prefetchInRender&&!df&&Fae(f,r)){const w=u?$R(o,h,i):l==null?void 0:l.promise;w==null||w.catch(oa).finally(()=>{h.updateResult()})}return o.notifyOnChangeProps?f:h.trackResult(f)}function Vae(t,e){return YB(t,VB)}function XB(t,e){return YB({...t,enabled:!0,suspense:!0,throwOnError:zae,placeholderData:void 0},VB)}var c3={exports:{}},u3={};/**
 * @license React
 * use-sync-external-store-with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var IR;function Uae(){if(IR)return u3;IR=1;var t=Nv();function e(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,i=t.useRef,s=t.useEffect,o=t.useMemo,l=t.useDebugValue;return u3.useSyncExternalStoreWithSelector=function(u,h,f,p,m){var v=i(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=o(function(){function w(j){if(!S){if(S=!0,_=j,j=p(j),m!==void 0&&b.hasValue){var A=b.value;if(m(A,j))return T=A}return T=j}if(A=T,n(_,j))return A;var E=p(j);return m!==void 0&&m(A,E)?(_=j,A):(_=j,T=E)}var S=!1,_,T,C=f===void 0?null:f;return[function(){return w(h())},C===null?void 0:function(){return w(C())}]},[h,f,p,m]);var x=r(u,v[0],v[1]);return s(function(){b.hasValue=!0,b.value=x},[x]),l(x),x},u3}var BR;function Qae(){return BR||(BR=1,c3.exports=Uae()),c3.exports}var Wae=Qae();function Yae(t){t()}function Xae(){let t=null,e=null;return{clear(){t=null,e=null},notify(){Yae(()=>{let n=t;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=t;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=e={callback:n,next:null,prev:e};return i.prev?i.prev.next=i:t=i,function(){!r||t===null||(r=!1,i.next?i.next.prev=i.prev:e=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var zR={notify(){},get:()=>[]};function Gae(t,e){let n,r=zR,i=0,s=!1;function o(x){f();const w=r.subscribe(x);let S=!1;return()=>{S||(S=!0,w(),p())}}function l(){r.notify()}function u(){b.onStateChange&&b.onStateChange()}function h(){return s}function f(){i++,n||(n=t.subscribe(u),r=Xae())}function p(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=zR)}function m(){s||(s=!0,f())}function v(){s&&(s=!1,p())}const b={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:u,isSubscribed:h,trySubscribe:m,tryUnsubscribe:v,getListeners:()=>r};return b}var Kae=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zae=Kae(),Jae=()=>typeof navigator<"u"&&navigator.product==="ReactNative",eoe=Jae(),toe=()=>Zae||eoe?M.useLayoutEffect:M.useEffect,noe=toe(),h3=Symbol.for("react-redux-context"),d3=typeof globalThis<"u"?globalThis:{};function roe(){if(!M.createContext)return{};const t=d3[h3]??(d3[h3]=new Map);let e=t.get(M.createContext);return e||(e=M.createContext(null),t.set(M.createContext,e)),e}var Ah=roe();function ioe(t){const{children:e,context:n,serverState:r,store:i}=t,s=M.useMemo(()=>{const u=Gae(i);return{store:i,subscription:u,getServerState:r?()=>r:void 0}},[i,r]),o=M.useMemo(()=>i.getState(),[i]);noe(()=>{const{subscription:u}=s;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),o!==i.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[s,o]);const l=n||Ah;return M.createElement(l.Provider,{value:s},e)}var soe=ioe;function v4(t=Ah){return function(){return M.useContext(t)}}var GB=v4();function KB(t=Ah){const e=t===Ah?GB:v4(t),n=()=>{const{store:r}=e();return r};return Object.assign(n,{withTypes:()=>n}),n}var aoe=KB();function ooe(t=Ah){const e=t===Ah?aoe:KB(t),n=()=>e().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var loe=ooe(),coe=(t,e)=>t===e;function uoe(t=Ah){const e=t===Ah?GB:v4(t),n=(r,i={})=>{const{equalityFn:s=coe}=typeof i=="function"?{equalityFn:i}:i,o=e(),{store:l,subscription:u,getServerState:h}=o;M.useRef(!0);const f=M.useCallback({[r.name](m){return r(m)}}[r.name],[r]),p=Wae.useSyncExternalStoreWithSelector(u.addNestedSub,l.getState,h||l.getState,f,s);return M.useDebugValue(p),p};return Object.assign(n,{withTypes:()=>n}),n}var hoe=uoe();const ou=loe.withTypes(),rc=hoe.withTypes();function is(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var doe=typeof Symbol=="function"&&Symbol.observable||"@@observable",qR=doe,f3=()=>Math.random().toString(36).substring(7).split("").join("."),foe={INIT:`@@redux/INIT${f3()}`,REPLACE:`@@redux/REPLACE${f3()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${f3()}`},Mx=foe;function b4(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function ZB(t,e,n){if(typeof t!="function")throw new Error(is(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(is(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(is(1));return n(ZB)(t,e)}let r=t,i=e,s=new Map,o=s,l=0,u=!1;function h(){o===s&&(o=new Map,s.forEach((w,S)=>{o.set(S,w)}))}function f(){if(u)throw new Error(is(3));return i}function p(w){if(typeof w!="function")throw new Error(is(4));if(u)throw new Error(is(5));let S=!0;h();const _=l++;return o.set(_,w),function(){if(S){if(u)throw new Error(is(6));S=!1,h(),o.delete(_),s=null}}}function m(w){if(!b4(w))throw new Error(is(7));if(typeof w.type>"u")throw new Error(is(8));if(typeof w.type!="string")throw new Error(is(17));if(u)throw new Error(is(9));try{u=!0,i=r(i,w)}finally{u=!1}return(s=o).forEach(_=>{_()}),w}function v(w){if(typeof w!="function")throw new Error(is(10));r=w,m({type:Mx.REPLACE})}function b(){const w=p;return{subscribe(S){if(typeof S!="object"||S===null)throw new Error(is(11));function _(){const C=S;C.next&&C.next(f())}return _(),{unsubscribe:w(_)}},[qR](){return this}}}return m({type:Mx.INIT}),{dispatch:m,subscribe:p,getState:f,replaceReducer:v,[qR]:b}}function poe(t){Object.keys(t).forEach(e=>{const n=t[e];if(typeof n(void 0,{type:Mx.INIT})>"u")throw new Error(is(12));if(typeof n(void 0,{type:Mx.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(is(13))})}function moe(t){const e=Object.keys(t),n={};for(let s=0;s<e.length;s++){const o=e[s];typeof t[o]=="function"&&(n[o]=t[o])}const r=Object.keys(n);let i;try{poe(n)}catch(s){i=s}return function(o={},l){if(i)throw i;let u=!1;const h={};for(let f=0;f<r.length;f++){const p=r[f],m=n[p],v=o[p],b=m(v,l);if(typeof b>"u")throw l&&l.type,new Error(is(14));h[p]=b,u=u||b!==v}return u=u||r.length!==Object.keys(o).length,u?h:o}}function Rx(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...r)=>e(n(...r)))}function goe(...t){return e=>(n,r)=>{const i=e(n,r);let s=()=>{throw new Error(is(15))};const o={getState:i.getState,dispatch:(u,...h)=>s(u,...h)},l=t.map(u=>u(o));return s=Rx(...l)(i.dispatch),{...i,dispatch:s}}}function JB(t){return b4(t)&&"type"in t&&typeof t.type=="string"}var ez=Symbol.for("immer-nothing"),FR=Symbol.for("immer-draftable"),Ws=Symbol.for("immer-state");function Ko(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var $a=Object,vm=$a.getPrototypeOf,Dx="constructor",A2="prototype",NC="configurable",Nx="enumerable",q1="writable",ev="value",Zc=t=>!!t&&!!t[Ws];function ul(t){var e;return t?tz(t)||R2(t)||!!t[FR]||!!((e=t[Dx])!=null&&e[FR])||D2(t)||N2(t):!1}var voe=$a[A2][Dx].toString(),HR=new WeakMap;function tz(t){if(!t||!y4(t))return!1;const e=vm(t);if(e===null||e===$a[A2])return!0;const n=$a.hasOwnProperty.call(e,Dx)&&e[Dx];if(n===Object)return!0;if(!vp(n))return!1;let r=HR.get(n);return r===void 0&&(r=Function.toString.call(n),HR.set(n,r)),r===voe}function M2(t,e,n=!0){tb(t)===0?(n?Reflect.ownKeys(t):$a.keys(t)).forEach(i=>{e(i,t[i],t)}):t.forEach((r,i)=>e(i,r,t))}function tb(t){const e=t[Ws];return e?e.type_:R2(t)?1:D2(t)?2:N2(t)?3:0}var VR=(t,e,n=tb(t))=>n===2?t.has(e):$a[A2].hasOwnProperty.call(t,e),PC=(t,e,n=tb(t))=>n===2?t.get(e):t[e],Px=(t,e,n,r=tb(t))=>{r===2?t.set(e,n):r===3?t.add(n):t[e]=n};function boe(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var R2=Array.isArray,D2=t=>t instanceof Map,N2=t=>t instanceof Set,y4=t=>typeof t=="object",vp=t=>typeof t=="function",p3=t=>typeof t=="boolean";function yoe(t){const e=+t;return Number.isInteger(e)&&String(e)===t}var $c=t=>t.copy_||t.base_,x4=t=>t.modified_?t.copy_:t.base_;function LC(t,e){if(D2(t))return new Map(t);if(N2(t))return new Set(t);if(R2(t))return Array[A2].slice.call(t);const n=tz(t);if(e===!0||e==="class_only"&&!n){const r=$a.getOwnPropertyDescriptors(t);delete r[Ws];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const o=i[s],l=r[o];l[q1]===!1&&(l[q1]=!0,l[NC]=!0),(l.get||l.set)&&(r[o]={[NC]:!0,[q1]:!0,[Nx]:l[Nx],[ev]:t[o]})}return $a.create(vm(t),r)}else{const r=vm(t);if(r!==null&&n)return{...t};const i=$a.create(r);return $a.assign(i,t)}}function w4(t,e=!1){return P2(t)||Zc(t)||!ul(t)||(tb(t)>1&&$a.defineProperties(t,{set:Hy,add:Hy,clear:Hy,delete:Hy}),$a.freeze(t),e&&M2(t,(n,r)=>{w4(r,!0)},!1)),t}function xoe(){Ko(2)}var Hy={[ev]:xoe};function P2(t){return t===null||!y4(t)?!0:$a.isFrozen(t)}var Lx="MapSet",$C="Patches",UR="ArrayMethods",nz={};function ff(t){const e=nz[t];return e||Ko(0,t),e}var QR=t=>!!nz[t],tv,rz=()=>tv,woe=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:QR(Lx)?ff(Lx):void 0,arrayMethodsPlugin_:QR(UR)?ff(UR):void 0});function WR(t,e){e&&(t.patchPlugin_=ff($C),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function IC(t){BC(t),t.drafts_.forEach(Soe),t.drafts_=null}function BC(t){t===tv&&(tv=t.parent_)}var YR=t=>tv=woe(tv,t);function Soe(t){const e=t[Ws];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function XR(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];if(t!==void 0&&t!==n){n[Ws].modified_&&(IC(e),Ko(4)),ul(t)&&(t=GR(e,t));const{patchPlugin_:i}=e;i&&i.generateReplacementPatches_(n[Ws].base_,t,e)}else t=GR(e,n);return joe(e,t,!0),IC(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==ez?t:void 0}function GR(t,e){if(P2(e))return e;const n=e[Ws];if(!n)return $x(e,t.handledSet_,t);if(!L2(n,t))return e;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(t);az(n,t)}return n.copy_}function joe(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&w4(e,n)}function iz(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var L2=(t,e)=>t.scope_===e,_oe=[];function sz(t,e,n,r){const i=$c(t),s=t.type_;if(r!==void 0&&PC(i,r,s)===e){Px(i,r,n,s);return}if(!t.draftLocations_){const l=t.draftLocations_=new Map;M2(i,(u,h)=>{if(Zc(h)){const f=l.get(h)||[];f.push(u),l.set(h,f)}})}const o=t.draftLocations_.get(e)??_oe;for(const l of o)Px(i,l,n,s)}function Toe(t,e,n){t.callbacks_.push(function(i){var l;const s=e;if(!s||!L2(s,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(s);const o=x4(s);sz(t,s.draft_??s,o,n),az(s,i)})}function az(t,e){var r;if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(((r=t.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=e;if(i){const s=i.getPath(t);s&&i.generatePatches_(t,s,e)}iz(t)}}function Coe(t,e,n){const{scope_:r}=t;if(Zc(n)){const i=n[Ws];L2(i,r)&&i.callbacks_.push(function(){F1(t);const o=x4(i);sz(t,n,o,e)})}else ul(n)&&t.callbacks_.push(function(){const s=$c(t);t.type_===3?s.has(n)&&$x(n,r.handledSet_,r):PC(s,e,t.type_)===n&&r.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&$x(PC(t.copy_,e,t.type_),r.handledSet_,r)})}function $x(t,e,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Zc(t)||e.has(t)||!ul(t)||P2(t)||(e.add(t),M2(t,(r,i)=>{if(Zc(i)){const s=i[Ws];if(L2(s,n)){const o=x4(s);Px(t,r,o,t.type_),iz(s)}}else ul(i)&&$x(i,e,n)})),t}function koe(t,e){const n=R2(t),r={type_:n?1:0,scope_:e?e.scope_:rz(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,s=Ix;n&&(i=[r],s=nv);const{revoke:o,proxy:l}=Proxy.revocable(i,s);return r.draft_=l,r.revoke_=o,[l,r]}var Ix={get(t,e){if(e===Ws)return t;let n=t.scope_.arrayMethodsPlugin_;const r=t.type_===1&&typeof e=="string";if(r&&n!=null&&n.isArrayOperationMethod(e))return n.createMethodInterceptor(t,e);const i=$c(t);if(!VR(i,e,t.type_))return Ooe(t,i,e);const s=i[e];if(t.finalized_||!ul(s)||r&&t.operationMethod&&(n!=null&&n.isMutatingArrayMethod(t.operationMethod))&&yoe(e))return s;if(s===m3(t.base_,e)){F1(t);const o=t.type_===1?+e:e,l=qC(t.scope_,s,t,o);return t.copy_[o]=l}return s},has(t,e){return e in $c(t)},ownKeys(t){return Reflect.ownKeys($c(t))},set(t,e,n){const r=oz($c(t),e);if(r!=null&&r.set)return r.set.call(t.draft_,n),!0;if(!t.modified_){const i=m3($c(t),e),s=i==null?void 0:i[Ws];if(s&&s.base_===n)return t.copy_[e]=n,t.assigned_.set(e,!1),!0;if(boe(n,i)&&(n!==void 0||VR(t.base_,e,t.type_)))return!0;F1(t),zC(t)}return t.copy_[e]===n&&(n!==void 0||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_.set(e,!0),Coe(t,e,n)),!0},deleteProperty(t,e){return F1(t),m3(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),zC(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=$c(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{[q1]:!0,[NC]:t.type_!==1||e!=="length",[Nx]:r[Nx],[ev]:n[e]}},defineProperty(){Ko(11)},getPrototypeOf(t){return vm(t.base_)},setPrototypeOf(){Ko(12)}},nv={};for(let t in Ix){let e=Ix[t];nv[t]=function(){const n=arguments;return n[0]=n[0][0],e.apply(this,n)}}nv.deleteProperty=function(t,e){return nv.set.call(this,t,e,void 0)};nv.set=function(t,e,n){return Ix.set.call(this,t[0],e,n,t[0])};function m3(t,e){const n=t[Ws];return(n?$c(n):t)[e]}function Ooe(t,e,n){var i;const r=oz(e,n);return r?ev in r?r[ev]:(i=r.get)==null?void 0:i.call(t.draft_):void 0}function oz(t,e){if(!(e in t))return;let n=vm(t);for(;n;){const r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=vm(n)}}function zC(t){t.modified_||(t.modified_=!0,t.parent_&&zC(t.parent_))}function F1(t){t.copy_||(t.assigned_=new Map,t.copy_=LC(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Eoe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,n,r)=>{if(vp(e)&&!vp(n)){const s=n;n=e;const o=this;return function(u=s,...h){return o.produce(u,f=>n.call(this,f,...h))}}vp(n)||Ko(6),r!==void 0&&!vp(r)&&Ko(7);let i;if(ul(e)){const s=YR(this),o=qC(s,e,void 0);let l=!0;try{i=n(o),l=!1}finally{l?IC(s):BC(s)}return WR(s,r),XR(i,s)}else if(!e||!y4(e)){if(i=n(e),i===void 0&&(i=e),i===ez&&(i=void 0),this.autoFreeze_&&w4(i,!0),r){const s=[],o=[];ff($C).generateReplacementPatches_(e,i,{patches_:s,inversePatches_:o}),r(s,o)}return i}else Ko(1,e)},this.produceWithPatches=(e,n)=>{if(vp(e))return(o,...l)=>this.produceWithPatches(o,u=>e(u,...l));let r,i;return[this.produce(e,n,(o,l)=>{r=o,i=l}),r,i]},p3(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),p3(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),p3(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){ul(t)||Ko(8),Zc(t)&&(t=Aoe(t));const e=YR(this),n=qC(e,t,void 0);return n[Ws].isManual_=!0,BC(e),n}finishDraft(t,e){const n=t&&t[Ws];(!n||!n.isManual_)&&Ko(9);const{scope_:r}=n;return WR(r,e),XR(void 0,r)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let n;for(n=e.length-1;n>=0;n--){const i=e[n];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}n>-1&&(e=e.slice(n+1));const r=ff($C).applyPatches_;return Zc(t)?r(t,e):this.produce(t,i=>r(i,e))}};function qC(t,e,n,r){const[i,s]=D2(e)?ff(Lx).proxyMap_(e,n):N2(e)?ff(Lx).proxySet_(e,n):koe(e,n);return((n==null?void 0:n.scope_)??rz()).drafts_.push(i),s.callbacks_=(n==null?void 0:n.callbacks_)??[],s.key_=r,n&&r!==void 0?Toe(n,s,r):s.callbacks_.push(function(u){var f;(f=u.mapSetPlugin_)==null||f.fixSetContents(s);const{patchPlugin_:h}=u;s.modified_&&h&&h.generatePatches_(s,[],u)}),i}function Aoe(t){return Zc(t)||Ko(10,t),lz(t)}function lz(t){if(!ul(t)||P2(t))return t;const e=t[Ws];let n,r=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=LC(t,e.scope_.immer_.useStrictShallowCopy_),r=e.scope_.immer_.shouldUseStrictIteration()}else n=LC(t,!0);return M2(n,(i,s)=>{Px(n,i,lz(s))},r),e&&(e.finalized_=!1),n}var Moe=new Eoe,cz=Moe.produce;function uz(t){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,t):i(s)}var Roe=uz(),Doe=uz,Noe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Rx:Rx.apply(null,arguments)};function bm(t,e){function n(...r){if(e){let i=e(...r);if(!i)throw new Error(Ba(0));return{type:t,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:t,payload:r[0]}}return n.toString=()=>`${t}`,n.type=t,n.match=r=>JB(r)&&r.type===t,n}var hz=class mg extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,mg.prototype)}static get[Symbol.species](){return mg}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new mg(...e[0].concat(this)):new mg(...e.concat(this))}};function KR(t){return ul(t)?cz(t,()=>{}):t}function Vy(t,e,n){return t.has(e)?t.get(e):t.set(e,n(e)).get(e)}function Poe(t){return typeof t=="boolean"}var Loe=()=>function(e){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=e??{};let o=new hz;return n&&(Poe(n)?o.push(Roe):o.push(Doe(n.extraArgument))),o},$oe="RTK_autoBatch",ZR=t=>e=>{setTimeout(e,t)},Ioe=(t={type:"raf"})=>e=>(...n)=>{const r=e(...n);let i=!0,s=!1,o=!1;const l=new Set,u=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ZR(10):t.type==="callback"?t.queueNotification:ZR(t.timeout),h=()=>{o=!1,s&&(s=!1,l.forEach(f=>f()))};return Object.assign({},r,{subscribe(f){const p=()=>i&&f(),m=r.subscribe(p);return l.add(f),()=>{m(),l.delete(f)}},dispatch(f){var p;try{return i=!((p=f==null?void 0:f.meta)!=null&&p[$oe]),s=!i,s&&(o||(o=!0,u(h))),r.dispatch(f)}finally{i=!0}}})},Boe=t=>function(n){const{autoBatch:r=!0}=n??{};let i=new hz(t);return r&&i.push(Ioe(typeof r=="object"?r:void 0)),i};function zoe(t){const e=Loe(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:s=void 0,enhancers:o=void 0}=t||{};let l;if(typeof n=="function")l=n;else if(b4(n))l=moe(n);else throw new Error(Ba(1));let u;typeof r=="function"?u=r(e):u=e();let h=Rx;i&&(h=Noe({trace:!1,...typeof i=="object"&&i}));const f=goe(...u),p=Boe(f);let m=typeof o=="function"?o(p):p();const v=h(...m);return ZB(l,s,v)}function dz(t){const e={},n=[];let r;const i={addCase(s,o){const l=typeof s=="string"?s:s.type;if(!l)throw new Error(Ba(28));if(l in e)throw new Error(Ba(29));return e[l]=o,i},addAsyncThunk(s,o){return o.pending&&(e[s.pending.type]=o.pending),o.rejected&&(e[s.rejected.type]=o.rejected),o.fulfilled&&(e[s.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:s.settled,reducer:o.settled}),i},addMatcher(s,o){return n.push({matcher:s,reducer:o}),i},addDefaultCase(s){return r=s,i}};return t(i),[e,n,r]}function qoe(t){return typeof t=="function"}function Foe(t,e){let[n,r,i]=dz(e),s;if(qoe(t))s=()=>KR(t());else{const l=KR(t);s=()=>l}function o(l=s(),u){let h=[n[u.type],...r.filter(({matcher:f})=>f(u)).map(({reducer:f})=>f)];return h.filter(f=>!!f).length===0&&(h=[i]),h.reduce((f,p)=>{if(p)if(Zc(f)){const v=p(f,u);return v===void 0?f:v}else{if(ul(f))return cz(f,m=>p(m,u));{const m=p(f,u);if(m===void 0){if(f===null)return f;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}}return f},l)}return o.getInitialState=s,o}var Hoe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Voe=(t=21)=>{let e="",n=t;for(;n--;)e+=Hoe[Math.random()*64|0];return e},Uoe=Symbol.for("rtk-slice-createasyncthunk");function Qoe(t,e){return`${t}/${e}`}function Woe({creators:t}={}){var n;const e=(n=t==null?void 0:t.asyncThunk)==null?void 0:n[Uoe];return function(i){const{name:s,reducerPath:o=s}=i;if(!s)throw new Error(Ba(11));const l=(typeof i.reducers=="function"?i.reducers(Xoe()):i.reducers)||{},u=Object.keys(l),h={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(C,j){const A=typeof C=="string"?C:C.type;if(!A)throw new Error(Ba(12));if(A in h.sliceCaseReducersByType)throw new Error(Ba(13));return h.sliceCaseReducersByType[A]=j,f},addMatcher(C,j){return h.sliceMatchers.push({matcher:C,reducer:j}),f},exposeAction(C,j){return h.actionCreators[C]=j,f},exposeCaseReducer(C,j){return h.sliceCaseReducersByName[C]=j,f}};u.forEach(C=>{const j=l[C],A={reducerName:C,type:Qoe(s,C),createNotation:typeof i.reducers=="function"};Koe(j)?Joe(A,j,f,e):Goe(A,j,f)});function p(){const[C={},j=[],A=void 0]=typeof i.extraReducers=="function"?dz(i.extraReducers):[i.extraReducers],E={...C,...h.sliceCaseReducersByType};return Foe(i.initialState,R=>{for(let N in E)R.addCase(N,E[N]);for(let N of h.sliceMatchers)R.addMatcher(N.matcher,N.reducer);for(let N of j)R.addMatcher(N.matcher,N.reducer);A&&R.addDefaultCase(A)})}const m=C=>C,v=new Map,b=new WeakMap;let x;function w(C,j){return x||(x=p()),x(C,j)}function S(){return x||(x=p()),x.getInitialState()}function _(C,j=!1){function A(R){let N=R[C];return typeof N>"u"&&j&&(N=Vy(b,A,S)),N}function E(R=m){const N=Vy(v,j,()=>new WeakMap);return Vy(N,R,()=>{const $={};for(const[D,F]of Object.entries(i.selectors??{}))$[D]=Yoe(F,R,()=>Vy(b,R,S),j);return $})}return{reducerPath:C,getSelectors:E,get selectors(){return E(A)},selectSlice:A}}const T={name:s,reducer:w,actions:h.actionCreators,caseReducers:h.sliceCaseReducersByName,getInitialState:S,..._(o),injectInto(C,{reducerPath:j,...A}={}){const E=j??o;return C.inject({reducerPath:E,reducer:w},A),{...T,..._(E,!0)}}};return T}}function Yoe(t,e,n,r){function i(s,...o){let l=e(s);return typeof l>"u"&&r&&(l=n()),t(l,...o)}return i.unwrapped=t,i}var $2=Woe();function Xoe(){function t(e,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...n}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...n){return e(...n)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:n}},asyncThunk:t}}function Goe({type:t,reducerName:e,createNotation:n},r,i){let s,o;if("reducer"in r){if(n&&!Zoe(r))throw new Error(Ba(17));s=r.reducer,o=r.prepare}else s=r;i.addCase(t,s).exposeCaseReducer(e,s).exposeAction(e,o?bm(t,o):bm(t))}function Koe(t){return t._reducerDefinitionType==="asyncThunk"}function Zoe(t){return t._reducerDefinitionType==="reducerWithPrepare"}function Joe({type:t,reducerName:e},n,r,i){if(!i)throw new Error(Ba(18));const{payloadCreator:s,fulfilled:o,pending:l,rejected:u,settled:h,options:f}=n,p=i(t,s,f);r.exposeAction(e,p),o&&r.addCase(p.fulfilled,o),l&&r.addCase(p.pending,l),u&&r.addCase(p.rejected,u),h&&r.addMatcher(p.settled,h),r.exposeCaseReducer(e,{fulfilled:o||Uy,pending:l||Uy,rejected:u||Uy,settled:h||Uy})}function Uy(){}var ele="task",fz="listener",pz="completed",S4="cancelled",tle=`task-${S4}`,nle=`task-${pz}`,FC=`${fz}-${S4}`,rle=`${fz}-${pz}`,I2=class{constructor(t){Yn(this,"name","TaskAbortError");Yn(this,"message");this.code=t,this.message=`${ele} ${S4} (reason: ${t})`}},j4=(t,e)=>{if(typeof t!="function")throw new TypeError(Ba(32))},Bx=()=>{},mz=(t,e=Bx)=>(t.catch(e),t),gz=(t,e)=>(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)),rf=t=>{if(t.aborted)throw new I2(t.reason)};function vz(t,e){let n=Bx;return new Promise((r,i)=>{const s=()=>i(new I2(t.reason));if(t.aborted){s();return}n=gz(t,s),e.finally(()=>n()).then(r,i)}).finally(()=>{n=Bx})}var ile=async(t,e)=>{try{return await Promise.resolve(),{status:"ok",value:await t()}}catch(n){return{status:n instanceof I2?"cancelled":"rejected",error:n}}finally{e==null||e()}},zx=t=>e=>mz(vz(t,e).then(n=>(rf(t),n))),bz=t=>{const e=zx(t);return n=>e(new Promise(r=>setTimeout(r,n)))},{assign:Np}=Object,JR={},B2="listenerMiddleware",sle=(t,e)=>{const n=r=>gz(t,()=>r.abort(t.reason));return(r,i)=>{j4(r);const s=new AbortController;n(s);const o=ile(async()=>{rf(t),rf(s.signal);const l=await r({pause:zx(s.signal),delay:bz(s.signal),signal:s.signal});return rf(s.signal),l},()=>s.abort(nle));return i!=null&&i.autoJoin&&e.push(o.catch(Bx)),{result:zx(t)(o),cancel(){s.abort(tle)}}}},ale=(t,e)=>{const n=async(r,i)=>{rf(e);let s=()=>{};const l=[new Promise((u,h)=>{let f=t({predicate:r,effect:(p,m)=>{m.unsubscribe(),u([p,m.getState(),m.getOriginalState()])}});s=()=>{f(),h()}})];i!=null&&l.push(new Promise(u=>setTimeout(u,i,null)));try{const u=await vz(e,Promise.race(l));return rf(e),u}finally{s()}};return(r,i)=>mz(n(r,i))},yz=t=>{let{type:e,actionCreator:n,matcher:r,predicate:i,effect:s}=t;if(e)i=bm(e).match;else if(n)e=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Ba(21));return j4(s),{predicate:i,type:e,effect:s}},xz=Np(t=>{const{type:e,predicate:n,effect:r}=yz(t);return{id:Voe(),effect:r,type:e,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Ba(22))}}},{withTypes:()=>xz}),eD=(t,e)=>{const{type:n,effect:r,predicate:i}=yz(e);return Array.from(t.values()).find(s=>(typeof n=="string"?s.type===n:s.predicate===i)&&s.effect===r)},HC=t=>{t.pending.forEach(e=>{e.abort(FC)})},ole=(t,e)=>()=>{for(const n of e.keys())HC(n);t.clear()},tD=(t,e,n)=>{try{t(e,n)}catch(r){setTimeout(()=>{throw r},0)}},wz=Np(bm(`${B2}/add`),{withTypes:()=>wz}),lle=bm(`${B2}/removeAll`),Sz=Np(bm(`${B2}/remove`),{withTypes:()=>Sz}),cle=(...t)=>{console.error(`${B2}/error`,...t)},ule=(t={})=>{const e=new Map,n=new Map,r=v=>{const b=n.get(v)??0;n.set(v,b+1)},i=v=>{const b=n.get(v)??1;b===1?n.delete(v):n.set(v,b-1)},{extra:s,onError:o=cle}=t;j4(o);const l=v=>(v.unsubscribe=()=>e.delete(v.id),e.set(v.id,v),b=>{v.unsubscribe(),b!=null&&b.cancelActive&&HC(v)}),u=v=>{const b=eD(e,v)??xz(v);return l(b)};Np(u,{withTypes:()=>u});const h=v=>{const b=eD(e,v);return b&&(b.unsubscribe(),v.cancelActive&&HC(b)),!!b};Np(h,{withTypes:()=>h});const f=async(v,b,x,w)=>{const S=new AbortController,_=ale(u,S.signal),T=[];try{v.pending.add(S),r(v),await Promise.resolve(v.effect(b,Np({},x,{getOriginalState:w,condition:(C,j)=>_(C,j).then(Boolean),take:_,delay:bz(S.signal),pause:zx(S.signal),extra:s,signal:S.signal,fork:sle(S.signal,T),unsubscribe:v.unsubscribe,subscribe:()=>{e.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((C,j,A)=>{C!==S&&(C.abort(FC),A.delete(C))})},cancel:()=>{S.abort(FC),v.pending.delete(S)},throwIfCancelled:()=>{rf(S.signal)}})))}catch(C){C instanceof I2||tD(o,C,{raisedBy:"effect"})}finally{await Promise.all(T),S.abort(rle),i(v),v.pending.delete(S)}},p=ole(e,n);return{middleware:v=>b=>x=>{if(!JB(x))return b(x);if(wz.match(x))return u(x.payload);if(lle.match(x)){p();return}if(Sz.match(x))return h(x.payload);let w=v.getState();const S=()=>{if(w===JR)throw new Error(Ba(23));return w};let _;try{if(_=b(x),e.size>0){const T=v.getState(),C=Array.from(e.values());for(const j of C){let A=!1;try{A=j.predicate(x,T,w)}catch(E){A=!1,tD(o,E,{raisedBy:"predicate"})}A&&f(j,x,v,S)}}}finally{w=JR}return _},startListening:u,stopListening:h,clearListeners:p}};function Ba(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var H1={exports:{}},hle=H1.exports,nD;function dle(){return nD||(nD=1,function(t,e){(function(n,r){t.exports=r()})(hle,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",l="minute",u="hour",h="day",f="week",p="month",m="quarter",v="year",b="date",x="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var q=["th","st","nd","rd"],P=H%100;return"["+H+(q[(P-20)%10]||q[P]||q[0])+"]"}},T=function(H,q,P){var I=String(H);return!I||I.length>=q?H:""+Array(q+1-I.length).join(P)+H},C={s:T,z:function(H){var q=-H.utcOffset(),P=Math.abs(q),I=Math.floor(P/60),U=P%60;return(q<=0?"+":"-")+T(I,2,"0")+":"+T(U,2,"0")},m:function H(q,P){if(q.date()<P.date())return-H(P,q);var I=12*(P.year()-q.year())+(P.month()-q.month()),U=q.clone().add(I,p),Z=P-U<0,X=q.clone().add(I+(Z?-1:1),p);return+(-(I+(P-U)/(Z?U-X:X-U))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:p,y:v,w:f,d:h,D:b,h:u,m:l,s:o,ms:s,Q:m}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},j="en",A={};A[j]=_;var E="$isDayjsObject",R=function(H){return H instanceof F||!(!H||!H[E])},N=function H(q,P,I){var U;if(!q)return j;if(typeof q=="string"){var Z=q.toLowerCase();A[Z]&&(U=Z),P&&(A[Z]=P,U=Z);var X=q.split("-");if(!U&&X.length>1)return H(X[0])}else{var V=q.name;A[V]=q,U=V}return!I&&U&&(j=U),U||!I&&j},$=function(H,q){if(R(H))return H.clone();var P=typeof q=="object"?q:{};return P.date=H,P.args=arguments,new F(P)},D=C;D.l=N,D.i=R,D.w=function(H,q){return $(H,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var F=function(){function H(P){this.$L=N(P.locale,null,!0),this.parse(P),this.$x=this.$x||P.x||{},this[E]=!0}var q=H.prototype;return q.parse=function(P){this.$d=function(I){var U=I.date,Z=I.utc;if(U===null)return new Date(NaN);if(D.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var X=U.match(w);if(X){var V=X[2]-1||0,G=(X[7]||"0").substring(0,3);return Z?new Date(Date.UTC(X[1],V,X[3]||1,X[4]||0,X[5]||0,X[6]||0,G)):new Date(X[1],V,X[3]||1,X[4]||0,X[5]||0,X[6]||0,G)}}return new Date(U)}(P),this.init()},q.init=function(){var P=this.$d;this.$y=P.getFullYear(),this.$M=P.getMonth(),this.$D=P.getDate(),this.$W=P.getDay(),this.$H=P.getHours(),this.$m=P.getMinutes(),this.$s=P.getSeconds(),this.$ms=P.getMilliseconds()},q.$utils=function(){return D},q.isValid=function(){return this.$d.toString()!==x},q.isSame=function(P,I){var U=$(P);return this.startOf(I)<=U&&U<=this.endOf(I)},q.isAfter=function(P,I){return $(P)<this.startOf(I)},q.isBefore=function(P,I){return this.endOf(I)<$(P)},q.$g=function(P,I,U){return D.u(P)?this[I]:this.set(U,P)},q.unix=function(){return Math.floor(this.valueOf()/1e3)},q.valueOf=function(){return this.$d.getTime()},q.startOf=function(P,I){var U=this,Z=!!D.u(I)||I,X=D.p(P),V=function(Fe,Pe){var ae=D.w(U.$u?Date.UTC(U.$y,Pe,Fe):new Date(U.$y,Pe,Fe),U);return Z?ae:ae.endOf(h)},G=function(Fe,Pe){return D.w(U.toDate()[Fe].apply(U.toDate("s"),(Z?[0,0,0,0]:[23,59,59,999]).slice(Pe)),U)},W=this.$W,te=this.$M,oe=this.$D,be="set"+(this.$u?"UTC":"");switch(X){case v:return Z?V(1,0):V(31,11);case p:return Z?V(1,te):V(0,te+1);case f:var ye=this.$locale().weekStart||0,Ke=(W<ye?W+7:W)-ye;return V(Z?oe-Ke:oe+(6-Ke),te);case h:case b:return G(be+"Hours",0);case u:return G(be+"Minutes",1);case l:return G(be+"Seconds",2);case o:return G(be+"Milliseconds",3);default:return this.clone()}},q.endOf=function(P){return this.startOf(P,!1)},q.$set=function(P,I){var U,Z=D.p(P),X="set"+(this.$u?"UTC":""),V=(U={},U[h]=X+"Date",U[b]=X+"Date",U[p]=X+"Month",U[v]=X+"FullYear",U[u]=X+"Hours",U[l]=X+"Minutes",U[o]=X+"Seconds",U[s]=X+"Milliseconds",U)[Z],G=Z===h?this.$D+(I-this.$W):I;if(Z===p||Z===v){var W=this.clone().set(b,1);W.$d[V](G),W.init(),this.$d=W.set(b,Math.min(this.$D,W.daysInMonth())).$d}else V&&this.$d[V](G);return this.init(),this},q.set=function(P,I){return this.clone().$set(P,I)},q.get=function(P){return this[D.p(P)]()},q.add=function(P,I){var U,Z=this;P=Number(P);var X=D.p(I),V=function(te){var oe=$(Z);return D.w(oe.date(oe.date()+Math.round(te*P)),Z)};if(X===p)return this.set(p,this.$M+P);if(X===v)return this.set(v,this.$y+P);if(X===h)return V(1);if(X===f)return V(7);var G=(U={},U[l]=r,U[u]=i,U[o]=n,U)[X]||1,W=this.$d.getTime()+P*G;return D.w(W,this)},q.subtract=function(P,I){return this.add(-1*P,I)},q.format=function(P){var I=this,U=this.$locale();if(!this.isValid())return U.invalidDate||x;var Z=P||"YYYY-MM-DDTHH:mm:ssZ",X=D.z(this),V=this.$H,G=this.$m,W=this.$M,te=U.weekdays,oe=U.months,be=U.meridiem,ye=function(Pe,ae,Te,fe){return Pe&&(Pe[ae]||Pe(I,Z))||Te[ae].slice(0,fe)},Ke=function(Pe){return D.s(V%12||12,Pe,"0")},Fe=be||function(Pe,ae,Te){var fe=Pe<12?"AM":"PM";return Te?fe.toLowerCase():fe};return Z.replace(S,function(Pe,ae){return ae||function(Te){switch(Te){case"YY":return String(I.$y).slice(-2);case"YYYY":return D.s(I.$y,4,"0");case"M":return W+1;case"MM":return D.s(W+1,2,"0");case"MMM":return ye(U.monthsShort,W,oe,3);case"MMMM":return ye(oe,W);case"D":return I.$D;case"DD":return D.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return ye(U.weekdaysMin,I.$W,te,2);case"ddd":return ye(U.weekdaysShort,I.$W,te,3);case"dddd":return te[I.$W];case"H":return String(V);case"HH":return D.s(V,2,"0");case"h":return Ke(1);case"hh":return Ke(2);case"a":return Fe(V,G,!0);case"A":return Fe(V,G,!1);case"m":return String(G);case"mm":return D.s(G,2,"0");case"s":return String(I.$s);case"ss":return D.s(I.$s,2,"0");case"SSS":return D.s(I.$ms,3,"0");case"Z":return X}return null}(Pe)||X.replace(":","")})},q.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},q.diff=function(P,I,U){var Z,X=this,V=D.p(I),G=$(P),W=(G.utcOffset()-this.utcOffset())*r,te=this-G,oe=function(){return D.m(X,G)};switch(V){case v:Z=oe()/12;break;case p:Z=oe();break;case m:Z=oe()/3;break;case f:Z=(te-W)/6048e5;break;case h:Z=(te-W)/864e5;break;case u:Z=te/i;break;case l:Z=te/r;break;case o:Z=te/n;break;default:Z=te}return U?Z:D.a(Z)},q.daysInMonth=function(){return this.endOf(p).$D},q.$locale=function(){return A[this.$L]},q.locale=function(P,I){if(!P)return this.$L;var U=this.clone(),Z=N(P,I,!0);return Z&&(U.$L=Z),U},q.clone=function(){return D.w(this.$d,this)},q.toDate=function(){return new Date(this.valueOf())},q.toJSON=function(){return this.isValid()?this.toISOString():null},q.toISOString=function(){return this.$d.toISOString()},q.toString=function(){return this.$d.toUTCString()},H}(),Q=F.prototype;return $.prototype=Q,[["$ms",s],["$s",o],["$m",l],["$H",u],["$W",h],["$M",p],["$y",v],["$D",b]].forEach(function(H){Q[H[1]]=function(q){return this.$g(q,H[0],H[1])}}),$.extend=function(H,q){return H.$i||(H(q,F,$),H.$i=!0),$},$.locale=N,$.isDayjs=R,$.unix=function(H){return $(1e3*H)},$.en=A[j],$.Ls=A,$.p={},$})}(H1)),H1.exports}var fle=dle();const qe=dl(fle);var V1={exports:{}},ple=V1.exports,rD;function mle(){return rD||(rD=1,function(t,e){(function(n,r){t.exports=r()})(ple,function(){var n,r,i=1e3,s=6e4,o=36e5,l=864e5,u=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h=31536e6,f=2628e6,p=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,m={years:h,months:f,days:l,hours:o,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},v=function(A){return A instanceof C},b=function(A,E,R){return new C(A,R,E.$l)},x=function(A){return r.p(A)+"s"},w=function(A){return A<0},S=function(A){return w(A)?Math.ceil(A):Math.floor(A)},_=function(A){return Math.abs(A)},T=function(A,E){return A?w(A)?{negative:!0,format:""+_(A)+E}:{negative:!1,format:""+A+E}:{negative:!1,format:""}},C=function(){function A(R,N,$){var D=this;if(this.$d={},this.$l=$,R===void 0&&(this.$ms=0,this.parseFromMilliseconds()),N)return b(R*m[x(N)],this);if(typeof R=="number")return this.$ms=R,this.parseFromMilliseconds(),this;if(typeof R=="object")return Object.keys(R).forEach(function(H){D.$d[x(H)]=R[H]}),this.calMilliseconds(),this;if(typeof R=="string"){var F=R.match(p);if(F){var Q=F.slice(2).map(function(H){return H!=null?Number(H):0});return this.$d.years=Q[0],this.$d.months=Q[1],this.$d.weeks=Q[2],this.$d.days=Q[3],this.$d.hours=Q[4],this.$d.minutes=Q[5],this.$d.seconds=Q[6],this.calMilliseconds(),this}}return this}var E=A.prototype;return E.calMilliseconds=function(){var R=this;this.$ms=Object.keys(this.$d).reduce(function(N,$){return N+(R.$d[$]||0)*m[$]},0)},E.parseFromMilliseconds=function(){var R=this.$ms;this.$d.years=S(R/h),R%=h,this.$d.months=S(R/f),R%=f,this.$d.days=S(R/l),R%=l,this.$d.hours=S(R/o),R%=o,this.$d.minutes=S(R/s),R%=s,this.$d.seconds=S(R/i),R%=i,this.$d.milliseconds=R},E.toISOString=function(){var R=T(this.$d.years,"Y"),N=T(this.$d.months,"M"),$=+this.$d.days||0;this.$d.weeks&&($+=7*this.$d.weeks);var D=T($,"D"),F=T(this.$d.hours,"H"),Q=T(this.$d.minutes,"M"),H=this.$d.seconds||0;this.$d.milliseconds&&(H+=this.$d.milliseconds/1e3,H=Math.round(1e3*H)/1e3);var q=T(H,"S"),P=R.negative||N.negative||D.negative||F.negative||Q.negative||q.negative,I=F.format||Q.format||q.format?"T":"",U=(P?"-":"")+"P"+R.format+N.format+D.format+I+F.format+Q.format+q.format;return U==="P"||U==="-P"?"P0D":U},E.toJSON=function(){return this.toISOString()},E.format=function(R){var N=R||"YYYY-MM-DDTHH:mm:ss",$={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return N.replace(u,function(D,F){return F||String($[D])})},E.as=function(R){return this.$ms/m[x(R)]},E.get=function(R){var N=this.$ms,$=x(R);return $==="milliseconds"?N%=1e3:N=$==="weeks"?S(N/m[$]):this.$d[$],N||0},E.add=function(R,N,$){var D;return D=N?R*m[x(N)]:v(R)?R.$ms:b(R,this).$ms,b(this.$ms+D*($?-1:1),this)},E.subtract=function(R,N){return this.add(R,N,!0)},E.locale=function(R){var N=this.clone();return N.$l=R,N},E.clone=function(){return b(this.$ms,this)},E.humanize=function(R){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!R)},E.valueOf=function(){return this.asMilliseconds()},E.milliseconds=function(){return this.get("milliseconds")},E.asMilliseconds=function(){return this.as("milliseconds")},E.seconds=function(){return this.get("seconds")},E.asSeconds=function(){return this.as("seconds")},E.minutes=function(){return this.get("minutes")},E.asMinutes=function(){return this.as("minutes")},E.hours=function(){return this.get("hours")},E.asHours=function(){return this.as("hours")},E.days=function(){return this.get("days")},E.asDays=function(){return this.as("days")},E.weeks=function(){return this.get("weeks")},E.asWeeks=function(){return this.as("weeks")},E.months=function(){return this.get("months")},E.asMonths=function(){return this.as("months")},E.years=function(){return this.get("years")},E.asYears=function(){return this.as("years")},A}(),j=function(A,E,R){return A.add(E.years()*R,"y").add(E.months()*R,"M").add(E.days()*R,"d").add(E.hours()*R,"h").add(E.minutes()*R,"m").add(E.seconds()*R,"s").add(E.milliseconds()*R,"ms")};return function(A,E,R){n=R,r=R().$utils(),R.duration=function(D,F){var Q=R.locale();return b(D,{$l:Q},F)},R.isDuration=v;var N=E.prototype.add,$=E.prototype.subtract;E.prototype.add=function(D,F){return v(D)?j(this,D,1):N.bind(this)(D,F)},E.prototype.subtract=function(D,F){return v(D)?j(this,D,-1):$.bind(this)(D,F)}}})}(V1)),V1.exports}var gle=mle();const vle=dl(gle);var U1={exports:{}},ble=U1.exports,iD;function yle(){return iD||(iD=1,function(t,e){(function(n,r){t.exports=r()})(ble,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(s,o,l){var u=o.prototype;l.utc=function(x){var w={date:x,utc:!0,args:arguments};return new o(w)},u.utc=function(x){var w=l(this.toDate(),{locale:this.$L,utc:!0});return x?w.add(this.utcOffset(),n):w},u.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var h=u.parse;u.parse=function(x){x.utc&&(this.$u=!0),this.$utils().u(x.$offset)||(this.$offset=x.$offset),h.call(this,x)};var f=u.init;u.init=function(){if(this.$u){var x=this.$d;this.$y=x.getUTCFullYear(),this.$M=x.getUTCMonth(),this.$D=x.getUTCDate(),this.$W=x.getUTCDay(),this.$H=x.getUTCHours(),this.$m=x.getUTCMinutes(),this.$s=x.getUTCSeconds(),this.$ms=x.getUTCMilliseconds()}else f.call(this)};var p=u.utcOffset;u.utcOffset=function(x,w){var S=this.$utils().u;if(S(x))return this.$u?0:S(this.$offset)?p.call(this):this.$offset;if(typeof x=="string"&&(x=function(j){j===void 0&&(j="");var A=j.match(r);if(!A)return null;var E=(""+A[0]).match(i)||["-",0,0],R=E[0],N=60*+E[1]+ +E[2];return N===0?0:R==="+"?N:-N}(x),x===null))return this;var _=Math.abs(x)<=16?60*x:x;if(_===0)return this.utc(w);var T=this.clone();if(w)return T.$offset=_,T.$u=!1,T;var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(T=this.local().add(_+C,n)).$offset=_,T.$x.$localOffset=C,T};var m=u.format;u.format=function(x){var w=x||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return m.call(this,w)},u.valueOf=function(){var x=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*x},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var v=u.toDate;u.toDate=function(x){return x==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var b=u.diff;u.diff=function(x,w,S){if(x&&this.$u===x.$u)return b.call(this,x,w,S);var _=this.local(),T=l(x).local();return b.call(_,T,w,S)}}})}(U1)),U1.exports}var xle=yle();const wle=dl(xle);qe.extend(vle);qe.extend(wle);const _4=t=>{if(t==="")return null;if(t==="0")return 0;const e=new RegExp("^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$"),n=t.match(e);if(!n)return null;let r=0;const i=(s,o)=>{if(n[s]===void 0)return;const l=parseInt(n[s]);r+=l*o};return i(2,1e3*60*60*24*365),i(4,1e3*60*60*24*7),i(6,1e3*60*60*24),i(8,1e3*60*60),i(10,1e3*60),i(12,1e3),i(14,1),r},jz=(t,e,n)=>{if(t===0)return"0s";const r=t<0?"-":"";let i=Math.abs(t);const s=[];for(const{unit:o,mult:l,exact:u}of[{unit:"y",mult:1e3*60*60*24*365,exact:!0},{unit:"w",mult:1e3*60*60*24*7,exact:!0},{unit:"d",mult:1e3*60*60*24,exact:!1},{unit:"h",mult:1e3*60*60,exact:!1},{unit:"m",mult:1e3*60,exact:!1},{unit:"s",mult:1e3,exact:!1},{unit:"ms",mult:1,exact:!1}]){if(u&&i%l!==0)continue;const h=Math.floor(i/l);if(h>0)if(i-=h*l,n&&o==="s"&&i>0){s.push(`${parseFloat((h+i/1e3).toFixed(3))}s`);break}else s.push(`${h}${o}`);s.length==0&&o=="ms"&&s.push(`${Math.round(i)}ms`)}return r+s.join(e||"")},Bn=t=>jz(t);function Sle(t){return qe.utc(t).valueOf()}const qx=()=>qe().valueOf(),Pp=t=>jz(t," ",!0),Fx=(t,e,n=" ago")=>{const r=Sle(t);return r<0?"never":Pp(e-r)+n},sf=(t,e)=>e?qe.unix(t).tz(qe.tz.guess()).format():qe.unix(t).utc().format();function sD(t){return qe.utc(t).valueOf()}const jle=t=>{const e=new URLSearchParams(t),n=[];for(let r=0;e.has(`g${r}.expr`);r++){const i=z2(),s=(o,l)=>{const u=`g${r}.${o}`;e.has(u)&&l(e.get(u))};s("expr",o=>{i.expr=o}),s("show_tree",o=>{i.showTree=o==="1"}),s("tab",o=>{switch(o){case"0":case"graph":i.visualizer.activeTab="graph";break;case"1":case"table":i.visualizer.activeTab="table";break;case"explain":i.visualizer.activeTab="explain";break;default:console.log("Unknown tab",o)}}),s("display_mode",o=>{i.visualizer.displayMode=o}),s("stacked",o=>{i.visualizer.displayMode=o==="1"?ym.Stacked:ym.Lines}),s("y_axis_min",o=>{i.visualizer.yAxisMin=o===""?null:parseFloat(o)}),s("show_exemplars",o=>{i.visualizer.showExemplars=o==="1"}),s("range_input",o=>{i.visualizer.range=_4(o)||i.visualizer.range}),s("end_input",o=>{i.visualizer.endTime=sD(o)}),s("step_input",o=>{parseInt(o)>0&&(i.visualizer.resolution={type:"custom",step:parseInt(o)*1e3})}),s("res_type",o=>{switch(o){case"auto":s("res_density",l=>{["low","medium","high"].includes(l)&&(i.visualizer.resolution={type:"auto",density:l})});break;case"fixed":s("res_step",l=>{i.visualizer.resolution={type:"fixed",step:parseFloat(l)*1e3}});break;case"custom":s("res_step",l=>{i.visualizer.resolution={type:"custom",step:parseFloat(l)*1e3}});break;default:console.log("Unknown resolution type",o)}}),s("moment_input",o=>{i.visualizer.endTime=sD(o)}),n.push(i)}return n};function aD(t){return qe.utc(t).format("YYYY-MM-DD HH:mm:ss")}const _le=t=>{const e=new URLSearchParams,n=(r,i,s)=>e.append(`g${r}.${i}`,s);return t.forEach((r,i)=>{switch(n(i,"expr",r.expr),n(i,"show_tree",r.showTree?"1":"0"),n(i,"tab",r.visualizer.activeTab),r.visualizer.endTime!==null&&(n(i,"end_input",aD(r.visualizer.endTime)),n(i,"moment_input",aD(r.visualizer.endTime))),n(i,"range_input",Bn(r.visualizer.range)),r.visualizer.resolution.type){case"auto":n(i,"res_type","auto"),n(i,"res_density",r.visualizer.resolution.density);break;case"fixed":n(i,"res_type","fixed"),n(i,"res_step",(r.visualizer.resolution.step/1e3).toString());break;case"custom":n(i,"res_type","custom"),n(i,"res_step",(r.visualizer.resolution.step/1e3).toString());break}n(i,"display_mode",r.visualizer.displayMode),r.visualizer.yAxisMin!==null&&n(i,"y_axis_min",r.visualizer.yAxisMin.toString()),n(i,"show_exemplars",r.visualizer.showExemplars?"1":"0")}),e},Ea=(t,e)=>{const n=localStorage.getItem(t);return n===null?e:JSON.parse(n)},_z="queryPage.queryHistory";var ym=(t=>(t.Lines="lines",t.Stacked="stacked",t.Heatmap="heatmap",t))(ym||{});const Q1=(t,e)=>{switch(t.type){case"auto":{const n=t.density==="high"?750:t.density==="medium"?250:100;return Math.max(Math.floor(e/n/1e3)*1e3,1e3)}case"fixed":return t.step;case"custom":return t.step}},z2=()=>({id:dm(),expr:"",showTree:!1,showMetricsExplorer:!1,visualizer:{activeTab:"table",endTime:null,range:3600*1e3,resolution:{type:"auto",density:"medium"},displayMode:"lines",showExemplars:!1,yAxisMin:null}}),Tle={panels:[z2()],queryHistory:Ea(_z,[])},dp=t=>{const e="?"+_le(t).toString();window.history.pushState({},"",e)},Tz=$2({name:"queryPage",initialState:Tle,reducers:{setPanels:(t,{payload:e})=>{t.panels=e},addPanel:t=>{t.panels.push(z2()),dp(t.panels)},duplicatePanel:(t,{payload:e})=>{const n={...t.panels[e.idx],id:dm(),expr:e.expr};t.panels.splice(e.idx+1,0,n),dp(t.panels)},removePanel:(t,{payload:e})=>{t.panels.splice(e,1),dp(t.panels)},setExpr:(t,{payload:e})=>{t.panels[e.idx].expr=e.expr,dp(t.panels)},addQueryToHistory:(t,{payload:e})=>{t.queryHistory=[e,...t.queryHistory.filter(n=>n!==e)].slice(0,50)},setShowTree:(t,{payload:e})=>{t.panels[e.idx].showTree=e.showTree,dp(t.panels)},setVisualizer:(t,{payload:e})=>{t.panels[e.idx].visualizer=e.visualizer,dp(t.panels)}}}),{setPanels:oD,addPanel:Cle,removePanel:kle,duplicatePanel:Ole,setExpr:Ele,addQueryToHistory:Cz,setShowTree:g3,setVisualizer:Gu}=Tz.actions,Ale=Tz.reducer;function Mle({direction:t,levelIndex:e,rowIndex:n,cellIndex:r,size:i}){switch(t){case"up":return e===0&&n===0?null:n===0?{levelIndex:e-1,rowIndex:r<=i[e-1][i[e-1].length-1]-1?i[e-1].length-1:i[e-1].length-2,cellIndex:r}:{levelIndex:e,rowIndex:n-1,cellIndex:r};case"down":return n===i[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:r}:n===i[e].length-2&&r>=i[e][i[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:r}:{levelIndex:e,rowIndex:n+1,cellIndex:r};case"left":return e===0&&n===0&&r===0?null:n===0&&r===0?{levelIndex:e-1,rowIndex:i[e-1].length-1,cellIndex:i[e-1][i[e-1].length-1]-1}:r===0?{levelIndex:e,rowIndex:n-1,cellIndex:i[e][n-1]-1}:{levelIndex:e,rowIndex:n,cellIndex:r-1};case"right":return n===i[e].length-1&&r===i[e][n]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:r===i[e][n]-1?{levelIndex:e,rowIndex:n+1,cellIndex:0}:{levelIndex:e,rowIndex:n,cellIndex:r+1};default:return{levelIndex:e,rowIndex:n,cellIndex:r}}}function kz({controlsRef:t,direction:e,levelIndex:n,rowIndex:r,cellIndex:i,size:s}){var u,h,f;const o=Mle({direction:e,size:s,rowIndex:r,cellIndex:i,levelIndex:n});if(!o)return;const l=(f=(h=(u=t.current)==null?void 0:u[o.levelIndex])==null?void 0:h[o.rowIndex])==null?void 0:f[o.cellIndex];l&&(l.disabled||l.getAttribute("data-hidden")||l.getAttribute("data-outside")?kz({controlsRef:t,direction:e,levelIndex:o.levelIndex,cellIndex:o.cellIndex,rowIndex:o.rowIndex,size:s}):l.focus())}function Rle(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function Dle(t){var e;return(e=t.current)==null?void 0:e.map(n=>n.map(r=>r.length))}function T4({controlsRef:t,levelIndex:e,rowIndex:n,cellIndex:r,event:i}){const s=Rle(i.key);if(s){i.preventDefault();const o=Dle(t);kz({controlsRef:t,direction:s,levelIndex:e,rowIndex:n,cellIndex:r,size:o})}}function lD(t,e){let n=t?qe(t):qe();if(e==="")return n.format("YYYY-MM-DD HH:mm:ss");const[r,i,s=0]=e.split(":").map(Number);return n=n.set("hour",r),n=n.set("minute",i),n=n.set("second",s),n=n.set("millisecond",0),n.format("YYYY-MM-DD HH:mm:ss")}function Es(t){return t==null||t===""?t:qe(t).format("YYYY-MM-DD")}function _p(t){return t==null||t===""?t:qe(t).format("YYYY-MM-DD HH:mm:ss")}function Nle({minDate:t,maxDate:e}){const n=qe();return!t&&!e?Es(n):t&&qe(n).isBefore(t)?Es(t):e&&qe(n).isAfter(e)?Es(e):Es(n)}function v3(t,e,n){return!t&&!e?_p(n):t&&qe(n).isBefore(t)?_p(t):e&&qe(n).isAfter(e)?_p(e):_p(n)}const Ple={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},Lle=M.createContext(Ple);function Gh(){const t=M.useContext(Lle),e=M.useCallback(s=>s||t.locale,[t.locale]),n=M.useCallback(s=>typeof s=="number"?s:t.firstDayOfWeek,[t.firstDayOfWeek]),r=M.useCallback(s=>Array.isArray(s)?s:t.weekendDays,[t.weekendDays]),i=M.useCallback(s=>typeof s=="string"?s:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:n,getWeekendDays:r,getLabelSeparator:i}}function $le({value:t,type:e,withTime:n}){const r=n?_p:Es;if(e==="range"&&Array.isArray(t)){const i=r(t[0]),s=r(t[1]);return i?s?`${i} – ${s}`:`${i} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?r(t):""}function Oz({value:t,type:e,name:n,form:r,withTime:i=!1}){return a.jsx("input",{type:"hidden",value:$le({value:t,type:e,withTime:i}),name:n,form:r})}Oz.displayName="@mantine/dates/HiddenDatesInput";function Os(t){return t<10?`0${t}`:`${t}`}const Ile=t=>Number(t.toFixed(0)[0]),W1=M.forwardRef(({value:t,min:e,max:n,onChange:r,focusable:i,step:s,onNextInput:o,onPreviousInput:l,onFocus:u,readOnly:h,allowTemporaryZero:f=!1,placeholder:p="--",...m},v)=>{const b=Ile(n),x=n+1-s,w=_=>{if(h)return;const T=_.replace(/\D/g,"");if(T!==""){const C=parseInt(T,10),j=f&&C===0&&e>0?0:Sh(C,e,n);r(j),(j>b||_.startsWith("00"))&&(o==null||o())}},S=_=>{if(!h){if((_.key==="0"||_.key==="Num0")&&t===0&&(_.preventDefault(),o==null||o()),_.key==="Home"&&(_.preventDefault(),r(e)),_.key==="End"&&(_.preventDefault(),r(n)),(_.key==="Backspace"||_.key==="Delete")&&(_.preventDefault(),t!==null?r(null):l==null||l()),_.key==="ArrowRight"&&(_.preventDefault(),o==null||o()),_.key==="ArrowLeft"&&(_.preventDefault(),l==null||l()),_.key==="ArrowUp"){_.preventDefault();const T=t===null?e:Sh(t+s,e,x);r(T)}if(_.key==="ArrowDown"){_.preventDefault();const T=t===null?x:Sh(t-s,e,x);r(T)}}};return a.jsx("input",{ref:v,type:"text",role:"spinbutton","aria-valuemin":e,"aria-valuemax":n,"aria-valuenow":t===null?0:t,"data-empty":t===null||void 0,inputMode:"numeric",placeholder:p,value:t===null?"":Os(t),onChange:_=>w(_.currentTarget.value),onKeyDown:S,onFocus:_=>{_.currentTarget.select(),u==null||u(_)},onClick:_=>{_.stopPropagation(),_.currentTarget.select()},onMouseDown:_=>_.stopPropagation(),...m})});W1.displayName="@mantine/dates/SpinInput";const[Ble,kf]=Wi("TimeInput component was not found in the component tree"),Ez=M.forwardRef(({labels:t,value:e,onChange:n,className:r,style:i,onPreviousInput:s,readOnly:o,onMouseDown:l,onTouchStart:u,inputType:h,...f},p)=>{const m=kf(),v=b=>{o||(b.key==="Home"&&(b.preventDefault(),n(t.am)),b.key==="End"&&(b.preventDefault(),n(t.pm)),(b.key==="Backspace"||b.key==="Delete")&&(b.preventDefault(),e===null?s==null||s():n(null)),b.key==="ArrowLeft"&&(b.preventDefault(),s==null||s()),(b.key==="ArrowUp"||b.key==="ArrowDown")&&(b.preventDefault(),n(e===t.am?t.pm:t.am)),b.code==="KeyA"&&(b.preventDefault(),n(t.am)),b.code==="KeyP"&&(b.preventDefault(),n(t.pm)))};if(h==="input"){const b=e||"--",x=b.length+1;return a.jsx("input",{...m.getStyles("field",{className:r,style:i}),ref:p,value:b,size:x,readOnly:!0,onChange:()=>{},onClick:w=>w.stopPropagation(),onKeyDown:v,onMouseDown:w=>{w.stopPropagation(),l==null||l(w)},"data-am-pm":!0,...f})}return a.jsxs("select",{...m.getStyles("field",{className:r,style:i}),ref:p,value:e||"",onChange:b=>!o&&n(b.target.value||null),onClick:b=>b.stopPropagation(),onKeyDown:v,onMouseDown:b=>{b.stopPropagation(),l==null||l(b)},"data-am-pm":!0,...f,children:[a.jsx("option",{value:"",children:"--"}),a.jsx("option",{value:t.am,children:t.am}),a.jsx("option",{value:t.pm,children:t.pm})]})});Ez.displayName="@mantine/dates/AmPmInput";function C4({value:t,active:e,onSelect:n}){const r=kf();return a.jsx(Dr,{mod:{active:e},onClick:()=>n(t),onMouseDown:i=>i.preventDefault(),"data-value":t,tabIndex:-1,...r.getStyles("control"),children:typeof t=="number"?Os(t):t})}C4.displayName="@mantine/dates/TimeControl";function Az({labels:t,value:e,onSelect:n}){const r=kf(),i=[t.am,t.pm].map(s=>a.jsx(C4,{value:s,active:e===s,onSelect:n},s));return a.jsx("div",{...r.getStyles("controlsList"),children:i})}Az.displayName="@mantine/dates/AmPmControlsList";function zle(t,e){if(!t||!e)return!1;const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top>=r.top&&n.bottom<=r.bottom&&n.left>=r.left&&n.right<=r.right}function qle(t,e,n){const r=[];for(let i=t;i<=e;i+=n)r.push(i);return r}function Y1({min:t,max:e,step:n,value:r,onSelect:i,reversed:s}){const o=kf(),l=M.useRef(null),u=qle(t,e,n),h=(s?u.reverse():u).map(f=>a.jsx(C4,{value:f,active:r===f,onSelect:i},f));return M.useEffect(()=>{r!==null&&requestAnimationFrame(()=>{var m;const p=(m=l.current)==null?void 0:m.querySelector(`[data-value="${r}"]`);zle(p,l.current)||p==null||p.scrollIntoView({block:"nearest"})})},[r]),a.jsx(Fa,{h:o.maxDropdownContentHeight,type:"never",viewportRef:l,...o.getStyles("scrollarea"),...o.scrollAreaProps,children:a.jsx("div",{...o.getStyles("controlsList"),children:h})})}Y1.displayName="@mantine/dates/TimeControlsList";var Mz={fieldsRoot:"m_7a8f1e6d",fieldsGroup:"m_d6bb0a54",controlsList:"m_b97ecb26",controlsListGroup:"m_31fe42f9",dropdown:"m_9c4817c3",control:"m_154c536b",presetControl:"m_7be09d0c",presetsGroup:"m_7d00001d",presetsGroupLabel:"m_d8d918d7",field:"m_6b43ba88"};function Hx(t){const[e=null,n=null,r=null]=t.split(":").map(Number);return{hours:e,minutes:n,seconds:r}}function Rz({time:t,compare:e,withSeconds:n}){const r=Hx(t),i=Hx(e);return n?r.hours===i.hours&&r.minutes===i.minutes&&r.seconds===i.seconds:r.hours===i.hours&&r.minutes===i.minutes}function Fle(t,e){return`${t.getHours()}:${t.getMinutes()}${e?`:${t.getSeconds()}`:""}`}function Hle({value:t,format:e,amPmLabels:n,withSeconds:r}){const i=Hx(typeof t=="string"?t:Fle(t,r));if(i.hours===null||i.minutes===null)return null;if(e==="24h")return`${Os(i.hours)}:${Os(i.minutes)}${r?`:${Os(i.seconds||0)}`:""}`;const s=i.hours>=12;return`${i.hours%12===0?12:i.hours%12}:${Os(i.minutes)}${r?`:${Os(i.seconds||0)}`:""} ${s?n.pm:n.am}`}function Dz({value:t,format:e="24h",amPmLabels:n={am:"AM",pm:"PM"},withSeconds:r=!1}){return a.jsx(a.Fragment,{children:Hle({value:t,format:e,amPmLabels:n,withSeconds:r})})}Dz.displayName="@mantine/dates/TimeValue";function k4({value:t,active:e,onChange:n,format:r,amPmLabels:i,withSeconds:s}){const o=kf();return a.jsx(Dr,{mod:{active:e},onClick:()=>n(t),...o.getStyles("presetControl"),children:a.jsx(Dz,{withSeconds:s,value:t,format:r,amPmLabels:i})})}k4.displayName="@mantine/dates/TimePresetControl";function Nz({value:t,data:e,onChange:n,format:r,amPmLabels:i,withSeconds:s}){const o=kf(),l=e.values.map(u=>a.jsx(k4,{value:u,format:r,amPmLabels:i,withSeconds:s,active:Rz({time:u,compare:t,withSeconds:s}),onChange:n},u));return a.jsxs("div",{...o.getStyles("presetsGroup"),children:[a.jsx("div",{...o.getStyles("presetsGroupLabel"),children:e.label}),a.jsx(C2,{cols:s?2:3,spacing:4,children:l})]})}Nz.displayName="@mantine/dates/TimePresetGroup";function Pz({presets:t,format:e,amPmLabels:n,withSeconds:r,value:i,onChange:s}){const o=kf();if(t.length===0)return null;if(typeof t[0]=="string"){const u=t.map(h=>a.jsx(k4,{value:h,format:e,amPmLabels:n,withSeconds:r,active:Rz({time:h,compare:i,withSeconds:r}),onChange:s},h));return a.jsx(Fa.Autosize,{mah:o.maxDropdownContentHeight,type:"never",...o.getStyles("scrollarea"),...o.scrollAreaProps,children:a.jsx("div",{...o.getStyles("presetsRoot"),children:a.jsx(C2,{cols:r?2:3,spacing:4,children:u})})})}const l=t.map((u,h)=>a.jsx(Nz,{data:u,value:i,format:e,amPmLabels:n,withSeconds:r,onChange:s},h));return a.jsx(Fa.Autosize,{mah:o.maxDropdownContentHeight,type:"never",...o.getStyles("scrollarea"),...o.scrollAreaProps,children:a.jsx("div",{...o.getStyles("presetsRoot"),children:l})})}Pz.displayName="@mantine/dates/TimePresets";function b3(t){const[e=0,n=0,r=0]=t.split(":").map(Number);return e*3600+n*60+r}function Vle(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60),r=t%60;return{timeString:`${Os(e)}:${Os(n)}:${Os(r)}`,hours:e,minutes:n,seconds:r}}function Lz(t,e,n){const r=b3(t),i=e?b3(e):-1/0,s=n?b3(n):1/0,o=Math.max(i,Math.min(r,s));return Vle(o)}function Ule({hours:t,minutes:e,seconds:n,amPmLabels:r}){if(t===null)return{hours:null,minutes:null,seconds:null,amPm:null};const i=t>=12?r.pm:r.am;return{hours:t%12===0?12:t%12,minutes:typeof e=="number"?e:null,seconds:typeof n=="number"?n:null,amPm:i}}function gg({time:t,format:e,amPmLabels:n}){if(t==="")return{hours:null,minutes:null,seconds:null,amPm:null};const{hours:r,minutes:i,seconds:s}=Hx(t),o={hours:r,minutes:i,seconds:s};return e==="12h"?Ule({...o,amPmLabels:n}):{...o,amPm:null}}function Qle({hours:t,minutes:e,seconds:n,amPm:r,amPmLabels:i,withSeconds:s}){let o=t;return r===i.pm&&t!==12?o+=12:r===i.am&&t===12&&(o=0),`${Os(o)}:${Os(e)}${s?`:${Os(n||0)}`:""}`}function bp({hours:t,minutes:e,seconds:n,format:r,withSeconds:i,amPm:s,amPmLabels:o}){return t===null||e===null?{valid:!1,value:""}:i&&n===null?{valid:!1,value:""}:r==="24h"?{valid:!0,value:`${Os(t)}:${Os(e)}${i?`:${Os(n)}`:""}`}:s===null?{valid:!1,value:""}:{valid:!0,value:Qle({hours:t,minutes:e,seconds:n,amPm:s,amPmLabels:o,withSeconds:i})}}function Wle({value:t,defaultValue:e,onChange:n,format:r,amPmLabels:i,withSeconds:s=!1,min:o,max:l,clearable:u,readOnly:h,disabled:f,pasteSplit:p}){const m=gg({time:t||e||"",amPmLabels:i,format:r}),v=bp({hours:m.hours,minutes:m.minutes,seconds:m.seconds,format:r,withSeconds:s,amPm:m.amPm,amPmLabels:i}),b=M.useRef(!0),x=M.useRef(!v.valid),[w,S]=M.useState(m.hours),[_,T]=M.useState(m.minutes),[C,j]=M.useState(m.seconds),[A,E]=M.useState(m.amPm),R=u&&!h&&!f&&(w!==null||_!==null||C!==null||A!==null),N=M.useRef(null),$=M.useRef(null),D=M.useRef(null),F=M.useRef(null),Q=W=>{var te,oe,be,ye;W==="hours"&&((te=N.current)==null||te.focus()),W==="minutes"&&((oe=$.current)==null||oe.focus()),W==="seconds"&&((be=D.current)==null||be.focus()),W==="amPm"&&((ye=F.current)==null||ye.focus())},H=(W,te)=>{const oe={hours:w,minutes:_,seconds:C,amPm:A,[W]:te},be=bp({...oe,format:r,withSeconds:s,amPmLabels:i});be.valid?(b.current=!1,x.current=!1,W==="hours"&&S(te),W==="minutes"&&T(te),W==="seconds"&&j(te),W==="amPm"&&E(te),n==null||n(be.value)):(b.current=!1,x.current||(n==null||n(""),x.current=!0))},q=W=>{b.current=!1;const te=gg({time:W,amPmLabels:i,format:r});S(te.hours),T(te.minutes),j(te.seconds),E(te.amPm);const oe=bp({...te,format:r,withSeconds:s,amPmLabels:i});x.current=!oe.valid,n==null||n(W)},P=W=>{let te=W;r==="12h"&&typeof W=="number"&&W>12&&(te=(W-1)%12+1),S(te),H("hours",te),Q("hours")},I=W=>{T(W),H("minutes",W),Q("minutes")},U=W=>{j(W),H("seconds",W),Q("seconds")},Z=W=>{E(W),H("amPm",W),Q("amPm")},X=()=>{b.current=!1,S(null),T(null),j(null),E(null),n==null||n(""),x.current=!0,Q("hours")},V=W=>{W.preventDefault();const te=W.clipboardData.getData("text"),oe=(p||gg)({time:te,format:r,amPmLabels:i}),be=bp({...oe,format:r,withSeconds:s,amPmLabels:i});if(be.valid){b.current=!1;const ye=Lz(be.value,o||"00:00:00",l||"23:59:59");n==null||n(ye.timeString),S(oe.hours),T(oe.minutes),j(oe.seconds),E(oe.amPm)}},G=bp({hours:w,minutes:_,seconds:C,format:r,withSeconds:s,amPm:A,amPmLabels:i});return Yl(()=>{if(t===""){b.current=!1,S(null),T(null),j(null),E(null),b.current=!0;return}if(b.current&&typeof t=="string"){const W=gg({time:t||"",amPmLabels:i,format:r});S(W.hours),T(W.minutes),j(W.seconds),E(W.amPm)}b.current=!0},[t]),{refs:{hours:N,minutes:$,seconds:D,amPm:F},values:{hours:w,minutes:_,seconds:C,amPm:A},setHours:P,setMinutes:I,setSeconds:U,setAmPm:Z,focus:Q,clear:X,onPaste:V,setTimeString:q,isClearable:R,hiddenInputValue:G.value}}const Yle={hoursStep:1,minutesStep:1,secondsStep:1,format:"24h",amPmLabels:{am:"AM",pm:"PM"},pasteSplit:gg,maxDropdownContentHeight:200,hoursPlaceholder:"--",minutesPlaceholder:"--",secondsPlaceholder:"--"},Xle=(t,{size:e})=>({dropdown:{"--control-font-size":Or(e)}}),O4=Ae((t,e)=>{const n=Se("TimePicker",Yle,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,onClick:h,format:f,value:p,defaultValue:m,onChange:v,hoursStep:b,minutesStep:x,secondsStep:w,withSeconds:S,hoursInputLabel:_,minutesInputLabel:T,secondsInputLabel:C,amPmInputLabel:j,amPmLabels:A,clearable:E,onMouseDown:R,onFocusCapture:N,onBlurCapture:$,min:D,max:F,popoverProps:Q,withDropdown:H,rightSection:q,onFocus:P,onBlur:I,clearButtonProps:U,hoursInputProps:Z,minutesInputProps:X,secondsInputProps:V,amPmSelectProps:G,readOnly:W,disabled:te,size:oe,name:be,form:ye,hiddenInputProps:Ke,labelProps:Fe,pasteSplit:Pe,hoursRef:ae,minutesRef:Te,secondsRef:fe,amPmRef:Ee,presets:gt,maxDropdownContentHeight:We,scrollAreaProps:Be,attributes:ze,reverseTimeControlsList:De,hoursPlaceholder:Ye,minutesPlaceholder:$t,secondsPlaceholder:tt,...et}=n,{resolvedClassNames:Ve,resolvedStyles:Le}=jo({classNames:r,styles:o,props:n}),Ce=lt({name:"TimePicker",classes:Mz,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:ze,vars:u,varsResolver:Xle}),ge=Wle({value:p,defaultValue:m,onChange:v,format:f,amPmLabels:A,withSeconds:S,min:D,max:F,clearable:E,disabled:te,readOnly:W,pasteSplit:Pe}),Kt=cr(ge.refs.hours,ae),qn=cr(ge.refs.minutes,Te),Ft=cr(ge.refs.seconds,fe),xn=cr(ge.refs.amPm,Ee),Zt=Ei(),ln=M.useRef(!1),[nn,Pt]=M.useState(!1),Wt=yt=>{ln.current||(ln.current=!0,P==null||P(yt))},Ri=yt=>{if(!yt.currentTarget.contains(yt.relatedTarget)){const kt=ge.values,ir=bp({...kt,format:f,amPmLabels:A,withSeconds:!!S});if(ir.valid&&(D||F)){const It=Lz(ir.value,D,F);It.timeString!==ir.value&&ge.setTimeString(It.timeString)}ln.current=!1,I==null||I(yt)}};return a.jsx(Ble,{value:{getStyles:Ce,scrollAreaProps:Be,maxDropdownContentHeight:We},children:a.jsxs(Kn,{opened:nn,transitionProps:{duration:0},position:"bottom-start",withRoles:!1,disabled:te||W||!H,...Q,children:[a.jsx(Kn.Target,{children:a.jsxs(Ha,{component:"div",size:oe,disabled:te,ref:e,onClick:yt=>{h==null||h(yt),ge.focus("hours")},onMouseDown:yt=>{yt.preventDefault(),R==null||R(yt)},onFocusCapture:yt=>{Pt(!0),N==null||N(yt)},onBlurCapture:yt=>{Pt(!1),$==null||$(yt)},rightSection:q||ge.isClearable&&a.jsx(Jl,{...U,size:oe,onClick:yt=>{var kt;ge.clear(),(kt=U==null?void 0:U.onClick)==null||kt.call(U,yt)},onMouseDown:yt=>{var kt;yt.preventDefault(),(kt=U==null?void 0:U.onMouseDown)==null||kt.call(U,yt)}}),labelProps:{htmlFor:Zt,...Fe},style:s,className:i,classNames:Ve,styles:Le,__staticSelector:"TimePicker",...et,children:[a.jsx("div",{...Ce("fieldsRoot"),dir:"ltr",children:a.jsxs("div",{...Ce("fieldsGroup"),onBlur:Ri,children:[a.jsx(W1,{id:Zt,...Z,...Ce("field",{className:Z==null?void 0:Z.className,style:Z==null?void 0:Z.style}),value:ge.values.hours,onChange:ge.setHours,onNextInput:()=>ge.focus("minutes"),min:f==="12h"?1:0,max:f==="12h"?12:23,allowTemporaryZero:f==="12h",focusable:!0,step:b,ref:Kt,"aria-label":_,readOnly:W,disabled:te,onPaste:ge.onPaste,onFocus:yt=>{var kt;Wt(yt),(kt=Z==null?void 0:Z.onFocus)==null||kt.call(Z,yt)},onBlur:yt=>{var It;const kt=yt.currentTarget.value,ir=kt?parseInt(kt,10):null;f==="12h"&&ir===0&&ge.setHours(12),(It=Z==null?void 0:Z.onBlur)==null||It.call(Z,yt)},placeholder:Ye}),a.jsx("span",{children:":"}),a.jsx(W1,{...X,...Ce("field",{className:X==null?void 0:X.className,style:X==null?void 0:X.style}),value:ge.values.minutes,onChange:ge.setMinutes,min:0,max:59,focusable:!0,step:x,ref:qn,onPreviousInput:()=>ge.focus("hours"),onNextInput:()=>S?ge.focus("seconds"):ge.focus("amPm"),"aria-label":T,tabIndex:-1,readOnly:W,disabled:te,onPaste:ge.onPaste,onFocus:yt=>{var kt;Wt(yt),(kt=X==null?void 0:X.onFocus)==null||kt.call(X,yt)},placeholder:$t}),S&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:":"}),a.jsx(W1,{...V,...Ce("field",{className:V==null?void 0:V.className,style:V==null?void 0:V.style}),value:ge.values.seconds,onChange:ge.setSeconds,min:0,max:59,focusable:!0,step:w,ref:Ft,onPreviousInput:()=>ge.focus("minutes"),onNextInput:()=>ge.focus("amPm"),"aria-label":C,tabIndex:-1,readOnly:W,disabled:te,onPaste:ge.onPaste,onFocus:yt=>{var kt;Wt(yt),(kt=V==null?void 0:V.onFocus)==null||kt.call(V,yt)},placeholder:tt})]}),f==="12h"&&a.jsx(Ez,{...G,inputType:H?"input":"select",labels:A,value:ge.values.amPm,onChange:ge.setAmPm,ref:xn,"aria-label":j,onPreviousInput:()=>S?ge.focus("seconds"):ge.focus("minutes"),readOnly:W,disabled:te,tabIndex:-1,onPaste:ge.onPaste,onFocus:yt=>{var kt;Wt(yt),(kt=G==null?void 0:G.onFocus)==null||kt.call(G,yt)}})]})}),a.jsx("input",{type:"hidden",name:be,form:ye,value:ge.hiddenInputValue,...Ke})]})}),a.jsx(Kn.Dropdown,{...Ce("dropdown"),onMouseDown:yt=>yt.preventDefault(),children:gt?a.jsx(Pz,{value:ge.hiddenInputValue,onChange:ge.setTimeString,format:f,presets:gt,amPmLabels:A,withSeconds:S||!1}):a.jsxs("div",{...Ce("controlsListGroup"),children:[a.jsx(Y1,{min:f==="12h"?1:0,max:f==="12h"?12:23,step:b,value:ge.values.hours,onSelect:ge.setHours,reversed:De}),a.jsx(Y1,{min:0,max:59,step:x,value:ge.values.minutes,onSelect:ge.setMinutes,reversed:De}),S&&a.jsx(Y1,{min:0,max:59,step:w,value:ge.values.seconds,onSelect:ge.setSeconds,reversed:De}),f==="12h"&&a.jsx(Az,{labels:A,value:ge.values.amPm,onSelect:ge.setAmPm})]})})]})})});O4.displayName="@mantine/dates/TimePicker";O4.classes=Mz;var $z={day:"m_396ce5cb"};const Gle=(t,{size:e})=>({day:{"--day-size":zt(e,"day-size")}}),E4=Ae((t,e)=>{const n=Se("Day",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,date:h,disabled:f,__staticSelector:p,weekend:m,outside:v,selected:b,renderDay:x,inRange:w,firstInRange:S,lastInRange:_,hidden:T,static:C,highlightToday:j,attributes:A,...E}=n,R=lt({name:p||"Day",classes:$z,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:A,vars:u,varsResolver:Gle,rootSelector:"day"});return a.jsx(Dr,{...R("day",{style:T?{display:"none"}:void 0}),component:C?"div":"button",ref:e,disabled:f,"data-today":qe(h).isSame(new Date,"day")||void 0,"data-hidden":T||void 0,"data-highlight-today":j||void 0,"data-disabled":f||void 0,"data-weekend":!f&&!v&&m||void 0,"data-outside":!f&&v||void 0,"data-selected":!f&&b||void 0,"data-in-range":w&&!f||void 0,"data-first-in-range":S&&!f||void 0,"data-last-in-range":_&&!f||void 0,"data-static":C||void 0,unstyled:l,...E,children:(x==null?void 0:x(h))||qe(h).date()})});E4.classes=$z;E4.displayName="@mantine/dates/Day";function Kle({locale:t,format:e="dd",firstDayOfWeek:n=1}){const r=qe().day(n),i=[];for(let s=0;s<7;s+=1)typeof e=="string"?i.push(qe(r).add(s,"days").locale(t).format(e)):i.push(e(qe(r).add(s,"days").format("YYYY-MM-DD")));return i}var Iz={weekday:"m_18a3eca"};const Zle=(t,{size:e})=>({weekdaysRow:{"--wr-fz":Or(e),"--wr-spacing":Hi(e)}}),A4=Ae((t,e)=>{const n=Se("WeekdaysRow",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,locale:h,firstDayOfWeek:f,weekdayFormat:p,cellComponent:m="th",__staticSelector:v,withWeekNumbers:b,attributes:x,...w}=n,S=lt({name:v||"WeekdaysRow",classes:Iz,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:x,vars:u,varsResolver:Zle,rootSelector:"weekdaysRow"}),_=Gh(),T=Kle({locale:_.getLocale(h),format:p,firstDayOfWeek:_.getFirstDayOfWeek(f)}).map((C,j)=>a.jsx(m,{...S("weekday"),children:C},j));return a.jsxs(ve,{component:"tr",ref:e,...S("weekdaysRow"),...w,children:[b&&a.jsx(m,{...S("weekday"),children:"#"}),T]})});A4.classes=Iz;A4.displayName="@mantine/dates/WeekdaysRow";function Jle(t,e=1){let n=qe(t);if(!n.isValid())return n;const r=e===0?6:e-1;for(;n.day()!==r;)n=n.add(1,"day");return n.format("YYYY-MM-DD")}function ece(t,e=1){let n=qe(t);for(;n.day()!==e;)n=n.subtract(1,"day");return n.format("YYYY-MM-DD")}function tce({month:t,firstDayOfWeek:e=1,consistentWeeks:n}){const r=qe(t).subtract(qe(t).date()-1,"day"),i=qe(r.format("YYYY-M-D")),s=i.format("YYYY-MM-DD"),o=i.add(+i.daysInMonth()-1,"day").format("YYYY-MM-DD"),l=Jle(o,e),u=[];let h=qe(ece(s,e));for(;qe(h).isBefore(l,"day");){const f=[];for(let p=0;p<7;p+=1)f.push(h.format("YYYY-MM-DD")),h=h.add(1,"day");u.push(f)}if(n&&u.length<6){const f=u[u.length-1],p=f[f.length-1];let m=qe(p).add(1,"day");for(;u.length<6;){const v=[];for(let b=0;b<7;b+=1)v.push(m.format("YYYY-MM-DD")),m=m.add(1,"day");u.push(v)}}return u}function M4(t,e){return qe(t).format("YYYY-MM")===qe(e).format("YYYY-MM")}function Bz(t,e){return e?qe(t).isAfter(qe(e).subtract(1,"day"),"day"):!0}function zz(t,e){return e?qe(t).isBefore(qe(e).add(1,"day"),"day"):!0}function nce({dates:t,minDate:e,maxDate:n,getDayProps:r,excludeDate:i,hideOutsideDates:s,month:o}){const l=t.flat().filter(f=>{var p;return zz(f,n)&&Bz(f,e)&&!(i!=null&&i(f))&&!((p=r==null?void 0:r(f))!=null&&p.disabled)&&(!s||M4(f,o))}),u=l.find(f=>{var p;return(p=r==null?void 0:r(f))==null?void 0:p.selected});if(u)return u;const h=l.find(f=>qe().isSame(f,"date"));return h||l[0]}var X1={exports:{}},rce=X1.exports,cD;function ice(){return cD||(cD=1,function(t,e){(function(n,r){t.exports=r()})(rce,function(){var n="day";return function(r,i,s){var o=function(h){return h.add(4-h.isoWeekday(),n)},l=i.prototype;l.isoWeekYear=function(){return o(this).year()},l.isoWeek=function(h){if(!this.$utils().u(h))return this.add(7*(h-this.isoWeek()),n);var f,p,m,v,b=o(this),x=(f=this.isoWeekYear(),p=this.$u,m=(p?s.utc:s)().year(f).startOf("year"),v=4-m.isoWeekday(),m.isoWeekday()>4&&(v+=7),m.add(v,n));return b.diff(x,"week")+1},l.isoWeekday=function(h){return this.$utils().u(h)?this.day()||7:this.day(this.day()%7?h:h-7)};var u=l.startOf;l.startOf=function(h,f){var p=this.$utils(),m=!!p.u(f)||f;return p.p(h)==="isoweek"?m?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):u.bind(this)(h,f)}}})}(X1)),X1.exports}var sce=ice();const ace=dl(sce);qe.extend(ace);function oce(t){const e=t.find(n=>qe(n).day()===1);return qe(e).isoWeek()}var qz={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const lce={withCellSpacing:!0},cce=(t,{size:e})=>({weekNumber:{"--wn-fz":Or(e),"--wn-size":zt(e,"wn-size")}}),q2=Ae((t,e)=>{const n=Se("Month",lce,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,__staticSelector:h,locale:f,firstDayOfWeek:p,weekdayFormat:m,month:v,weekendDays:b,getDayProps:x,excludeDate:w,minDate:S,maxDate:_,renderDay:T,hideOutsideDates:C,hideWeekdays:j,getDayAriaLabel:A,static:E,__getDayRef:R,__onDayKeyDown:N,__onDayClick:$,__onDayMouseEnter:D,__preventFocus:F,__stopPropagation:Q,withCellSpacing:H,size:q,highlightToday:P,withWeekNumbers:I,attributes:U,...Z}=n,X=lt({name:h||"Month",classes:qz,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:U,vars:u,varsResolver:cce,rootSelector:"month"}),V=Gh(),G=tce({month:v,firstDayOfWeek:V.getFirstDayOfWeek(p),consistentWeeks:V.consistentWeeks}),W=nce({dates:G,minDate:Es(S),maxDate:Es(_),getDayProps:x,excludeDate:w,hideOutsideDates:C,month:v}),{resolvedClassNames:te,resolvedStyles:oe}=jo({classNames:r,styles:o,props:n}),be=G.map((ye,Ke)=>{const Fe=ye.map((Pe,ae)=>{const Te=!M4(Pe,v),fe=(A==null?void 0:A(Pe))||qe(Pe).locale(f||V.locale).format("D MMMM YYYY"),Ee=x==null?void 0:x(Pe),gt=qe(Pe).isSame(W,"date");return a.jsx("td",{...X("monthCell"),"data-with-spacing":H||void 0,children:a.jsx(E4,{__staticSelector:h||"Month",classNames:te,styles:oe,unstyled:l,"data-mantine-stop-propagation":Q||void 0,highlightToday:P,renderDay:T,date:Pe,size:q,weekend:V.getWeekendDays(b).includes(qe(Pe).get("day")),outside:Te,hidden:C?Te:!1,"aria-label":fe,static:E,disabled:(w==null?void 0:w(Pe))||!zz(Pe,Es(_))||!Bz(Pe,Es(S)),ref:We=>{We&&(R==null||R(Ke,ae,We))},...Ee,onKeyDown:We=>{var Be;(Be=Ee==null?void 0:Ee.onKeyDown)==null||Be.call(Ee,We),N==null||N(We,{rowIndex:Ke,cellIndex:ae,date:Pe})},onMouseEnter:We=>{var Be;(Be=Ee==null?void 0:Ee.onMouseEnter)==null||Be.call(Ee,We),D==null||D(We,Pe)},onClick:We=>{var Be;(Be=Ee==null?void 0:Ee.onClick)==null||Be.call(Ee,We),$==null||$(We,Pe)},onMouseDown:We=>{var Be;(Be=Ee==null?void 0:Ee.onMouseDown)==null||Be.call(Ee,We),F&&We.preventDefault()},tabIndex:F||!gt?-1:0})},Pe.toString())});return a.jsxs("tr",{...X("monthRow"),children:[I&&a.jsx("td",{...X("weekNumber"),children:oce(ye)}),Fe]},Ke)});return a.jsxs(ve,{component:"table",...X("month"),size:q,ref:e,...Z,children:[!j&&a.jsx("thead",{...X("monthThead"),children:a.jsx(A4,{__staticSelector:h||"Month",locale:f,firstDayOfWeek:p,weekdayFormat:m,size:q,classNames:te,styles:oe,unstyled:l,withWeekNumbers:I})}),a.jsx("tbody",{...X("monthTbody"),children:be})]})});q2.classes=qz;q2.displayName="@mantine/dates/Month";var Fz={pickerControl:"m_dc6a3c71"};const uce=(t,{size:e})=>({pickerControl:{"--dpc-fz":Or(e),"--dpc-size":zt(e,"dpc-size")}}),F2=Ae((t,e)=>{const n=Se("PickerControl",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,firstInRange:h,lastInRange:f,inRange:p,__staticSelector:m,selected:v,disabled:b,attributes:x,...w}=n,S=lt({name:m||"PickerControl",classes:Fz,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:x,vars:u,varsResolver:uce,rootSelector:"pickerControl"});return a.jsx(Dr,{...S("pickerControl"),ref:e,unstyled:l,"data-picker-control":!0,"data-selected":v&&!b||void 0,"data-disabled":b||void 0,"data-in-range":p&&!b&&!v||void 0,"data-first-in-range":h&&!b||void 0,"data-last-in-range":f&&!b||void 0,disabled:b,...w})});F2.classes=Fz;F2.displayName="@mantine/dates/PickerControl";function Hz({year:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&qe(t).isBefore(e,"year")||n&&qe(t).isAfter(n,"year"))}function hce({years:t,minDate:e,maxDate:n,getYearControlProps:r}){const i=t.flat().filter(l=>{var u;return!Hz({year:l,minDate:e,maxDate:n})&&!((u=r==null?void 0:r(l))!=null&&u.disabled)}),s=i.find(l=>{var u;return(u=r==null?void 0:r(l))==null?void 0:u.selected});if(s)return s;const o=i.find(l=>qe().isSame(l,"year"));return o||i[0]}function Vz(t){const e=qe(t).year(),n=e-e%10;let r=0;const i=[[],[],[],[]];for(let s=0;s<4;s+=1){const o=s===3?1:3;for(let l=0;l<o;l+=1)i[s].push(qe(new Date(n+r,0)).format("YYYY-MM-DD")),r+=1}return i}var Uz={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const dce={yearsListFormat:"YYYY",withCellSpacing:!0},H2=Ae((t,e)=>{const n=Se("YearsList",dce,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,decade:h,yearsListFormat:f,locale:p,minDate:m,maxDate:v,getYearControlProps:b,__staticSelector:x,__getControlRef:w,__onControlKeyDown:S,__onControlClick:_,__onControlMouseEnter:T,__preventFocus:C,__stopPropagation:j,withCellSpacing:A,size:E,attributes:R,...N}=n,$=lt({name:x||"YearsList",classes:Uz,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:R,vars:u,rootSelector:"yearsList"}),D=Gh(),F=Vz(h),Q=hce({years:F,minDate:m,maxDate:v,getYearControlProps:b}),H=F.map((q,P)=>{const I=q.map((U,Z)=>{const X=b==null?void 0:b(U),V=qe(U).isSame(Q,"year");return a.jsx("td",{...$("yearsListCell"),"data-with-spacing":A||void 0,children:a.jsx(F2,{...$("yearsListControl"),size:E,unstyled:l,"data-mantine-stop-propagation":j||void 0,disabled:Hz({year:U,minDate:m,maxDate:v}),ref:G=>{G&&(w==null||w(P,Z,G))},...X,onKeyDown:G=>{var W;(W=X==null?void 0:X.onKeyDown)==null||W.call(X,G),S==null||S(G,{rowIndex:P,cellIndex:Z,date:U})},onClick:G=>{var W;(W=X==null?void 0:X.onClick)==null||W.call(X,G),_==null||_(G,U)},onMouseEnter:G=>{var W;(W=X==null?void 0:X.onMouseEnter)==null||W.call(X,G),T==null||T(G,U)},onMouseDown:G=>{var W;(W=X==null?void 0:X.onMouseDown)==null||W.call(X,G),C&&G.preventDefault()},tabIndex:C||!V?-1:0,children:(X==null?void 0:X.children)??qe(U).locale(D.getLocale(p)).format(f)})},Z)});return a.jsx("tr",{...$("yearsListRow"),children:I},P)});return a.jsx(ve,{component:"table",ref:e,size:E,...$("yearsList"),...N,children:a.jsx("tbody",{children:H})})});H2.classes=Uz;H2.displayName="@mantine/dates/YearsList";function Qz({month:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&qe(t).isBefore(e,"month")||n&&qe(t).isAfter(n,"month"))}function fce({months:t,minDate:e,maxDate:n,getMonthControlProps:r}){const i=t.flat().filter(l=>{var u;return!Qz({month:l,minDate:e,maxDate:n})&&!((u=r==null?void 0:r(l))!=null&&u.disabled)}),s=i.find(l=>{var u;return(u=r==null?void 0:r(l))==null?void 0:u.selected});if(s)return s;const o=i.find(l=>qe().isSame(l,"month"));return o||i[0]}function pce(t){const e=qe(t).startOf("year").toDate(),n=[[],[],[],[]];let r=0;for(let i=0;i<4;i+=1)for(let s=0;s<3;s+=1)n[i].push(qe(e).add(r,"months").format("YYYY-MM-DD")),r+=1;return n}var Wz={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const mce={monthsListFormat:"MMM",withCellSpacing:!0},V2=Ae((t,e)=>{const n=Se("MonthsList",mce,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,__staticSelector:h,year:f,monthsListFormat:p,locale:m,minDate:v,maxDate:b,getMonthControlProps:x,__getControlRef:w,__onControlKeyDown:S,__onControlClick:_,__onControlMouseEnter:T,__preventFocus:C,__stopPropagation:j,withCellSpacing:A,size:E,attributes:R,...N}=n,$=lt({name:h||"MonthsList",classes:Wz,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:R,vars:u,rootSelector:"monthsList"}),D=Gh(),F=pce(f),Q=fce({months:F,minDate:Es(v),maxDate:Es(b),getMonthControlProps:x}),H=F.map((q,P)=>{const I=q.map((U,Z)=>{const X=x==null?void 0:x(U),V=qe(U).isSame(Q,"month");return a.jsx("td",{...$("monthsListCell"),"data-with-spacing":A||void 0,children:a.jsx(F2,{...$("monthsListControl"),size:E,unstyled:l,__staticSelector:h||"MonthsList","data-mantine-stop-propagation":j||void 0,disabled:Qz({month:U,minDate:Es(v),maxDate:Es(b)}),ref:G=>{G&&(w==null||w(P,Z,G))},...X,onKeyDown:G=>{var W;(W=X==null?void 0:X.onKeyDown)==null||W.call(X,G),S==null||S(G,{rowIndex:P,cellIndex:Z,date:U})},onClick:G=>{var W;(W=X==null?void 0:X.onClick)==null||W.call(X,G),_==null||_(G,U)},onMouseEnter:G=>{var W;(W=X==null?void 0:X.onMouseEnter)==null||W.call(X,G),T==null||T(G,U)},onMouseDown:G=>{var W;(W=X==null?void 0:X.onMouseDown)==null||W.call(X,G),C&&G.preventDefault()},tabIndex:C||!V?-1:0,children:(X==null?void 0:X.children)??qe(U).locale(D.getLocale(m)).format(p)})},Z)});return a.jsx("tr",{...$("monthsListRow"),children:I},P)});return a.jsx(ve,{component:"table",ref:e,size:E,...$("monthsList"),...N,children:a.jsx("tbody",{children:H})})});V2.classes=Wz;V2.displayName="@mantine/dates/MonthsList";var Yz={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const gce={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},vce=(t,{size:e})=>({calendarHeader:{"--dch-control-size":zt(e,"dch-control-size"),"--dch-fz":Or(e)}}),Kh=Ae((t,e)=>{const n=Se("CalendarHeader",gce,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,nextIcon:h,previousIcon:f,nextLabel:p,previousLabel:m,onNext:v,onPrevious:b,onLevelClick:x,label:w,nextDisabled:S,previousDisabled:_,hasNextLevel:T,levelControlAriaLabel:C,withNext:j,withPrevious:A,headerControlsOrder:E,__staticSelector:R,__preventFocus:N,__stopPropagation:$,attributes:D,...F}=n,Q=lt({name:R||"CalendarHeader",classes:Yz,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:D,vars:u,varsResolver:vce,rootSelector:"calendarHeader"}),H=N?Z=>Z.preventDefault():void 0,q=A&&M.createElement(Dr,{...Q("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":m,onClick:b,unstyled:l,onMouseDown:H,disabled:_,"data-disabled":_||void 0,tabIndex:N||_?-1:0,"data-mantine-stop-propagation":$||void 0},f||a.jsx(Cx,{...Q("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),P=M.createElement(Dr,{component:T?"button":"div",...Q("calendarHeaderLevel"),key:"level",onClick:T?x:void 0,unstyled:l,onMouseDown:T?H:void 0,disabled:!T,"data-static":!T||void 0,"aria-label":C,tabIndex:N||!T?-1:0,"data-mantine-stop-propagation":$||void 0},w),I=j&&M.createElement(Dr,{...Q("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":p,onClick:v,unstyled:l,onMouseDown:H,disabled:S,"data-disabled":S||void 0,tabIndex:N||S?-1:0,"data-mantine-stop-propagation":$||void 0},h||a.jsx(Cx,{...Q("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),U=E.map(Z=>Z==="previous"?q:Z==="level"?P:Z==="next"?I:null);return a.jsx(ve,{...Q("calendarHeader"),ref:e,...F,children:U})});Kh.classes=Yz;Kh.displayName="@mantine/dates/CalendarHeader";function bce(t){const e=Vz(t);return[e[0][0],e[3][0]]}const yce={decadeLabelFormat:"YYYY"},U2=Ae((t,e)=>{const n=Se("DecadeLevel",yce,t),{decade:r,locale:i,minDate:s,maxDate:o,yearsListFormat:l,getYearControlProps:u,__getControlRef:h,__onControlKeyDown:f,__onControlClick:p,__onControlMouseEnter:m,withCellSpacing:v,__preventFocus:b,nextIcon:x,previousIcon:w,nextLabel:S,previousLabel:_,onNext:T,onPrevious:C,nextDisabled:j,previousDisabled:A,levelControlAriaLabel:E,withNext:R,withPrevious:N,headerControlsOrder:$,decadeLabelFormat:D,classNames:F,styles:Q,unstyled:H,__staticSelector:q,__stopPropagation:P,size:I,attributes:U,...Z}=n,X=Gh(),[V,G]=bce(r),W={__staticSelector:q||"DecadeLevel",classNames:F,styles:Q,unstyled:H,size:I,attributes:U},te=typeof j=="boolean"?j:o?!qe(G).endOf("year").isBefore(o):!1,oe=typeof A=="boolean"?A:s?!qe(V).startOf("year").isAfter(s):!1,be=(ye,Ke)=>qe(ye).locale(i||X.locale).format(Ke);return a.jsxs(ve,{"data-decade-level":!0,size:I,ref:e,...Z,children:[a.jsx(Kh,{label:typeof D=="function"?D(V,G):`${be(V,D)} – ${be(G,D)}`,__preventFocus:b,__stopPropagation:P,nextIcon:x,previousIcon:w,nextLabel:S,previousLabel:_,onNext:T,onPrevious:C,nextDisabled:te,previousDisabled:oe,hasNextLevel:!1,levelControlAriaLabel:E,withNext:R,withPrevious:N,headerControlsOrder:$,...W}),a.jsx(H2,{decade:r,locale:i,minDate:s,maxDate:o,yearsListFormat:l,getYearControlProps:u,__getControlRef:h,__onControlKeyDown:f,__onControlClick:p,__onControlMouseEnter:m,__preventFocus:b,__stopPropagation:P,withCellSpacing:v,...W})]})});U2.classes={...H2.classes,...Kh.classes};U2.displayName="@mantine/dates/DecadeLevel";const xce={yearLabelFormat:"YYYY"},Q2=Ae((t,e)=>{const n=Se("YearLevel",xce,t),{year:r,locale:i,minDate:s,maxDate:o,monthsListFormat:l,getMonthControlProps:u,__getControlRef:h,__onControlKeyDown:f,__onControlClick:p,__onControlMouseEnter:m,withCellSpacing:v,__preventFocus:b,nextIcon:x,previousIcon:w,nextLabel:S,previousLabel:_,onNext:T,onPrevious:C,onLevelClick:j,nextDisabled:A,previousDisabled:E,hasNextLevel:R,levelControlAriaLabel:N,withNext:$,withPrevious:D,headerControlsOrder:F,yearLabelFormat:Q,__staticSelector:H,__stopPropagation:q,size:P,classNames:I,styles:U,unstyled:Z,attributes:X,...V}=n,G=Gh(),W={__staticSelector:H||"YearLevel",classNames:I,styles:U,unstyled:Z,size:P,attributes:X},te=typeof A=="boolean"?A:o?!qe(r).endOf("year").isBefore(o):!1,oe=typeof E=="boolean"?E:s?!qe(r).startOf("year").isAfter(s):!1;return a.jsxs(ve,{"data-year-level":!0,size:P,ref:e,...V,children:[a.jsx(Kh,{label:typeof Q=="function"?Q(r):qe(r).locale(i||G.locale).format(Q),__preventFocus:b,__stopPropagation:q,nextIcon:x,previousIcon:w,nextLabel:S,previousLabel:_,onNext:T,onPrevious:C,onLevelClick:j,nextDisabled:te,previousDisabled:oe,hasNextLevel:R,levelControlAriaLabel:N,withNext:$,withPrevious:D,headerControlsOrder:F,...W}),a.jsx(V2,{year:r,locale:i,minDate:s,maxDate:o,monthsListFormat:l,getMonthControlProps:u,__getControlRef:h,__onControlKeyDown:f,__onControlClick:p,__onControlMouseEnter:m,__preventFocus:b,__stopPropagation:q,withCellSpacing:v,...W})]})});Q2.classes={...Kh.classes,...V2.classes};Q2.displayName="@mantine/dates/YearLevel";const wce={monthLabelFormat:"MMMM YYYY"},W2=Ae((t,e)=>{const n=Se("MonthLevel",wce,t),{month:r,locale:i,firstDayOfWeek:s,weekdayFormat:o,weekendDays:l,getDayProps:u,excludeDate:h,minDate:f,maxDate:p,renderDay:m,hideOutsideDates:v,hideWeekdays:b,getDayAriaLabel:x,__getDayRef:w,__onDayKeyDown:S,__onDayClick:_,__onDayMouseEnter:T,withCellSpacing:C,highlightToday:j,withWeekNumbers:A,__preventFocus:E,__stopPropagation:R,nextIcon:N,previousIcon:$,nextLabel:D,previousLabel:F,onNext:Q,onPrevious:H,onLevelClick:q,nextDisabled:P,previousDisabled:I,hasNextLevel:U,levelControlAriaLabel:Z,withNext:X,withPrevious:V,headerControlsOrder:G,monthLabelFormat:W,classNames:te,styles:oe,unstyled:be,__staticSelector:ye,size:Ke,static:Fe,attributes:Pe,...ae}=n,Te=Gh(),fe={__staticSelector:ye||"MonthLevel",classNames:te,styles:oe,unstyled:be,size:Ke,attributes:Pe},Ee=typeof P=="boolean"?P:p?!qe(r).endOf("month").isBefore(p):!1,gt=typeof I=="boolean"?I:f?!qe(r).startOf("month").isAfter(f):!1;return a.jsxs(ve,{"data-month-level":!0,size:Ke,ref:e,...ae,children:[a.jsx(Kh,{label:typeof W=="function"?W(r):qe(r).locale(i||Te.locale).format(W),__preventFocus:E,__stopPropagation:R,nextIcon:N,previousIcon:$,nextLabel:D,previousLabel:F,onNext:Q,onPrevious:H,onLevelClick:q,nextDisabled:Ee,previousDisabled:gt,hasNextLevel:U,levelControlAriaLabel:Z,withNext:X,withPrevious:V,headerControlsOrder:G,...fe}),a.jsx(q2,{month:r,locale:i,firstDayOfWeek:s,weekdayFormat:o,weekendDays:l,getDayProps:u,excludeDate:h,minDate:f,maxDate:p,renderDay:m,hideOutsideDates:v,hideWeekdays:b,getDayAriaLabel:x,__getDayRef:w,__onDayKeyDown:S,__onDayClick:_,__onDayMouseEnter:T,__preventFocus:E,__stopPropagation:R,static:Fe,withCellSpacing:C,highlightToday:j,withWeekNumbers:A,...fe})]})});W2.classes={...q2.classes,...Kh.classes};W2.displayName="@mantine/dates/MonthLevel";var Xz={levelsGroup:"m_30b26e33"};const Zh=Ae((t,e)=>{const n=Se("LevelsGroup",null,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,__staticSelector:h,attributes:f,...p}=n,m=lt({name:h||"LevelsGroup",classes:Xz,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:f,vars:u,rootSelector:"levelsGroup"});return a.jsx(ve,{ref:e,...m("levelsGroup"),...p})});Zh.classes=Xz;Zh.displayName="@mantine/dates/LevelsGroup";const Sce={numberOfColumns:1},Y2=Ae((t,e)=>{const n=Se("DecadeLevelGroup",Sce,t),{decade:r,locale:i,minDate:s,maxDate:o,yearsListFormat:l,getYearControlProps:u,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:p,__preventFocus:m,nextIcon:v,previousIcon:b,nextLabel:x,previousLabel:w,onNext:S,onPrevious:_,nextDisabled:T,previousDisabled:C,headerControlsOrder:j,classNames:A,styles:E,unstyled:R,__staticSelector:N,__stopPropagation:$,numberOfColumns:D,levelControlAriaLabel:F,decadeLabelFormat:Q,size:H,vars:q,attributes:P,...I}=n,U=M.useRef([]),Z=Array(D).fill(0).map((X,V)=>{const G=qe(r).add(V*10,"years").format("YYYY-MM-DD");return a.jsx(U2,{size:H,yearsListFormat:l,decade:G,withNext:V===D-1,withPrevious:V===0,decadeLabelFormat:Q,__onControlClick:h,__onControlMouseEnter:f,__onControlKeyDown:(W,te)=>T4({levelIndex:V,rowIndex:te.rowIndex,cellIndex:te.cellIndex,event:W,controlsRef:U}),__getControlRef:(W,te,oe)=>{Array.isArray(U.current[V])||(U.current[V]=[]),Array.isArray(U.current[V][W])||(U.current[V][W]=[]),U.current[V][W][te]=oe},levelControlAriaLabel:typeof F=="function"?F(G):F,locale:i,minDate:s,maxDate:o,__preventFocus:m,__stopPropagation:$,nextIcon:v,previousIcon:b,nextLabel:x,previousLabel:w,onNext:S,onPrevious:_,nextDisabled:T,previousDisabled:C,getYearControlProps:u,__staticSelector:N||"DecadeLevelGroup",classNames:A,styles:E,unstyled:R,withCellSpacing:p,headerControlsOrder:j,attributes:P},V)});return a.jsx(Zh,{classNames:A,styles:E,__staticSelector:N||"DecadeLevelGroup",ref:e,size:H,unstyled:R,attributes:P,...I,children:Z})});Y2.classes={...Zh.classes,...U2.classes};Y2.displayName="@mantine/dates/DecadeLevelGroup";const jce={numberOfColumns:1},X2=Ae((t,e)=>{const n=Se("YearLevelGroup",jce,t),{year:r,locale:i,minDate:s,maxDate:o,monthsListFormat:l,getMonthControlProps:u,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:p,__preventFocus:m,nextIcon:v,previousIcon:b,nextLabel:x,previousLabel:w,onNext:S,onPrevious:_,onLevelClick:T,nextDisabled:C,previousDisabled:j,hasNextLevel:A,headerControlsOrder:E,classNames:R,styles:N,unstyled:$,__staticSelector:D,__stopPropagation:F,numberOfColumns:Q,levelControlAriaLabel:H,yearLabelFormat:q,size:P,vars:I,attributes:U,...Z}=n,X=M.useRef([]),V=Array(Q).fill(0).map((G,W)=>{const te=qe(r).add(W,"years").format("YYYY-MM-DD");return a.jsx(Q2,{size:P,monthsListFormat:l,year:te,withNext:W===Q-1,withPrevious:W===0,yearLabelFormat:q,__stopPropagation:F,__onControlClick:h,__onControlMouseEnter:f,__onControlKeyDown:(oe,be)=>T4({levelIndex:W,rowIndex:be.rowIndex,cellIndex:be.cellIndex,event:oe,controlsRef:X}),__getControlRef:(oe,be,ye)=>{Array.isArray(X.current[W])||(X.current[W]=[]),Array.isArray(X.current[W][oe])||(X.current[W][oe]=[]),X.current[W][oe][be]=ye},levelControlAriaLabel:typeof H=="function"?H(te):H,locale:i,minDate:s,maxDate:o,__preventFocus:m,nextIcon:v,previousIcon:b,nextLabel:x,previousLabel:w,onNext:S,onPrevious:_,onLevelClick:T,nextDisabled:C,previousDisabled:j,hasNextLevel:A,getMonthControlProps:u,classNames:R,styles:N,unstyled:$,__staticSelector:D||"YearLevelGroup",withCellSpacing:p,headerControlsOrder:E,attributes:U},W)});return a.jsx(Zh,{classNames:R,styles:N,__staticSelector:D||"YearLevelGroup",ref:e,size:P,unstyled:$,attributes:U,...Z,children:V})});X2.classes={...Q2.classes,...Zh.classes};X2.displayName="@mantine/dates/YearLevelGroup";const _ce={numberOfColumns:1},G2=Ae((t,e)=>{const n=Se("MonthLevelGroup",_ce,t),{month:r,locale:i,firstDayOfWeek:s,weekdayFormat:o,weekendDays:l,getDayProps:u,excludeDate:h,minDate:f,maxDate:p,renderDay:m,hideOutsideDates:v,hideWeekdays:b,getDayAriaLabel:x,__onDayClick:w,__onDayMouseEnter:S,withCellSpacing:_,highlightToday:T,withWeekNumbers:C,__preventFocus:j,nextIcon:A,previousIcon:E,nextLabel:R,previousLabel:N,onNext:$,onPrevious:D,onLevelClick:F,nextDisabled:Q,previousDisabled:H,hasNextLevel:q,headerControlsOrder:P,classNames:I,styles:U,unstyled:Z,numberOfColumns:X,levelControlAriaLabel:V,monthLabelFormat:G,__staticSelector:W,__stopPropagation:te,size:oe,static:be,vars:ye,attributes:Ke,...Fe}=n,Pe=M.useRef([]),ae=Array(X).fill(0).map((Te,fe)=>{const Ee=qe(r).add(fe,"months").format("YYYY-MM-DD");return a.jsx(W2,{month:Ee,withNext:fe===X-1,withPrevious:fe===0,monthLabelFormat:G,__stopPropagation:te,__onDayClick:w,__onDayMouseEnter:S,__onDayKeyDown:(gt,We)=>T4({levelIndex:fe,rowIndex:We.rowIndex,cellIndex:We.cellIndex,event:gt,controlsRef:Pe}),__getDayRef:(gt,We,Be)=>{Array.isArray(Pe.current[fe])||(Pe.current[fe]=[]),Array.isArray(Pe.current[fe][gt])||(Pe.current[fe][gt]=[]),Pe.current[fe][gt][We]=Be},levelControlAriaLabel:typeof V=="function"?V(Ee):V,locale:i,firstDayOfWeek:s,weekdayFormat:o,weekendDays:l,getDayProps:u,excludeDate:h,minDate:f,maxDate:p,renderDay:m,hideOutsideDates:v,hideWeekdays:b,getDayAriaLabel:x,__preventFocus:j,nextIcon:A,previousIcon:E,nextLabel:R,previousLabel:N,onNext:$,onPrevious:D,onLevelClick:F,nextDisabled:Q,previousDisabled:H,hasNextLevel:q,classNames:I,styles:U,unstyled:Z,__staticSelector:W||"MonthLevelGroup",size:oe,static:be,withCellSpacing:_,highlightToday:T,withWeekNumbers:C,headerControlsOrder:P,attributes:Ke},fe)});return a.jsx(Zh,{classNames:I,styles:U,__staticSelector:W||"MonthLevelGroup",ref:e,size:oe,attributes:Ke,...Fe,children:ae})});G2.classes={...Zh.classes,...W2.classes};G2.displayName="@mantine/dates/MonthLevelGroup";var Gz={input:"m_6fa5e2aa"};const K2=Ae((t,e)=>{const{inputProps:n,wrapperProps:r,placeholder:i,classNames:s,styles:o,unstyled:l,popoverProps:u,modalProps:h,dropdownType:f,children:p,formattedValue:m,dropdownHandlers:v,dropdownOpened:b,onClick:x,clearable:w,onClear:S,clearButtonProps:_,rightSection:T,shouldClear:C,readOnly:j,disabled:A,value:E,name:R,form:N,type:$,onDropdownClose:D,withTime:F,...Q}=K$("PickerInputBase",{size:"sm"},t),H=a.jsx(Mr.ClearButton,{onClick:S,unstyled:l,..._}),q=()=>{$==="range"&&Array.isArray(E)&&E[0]&&!E[1]&&S(),v.close()};return a.jsxs(a.Fragment,{children:[f==="modal"&&!j&&a.jsx(Va,{opened:b,onClose:q,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:l,...h,children:p}),a.jsx(Mr.Wrapper,{...r,children:a.jsxs(Kn,{position:"bottom-start",opened:b,trapFocus:!0,returnFocus:!1,unstyled:l,onClose:D,...u,disabled:(u==null?void 0:u.disabled)||f==="modal"||j,onChange:P=>{var I;P||((I=u==null?void 0:u.onClose)==null||I.call(u),q())},children:[a.jsx(Kn.Target,{children:a.jsx(Mr,{"data-dates-input":!0,"data-read-only":j||void 0,disabled:A,component:"button",type:"button",multiline:!0,onClick:P=>{x==null||x(P),v.toggle()},__clearSection:H,__clearable:w&&C&&!j&&!A,rightSection:T,...n,ref:e,classNames:{...s,input:Lr(Gz.input,s==null?void 0:s.input)},...Q,children:m||a.jsx(Mr.Placeholder,{error:n.error,unstyled:l,classNames:s,styles:o,__staticSelector:n.__staticSelector,children:i})})}),a.jsx(Kn.Dropdown,{"data-dates-dropdown":!0,children:p})]})}),a.jsx(Oz,{value:E,name:R,form:N,type:$,withTime:F})]})});K2.classes=Gz;K2.displayName="@mantine/dates/PickerInputBase";const uD=t=>t==="range"?[null,null]:t==="multiple"?[]:null,hD=(t,e)=>{const n=e?_p:Es;return Array.isArray(t)?t.map(n):n(t)};function R4({type:t,value:e,defaultValue:n,onChange:r,withTime:i=!1}){const s=M.useRef(t),[o,l,u]=Qi({value:hD(e,i),defaultValue:hD(n,i),finalValue:uD(t),onChange:r});let h=o;return s.current!==t&&(s.current=t,e===void 0&&(h=n!==void 0?n:uD(t),l(h))),[h,l,u]}function y3(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function Tce(t){return t===0?"month":t===1?"year":"decade"}function J0(t,e,n){return Tce(Sh(y3(t,0),y3(e,0),y3(n,2)))}const Cce={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},Z2=Ae((t,e)=>{const n=Se("Calendar",Cce,t),{vars:r,maxLevel:i,minLevel:s,defaultLevel:o,level:l,onLevelChange:u,date:h,defaultDate:f,onDateChange:p,numberOfColumns:m,columnsToScroll:v,ariaLabels:b,nextLabel:x,previousLabel:w,onYearSelect:S,onMonthSelect:_,onYearMouseEnter:T,onMonthMouseEnter:C,headerControlsOrder:j,__updateDateOnYearSelect:A,__updateDateOnMonthSelect:E,__setDateRef:R,__setLevelRef:N,firstDayOfWeek:$,weekdayFormat:D,weekendDays:F,getDayProps:Q,excludeDate:H,renderDay:q,hideOutsideDates:P,hideWeekdays:I,getDayAriaLabel:U,monthLabelFormat:Z,nextIcon:X,previousIcon:V,__onDayClick:G,__onDayMouseEnter:W,withCellSpacing:te,highlightToday:oe,withWeekNumbers:be,monthsListFormat:ye,getMonthControlProps:Ke,yearLabelFormat:Fe,yearsListFormat:Pe,getYearControlProps:ae,decadeLabelFormat:Te,classNames:fe,styles:Ee,unstyled:gt,minDate:We,maxDate:Be,locale:ze,__staticSelector:De,size:Ye,__preventFocus:$t,__stopPropagation:tt,onNextDecade:et,onPreviousDecade:Ve,onNextYear:Le,onPreviousYear:Ce,onNextMonth:ge,onPreviousMonth:Kt,static:qn,enableKeyboardNavigation:Ft,attributes:xn,...Zt}=n,{resolvedClassNames:ln,resolvedStyles:nn}=jo({classNames:fe,styles:Ee,props:n}),[Pt,Wt]=Qi({value:l?J0(l,s,i):void 0,defaultValue:o?J0(o,s,i):void 0,finalValue:J0(void 0,s,i),onChange:u}),[Ri,yt]=R4({type:"default",value:Es(h),defaultValue:Es(f),onChange:p});M.useImperativeHandle(R,()=>Ze=>{yt(Ze)}),M.useImperativeHandle(N,()=>Ze=>{Wt(Ze)});const kt={__staticSelector:De||"Calendar",styles:nn,classNames:ln,unstyled:gt,size:Ye,attributes:xn},ir=v||m||1,It=new Date,dr=We&&qe(It).isAfter(We)?We:qe(It).format("YYYY-MM-DD"),An=Ri||dr,ie=()=>{const Ze=qe(An).add(ir,"month").format("YYYY-MM-DD");ge==null||ge(Ze),yt(Ze)},Oe=()=>{const Ze=qe(An).subtract(ir,"month").format("YYYY-MM-DD");Kt==null||Kt(Ze),yt(Ze)},nt=()=>{const Ze=qe(An).add(ir,"year").format("YYYY-MM-DD");Le==null||Le(Ze),yt(Ze)},Et=()=>{const Ze=qe(An).subtract(ir,"year").format("YYYY-MM-DD");Ce==null||Ce(Ze),yt(Ze)},Mn=()=>{const Ze=qe(An).add(10*ir,"year").format("YYYY-MM-DD");et==null||et(Ze),yt(Ze)},rn=()=>{const Ze=qe(An).subtract(10*ir,"year").format("YYYY-MM-DD");Ve==null||Ve(Ze),yt(Ze)},rt=M.useRef(null);M.useEffect(()=>{if(!Ft||qn)return;const Ze=Ht=>{var ds;if(!((ds=rt.current)!=null&&ds.contains(document.activeElement)))return;const Yt=Ht.ctrlKey||Ht.metaKey,xi=Ht.shiftKey;switch(Ht.key){case"ArrowUp":Yt&&xi?(Ht.preventDefault(),rn()):Yt&&(Ht.preventDefault(),Et());break;case"ArrowDown":Yt&&xi?(Ht.preventDefault(),Mn()):Yt&&(Ht.preventDefault(),nt());break;case"y":case"Y":Pt==="month"&&(Ht.preventDefault(),Wt("year"));break}};return document.addEventListener("keydown",Ze),()=>{document.removeEventListener("keydown",Ze)}},[Ft,qn,Pt,nt,Et,Mn,rn]);const st=Ze=>{rt.current=Ze,typeof e=="function"?e(Ze):e&&(e.current=Ze)};return a.jsxs(ve,{ref:st,size:Ye,"data-calendar":!0,...Zt,children:[Pt==="month"&&a.jsx(G2,{month:An,minDate:We,maxDate:Be,firstDayOfWeek:$,weekdayFormat:D,weekendDays:F,getDayProps:Q,excludeDate:H,renderDay:q,hideOutsideDates:P,hideWeekdays:I,getDayAriaLabel:U,onNext:ie,onPrevious:Oe,hasNextLevel:i!=="month",onLevelClick:()=>Wt("year"),numberOfColumns:m,locale:ze,levelControlAriaLabel:b==null?void 0:b.monthLevelControl,nextLabel:(b==null?void 0:b.nextMonth)??x,nextIcon:X,previousLabel:(b==null?void 0:b.previousMonth)??w,previousIcon:V,monthLabelFormat:Z,__onDayClick:G,__onDayMouseEnter:W,__preventFocus:$t,__stopPropagation:tt,static:qn,withCellSpacing:te,highlightToday:oe,withWeekNumbers:be,headerControlsOrder:j,...kt}),Pt==="year"&&a.jsx(X2,{year:An,numberOfColumns:m,minDate:We,maxDate:Be,monthsListFormat:ye,getMonthControlProps:Ke,locale:ze,onNext:nt,onPrevious:Et,hasNextLevel:i!=="month"&&i!=="year",onLevelClick:()=>Wt("decade"),levelControlAriaLabel:b==null?void 0:b.yearLevelControl,nextLabel:(b==null?void 0:b.nextYear)??x,nextIcon:X,previousLabel:(b==null?void 0:b.previousYear)??w,previousIcon:V,yearLabelFormat:Fe,__onControlMouseEnter:C,__onControlClick:(Ze,Ht)=>{E&&yt(Ht),Wt(J0("month",s,i)),_==null||_(Ht)},__preventFocus:$t,__stopPropagation:tt,withCellSpacing:te,headerControlsOrder:j,...kt}),Pt==="decade"&&a.jsx(Y2,{decade:An,minDate:We,maxDate:Be,yearsListFormat:Pe,getYearControlProps:ae,locale:ze,onNext:Mn,onPrevious:rn,numberOfColumns:m,nextLabel:(b==null?void 0:b.nextDecade)??x,nextIcon:X,previousLabel:(b==null?void 0:b.previousDecade)??w,previousIcon:V,decadeLabelFormat:Te,__onControlMouseEnter:T,__onControlClick:(Ze,Ht)=>{A&&yt(Ht),Wt(J0("year",s,i)),S==null||S(Ht)},__preventFocus:$t,__stopPropagation:tt,withCellSpacing:te,headerControlsOrder:j,...kt})]})});Z2.classes={...Y2.classes,...X2.classes,...G2.classes};Z2.displayName="@mantine/dates/Calendar";function Kz(t){const{maxLevel:e,minLevel:n,defaultLevel:r,level:i,onLevelChange:s,nextIcon:o,previousIcon:l,date:u,defaultDate:h,onDateChange:f,numberOfColumns:p,columnsToScroll:m,ariaLabels:v,nextLabel:b,previousLabel:x,onYearSelect:w,onMonthSelect:S,onYearMouseEnter:_,onMonthMouseEnter:T,onNextMonth:C,onPreviousMonth:j,onNextYear:A,onPreviousYear:E,onNextDecade:R,onPreviousDecade:N,withCellSpacing:$,highlightToday:D,__updateDateOnYearSelect:F,__updateDateOnMonthSelect:Q,__setDateRef:H,__setLevelRef:q,withWeekNumbers:P,headerControlsOrder:I,firstDayOfWeek:U,weekdayFormat:Z,weekendDays:X,getDayProps:V,excludeDate:G,renderDay:W,hideOutsideDates:te,hideWeekdays:oe,getDayAriaLabel:be,monthLabelFormat:ye,monthsListFormat:Ke,getMonthControlProps:Fe,yearLabelFormat:Pe,yearsListFormat:ae,getYearControlProps:Te,decadeLabelFormat:fe,allowSingleDateInRange:Ee,allowDeselect:gt,minDate:We,maxDate:Be,locale:ze,...De}=t;return{calendarProps:{maxLevel:e,minLevel:n,defaultLevel:r,level:i,onLevelChange:s,nextIcon:o,previousIcon:l,date:u,defaultDate:h,onDateChange:f,numberOfColumns:p,columnsToScroll:m,ariaLabels:v,nextLabel:b,previousLabel:x,onYearSelect:w,onMonthSelect:S,onYearMouseEnter:_,onMonthMouseEnter:T,onNextMonth:C,onPreviousMonth:j,onNextYear:A,onPreviousYear:E,onNextDecade:R,onPreviousDecade:N,withCellSpacing:$,highlightToday:D,__updateDateOnYearSelect:F,__updateDateOnMonthSelect:Q,__setDateRef:H,withWeekNumbers:P,headerControlsOrder:I,firstDayOfWeek:U,weekdayFormat:Z,weekendDays:X,getDayProps:V,excludeDate:G,renderDay:W,hideOutsideDates:te,hideWeekdays:oe,getDayAriaLabel:be,monthLabelFormat:ye,monthsListFormat:Ke,getMonthControlProps:Fe,yearLabelFormat:Pe,yearsListFormat:ae,getYearControlProps:Te,decadeLabelFormat:fe,allowSingleDateInRange:Ee,allowDeselect:gt,minDate:We,maxDate:Be,locale:ze},others:De}}function dD(t,e){const n=[...e].sort((r,i)=>qe(r).isAfter(qe(i))?1:-1);return qe(n[0]).startOf("day").subtract(1,"ms").isBefore(t)&&qe(n[1]).endOf("day").add(1,"ms").isAfter(t)}function kce({type:t,level:e,value:n,defaultValue:r,onChange:i,allowSingleDateInRange:s,allowDeselect:o,onMouseLeave:l}){const[u,h]=R4({type:t,value:n,defaultValue:r,onChange:i}),[f,p]=M.useState(t==="range"&&u[0]&&!u[1]?u[0]:null),[m,v]=M.useState(null),b=j=>{if(t==="range"){if(f&&!u[1]){if(qe(j).isSame(f,e)&&!s){p(null),v(null),h([null,null]);return}const A=[j,f];A.sort((E,R)=>qe(E).isAfter(qe(R))?1:-1),h(A),v(null),p(null);return}if(u[0]&&!u[1]&&qe(j).isSame(u[0],e)&&!s){p(null),v(null),h([null,null]);return}h([j,null]),v(null),p(j);return}if(t==="multiple"){u.some(A=>qe(A).isSame(j,e))?h(u.filter(A=>!qe(A).isSame(j,e))):h([...u,j]);return}u&&o&&qe(j).isSame(u,e)?h(null):h(j)},x=j=>f&&m?dD(j,[m,f]):u[0]&&u[1]?dD(j,u):!1,w=t==="range"?j=>{l==null||l(j),v(null)}:l,S=j=>u[0]&&qe(j).isSame(u[0],e)?!(m&&qe(m).isBefore(u[0])):!1,_=j=>u[1]?qe(j).isSame(u[1],e):!u[0]||!m?!1:qe(m).isBefore(u[0])&&qe(j).isSame(u[0],e),T=j=>{if(t==="range")return{selected:u.some(E=>E&&qe(E).isSame(j,e)),inRange:x(j),firstInRange:S(j),lastInRange:_(j),"data-autofocus":!!u[0]&&qe(u[0]).isSame(j,e)||void 0};if(t==="multiple")return{selected:u.some(E=>E&&qe(E).isSame(j,e)),"data-autofocus":!!u[0]&&qe(u[0]).isSame(j,e)||void 0};const A=qe(u).isSame(j,e);return{selected:A,"data-autofocus":A||void 0}},C=t==="range"&&f?v:()=>{};return M.useEffect(()=>{if(t==="range")if(u[0]&&!u[1])p(u[0]);else{const j=u[0]==null&&u[1]==null,A=u[0]!=null&&u[1]!=null;(j||A)&&(p(null),v(null))}},[u]),{onDateChange:b,onRootMouseLeave:w,onHoveredDateChange:C,getControlProps:T,_value:u,setValue:h}}var Oce={datePickerRoot:"m_765a40cf",presetsList:"m_d6a681e1",presetButton:"m_acd30b22"};const Ece=(t,{size:e})=>({datePickerRoot:{"--preset-font-size":Or(e)}}),Ace={type:"default",defaultLevel:"month",numberOfColumns:1,size:"sm"},J2=Ae((t,e)=>{const n=Se("DatePicker",Ace,t),{allowDeselect:r,allowSingleDateInRange:i,value:s,defaultValue:o,onChange:l,onMouseLeave:u,classNames:h,styles:f,__staticSelector:p,__onDayClick:m,__onDayMouseEnter:v,__onPresetSelect:b,__stopPropagation:x,presets:w,className:S,style:_,unstyled:T,size:C,vars:j,attributes:A,...E}=n,{calendarProps:R,others:N}=Kz(E),$=M.useRef(null),D=M.useRef(null),F=lt({name:p||"DatePicker",classes:Oce,props:n,className:S,style:_,classNames:h,styles:f,unstyled:T,attributes:A,rootSelector:w?"datePickerRoot":void 0,varsResolver:Ece,vars:j}),{onDateChange:Q,onRootMouseLeave:H,onHoveredDateChange:q,getControlProps:P,_value:I,setValue:U}=kce({type:N.type,level:"day",allowDeselect:r,allowSingleDateInRange:i,value:s,defaultValue:o,onChange:l,onMouseLeave:u}),{resolvedClassNames:Z,resolvedStyles:X}=jo({classNames:h,styles:f,props:n}),V=a.jsx(Z2,{ref:e,classNames:Z,styles:X,__staticSelector:p||"DatePicker",onMouseLeave:H,size:C,...R,...w?{}:N,__stopPropagation:x,__setDateRef:$,__setLevelRef:D,minLevel:R.minLevel||"month",__onDayMouseEnter:(te,oe)=>{q(oe),v==null||v(te,oe)},__onDayClick:(te,oe)=>{Q(oe),m==null||m(te,oe)},getDayProps:te=>{var oe;return{...P(te),...(oe=R.getDayProps)==null?void 0:oe.call(R,te)}},getMonthControlProps:te=>{var oe;return{selected:typeof I=="string"?M4(te,I):!1,...(oe=R.getMonthControlProps)==null?void 0:oe.call(R,te)}},getYearControlProps:te=>{var oe;return{selected:typeof I=="string"?qe(te).isSame(I,"year"):!1,...(oe=R.getYearControlProps)==null?void 0:oe.call(R,te)}},hideOutsideDates:R.hideOutsideDates??R.numberOfColumns!==1,...w?{}:{className:S,style:_,attributes:A}});if(!w)return V;const G=te=>{var be,ye;const oe=Array.isArray(te)?te[0]:te;oe!==void 0&&((be=$.current)==null||be.call($,oe),(ye=D.current)==null||ye.call(D,"month"),b?b(oe):U(te))},W=w.map((te,oe)=>a.jsx(Dr,{...F("presetButton"),onClick:()=>G(te.value),onMouseDown:be=>be.preventDefault(),"data-mantine-stop-propagation":x||void 0,children:te.label},oe));return a.jsxs(ve,{...F("datePickerRoot"),size:C,...N,children:[a.jsx("div",{...F("presetsList"),children:W}),V]})});J2.classes=Z2.classes;J2.displayName="@mantine/dates/DatePicker";var Zz={timeWrapper:"m_208d2562",timeInput:"m_62ee059"};function Mce({minDate:t,value:e}){const n=t?qe(t).format("HH:mm:ss"):null;return e&&t&&e===t?n??void 0:void 0}function Rce({maxDate:t,value:e}){const n=t?qe(t).format("HH:mm:ss"):null;return e&&t&&e===t?n??void 0:void 0}const Dce={dropdownType:"popover",size:"sm"},D4=Ae((t,e)=>{const n=Se("DateTimePicker",Dce,t),{value:r,defaultValue:i,onChange:s,valueFormat:o,locale:l,classNames:u,styles:h,unstyled:f,timePickerProps:p,submitButtonProps:m,withSeconds:v,level:b,defaultLevel:x,size:w,variant:S,dropdownType:_,vars:T,minDate:C,maxDate:j,defaultDate:A,defaultTimeValue:E,presets:R,attributes:N,onDropdownClose:$,...D}=n,F=lt({name:"DateTimePicker",classes:Zz,props:n,classNames:u,styles:h,unstyled:f,attributes:N,vars:T}),{resolvedClassNames:Q,resolvedStyles:H}=jo({classNames:u,styles:h,props:n}),q=o||(v?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),P=M.useRef(null),I=cr(P,p==null?void 0:p.hoursRef),{calendarProps:{allowSingleDateInRange:U,...Z},others:X}=Kz(D),V=Gh(),[G,W]=R4({type:"default",value:r,defaultValue:i,onChange:s,withTime:!0}),te=A||G,oe=ze=>ze?qe(ze).format(v?"HH:mm:ss":"HH:mm"):"",[be,ye]=M.useState(E||oe(G)),[Ke,Fe]=M.useState(b||x||"month"),[Pe,ae]=Iv(!1),Te=G?qe(G).locale(V.getLocale(l)).format(q):"",fe=ze=>{var De;(De=p==null?void 0:p.onChange)==null||De.call(p,ze),ye(ze),ze&&W(lD(G,ze))},Ee=ze=>{var De;ze&&W(lD(v3(C,j,ze),be||E||"")),(De=P.current)==null||De.focus()},gt=ze=>{ze.key==="Enter"&&(ze.preventDefault(),ae.close())};Yl(()=>{Pe||ye(oe(G))},[G,Pe]),Yl(()=>{Pe&&Fe("month")},[Pe]);const We=_==="popover",Be=()=>{const ze=v3(C,j,G);G&&G!==ze&&W(v3(C,j,G)),$==null||$()};return a.jsxs(K2,{formattedValue:Te,dropdownOpened:D.disabled?!1:Pe,dropdownHandlers:ae,classNames:Q,styles:H,unstyled:f,ref:e,onClear:()=>W(null),shouldClear:!!G,value:G,size:w,variant:S,dropdownType:_,...X,type:"default",__staticSelector:"DateTimePicker",onDropdownClose:Be,withTime:!0,attributes:N,children:[a.jsx(J2,{...Z,maxDate:j,minDate:C,size:w,variant:S,type:"default",value:G,defaultDate:te||Nle({maxDate:j,minDate:C}),onChange:Ee,locale:l,classNames:Q,styles:H,unstyled:f,__staticSelector:"DateTimePicker",__stopPropagation:We,level:b,defaultLevel:x,onLevelChange:ze=>{var De;Fe(ze),(De=Z.onLevelChange)==null||De.call(Z,ze)},presets:R,__onPresetSelect:ze=>{W(ze),ze&&ye(oe(ze))},attributes:N}),Ke==="month"&&a.jsxs("div",{...F("timeWrapper"),children:[a.jsx(O4,{value:be,withSeconds:v,unstyled:f,min:Mce({minDate:C,value:G}),max:Rce({maxDate:j,value:G}),...p,...F("timeInput",{className:p==null?void 0:p.className,style:p==null?void 0:p.style}),onChange:fe,onKeyDown:gt,size:w,"data-mantine-stop-propagation":We||void 0,hoursRef:I,attributes:N}),a.jsx(Nr,{variant:"default",size:`input-${w||"sm"}`,...F("submitButton",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),unstyled:f,"data-mantine-stop-propagation":We||void 0,children:a.jsx(a2,{size:"30%"}),...m,onClick:ze=>{var De;(De=m==null?void 0:m.onClick)==null||De.call(m,ze),ae.close(),Be()}})]})]})});D4.classes={...Zz,...K2.classes,...J2.classes};D4.displayName="@mantine/dates/DateTimePicker";const Nce="settings.useLocalTime",Pce="settings.enableQueryHistory",Lce="settings.enableAutocomplete",$ce="settings.enableSyntaxHighlighting",Ice="settings.enableLinter",Bce="settings.showAnnotations",zce="settings.showQueryWarnings",qce="settings.showQueryInfoNotices",Fce="settings.ruleGroupsPerPage",Hce="settings.alertGroupsPerPage",Vce=t=>{t.endsWith("/")&&(t=t.slice(0,-1));const n=["/query","/alerts","/targets","/rules","/service-discovery","/status","/tsdb-status","/flags","/config","/alertmanager-discovery","/agent"].find(r=>t.endsWith(r));return t.slice(0,t.length-(n||"").length)},Uce={consolesLink:GLOBAL_CONSOLES_LINK==="CONSOLES_LINK_PLACEHOLDER"||GLOBAL_CONSOLES_LINK===""||GLOBAL_CONSOLES_LINK===null?null:GLOBAL_CONSOLES_LINK,agentMode:GLOBAL_AGENT_MODE==="true",ready:GLOBAL_READY==="true",lookbackDelta:GLOBAL_LOOKBACKDELTA==="LOOKBACKDELTA_PLACEHOLDER"||GLOBAL_LOOKBACKDELTA===null?"":GLOBAL_LOOKBACKDELTA,pathPrefix:Vce(window.location.pathname),useLocalTime:Ea(Nce,!1),enableQueryHistory:Ea(Pce,!1),enableAutocomplete:Ea(Lce,!0),enableSyntaxHighlighting:Ea($ce,!0),enableLinter:Ea(Ice,!0),showAnnotations:Ea(Bce,!1),showQueryWarnings:Ea(zce,!0),showQueryInfoNotices:Ea(qce,!0),ruleGroupsPerPage:Ea(Fce,10),alertGroupsPerPage:Ea(Hce,10)},Jz=$2({name:"settings",initialState:Uce,reducers:{updateSettings:(t,{payload:e})=>{Object.assign(t,e)}}}),{updateSettings:ao}=Jz.actions,ai=()=>rc(t=>t.settings),Qce=Jz.reducer,fD={width:"0.9rem",height:"0.9rem"},eq=({time:t,range:e,description:n,onChangeTime:r})=>{const i=()=>t!==null?t:Date.now().valueOf(),{useLocalTime:s}=ai(),o=s?qe(t).format():qe(t).subtract(qe().utcOffset(),"minutes").format();return a.jsx(ht,{gap:5,children:a.jsx(D4,{title:"End time",w:230,valueFormat:"YYYY-MM-DD HH:mm:ss",withSeconds:!0,value:t!==null?o:void 0,onChange:l=>r(l?s?new Date(l).getTime():qe.utc(l).valueOf():null),"aria-label":n,placeholder:n,onClick:()=>{t===null&&r(i())},leftSection:a.jsx(Nr,{size:"lg",color:"gray",variant:"transparent",title:"Decrease time","aria-label":"Decrease time",onClick:()=>r(i()-e/2),children:a.jsx(are,{style:fD})}),styles:{section:{width:"unset"}},rightSection:a.jsxs(a.Fragment,{children:[t&&a.jsx(Jl,{variant:"transparent",color:"gray",onMouseDown:l=>l.preventDefault(),tabIndex:-1,onClick:()=>{r(null)},size:"xs"}),a.jsx(Nr,{size:"lg",color:"gray",variant:"transparent",title:"Increase time","aria-label":"Increase time",onClick:()=>r(i()+e/2),children:a.jsx(uB,{style:fD})})]})})})},pD={width:"0.9rem",height:"0.9rem"},mD=[1,10,60,5*60,15*60,30*60,60*60,2*60*60,6*60*60,12*60*60,24*60*60,48*60*60,7*24*60*60,14*24*60*60,28*24*60*60,56*24*60*60,112*24*60*60,182*24*60*60,365*24*60*60,730*24*60*60].map(t=>t*1e3),Wce=({range:t,onChangeRange:e})=>{const[n,r]=M.useState(Bn(t));M.useEffect(()=>{r(Bn(t))},[t]);const i=l=>{const u=_4(l);u===null?r(Bn(t)):e(u)},s=()=>{for(const l of mD)if(t<l){r(Bn(l)),e(l);return}},o=()=>{for(const l of mD.slice().reverse())if(t>l){r(Bn(l)),e(l);return}};return a.jsx(ht,{gap:5,children:a.jsx(ec,{title:"Range",value:n,onChange:l=>r(l.currentTarget.value),onBlur:()=>i(n),onKeyDown:l=>l.key==="Enter"&&i(n),"aria-label":"Range",style:{width:`calc(44px + ${n.length+3}ch)`},leftSection:a.jsx(Nr,{size:"lg",variant:"transparent",color:"gray","aria-label":"Decrease range",onClick:o,children:a.jsx(Bre,{style:pD})}),rightSection:a.jsx(Nr,{size:"lg",variant:"transparent",color:"gray","aria-label":"Increase range",onClick:s,children:a.jsx(mB,{style:pD})}),leftSectionPointerEvents:"all",rightSectionPointerEvents:"all"})})},tq=1024;let Yce=0,x3=class{constructor(e,n){this.from=e,this.to=n}};class on{constructor(e={}){this.id=Yce++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=pa.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}on.closedBy=new on({deserialize:t=>t.split(" ")});on.openedBy=new on({deserialize:t=>t.split(" ")});on.group=new on({deserialize:t=>t.split(" ")});on.isolate=new on({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});on.contextHash=new on({perNode:!0});on.lookAhead=new on({perNode:!0});on.mounted=new on({perNode:!0});class Mg{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[on.mounted.id]}}const Xce=Object.create(null);class pa{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):Xce,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new pa(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(e){return this.props[e.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(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(on.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(on.group),s=-1;s<(i?i.length:0);s++){let o=n[s<0?r.name:i[s]];if(o)return o}}}}pa.none=new pa("",Object.create(null),0,8);class N4{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let s of e){let o=s(r);if(o){i||(i=Object.assign({},r.props));let l=o[1],u=o[0];u.combine&&u.id in i&&(l=u.combine(i[u.id],l)),i[u.id]=l}}n.push(i?new pa(r.name,i,r.id,r.flags):r)}return new N4(n)}}const Qy=new WeakMap,gD=new WeakMap;var Yr;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(Yr||(Yr={}));class si{constructor(e,n,r,i,s){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=Mg.get(this);if(e&&!e.overlay)return e.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(e=0){return new UC(this.topNode,e)}cursorAt(e,n=0,r=0){let i=Qy.get(this)||this.topNode,s=new UC(i);return s.moveTo(e,n),Qy.set(this,s._tree),s}get topNode(){return new Rh(this,0,0,null)}resolve(e,n=0){let r=rv(Qy.get(this)||this.topNode,e,n,!1);return Qy.set(this,r),r}resolveInner(e,n=0){let r=rv(gD.get(this)||this.topNode,e,n,!0);return gD.set(this,r),r}resolveStack(e,n=0){return Zce(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,l=(o&Yr.IncludeAnonymous)>0;for(let u=this.cursor(o|Yr.IncludeAnonymous);;){let h=!1;if(u.from<=s&&u.to>=i&&(!l&&u.type.isAnonymous||n(u)!==!1)){if(u.firstChild())continue;h=!0}for(;h&&r&&(l||!u.type.isAnonymous)&&r(u),!u.nextSibling();){if(!u.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:$4(pa.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new si(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new si(pa.none,n,r,i)))}static build(e){return Jce(e)}}si.empty=new si(pa.none,[],[],0);class P4{constructor(e,n){this.buffer=e,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 P4(this.buffer,this.index)}}class Mh{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return pa.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,n,r,i,s){let{buffer:o}=this,l=-1;for(let u=e;u!=n&&!(nq(s,i,o[u+1],o[u+2])&&(l=u,r>0));u=o[u+3]);return l}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),o=0;for(let l=e,u=0;l<n;){s[u++]=i[l++],s[u++]=i[l++]-r;let h=s[u++]=i[l++]-r;s[u++]=i[l++]-e,o=Math.max(o,h)}return new Mh(s,o,this.set)}}function nq(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function rv(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!r&&t instanceof Rh&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=r?0:Yr.IgnoreOverlays;if(r)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof Rh&&o.index<0&&((i=l.enter(e,n,s))===null||i===void 0?void 0:i.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,n,s);if(!o)return t;t=o}}class rq{cursor(e=0){return new UC(this,e)}getChild(e,n=null,r=null){let i=vD(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return vD(this,e,n,r)}resolve(e,n=0){return rv(this,e,n,!1)}resolveInner(e,n=0){return rv(this,e,n,!0)}matchContext(e){return VC(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),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}}let Rh=class G1 extends rq{constructor(e,n,r,i){super(),this._tree=e,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(e,n,r,i,s=0){for(let o=this;;){for(let{children:l,positions:u}=o._tree,h=n>0?l.length:-1;e!=h;e+=n){let f=l[e],p=u[e]+o.from,m;if(!(!(s&Yr.EnterBracketed&&f instanceof si&&(m=Mg.get(f))&&!m.overlay&&m.bracketed&&r>=p&&r<=p+f.length)&&!nq(i,r,p,p+f.length))){if(f instanceof Mh){if(s&Yr.ExcludeBuffers)continue;let v=f.findChild(0,f.buffer.length,n,r-p,i);if(v>-1)return new vh(new Gce(o,f,e,p),null,v)}else if(s&Yr.IncludeAnonymous||!f.type.isAnonymous||L4(f)){let v;if(!(s&Yr.IgnoreMounts)&&(v=Mg.get(f))&&!v.overlay)return new G1(v.tree,p,e,o);let b=new G1(f,p,e,o);return s&Yr.IncludeAnonymous||!b.type.isAnonymous?b:b.nextChild(n<0?f.children.length-1:0,n,r,i,s)}}}if(s&Yr.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))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(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let i;if(!(r&Yr.IgnoreOverlays)&&(i=Mg.get(this._tree))&&i.overlay){let s=e-this.from,o=r&Yr.EnterBracketed&&i.bracketed;for(let{from:l,to:u}of i.overlay)if((n>0||o?l<=s:l<s)&&(n<0||o?u>=s:u>s))return new G1(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}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 vD(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function VC(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class Gce{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class vh extends rq{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(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new vh(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&Yr.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new vh(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new vh(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new vh(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),n.push(0)}return new si(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function iq(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let o=t[s];(o.from>n.from||o.to<n.to)&&(n=o,e=s)}let r=n instanceof Rh&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new Kce(i,n)}class Kce{constructor(e,n){this.heads=e,this.node=n}get next(){return iq(this.heads)}}function Zce(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof Rh?r:r.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[r])).push(o.resolve(e,n)),s=o}else{let o=Mg.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new Rh(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(rv(l,e,n,!1))}}return i?iq(i):r}class UC{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Yr.EnterBracketed,e instanceof Rh)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Rh?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Yr.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Yr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Yr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<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+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+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 s=n+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let l=r._tree.children[s];if(this.mode&Yr.IncludeAnonymous||l instanceof Mh||!l.type.isAnonymous||L4(l))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;n=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)n=new vh(this.buffer,n,this.stack[i]);return this.bufferNode=new vh(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(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(e){if(!this.buffer)return VC(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return VC(this._tree,e,i);let o=r[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function L4(t){return t.children.some(e=>e instanceof Mh||!e.type.isAnonymous||L4(e))}function Jce(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=tq,reused:s=[],minRepeatType:o=r.types.length}=t,l=Array.isArray(n)?new P4(n,n.length):n,u=r.types,h=0,f=0;function p(j,A,E,R,N,$){let{id:D,start:F,end:Q,size:H}=l,q=f,P=h;if(H<0)if(l.next(),H==-1){let V=s[D];E.push(V),R.push(F-j);return}else if(H==-3){h=D;return}else if(H==-4){f=D;return}else throw new RangeError(`Unrecognized record size: ${H}`);let I=u[D],U,Z,X=F-j;if(Q-F<=i&&(Z=w(l.pos-A,N))){let V=new Uint16Array(Z.size-Z.skip),G=l.pos-Z.size,W=V.length;for(;l.pos>G;)W=S(Z.start,V,W);U=new Mh(V,Q-Z.start,r),X=Z.start-j}else{let V=l.pos-H;l.next();let G=[],W=[],te=D>=o?D:-1,oe=0,be=Q;for(;l.pos>V;)te>=0&&l.id==te&&l.size>=0?(l.end<=be-i&&(b(G,W,F,oe,l.end,be,te,q,P),oe=G.length,be=l.end),l.next()):$>2500?m(F,V,G,W):p(F,V,G,W,te,$+1);if(te>=0&&oe>0&&oe<G.length&&b(G,W,F,oe,F,be,te,q,P),G.reverse(),W.reverse(),te>-1&&oe>0){let ye=v(I,P);U=$4(I,G,W,0,G.length,0,Q-F,ye,ye)}else U=x(I,G,W,Q-F,q-Q,P)}E.push(U),R.push(X)}function m(j,A,E,R){let N=[],$=0,D=-1;for(;l.pos>A;){let{id:F,start:Q,end:H,size:q}=l;if(q>4)l.next();else{if(D>-1&&Q<D)break;D<0&&(D=H-i),N.push(F,Q,H),$++,l.next()}}if($){let F=new Uint16Array($*4),Q=N[N.length-2];for(let H=N.length-3,q=0;H>=0;H-=3)F[q++]=N[H],F[q++]=N[H+1]-Q,F[q++]=N[H+2]-Q,F[q++]=q;E.push(new Mh(F,N[2]-Q,r)),R.push(Q-j)}}function v(j,A){return(E,R,N)=>{let $=0,D=E.length-1,F,Q;if(D>=0&&(F=E[D])instanceof si){if(!D&&F.type==j&&F.length==N)return F;(Q=F.prop(on.lookAhead))&&($=R[D]+F.length+Q)}return x(j,E,R,N,$,A)}}function b(j,A,E,R,N,$,D,F,Q){let H=[],q=[];for(;j.length>R;)H.push(j.pop()),q.push(A.pop()+E-N);j.push(x(r.types[D],H,q,$-N,F-$,Q)),A.push(N-E)}function x(j,A,E,R,N,$,D){if($){let F=[on.contextHash,$];D=D?[F].concat(D):[F]}if(N>25){let F=[on.lookAhead,N];D=D?[F].concat(D):[F]}return new si(j,A,E,R,D)}function w(j,A){let E=l.fork(),R=0,N=0,$=0,D=E.end-i,F={size:0,start:0,skip:0};e:for(let Q=E.pos-j;E.pos>Q;){let H=E.size;if(E.id==A&&H>=0){F.size=R,F.start=N,F.skip=$,$+=4,R+=4,E.next();continue}let q=E.pos-H;if(H<0||q<Q||E.start<D)break;let P=E.id>=o?4:0,I=E.start;for(E.next();E.pos>q;){if(E.size<0)if(E.size==-3||E.size==-4)P+=4;else break e;else E.id>=o&&(P+=4);E.next()}N=I,R+=H,$+=P}return(A<0||R==j)&&(F.size=R,F.start=N,F.skip=$),F.size>4?F:void 0}function S(j,A,E){let{id:R,start:N,end:$,size:D}=l;if(l.next(),D>=0&&R<o){let F=E;if(D>4){let Q=l.pos-(D-4);for(;l.pos>Q;)E=S(j,A,E)}A[--E]=F,A[--E]=$-j,A[--E]=N-j,A[--E]=R}else D==-3?h=R:D==-4&&(f=R);return E}let _=[],T=[];for(;l.pos>0;)p(t.start||0,t.bufferStart||0,_,T,-1,0);let C=(e=t.length)!==null&&e!==void 0?e:_.length?T[0]+_[0].length:0;return new si(u[t.topID],_.reverse(),T.reverse(),C)}const bD=new WeakMap;function K1(t,e){if(!t.isAnonymous||e instanceof Mh||e.type!=t)return 1;let n=bD.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof si)){n=1;break}n+=K1(t,r)}bD.set(e,n)}return n}function $4(t,e,n,r,i,s,o,l,u){let h=0;for(let b=r;b<i;b++)h+=K1(t,e[b]);let f=Math.ceil(h*1.5/8),p=[],m=[];function v(b,x,w,S,_){for(let T=w;T<S;){let C=T,j=x[T],A=K1(t,b[T]);for(T++;T<S;T++){let E=K1(t,b[T]);if(A+E>=f)break;A+=E}if(T==C+1){if(A>f){let E=b[C];v(E.children,E.positions,0,E.children.length,x[C]+_);continue}p.push(b[C])}else{let E=x[T-1]+b[T-1].length-j;p.push($4(t,b,x,C,T,j,E,null,u))}m.push(j+_-s)}}return v(e,n,r,i,0),(l||u)(p,m,o)}class af{constructor(e,n,r,i,s=!1,o=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new af(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let l=0,u=0,h=0;;l++){let f=l<n.length?n[l]:null,p=f?f.fromA:1e9;if(p-u>=r)for(;o&&o.from<p;){let m=o;if(u>=m.from||p<=m.to||h){let v=Math.max(m.from,u)-h,b=Math.min(m.to,p)-h;m=v>=b?null:new af(v,b,m.tree,m.offset+h,l>0,!!f)}if(m&&i.push(m),o.to>p)break;o=s<e.length?e[s++]:null}if(!f)break;u=f.toA,h=f.toA-f.toB}return i}}let sq=class{startParse(e,n,r){return typeof e=="string"&&(e=new eue(e)),r=r?r.length?r.map(i=>new x3(i.from,i.to)):[new x3(0,0)]:[new x3(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}};class eue{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new on({perNode:!0});var yD={};let tue=class QC{constructor(e,n,r,i,s,o,l,u,h,f=0,p){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=u,this.curContext=h,this.lookAhead=f,this.parent=p}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new QC(e,[],n,r,r,0,[],0,i?new xD(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(i);if(l&&(this.score+=l),r==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let u=this.stack.length-(r-1)*3-(e&262144?6:0),h=u?this.stack[u-2]:this.p.ranges[0].from,f=this.reducePos-h;f>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=f):this.p.lastBigReductionSize<f&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=f));let p=u?this.stack[u-1]:0,m=this.bufferBase+this.buffer.length-p;if(i<s.minRepeatTerm||e&131072){let v=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,h,v,m+4,!0)}if(e&262144)this.state=this.stack[u];else{let v=this.stack[u-3];this.state=s.getGoto(v,i,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(i,h)}storeNode(e,n,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,l=this.buffer.length;if(l==0&&o.parent&&(l=o.bufferBase-o.parent.bufferBase,o=o.parent),l>0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(n==r)return;if(o.buffer[l-2]>=n){o.buffer[l-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,n,r,i);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let u=o;u>0&&this.buffer[u-2]>r;u-=4)if(this.buffer[u-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>r;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=r,this.buffer[o+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=i;let l=o.stateFlag(s,1);!l&&(i>r||n<=o.maxNode)&&(this.reducePos=i),this.pushState(s,l?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=o.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(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new QC(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new nue(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){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 s=0,o;s<n.length;s+=2)(o=n[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&i.push(n[s],o);if(this.stack.length<120)for(let s=0;i.length<8&&s<n.length;s+=2){let o=n[s+1];i.some((l,u)=>u&1&&l==o)||i.push(n[s],o)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let s=n[i+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(n[i],this.pos),o.reducePos=this.pos,o.score-=200,r.push(o)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,s)=>{if(!n.includes(i))return n.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let u=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],u,!1)>=0)return l<<19|65536|u}}else{let l=r(o,s+1);if(l!=null)return l}})};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:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new xD(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};class xD{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class nue{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>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 Vx{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new Vx(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.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 Vx(this.stack,this.pos,this.index)}}function Wy(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let s=0;for(;;){let o=t.charCodeAt(r++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let u=o-32;if(u>=46&&(u-=46,l=!0),s+=u,l)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class Z1{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const wD=new Z1;class rue{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=wD,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;s<r.from;){if(!i)return null;let o=this.ranges[--i];s-=r.from-o.to,r=o}for(;n<0?s>r.to:s>=r.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];s+=o.from-r.to,r=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(r=s,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=r;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,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=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,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(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,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(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=wD,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class Lp{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;iue(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Lp.prototype.contextual=Lp.prototype.fallback=Lp.prototype.extend=!1;Lp.prototype.fallback=Lp.prototype.extend=!1;function iue(t,e,n,r,i,s){let o=0,l=1<<r,{dialect:u}=n.p.parser;e:for(;(l&t[o])!=0;){let h=t[o+1];for(let v=o+3;v<h;v+=2)if((t[v+1]&l)>0){let b=t[v];if(u.allows(b)&&(e.token.value==-1||e.token.value==b||sue(b,e.token.value,i,s))){e.acceptToken(b);break}}let f=e.next,p=0,m=t[o+2];if(e.next<0&&m>p&&t[h+m*3-3]==65535){o=t[h+m*3-1];continue e}for(;p<m;){let v=p+m>>1,b=h+v+(v<<1),x=t[b],w=t[b+1]||65536;if(f<x)m=v;else if(f>=w)p=v+1;else{o=t[b+2],e.advance();continue e}}break}}function SD(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function sue(t,e,n,r){let i=SD(n,r,e);return i<0||SD(n,r,t)<i}const Ta=typeof process<"u"&&yD&&/\bparse\b/.test(yD.LOG);let w3=null;function jD(t,e,n){let r=t.cursor(Yr.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class aue{constructor(e,n){this.fragments=e,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 e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?jD(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?jD(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)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 s=r.children[i],o=this.start[n]+r.positions[i];if(o>e)return this.nextStart=o,null;if(s instanceof si){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let u=s.prop(on.lookAhead);if(!u||l+u<this.fragment.to)return s}}this.index[n]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}}class oue{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Z1)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,o=i.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,u=0;for(let h=0;h<s.length;h++){if((1<<h&o)==0)continue;let f=s[h],p=this.tokens[h];if(!(r&&!f.fallback)&&((f.contextual||p.start!=e.pos||p.mask!=o||p.context!=l)&&(this.updateCachedToken(p,f,e),p.mask=o,p.context=l),p.lookAhead>p.end+25&&(u=Math.max(p.lookAhead,u)),p.value!=0)){let m=n;if(p.extended>-1&&(n=this.addActions(e,p.extended,p.end,n)),n=this.addActions(e,p.value,p.end,n),!f.extend&&(r=p,n>m))break}}for(;this.actions.length>n;)this.actions.pop();return u&&e.setLookAhead(u),!r&&e.pos==this.stream.end&&(r=new Z1,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Z1,{pos:r,p:i}=e;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(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),r);if(l>=0&&r.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let s=0;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let u=0;u<2;u++)for(let h=o.stateSlot(s,u?2:1);;h+=3){if(l[h]==65535)if(l[h+1]==1)h=Ic(l,h+2);else{i==0&&l[h+1]==2&&(i=this.putAction(Ic(l,h+2),n,r,i));break}l[h]==n&&(i=this.putAction(Ic(l,h+1),n,r,i))}return i}}class lue{constructor(e,n,r,i){this.parser=e,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 rue(n,i),this.tokens=new oue(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[tue.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.bufferLength*4?new aue(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>n)r.push(l);else{if(this.advanceStack(l,r,e))continue;{i||(i=[],s=[]),i.push(l);let u=this.tokens.getMainToken(l);s.push(u.value,u.end)}}break}}if(!r.length){let o=i&&uue(i);if(o)return Ta&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ta&&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 o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(o)return Ta&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((l,u)=>u.score-l.score);r.length>o;)r.pop();r.some(l=>l.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let o=0;o<r.length-1;o++){let l=r[o];for(let u=o+1;u<r.length;u++){let h=r[u];if(l.sameState(h)||l.buffer.length>500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)r.splice(u--,1);else{r.splice(o--,1);continue e}}}r.length>12&&(r.sort((o,l)=>l.score-o.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let o=1;o<r.length;o++)r[o].pos<this.minStackPos&&(this.minStackPos=r[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:s}=this,o=Ta?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,f=h?e.curContext.hash:0;for(let p=this.fragments.nodeAt(i);p;){let m=this.parser.nodeSet.types[p.type.id]==p.type?s.getGoto(e.state,p.type.id):-1;if(m>-1&&p.length&&(!h||(p.prop(on.contextHash)||0)==f))return e.useNode(p,m),Ta&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(p.type.id)})`),!0;if(!(p instanceof si)||p.children.length==0||p.positions[0]>0)break;let v=p.children[0];if(v instanceof si&&p.positions[0]==0)p=v;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Ta&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let u=this.tokens.getActions(e);for(let h=0;h<u.length;){let f=u[h++],p=u[h++],m=u[h++],v=h==u.length||!r,b=v?e:e.split(),x=this.tokens.mainToken;if(b.apply(f,p,x?x.start:b.pos,m),Ta&&console.log(o+this.stackID(b)+` (via ${(f&65536)==0?"shift":`reduce of ${s.getName(f&65535)}`} for ${s.getName(p)} @ ${i}${b==e?"":", split"})`),v)return!0;b.pos>i?n.push(b):r.push(b)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return _D(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],u=n[o<<1],h=n[(o<<1)+1],f=Ta?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Ta&&console.log(f+this.stackID(l)+" (restarted)"),this.advanceFully(l,r))))continue;let p=l.split(),m=f;for(let v=0;v<10&&p.forceReduce()&&(Ta&&console.log(m+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,r));v++)Ta&&(m=this.stackID(p)+" -> ");for(let v of l.recoverByInsert(u))Ta&&console.log(f+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,r);this.stream.end>l.pos?(h==l.pos&&(h++,u=0),l.recoverByDelete(u,h),Ta&&console.log(f+this.stackID(l)+` (via recover-delete ${this.parser.getName(u)})`),_D(l,r)):(!i||i.score<p.score)&&(i=p)}return i}stackToTree(e){return e.close(),si.build({buffer:Vx.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(w3||(w3=new WeakMap)).get(e);return n||w3.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function _D(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class cue{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}class Ux extends sq{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;l<e.repeatNodeCount;l++)n.push("");let r=Object.keys(e.topRules).map(l=>e.topRules[l][1]),i=[];for(let l=0;l<n.length;l++)i.push([]);function s(l,u,h){i[l].push([u,u.deserialize(String(h))])}if(e.nodeProps)for(let l of e.nodeProps){let u=l[0];typeof u=="string"&&(u=on[u]);for(let h=1;h<l.length;){let f=l[h++];if(f>=0)s(f,u,l[h++]);else{let p=l[h+-f];for(let m=-f;m>0;m--)s(l[h++],u,p);h++}}}this.nodeSet=new N4(n.map((l,u)=>pa.define({name:u>=this.minRepeatTerm?void 0:l,id:u,props:i[u],top:r.indexOf(u)>-1,error:u==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(u)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=tq;let o=Wy(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(TD),this.states=Wy(e.states,Uint32Array),this.data=Wy(e.stateData),this.goto=Wy(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Lp(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new lue(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let s=i[n+1];;){let o=i[s++],l=o&1,u=i[s++];if(l&&r)return u;for(let h=s+(o>>1);s<h;s++)if(i[s]==e)return u;if(l)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),o;;s+=3){if((o=r[s])==65535)if(r[s+1]==1)o=r[s=Ic(r,s+2)];else{if(r[s+1]==2)return Ic(r,s+2);break}if(o==n||o==0)return Ic(r,s+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Ic(this.data,s+2);else break;i=n(Ic(this.data,s+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Ic(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((s,o)=>o&1&&s==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Ux.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(l=>l.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return n.specializers[i]=TD(o),o})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(r[o]=!0)}let i=null;for(let s=0;s<n.length;s++)if(!r[s])for(let o=this.dialects[n[s]],l;(l=this.data[o++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[l]=1;return new cue(e,r,i)}static deserialize(e){return new Ux(e)}}function Ic(t,e){return t[e]|t[e+1]<<16}function uue(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function TD(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}let hue=0;class ho{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=hue++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof ho&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new ho(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new Qx(e);return r=>r.modified.indexOf(n)>-1?r:Qx.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let due=0;class Qx{constructor(e){this.name=e,this.instances=[],this.id=due++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(l=>l.base==e&&fue(n,l.modified));if(r)return r;let i=[],s=new ho(e.name,i,e,n);for(let l of n)l.instances.push(s);let o=pue(n);for(let l of e.set)if(!l.modified.length)for(let u of o)i.push(Qx.get(l,u));return s}}function fue(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function pue(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function aq(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],o=2,l=i;for(let p=0;;){if(l=="..."&&p>0&&p+3==i.length){o=1;break}let m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!m)throw new RangeError("Invalid path: "+i);if(s.push(m[0]=="*"?"":m[0][0]=='"'?JSON.parse(m[0]):m[0]),p+=m[0].length,p==i.length)break;let v=i[p++];if(p==i.length&&v=="!"){o=0;break}if(v!="/")throw new RangeError("Invalid path: "+i);l=i.slice(p)}let u=s.length-1,h=s[u];if(!h)throw new RangeError("Invalid path: "+i);let f=new iv(r,o,u>0?s.slice(0,u):null);e[h]=f.sort(e[h])}}return oq.add(e)}const oq=new on({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new iv(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class iv{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}iv.empty=new iv([],2,null);function lq(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let o of s.tag)n[o.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{let o=i;for(let l of s)for(let u of l.set){let h=n[u.id];if(h){o=o?o+" "+h:h;break}}return o},scope:r}}function mue(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function gue(t,e,n,r=0,i=t.length){let s=new vue(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class vue{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,s){let{type:o,from:l,to:u}=e;if(l>=r||u<=n)return;o.isTop&&(s=this.highlighters.filter(v=>!v.scope||v.scope(o)));let h=i,f=bue(e)||iv.empty,p=mue(s,f.tags);if(p&&(h&&(h+=" "),h+=p,f.mode==1&&(i+=(i?" ":"")+p)),this.startSpan(Math.max(n,l),h),f.opaque)return;let m=e.tree&&e.tree.prop(on.mounted);if(m&&m.overlay){let v=e.node.enter(m.overlay[0].from+l,1),b=this.highlighters.filter(w=>!w.scope||w.scope(m.tree.type)),x=e.firstChild();for(let w=0,S=l;;w++){let _=w<m.overlay.length?m.overlay[w]:null,T=_?_.from+l:u,C=Math.max(n,S),j=Math.min(r,T);if(C<j&&x)for(;e.from<j&&(this.highlightRange(e,C,j,i,s),this.startSpan(Math.min(j,e.to),h),!(e.to>=T||!e.nextSibling())););if(!_||T>r)break;S=_.to+l,S>n&&(this.highlightRange(v.cursor(),Math.max(n,_.from+l),Math.min(r,S),"",b),this.startSpan(Math.min(r,S),h))}x&&e.parent()}else if(e.firstChild()){m&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,s),this.startSpan(Math.min(r,e.to),h)}while(e.nextSibling());e.parent()}}}function bue(t){let e=t.type.prop(oq);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const at=ho.define,Yy=at(),th=at(),CD=at(th),kD=at(th),nh=at(),Xy=at(nh),S3=at(nh),El=at(),Sd=at(El),Tl=at(),Cl=at(),WC=at(),eg=at(WC),Gy=at(),pe={comment:Yy,lineComment:at(Yy),blockComment:at(Yy),docComment:at(Yy),name:th,variableName:at(th),typeName:CD,tagName:at(CD),propertyName:kD,attributeName:at(kD),className:at(th),labelName:at(th),namespace:at(th),macroName:at(th),literal:nh,string:Xy,docString:at(Xy),character:at(Xy),attributeValue:at(Xy),number:S3,integer:at(S3),float:at(S3),bool:at(nh),regexp:at(nh),escape:at(nh),color:at(nh),url:at(nh),keyword:Tl,self:at(Tl),null:at(Tl),atom:at(Tl),unit:at(Tl),modifier:at(Tl),operatorKeyword:at(Tl),controlKeyword:at(Tl),definitionKeyword:at(Tl),moduleKeyword:at(Tl),operator:Cl,derefOperator:at(Cl),arithmeticOperator:at(Cl),logicOperator:at(Cl),bitwiseOperator:at(Cl),compareOperator:at(Cl),updateOperator:at(Cl),definitionOperator:at(Cl),typeOperator:at(Cl),controlOperator:at(Cl),punctuation:WC,separator:at(WC),bracket:eg,angleBracket:at(eg),squareBracket:at(eg),paren:at(eg),brace:at(eg),content:El,heading:Sd,heading1:at(Sd),heading2:at(Sd),heading3:at(Sd),heading4:at(Sd),heading5:at(Sd),heading6:at(Sd),contentSeparator:at(El),list:at(El),quote:at(El),emphasis:at(El),strong:at(El),link:at(El),monospace:at(El),strikethrough:at(El),inserted:at(),deleted:at(),changed:at(),invalid:at(),meta:Gy,documentMeta:at(Gy),annotation:at(Gy),processingInstruction:at(Gy),definition:ho.defineModifier("definition"),constant:ho.defineModifier("constant"),function:ho.defineModifier("function"),standard:ho.defineModifier("standard"),local:ho.defineModifier("local"),special:ho.defineModifier("special")};for(let t in pe){let e=pe[t];e instanceof ho&&(e.name=t)}lq([{tag:pe.link,class:"tok-link"},{tag:pe.heading,class:"tok-heading"},{tag:pe.emphasis,class:"tok-emphasis"},{tag:pe.strong,class:"tok-strong"},{tag:pe.keyword,class:"tok-keyword"},{tag:pe.atom,class:"tok-atom"},{tag:pe.bool,class:"tok-bool"},{tag:pe.url,class:"tok-url"},{tag:pe.labelName,class:"tok-labelName"},{tag:pe.inserted,class:"tok-inserted"},{tag:pe.deleted,class:"tok-deleted"},{tag:pe.literal,class:"tok-literal"},{tag:pe.string,class:"tok-string"},{tag:pe.number,class:"tok-number"},{tag:[pe.regexp,pe.escape,pe.special(pe.string)],class:"tok-string2"},{tag:pe.variableName,class:"tok-variableName"},{tag:pe.local(pe.variableName),class:"tok-variableName tok-local"},{tag:pe.definition(pe.variableName),class:"tok-variableName tok-definition"},{tag:pe.special(pe.variableName),class:"tok-variableName2"},{tag:pe.definition(pe.propertyName),class:"tok-propertyName tok-definition"},{tag:pe.typeName,class:"tok-typeName"},{tag:pe.namespace,class:"tok-namespace"},{tag:pe.className,class:"tok-className"},{tag:pe.macroName,class:"tok-macroName"},{tag:pe.propertyName,class:"tok-propertyName"},{tag:pe.operator,class:"tok-operator"},{tag:pe.comment,class:"tok-comment"},{tag:pe.meta,class:"tok-meta"},{tag:pe.invalid,class:"tok-invalid"},{tag:pe.punctuation,class:"tok-punctuation"}]);const yue=174,xue=175,wue=1,Sue=2,jue=3,_ue=4,Tue=5,Cue=6,kue=7,Oue=8,Eue=9,Aue=10,Mue=11,Rue=12,Due=13,Nue=14,Pue=15,Lue=16,$ue=17,Iue=18,Bue=19,zue=20,que=21,Fue=22,Hue=23,Vue=24,Uue=25,Que=26,Wue=27,Yue=28,Xue=29,Gue=30,Kue=31,Zue=32,Jue=33,ehe={inf:yue,nan:xue,bool:wue,ignoring:Sue,on:jue,group_left:_ue,group_right:Tue,offset:Cue},OD=(t,e)=>ehe[t.toLowerCase()]||-1,the={avg:Oue,atan2:kue,bottomk:Eue,count:Aue,count_values:Mue,group:Rue,max:Due,min:Nue,quantile:Pue,limitk:Lue,limit_ratio:$ue,stddev:Iue,stdvar:Bue,sum:zue,topk:que,by:Fue,without:Hue,and:Vue,or:Uue,unless:Que,start:Wue,end:Yue,smoothed:Xue,anchored:Gue,fill:Kue,fill_left:Zue,fill_right:Jue},ED=(t,e)=>the[t.toLowerCase()]||-1,nhe=aq({LineComment:pe.comment,LabelName:pe.labelName,StringLiteral:pe.string,NumberDurationLiteral:pe.number,NumberDurationLiteralInDurationContext:pe.number,Identifier:pe.variableName,"Abs Absent AbsentOverTime Acos Acosh Asin Asinh Atan Atanh AvgOverTime Ceil Changes Clamp ClampMax ClampMin Cos Cosh CountOverTime DaysInMonth DayOfMonth DayOfWeek DayOfYear Deg Delta Deriv Exp Floor HistogramAvg HistogramCount HistogramFraction HistogramQuantile HistogramSum DoubleExponentialSmoothing Hour Idelta Increase Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MaxOverTime MinOverTime Minute Month Pi PredictLinear PresentOverTime QuantileOverTime Rad Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc SortByLabel SortByLabelDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Time Timestamp Vector Year":pe.function(pe.variableName),"Avg Bottomk Count Count_values Group LimitK LimitRatio Max Min Quantile Stddev Stdvar Sum Topk":pe.operatorKeyword,"By Without Bool On Ignoring GroupLeft GroupRight Offset Start End Smoothed Anchored":pe.modifier,"And Unless Or":pe.logicOperator,"Sub Add Mul Mod Div Atan2 Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow At":pe.operator,UnaryOp:pe.arithmeticOperator,"( )":pe.paren,"[ ]":pe.squareBracket,"{ }":pe.brace,"⚠":pe.invalid}),rhe={__proto__:null,absent_over_time:373,absent:375,abs:377,acos:379,acosh:381,asin:383,asinh:385,atan:387,atanh:389,avg_over_time:391,ceil:393,changes:395,clamp:397,clamp_max:399,clamp_min:401,cos:403,cosh:405,count_over_time:407,days_in_month:409,day_of_month:411,day_of_week:413,day_of_year:415,deg:417,delta:419,deriv:421,exp:423,first_over_time:425,floor:427,histogram_count:429,histogram_fraction:431,histogram_quantile:433,histogram_stddev:435,histogram_stdvar:437,histogram_sum:439,histogram_avg:441,double_exponential_smoothing:443,hour:445,idelta:447,increase:449,info:451,irate:453,label_replace:455,label_join:457,last_over_time:459,ln:461,log10:463,log2:465,mad_over_time:467,max_over_time:469,min_over_time:471,ts_of_first_over_time:473,ts_of_max_over_time:475,ts_of_min_over_time:477,ts_of_last_over_time:479,minute:481,month:483,pi:485,predict_linear:487,present_over_time:489,quantile_over_time:491,rad:493,rate:495,resets:497,round:499,scalar:501,sgn:503,sin:505,sinh:507,sort:509,sort_desc:511,sort_by_label:513,sort_by_label_desc:515,sqrt:517,stddev_over_time:519,stdvar_over_time:521,sum_over_time:523,tan:525,tanh:527,timestamp:529,time:531,vector:533,year:535},ihe=Ux.deserialize({version:14,states:"<tOYQPOOO(TQPOOOOQO'#DR'#DRO(YQPO'#DQOOQO'#D`'#D`O(eQPO'#FoQ/iQQOOOOQO'#Do'#DoO(`QPO'#DnOYQPO'#FlOYQPO'#FnO0|QSO'#FqO1XQQO'#FpOOQO'#Fp'#FpOOQO'#GU'#GUOOQO'#Dp'#DpOOQO'#Dr'#DrOOQO'#Ds'#DsOOQO'#Dt'#DtOOQO'#Du'#DuOOQO'#Dv'#DvOOQO'#Dw'#DwOOQO'#Dx'#DxOOQO'#Dy'#DyOOQO'#Dz'#DzOOQO'#D{'#D{OOQO'#D|'#D|OOQO'#D}'#D}OOQO'#EO'#EOOOQO'#EP'#EPOOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETOOQO'#EU'#EUOOQO'#EV'#EVOOQO'#EW'#EWOOQO'#EX'#EXOOQO'#EY'#EYOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#E]'#E]OOQO'#E^'#E^OOQO'#E_'#E_OOQO'#E`'#E`OOQO'#Ea'#EaOOQO'#Eb'#EbOOQO'#Ec'#EcOOQO'#Ed'#EdOOQO'#Ee'#EeOOQO'#Ef'#EfOOQO'#Eg'#EgOOQO'#Eh'#EhOOQO'#Ei'#EiOOQO'#Ej'#EjOOQO'#Ek'#EkOOQO'#El'#ElOOQO'#Em'#EmOOQO'#En'#EnOOQO'#Eo'#EoOOQO'#Ep'#EpOOQO'#Eq'#EqOOQO'#Er'#ErOOQO'#Es'#EsOOQO'#Et'#EtOOQO'#Eu'#EuOOQO'#Ev'#EvOOQO'#Ew'#EwOOQO'#Ex'#ExOOQO'#Ey'#EyOOQO'#Ez'#EzOOQO'#E{'#E{OOQO'#E|'#E|OOQO'#E}'#E}OOQO'#FO'#FOOOQO'#FP'#FPOOQO'#FQ'#FQOOQO'#FR'#FROOQO'#FS'#FSOOQO'#FT'#FTOOQO'#FU'#FUOOQO'#FV'#FVOOQO'#FW'#FWOOQO'#FX'#FXOOQO'#FY'#FYOOQO'#FZ'#FZOOQO'#F['#F[OOQO'#F]'#F]OOQO'#F^'#F^OOQO'#F_'#F_OOQO'#F`'#F`OOQO'#Fa'#FaOOQO'#Fb'#FbOOQO'#Fc'#FcOOQO'#Fd'#FdOOQO'#Fe'#FeOOQO'#Ff'#FfQOQPOOO2xQPO'#DSO2}QPO'#DXO(`QPO,59lO3UQQO,59lOOQO,59z,59zO4xQPO,59tO4xQPO,59tO4xQPO,59tO4xQPO,59tO4xQPO,59tO<VQPO,5<RO<VQPO,5<TOOQO,5<U,5<UOOQO,5<V,5<VO<yQPO,5<dOOQO,5:Y,5:YO=TQQO,5<WO=[QQO,5<YOOQO'#DV'#DVO>xQPO'#FrO?WQPO,5<]OOQO,5<],5<]O?dQPO,5<]OOQO,5<[,5<[O?lQSO'#DTOOQO,59n,59nOOQO,59s,59sO?wQQO,59sOOQO1G/W1G/WOOQO'#D['#D[O2xQPO'#D]O@RQPO'#D_O@WQPO'#DaO@]QPO'#DbOOQO'#D^'#D^OG]QPO'#D^OGdQPO'#D^OOQO'#GY'#GYOGkQPO'#GYONoQPO'#GYOYQPO1G/`OYQPO1G/`OYQPO1G/`OYQPO1G/`OYQPO1G/`OOQO'#Fh'#FhONyQPO'#FhO! UQSO1G1mOOQO1G1o1G1oO! ^QPO'#D`OOQO'#Fz'#FzOOQO1G2O1G2OO! iQPO1G2OOOQO1G1r1G1rOOQO'#Fs'#FsO! nQPO,5<^O! sQPO,5<cO! xQSO1G1wO!!TQPO1G1wOOQO1G1w1G1wOOQO,59o,59oO!!]QPO,59oOYQPO'#F}O!!eQPO1G/_OOQO1G/_1G/_O!!mQPO,59wO<hQPO,59yO<hQPO,59{O<hQPO,59|OOQO,59x,59xOOQO,5<t,5<tO!)wQPO,5<tO!2]QQO7+$zO!2mQQO7+$zO!4XQQO7+$zO!4oQQO7+$zO!6WQQO7+$zOOQO,5<S,5<SOOQO7+'X7+'XO!6wQPO7+'_O!7OQPO7+'jOOQO1G1x1G1xOOQO1G1}1G1}O!7TQPO,5<jOOQO,5<j,5<jOOQO7+'c7+'cO!7iQSO7+'cOOQO-E9|-E9|O!7tQSO1G/ZO!8PQPO1G/ZOOQO1G/Z1G/ZO!8XQQO,5<iOOQO-E9{-E9{OOQO7+$y7+$yO!8cQPO1G/cO!?gQPO1G/eO!?lQPO1G/gO!?qQPO1G/hOOQO1G2`1G2`OOQO<<Jy<<JyO!?vQPO<<JyOOQO<<KU<<KUOOQO<<J}<<J}P!?{QSO'#GOOOQO,5<h,5<hOOQO7+$u7+$uO!@TQSO7+$uOOQO-E9z-E9zOOQO7+$}7+$}OOQO7+%P7+%POOQO7+%R7+%ROOQO7+%S7+%SOOQOAN@eAN@eOOQO<<Ha<<HaP!@`QSO'#F|",stateData:"!@h~O$wOSrOS~OWQOXQOYQOZQO[QO]QO^QO_QO`QOaQObQOcQOdQOeQOz^O!e[O$tSO$uSO$yXO$}TO%OTO%PSO%Q_O%R`O%SaO%TbO%UcO%VdO%WeO%XfO%YgO%ZhO%[iO%]jO%^kO%_lO%`mO%anO%boO%cpO%dqO%erO%fsO%gtO%huO%ivO%jwO%kxO%lyO%mzO%n{O%o|O%p}O%q!OO%r!PO%s!QO%t!RO%u!SO%v!TO%w!UO%x!VO%y!WO%z!XO%{!YO%|!ZO%}![O&O!]O&P!^O&Q!_O&R!`O&S!aO&T!bO&U!cO&V!dO&W!eO&X!fO&Y!gO&Z!hO&[!iO&]!jO&^!kO&_!lO&`!mO&a!nO&b!oO&c!pO&d!qO&e!rO&f!sO&g!tO&h!uO&i!vO&j!wO&k!xO&l!yO&m!zO&n!{O&o!|O&p!}O&q#OO&r#PO&s#QO&t#RO&u#SO&yZO~O!e#TO~Of#UOg#UO$y#VO~O$t#YO$u#YO%P#YOW$cXX$cXY$cXZ$cX[$cX]$cX^$cX_$cX`$cXa$cXb$cXc$cXd$cXe$cXz$cX!e$cX$t$cX$u$cX$y$cX$}$cX%O$cX%P$cX%Q$cX%R$cX%S$cX%T$cX%U$cX%V$cX%W$cX%X$cX%Y$cX%Z$cX%[$cX%]$cX%^$cX%_$cX%`$cX%a$cX%b$cX%c$cX%d$cX%e$cX%f$cX%g$cX%h$cX%i$cX%j$cX%k$cX%l$cX%m$cX%n$cX%o$cX%p$cX%q$cX%r$cX%s$cX%t$cX%u$cX%v$cX%w$cX%x$cX%y$cX%z$cX%{$cX%|$cX%}$cX&O$cX&P$cX&Q$cX&R$cX&S$cX&T$cX&U$cX&V$cX&W$cX&X$cX&Y$cX&Z$cX&[$cX&]$cX&^$cX&_$cX&`$cX&a$cX&b$cX&c$cX&d$cX&e$cX&f$cX&g$cX&h$cX&i$cX&j$cX&k$cX&l$cX&m$cX&n$cX&o$cX&p$cX&q$cX&r$cX&s$cX&t$cX&u$cX&y$cX~OU#aOV#ZOh#^Oi#_Oj#^Om#cOn#bO}#ZO!V#ZO!W#ZO!X#ZO!Y#[O!Z#[O![#]O!]#]O!^#]O!_#]O!`#]O!a#]O$m#dO&v#`O~Ox#iOz#hO&z#kO~O&yZOU$dXV$dXh$dXi$dXj$dXm$dXn$dX}$dX!V$dX!W$dX!X$dX!Y$dX!Z$dX![$dX!]$dX!^$dX!_$dX!`$dX!a$dX$m$dX$s$dX&v$dX${$dX$z$dX~O$y#nO~O${#pO~PYOf#UOg#UOUtaVtahtaitajtamtanta}ta!Vta!Wta!Xta!Yta!Zta![ta!]ta!^ta!_ta!`ta!ata$mta$sta&vta${ta$zta~OP#sOQ#tOR#tOo#uOp#vOq#wOW$|PX$|PY$|PZ$|P[$|P]$|P^$|P_$|P`$|Pa$|Pb$|Pc$|Pd$|Pe$|Pz$|P!e$|P$t$|P$u$|P$y$|P$}$|P%O$|P%P$|P%Q$|P%R$|P%S$|P%T$|P%U$|P%V$|P%W$|P%X$|P%Y$|P%Z$|P%[$|P%]$|P%^$|P%_$|P%`$|P%a$|P%b$|P%c$|P%d$|P%e$|P%f$|P%g$|P%h$|P%i$|P%j$|P%k$|P%l$|P%m$|P%n$|P%o$|P%p$|P%q$|P%r$|P%s$|P%t$|P%u$|P%v$|P%w$|P%x$|P%y$|P%z$|P%{$|P%|$|P%}$|P&O$|P&P$|P&Q$|P&R$|P&S$|P&T$|P&U$|P&V$|P&W$|P&X$|P&Y$|P&Z$|P&[$|P&]$|P&^$|P&_$|P&`$|P&a$|P&b$|P&c$|P&d$|P&e$|P&f$|P&g$|P&h$|P&i$|P&j$|P&k$|P&l$|P&m$|P&n$|P&o$|P&p$|P&q$|P&r$|P&s$|P&t$|P&u$|P&y$|P~O$t$TO$u$TO$}$UO%O$UO%P$TO~O$tSO$uSO$}$XO%O$XO%PSO~Ok$YOl$YO~P<hO${$]O~P/iO}#ZOU$baV$bah$bai$baj$bam$ban$ba!V$ba!W$ba!X$ba!Y$ba!Z$ba![$ba!]$ba!^$ba!_$ba!`$ba!a$ba$m$ba$s$ba&v$ba${$ba$z$ba~O!a$^O$h$^O$i$^O$j$^O~O!a$^O$h$^O$i$^O$j$^O$z$aO&z$cO~Ox$eOz#hO${$dO~O$z$fO${$hO~P/iO$y$jO~O$y$kO~O$y$lO~OW!QXX!QXY!QXZ!QX[!QX]!QX^!QX_!QX`!QXa!QXb!QXc!QXd!QXe!QXz!QX!e!QX$t!QX$u!QX$y!QX$}!QX%O!QX%P!QX%Q!QX%R!QX%S!QX%T!QX%U!QX%V!QX%W!QX%X!QX%Y!QX%Z!QX%[!QX%]!QX%^!QX%_!QX%`!QX%a!QX%b!QX%c!QX%d!QX%e!QX%f!QX%g!QX%h!QX%i!QX%j!QX%k!QX%l!QX%m!QX%n!QX%o!QX%p!QX%q!QX%r!QX%s!QX%t!QX%u!QX%v!QX%w!QX%x!QX%y!QX%z!QX%{!QX%|!QX%}!QX&O!QX&P!QX&Q!QX&R!QX&S!QX&T!QX&U!QX&V!QX&W!QX&X!QX&Y!QX&Z!QX&[!QX&]!QX&^!QX&_!QX&`!QX&a!QX&b!QX&c!QX&d!QX&e!QX&f!QX&g!QX&h!QX&i!QX&j!QX&k!QX&l!QX&m!QX&n!QX&o!QX&p!QX&q!QX&r!QX&s!QX&t!QX&u!QX&y!QX~Oq#wO~P@bOp#vO~P@bOo#uOp#vOq#wOW$|XX$|XY$|XZ$|X[$|X]$|X^$|X_$|X`$|Xa$|Xb$|Xc$|Xd$|Xe$|Xz$|X!e$|X$t$|X$u$|X$y$|X$}$|X%O$|X%P$|X%Q$|X%R$|X%S$|X%T$|X%U$|X%V$|X%W$|X%X$|X%Y$|X%Z$|X%[$|X%]$|X%^$|X%_$|X%`$|X%a$|X%b$|X%c$|X%d$|X%e$|X%f$|X%g$|X%h$|X%i$|X%j$|X%k$|X%l$|X%m$|X%n$|X%o$|X%p$|X%q$|X%r$|X%s$|X%t$|X%u$|X%v$|X%w$|X%x$|X%y$|X%z$|X%{$|X%|$|X%}$|X&O$|X&P$|X&Q$|X&R$|X&S$|X&T$|X&U$|X&V$|X&W$|X&X$|X&Y$|X&Z$|X&[$|X&]$|X&^$|X&_$|X&`$|X&a$|X&b$|X&c$|X&d$|X&e$|X&f$|X&g$|X&h$|X&i$|X&j$|X&k$|X&l$|X&m$|X&n$|X&o$|X&p$|X&q$|X&r$|X&s$|X&t$|X&u$|X&y$|X~OQ#tOR#tO~PGkO$t$uO$u$uO%P$uO~O&w$vO&x$wO~O$t#YO$u#YO%P#YO~O$y$xO~Oz$yO~Oz$zO~Ox#iOz#hO&z$}O~O$z%OO&z$}O~O$z%QO${%SO~O$z$fO${%VO~OS%WOT%WOW!PaX!PaY!PaZ!Pa[!Pa]!Pa^!Pa_!Pa`!Paa!Pab!Pac!Pad!Pae!Pao!Pap!Paq!Paz!Pa!e!Pa$t!Pa$u!Pa$y!Pa$}!Pa%O!Pa%P!Pa%Q!Pa%R!Pa%S!Pa%T!Pa%U!Pa%V!Pa%W!Pa%X!Pa%Y!Pa%Z!Pa%[!Pa%]!Pa%^!Pa%_!Pa%`!Pa%a!Pa%b!Pa%c!Pa%d!Pa%e!Pa%f!Pa%g!Pa%h!Pa%i!Pa%j!Pa%k!Pa%l!Pa%m!Pa%n!Pa%o!Pa%p!Pa%q!Pa%r!Pa%s!Pa%t!Pa%u!Pa%v!Pa%w!Pa%x!Pa%y!Pa%z!Pa%{!Pa%|!Pa%}!Pa&O!Pa&P!Pa&Q!Pa&R!Pa&S!Pa&T!Pa&U!Pa&V!Pa&W!Pa&X!Pa&Y!Pa&Z!Pa&[!Pa&]!Pa&^!Pa&_!Pa&`!Pa&a!Pa&b!Pa&c!Pa&d!Pa&e!Pa&f!Pa&g!Pa&h!Pa&i!Pa&j!Pa&k!Pa&l!Pa&m!Pa&n!Pa&o!Pa&p!Pa&q!Pa&r!Pa&s!Pa&t!Pa&u!Pa&y!Pa~Oo#uOp#vOq#wOW$|aX$|aY$|aZ$|a[$|a]$|a^$|a_$|a`$|aa$|ab$|ac$|ad$|ae$|az$|a!e$|a$t$|a$u$|a$y$|a$}$|a%O$|a%P$|a%Q$|a%R$|a%S$|a%T$|a%U$|a%V$|a%W$|a%X$|a%Y$|a%Z$|a%[$|a%]$|a%^$|a%_$|a%`$|a%a$|a%b$|a%c$|a%d$|a%e$|a%f$|a%g$|a%h$|a%i$|a%j$|a%k$|a%l$|a%m$|a%n$|a%o$|a%p$|a%q$|a%r$|a%s$|a%t$|a%u$|a%v$|a%w$|a%x$|a%y$|a%z$|a%{$|a%|$|a%}$|a&O$|a&P$|a&Q$|a&R$|a&S$|a&T$|a&U$|a&V$|a&W$|a&X$|a&Y$|a&Z$|a&[$|a&]$|a&^$|a&_$|a&`$|a&a$|a&b$|a&c$|a&d$|a&e$|a&f$|a&g$|a&h$|a&i$|a&j$|a&k$|a&l$|a&m$|a&n$|a&o$|a&p$|a&q$|a&r$|a&s$|a&t$|a&u$|a&y$|a~O}#ZOU|qh|qi|qj|qm|qn|q!Y|q!Z|q![|q!]|q!^|q!_|q!`|q!a|q$m|q$s|q&v|q${|q$z|q~OV|q!V|q!W|q!X|q~P!0{OV#ZO!V#ZO!W#ZO!X#ZO~P!0{OV#ZO}#ZO!V#ZO!W#ZO!X#ZO!Y#[O!Z#[OU|qh|qi|qj|qm|qn|q$m|q$s|q&v|q${|q$z|q~O![|q!]|q!^|q!_|q!`|q!a|q~P!2}O![#]O!]#]O!^#]O!_#]O!`#]O!a#]O~P!2}OV#ZOh#^Oj#^O}#ZO!V#ZO!W#ZO!X#ZO!Y#[O!Z#[O![#]O!]#]O!^#]O!_#]O!`#]O!a#]O~OU|qi|qm|qn|q$m|q$s|q&v|q${|q$z|q~P!5VO&w%]O~P<VO${%_O~O!a$^O$h$^O$i$^O$j$^O$z$ra&z$ra~Ox#iOz#hO&z%`O~Ox%bOz#hO${%cO~O$z%dO${%cO~O$z$qa${$qa~P/iO$y#nOW!PiX!PiY!PiZ!Pi[!Pi]!Pi^!Pi_!Pi`!Pia!Pib!Pic!Pid!Pie!Pio!Pip!Piq!Piz!Pi!e!Pi$t!Pi$u!Pi$}!Pi%O!Pi%P!Pi%Q!Pi%R!Pi%S!Pi%T!Pi%U!Pi%V!Pi%W!Pi%X!Pi%Y!Pi%Z!Pi%[!Pi%]!Pi%^!Pi%_!Pi%`!Pi%a!Pi%b!Pi%c!Pi%d!Pi%e!Pi%f!Pi%g!Pi%h!Pi%i!Pi%j!Pi%k!Pi%l!Pi%m!Pi%n!Pi%o!Pi%p!Pi%q!Pi%r!Pi%s!Pi%t!Pi%u!Pi%v!Pi%w!Pi%x!Pi%y!Pi%z!Pi%{!Pi%|!Pi%}!Pi&O!Pi&P!Pi&Q!Pi&R!Pi&S!Pi&T!Pi&U!Pi&V!Pi&W!Pi&X!Pi&Y!Pi&Z!Pi&[!Pi&]!Pi&^!Pi&_!Pi&`!Pi&a!Pi&b!Pi&c!Pi&d!Pi&e!Pi&f!Pi&g!Pi&h!Pi&i!Pi&j!Pi&k!Pi&l!Pi&m!Pi&n!Pi&o!Pi&p!Pi&q!Pi&r!Pi&s!Pi&t!Pi&u!Pi&y!Pi~O${%gO~O${%hO~O${%iO~O&w%jO~Ox#iOz#hO~Ox%bOz#hO${%kO~Ox%bOz#hO~O",goto:"+e$}PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP%O%[%h%nP%wP&X%OP&b&i&s'R']'u(SPPPPPPPPPPP%O(a(mP(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m%O(y%O%O%O%O%O%O)S%O)`)o)wPPP)o%OP*OP*R*X*_PPPPP*fPPP+Ue^OXY#V$O$P$Q$R$S$feROXY#V$O$P$Q$R$S$fQ#WRR#r#XQ#o#UQ$i#tR%f%WQ#jZQ$e#nU${$a%O%aV%b%Q%d%lQ#XRQ#eWR#r#WZ#}#Z#[#]#^#_Y#|#Z#[#]#^#_R$o#}Y#{#Z#[#]#^#_S$n#|#}R%[$oa#x#Z#[#]#^#_#|#}$od^OXY#V$O$P$Q$R$S$fQ$Z#dQ%X$jQ%Y$kR%Z$l`#y#Z#[#]#^#_#|#}$oR$m#z`#z#Z#[#]#^#_#|#}$oR$m#yeWOXY#V$O$P$Q$R$S$feVOXY#V$O$P$Q$R$S$fQ$V#`Q$W#aR%^$weYOXY#V$O$P$Q$R$S$fd]OXY#V$O$P$Q$R$S$fR#m[Q#lZV$|$a%O%aQ$_#iT$`#j${R$[#dQ%R$eR%e%RQ$g#qR%U$gS$b#j#lR%P$bQUOQ#fXQ#gYQ#q#VQ$p$OQ$q$PQ$r$QQ$s$RQ$t$SR%T$fQ$O#ZQ$P#[Q$Q#]Q$R#^R$S#_",nodeNames:"⚠ Bool Ignoring On GroupLeft GroupRight Offset Atan2 Avg Bottomk Count CountValues Group Max Min Quantile LimitK LimitRatio Stddev Stdvar Sum Topk By Without And Or Unless Start End Smoothed Anchored Fill FillLeft FillRight LineComment PromQL AggregateExpr AggregateOp AggregateModifier GroupingLabels LabelName QuotedLabelName StringLiteral FunctionCallBody BinaryExpr Pow BoolModifier MatchingModifierClause FillModifier FillClause NumberDurationLiteral FillLeftClause FillRightClause Mul Div Mod Add Sub Eql Gte Gtr Lte Lss Neq FunctionCall FunctionIdentifier AbsentOverTime Identifier Absent Abs Acos Acosh Asin Asinh Atan Atanh AvgOverTime Ceil Changes Clamp ClampMax ClampMin Cos Cosh CountOverTime DaysInMonth DayOfMonth DayOfWeek DayOfYear Deg Delta Deriv Exp FirstOverTime Floor HistogramCount HistogramFraction HistogramQuantile HistogramStdDev HistogramStdVar HistogramSum HistogramAvg DoubleExponentialSmoothing Hour Idelta Increase Info Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MadOverTime MaxOverTime MinOverTime TsOfFirstOverTime TsOfMaxOverTime TsOfMinOverTime TsOfLastOverTime Minute Month Pi PredictLinear PresentOverTime QuantileOverTime Rad Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc SortByLabel SortByLabelDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Timestamp Time Vector Year MatrixSelector NumberDurationLiteralInDurationContext OffsetExpr AnchoredExpr SmoothedExpr ParenExpr SubqueryExpr UnaryExpr UnaryOp VectorSelector LabelMatchers UnquotedLabelMatcher MatchOp EqlSingle EqlRegex NeqRegex QuotedLabelMatcher StepInvariantExpr At AtModifierPreprocessors MetricName",maxTerm:272,nodeProps:[["group",-14,36,42,44,50,64,149,151,152,153,154,155,156,158,166,"Expr"]],propSources:[nhe],skippedNodes:[0,34],repeatNodeCount:3,tokenData:"4k~RwX^#lpq#lqr$ars$tst&luv'Twx'Yxy({yz)Qz{)V{|)[|})c}!O)h!O!P)o!P!Q*u!Q!R*z!R![+u![!]1O!^!_1z!_!`2X!`!a2n!b!c2{!c!}3Q!}#O3h#P#Q3m#Q#R3r#R#S3Q#S#T3w#T#o3Q#o#p4a#q#r4f#y#z#l$f$g#l#BY#BZ#l$IS$I_#l$I|$JO#l$JT$JU#l$KV$KW#l&FU&FV#l~#qY$w~X^#lpq#l#y#z#l$f$g#l#BY#BZ#l$IS$I_#l$I|$JO#l$JT$JU#l$KV$KW#l&FU&FV#l~$dQ!_!`$j#r#s$o~$oO!a~~$tO$j~~$yWz~OY$tZr$trs%cs#O$t#O#P%h#P;'S$t;'S;=`&f<%lO$t~%hOz~~%kRO;'S$t;'S;=`%t;=`O$t~%yXz~OY$tZr$trs%cs#O$t#O#P%h#P;'S$t;'S;=`&f;=`<%l$t<%lO$t~&iP;=`<%l$t~&qSr~OY&lZ;'S&l;'S;=`&}<%lO&l~'QP;=`<%l&l~'YO!X~~'_Wz~OY'YZw'Ywx%cx#O'Y#O#P'w#P;'S'Y;'S;=`(u<%lO'Y~'zRO;'S'Y;'S;=`(T;=`O'Y~(YXz~OY'YZw'Ywx%cx#O'Y#O#P'w#P;'S'Y;'S;=`(u;=`<%l'Y<%lO'Y~(xP;=`<%l'Y~)QO$y~~)VO${~~)[O!V~R)cO%OP!YQ~)hO$z~R)oO$}P!ZQ~)rP!Q![)u~)zS%P~!Q![)u!g!h*W#R#S)o#X#Y*W~*ZR{|*d}!O*d!Q![*j~*gP!Q![*j~*oQ%P~!Q![*j#R#S*d~*zO!W~~+P[%P~!O!P)o!Q![+u!g!h*W#R#S,m#W#X-X#X#Y*W#[#]-p#a#b.U#g#h.x#k#l/Z#l#m0d#m#n/u~+zZ%P~!O!P)o!Q![+u!g!h*W#R#S,m#W#X-X#X#Y*W#[#]-p#a#b.U#g#h.x#k#l/Z#m#n/u~,pP!Q![,s~,xT%P~!O!P)o!Q![,s!g!h*W#R#S,m#X#Y*W~-^P%P~!Q![-a~-dS!Q![-a#[#]-p#a#b.U#g#h.x~-uP%P~!Q![-x~-{R!Q![-x#a#b.U#g#h.x~.ZQ%P~!Q![.a#g#h.s~.dR!Q![.a#a#b.m#g#h.x~.pP#g#h.s~.xO%P~~.}P%P~!Q![/Q~/TQ!Q![/Q#a#b.m~/`P%P~!Q![/c~/fT!Q![/c#W#X-X#[#]-p#a#b.U#g#h.x~/zP%P~!Q![/}~0QU!Q![/}#W#X-X#[#]-p#a#b.U#g#h.x#k#l/Z~0gR!Q![0p!c!i0p#T#Z0p~0uR%P~!Q![0p!c!i0p#T#Z0pV1VT&xS!eR!Q![1f![!]1f!c!}1f#R#S1f#T#o1fR1kT!eR!Q![1f![!]1f!c!}1f#R#S1f#T#o1f~2PP!`~!_!`2S~2XO!_~~2^Q$hP!_!`2d#r#s2iQ2iO![Q~2nO$i~~2sP!^~!_!`2v~2{O!]~~3QO$m~V3XT!eRxS!Q![3Q![!]1f!c!}3Q#R#S3Q#T#o3Q~3mO&v~~3rO&w~~3wO}~~3zTO#S3w#S#T%c#T;'S3w;'S;=`4Z<%lO3w~4^P;=`<%l3w~4fO&y~~4kO&z~",tokenizers:[0,1,2],topRules:{PromQL:[0,35],MetricName:[1,169]},specialized:[{term:67,get:(t,e)=>OD(t)<<1,external:OD},{term:67,get:(t,e)=>ED(t)<<1|1,external:ED,extend:!0},{term:67,get:t=>rhe[t]||-1}],tokenPrec:0}),she=3,ahe=4,ohe=5,cq=9,uq=11,lhe=15,hq=16,dq=17,fq=21,I4=24,B4=25,z4=26,che=35,eS=36,uhe=37,$p=39,sv=40,av=41,xm=42,_h=43,Ip=44,hhe=45,pq=46,dhe=47,fhe=48,phe=49,tS=50,mhe=51,ghe=52,vhe=53,bhe=54,yhe=55,xhe=56,whe=57,YC=58,XC=59,GC=60,KC=61,ZC=62,ov=63,JC=64,She=66,Wx=67,jhe=68,_he=69,The=70,Che=71,khe=72,Ohe=73,Ehe=74,Ahe=75,Mhe=76,Rhe=77,mq=78,Dhe=79,Nhe=80,Phe=81,Lhe=82,$he=83,Ihe=84,Bhe=85,zhe=86,qhe=87,Fhe=88,Hhe=89,ek=90,Vhe=91,Uhe=92,Qhe=93,Whe=94,Yhe=95,Xhe=96,Ghe=97,Khe=98,Zhe=99,Jhe=100,ede=101,tde=102,nde=103,rde=104,tk=105,ide=106,sde=107,ade=108,ode=109,lde=110,cde=111,ude=112,hde=113,dde=114,fde=115,pde=116,mde=117,gde=118,vde=119,bde=120,yde=121,xde=122,wde=123,Sde=124,jde=125,_de=126,Tde=127,nk=128,gq=129,Cde=130,kde=131,Ode=132,Ede=133,Ade=134,Mde=135,Rde=136,Dde=137,Nde=138,Pde=139,Lde=140,$de=141,Ide=142,Bde=143,zde=144,qde=145,Fde=146,Hde=147,Vde=148,wm=149,Yx=150,lv=151,vq=152,bq=153,yq=154,pf=155,xq=156,nb=158,Bp=159,bh=160,Xx=161,rb=162,wq=163,Sq=164,of=165,q4=166;var se;(function(t){t.none="none",t.vector="vector",t.scalar="scalar",t.matrix="matrix",t.string="string"})(se||(se={}));const Ude={[_he]:{name:"abs",argTypes:[se.vector],variadic:0,returnType:se.vector},[jhe]:{name:"absent",argTypes:[se.vector],variadic:0,returnType:se.vector},[She]:{name:"absent_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[The]:{name:"acos",argTypes:[se.vector],variadic:0,returnType:se.vector},[Che]:{name:"acosh",argTypes:[se.vector],variadic:0,returnType:se.vector},[khe]:{name:"asin",argTypes:[se.vector],variadic:0,returnType:se.vector},[Ohe]:{name:"asinh",argTypes:[se.vector],variadic:0,returnType:se.vector},[Ehe]:{name:"atan",argTypes:[se.vector],variadic:0,returnType:se.vector},[Ahe]:{name:"atanh",argTypes:[se.vector],variadic:0,returnType:se.vector},[Mhe]:{name:"avg_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[Rhe]:{name:"ceil",argTypes:[se.vector],variadic:0,returnType:se.vector},[mq]:{name:"changes",argTypes:[se.matrix],variadic:0,returnType:se.vector},[Dhe]:{name:"clamp",argTypes:[se.vector,se.scalar,se.scalar],variadic:0,returnType:se.vector},[Nhe]:{name:"clamp_max",argTypes:[se.vector,se.scalar],variadic:0,returnType:se.vector},[Phe]:{name:"clamp_min",argTypes:[se.vector,se.scalar],variadic:0,returnType:se.vector},[Lhe]:{name:"cos",argTypes:[se.vector],variadic:0,returnType:se.vector},[$he]:{name:"Cosh",argTypes:[se.vector],variadic:0,returnType:se.vector},[Ihe]:{name:"count_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[Bhe]:{name:"days_in_month",argTypes:[se.vector],variadic:1,returnType:se.vector},[zhe]:{name:"day_of_month",argTypes:[se.vector],variadic:1,returnType:se.vector},[qhe]:{name:"day_of_week",argTypes:[se.vector],variadic:1,returnType:se.vector},[Fhe]:{name:"day_of_year",argTypes:[se.vector],variadic:1,returnType:se.vector},[Hhe]:{name:"deg",argTypes:[se.vector],variadic:0,returnType:se.vector},[ek]:{name:"delta",argTypes:[se.matrix],variadic:0,returnType:se.vector},[Vhe]:{name:"deriv",argTypes:[se.matrix],variadic:0,returnType:se.vector},[Uhe]:{name:"exp",argTypes:[se.vector],variadic:0,returnType:se.vector},[Qhe]:{name:"first_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[Whe]:{name:"floor",argTypes:[se.vector],variadic:0,returnType:se.vector},[ede]:{name:"histogram_avg",argTypes:[se.vector],variadic:0,returnType:se.vector},[Yhe]:{name:"histogram_count",argTypes:[se.vector],variadic:0,returnType:se.vector},[Xhe]:{name:"histogram_fraction",argTypes:[se.scalar,se.scalar,se.vector],variadic:0,returnType:se.vector},[Ghe]:{name:"histogram_quantile",argTypes:[se.scalar,se.vector],variadic:0,returnType:se.vector},[Khe]:{name:"histogram_stddev",argTypes:[se.vector],variadic:0,returnType:se.vector},[Zhe]:{name:"histogram_stdvar",argTypes:[se.vector],variadic:0,returnType:se.vector},[Jhe]:{name:"histogram_sum",argTypes:[se.vector],variadic:0,returnType:se.vector},[tde]:{name:"double_exponential_smoothing",argTypes:[se.matrix,se.scalar,se.scalar],variadic:0,returnType:se.vector},[nde]:{name:"hour",argTypes:[se.vector],variadic:1,returnType:se.vector},[rde]:{name:"idelta",argTypes:[se.matrix],variadic:0,returnType:se.vector},[tk]:{name:"increase",argTypes:[se.matrix],variadic:0,returnType:se.vector},[ide]:{name:"info",argTypes:[se.vector,se.vector],variadic:1,returnType:se.vector},[sde]:{name:"irate",argTypes:[se.matrix],variadic:0,returnType:se.vector},[ade]:{name:"label_replace",argTypes:[se.vector,se.string,se.string,se.string,se.string],variadic:0,returnType:se.vector},[ode]:{name:"label_join",argTypes:[se.vector,se.string,se.string,se.string],variadic:-1,returnType:se.vector},[lde]:{name:"last_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[cde]:{name:"ln",argTypes:[se.vector],variadic:0,returnType:se.vector},[ude]:{name:"log10",argTypes:[se.vector],variadic:0,returnType:se.vector},[hde]:{name:"log2",argTypes:[se.vector],variadic:0,returnType:se.vector},[dde]:{name:"mad_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[fde]:{name:"max_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[pde]:{name:"min_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[mde]:{name:"ts_of_first_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[gde]:{name:"ts_of_max_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[vde]:{name:"ts_of_min_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[bde]:{name:"ts_of_last_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[yde]:{name:"minute",argTypes:[se.vector],variadic:1,returnType:se.vector},[xde]:{name:"month",argTypes:[se.vector],variadic:1,returnType:se.vector},[wde]:{name:"pi",argTypes:[],variadic:0,returnType:se.vector},[Sde]:{name:"predict_linear",argTypes:[se.matrix,se.scalar],variadic:0,returnType:se.vector},[jde]:{name:"present_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[_de]:{name:"quantile_over_time",argTypes:[se.scalar,se.matrix],variadic:0,returnType:se.vector},[Tde]:{name:"rad",argTypes:[se.vector],variadic:0,returnType:se.vector},[nk]:{name:"rate",argTypes:[se.matrix],variadic:0,returnType:se.vector},[gq]:{name:"resets",argTypes:[se.matrix],variadic:0,returnType:se.vector},[Cde]:{name:"round",argTypes:[se.vector,se.scalar],variadic:1,returnType:se.vector},[kde]:{name:"scalar",argTypes:[se.vector],variadic:0,returnType:se.scalar},[Ode]:{name:"sgn",argTypes:[se.vector],variadic:0,returnType:se.vector},[Ede]:{name:"sin",argTypes:[se.vector],variadic:0,returnType:se.vector},[Ade]:{name:"Sinh",argTypes:[se.vector],variadic:0,returnType:se.vector},[Mde]:{name:"sort",argTypes:[se.vector],variadic:0,returnType:se.vector},[Rde]:{name:"sort_desc",argTypes:[se.vector],variadic:0,returnType:se.vector},[Dde]:{name:"sort_by_label",argTypes:[se.vector,se.string],variadic:-1,returnType:se.vector},[Nde]:{name:"sort_by_label_desc",argTypes:[se.vector,se.string],variadic:-1,returnType:se.vector},[Pde]:{name:"sqrt",argTypes:[se.vector],variadic:0,returnType:se.vector},[Lde]:{name:"stddev_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[$de]:{name:"stdvar_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[Ide]:{name:"sum_over_time",argTypes:[se.matrix],variadic:0,returnType:se.vector},[Bde]:{name:"tan",argTypes:[se.vector],variadic:0,returnType:se.vector},[zde]:{name:"tanh",argTypes:[se.vector],variadic:0,returnType:se.vector},[Fde]:{name:"time",argTypes:[],variadic:0,returnType:se.scalar},[qde]:{name:"timestamp",argTypes:[se.vector],variadic:0,returnType:se.vector},[Hde]:{name:"vector",argTypes:[se.scalar],variadic:0,returnType:se.vector},[Vde]:{name:"year",argTypes:[se.vector],variadic:1,returnType:se.vector}};function jq(t){return Ude[t]}class _q{constructor(e,n,r){this.type=e,this.name=n,this.value=r}matchesEmpty(){switch(this.type){case rb:return this.value==="";case ov:return this.value!=="";default:return!1}}}var $l;(function(t){t.CardOneToOne="one-to-one",t.CardManyToOne="many-to-one",t.CardOneToMany="one-to-many",t.CardManyToMany="many-to-many"})($l||($l={}));function Qde(t,e){const n=new _q(0,"",""),r=t.cursor();switch(r.type.id){case of:if(!r.next())return n;do switch(r.type.id){case av:n.name=e.sliceDoc(r.from,r.to).slice(1,-1);break;case Xx:{const i=r.node.firstChild;i&&(n.type=i.type.id);break}case xm:n.value=e.sliceDoc(r.from,r.to).slice(1,-1);break}while(r.nextSibling());break;case bh:if(!r.next())return n;do switch(r.type.id){case sv:n.name=e.sliceDoc(r.from,r.to);break;case Xx:{const i=r.node.firstChild;i&&(n.type=i.type.id);break}case xm:n.value=e.sliceDoc(r.from,r.to).slice(1,-1);break}while(r.nextSibling());break;case av:n.name="__name__",n.value=e.sliceDoc(r.from,r.to).slice(1,-1),n.type=rb;break}return n}function Tq(t,e){const n=[];return t.forEach(r=>{n.push(Qde(r,e))}),n}function j3(t,e,n){if(!e||e.length===0)return t;let r="";for(const i of e){if(i.name===n||i.value==="")continue;let s="";switch(i.type){case rb:s="=";break;case ov:s="!=";break;case Sq:s="!~";break;case wq:s="=~";break;default:s="="}const o=`${i.name}${s}"${i.value}"`;r===""?r=o:r=`${r},${o}`}return`${t}{${r}}`}function F4(t,e){for(;;){if(!t||t.type.id===e)return t;t=t.parent}return null}function yh(t,...e){const n=t.cursor();if(!n.next())return!1;let r=!1;do r=e.some(i=>n.type.id===i||n.type.name===i);while(!r&&n.nextSibling());return r}function AD(t,...e){const n=t.cursor();if(!n.next())return!1;let r=0;do n.type.is(e[r])&&r++;while(r<e.length&&n.nextSibling());return r>=e.length}function Ml(t){var e;if(!t)return se.none;switch(t.type.id){case eS:return se.vector;case nb:return se.vector;case lv:return Ml(t.firstChild);case xm:return se.string;case tS:return se.scalar;case wm:return se.matrix;case pf:return se.matrix;case bq:return Ml(t.firstChild);case vq:return Ml(t.firstChild);case yq:return Ml(t.getChild("Expr"));case xq:return Ml(t.getChild("Expr"));case Ip:{const n=Ml(t.firstChild),r=Ml(t.lastChild);return n===se.scalar&&r===se.scalar?se.scalar:se.vector}case JC:{const n=(e=t.firstChild)===null||e===void 0?void 0:e.firstChild;return n?jq(n.type.id).returnType:se.none}case q4:return Ml(t.getChild("Expr"));default:return se.none}}let rk=[],Cq=[];(()=>{let t="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(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?Cq:rk).push(n=n+t[e])})();function Wde(t){if(t<768)return!1;for(let e=0,n=rk.length;;){let r=e+n>>1;if(t<rk[r])n=r;else if(t>=Cq[r])e=r+1;else return!0;if(e==n)return!1}}function MD(t){return t>=127462&&t<=127487}const RD=8205;function Yde(t,e,n=!0,r=!0){return(n?kq:Xde)(t,e,r)}function kq(t,e,n){if(e==t.length)return e;e&&Oq(t.charCodeAt(e))&&Eq(t.charCodeAt(e-1))&&e--;let r=_3(t,e);for(e+=DD(r);e<t.length;){let i=_3(t,e);if(r==RD||i==RD||n&&Wde(i))e+=DD(i),r=i;else if(MD(i)){let s=0,o=e-2;for(;o>=0&&MD(_3(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function Xde(t,e,n){for(;e>0;){let r=kq(t,e-2,n);if(r<e)return r;e--}return 0}function _3(t,e){let n=t.charCodeAt(e);if(!Eq(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Oq(r)?(n-55296<<10)+(r-56320)+65536:n}function Oq(t){return t>=56320&&t<57344}function Eq(t){return t>=55296&&t<56320}function DD(t){return t<65536?1:2}class jn{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Sm(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Il.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Sm(this,e,n);let r=[];return this.decompose(e,n,r,0),Il.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Rg(this),s=new Rg(e);for(let o=n,l=n;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(l+=i.value.length,i.done||l>=r)return!0}}iter(e=1){return new Rg(this,e)}iterRange(e,n=this.length){return new Aq(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Mq(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?jn.empty:e.length<=32?new ii(e):Il.from(ii.split(e,[]))}}class ii extends jn{constructor(e,n=Gde(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.text[s],l=i+o.length;if((n?r:l)>=e)return new Kde(i,l,r,o);i=l+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new ii(ND(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),l=J1(s.text,o.text.slice(),0,s.length);if(l.length<=32)r.push(new ii(l,o.length+s.length));else{let u=l.length>>1;r.push(new ii(l.slice(0,u)),new ii(l.slice(u)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof ii))return super.replace(e,n,r);[e,n]=Sm(this,e,n);let i=J1(this.text,J1(r.text,ND(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new ii(i,s):Il.from(ii.split(i,[]),s)}sliceString(e,n=this.length,r=`
`){[e,n]=Sm(this,e,n);let i="";for(let s=0,o=0;s<=n&&o<this.text.length;o++){let l=this.text[o],u=s+l.length;s>e&&o&&(i+=r),e<u&&n>s&&(i+=l.slice(Math.max(0,e-s),n-s)),s=u+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new ii(r,i)),r=[],i=-1);return i>-1&&n.push(new ii(r,i)),n}}class Il extends jn{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.children[s],l=i+o.length,u=r+o.lines-1;if((n?u:l)>=e)return o.lineInner(e,n,r,i);i=l+1,r=u+1}}decompose(e,n,r,i){for(let s=0,o=0;o<=n&&s<this.children.length;s++){let l=this.children[s],u=o+l.length;if(e<=u&&n>=o){let h=i&((o<=e?1:0)|(u>=n?2:0));o>=e&&u<=n&&!h?r.push(l):l.decompose(e-o,n-o,r,h)}o=u+1}}replace(e,n,r){if([e,n]=Sm(this,e,n),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],l=s+o.length;if(e>=s&&n<=l){let u=o.replace(e-s,n-s,r),h=this.lines-o.lines+u.lines;if(u.lines<h>>4&&u.lines>h>>6){let f=this.children.slice();return f[i]=u,new Il(f,this.length-(n-e)+r.length)}return super.replace(s,l,u)}s=l+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
`){[e,n]=Sm(this,e,n);let i="";for(let s=0,o=0;s<this.children.length&&o<=n;s++){let l=this.children[s],u=o+l.length;o>e&&s&&(i+=r),e<u&&n>o&&(i+=l.sliceString(e-o,n-o,r)),o=u+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Il))return 0;let r=0,[i,s,o,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==o||s==l)return r;let u=this.children[i],h=e.children[s];if(u!=h)return r+u.scanIdentical(h,n);r+=u.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let v of e)r+=v.lines;if(r<32){let v=[];for(let b of e)b.flatten(v);return new ii(v,n)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,l=[],u=0,h=-1,f=[];function p(v){let b;if(v.lines>s&&v instanceof Il)for(let x of v.children)p(x);else v.lines>o&&(u>o||!u)?(m(),l.push(v)):v instanceof ii&&u&&(b=f[f.length-1])instanceof ii&&v.lines+b.lines<=32?(u+=v.lines,h+=v.length+1,f[f.length-1]=new ii(b.text.concat(v.text),b.length+1+v.length)):(u+v.lines>i&&m(),u+=v.lines,h+=v.length+1,f.push(v))}function m(){u!=0&&(l.push(f.length==1?f[0]:Il.from(f,h)),h=-1,u=f.length=0)}for(let v of e)p(v);return m(),l.length==1?l[0]:new Il(l,n)}}jn.empty=new ii([""],0);function Gde(t){let e=-1;for(let n of t)e+=n.length+1;return e}function J1(t,e,n=0,r=1e9){for(let i=0,s=0,o=!0;s<t.length&&i<=r;s++){let l=t[s],u=i+l.length;u>=n&&(u>r&&(l=l.slice(0,r-i)),i<n&&(l=l.slice(n-i)),o?(e[e.length-1]+=l,o=!1):e.push(l)),i=u+1}return e}function ND(t,e,n){return J1(t,[""],e,n)}class Rg{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof ii?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,l=i instanceof ii?i.text.length:i.children.length;if(o==(n>0?l: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((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(i instanceof ii){let u=i.text[o+(n<0?-1:0)];if(this.offsets[r]+=n,u.length>Math.max(0,e))return this.value=e==0?u:n>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=i.children[o+(n<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(n>0?1:(u instanceof ii?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Aq{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Rg(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=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;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Mq{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);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"&&(jn.prototype[Symbol.iterator]=function(){return this.iter()},Rg.prototype[Symbol.iterator]=Aq.prototype[Symbol.iterator]=Mq.prototype[Symbol.iterator]=function(){return this});class Kde{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function Sm(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function ki(t,e,n=!0,r=!0){return Yde(t,e,n,r)}function Zde(t){return t>=56320&&t<57344}function Jde(t){return t>=55296&&t<56320}function la(t,e){let n=t.charCodeAt(e);if(!Jde(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Zde(r)?(n-55296<<10)+(r-56320)+65536:n}function H4(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Bl(t){return t<65536?1:2}const ik=/\r\n?|\n/;var us=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(us||(us={}));class Ql{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],o=this.sections[n++];o<0?(e(r,i,s),i+=s):i+=o,r+=s}}iterChangedRanges(e,n=!1){sk(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new Ql(e)}composeDesc(e){return this.empty?e:e.empty?this:Rq(this,e)}mapDesc(e,n=!1){return e.empty?this:ak(this,e,n)}mapPos(e,n=-1,r=us.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],u=this.sections[o++],h=i+l;if(u<0){if(h>e)return s+(e-i);s+=l}else{if(r!=us.Simple&&h>=e&&(r==us.TrackDel&&i<e&&h>e||r==us.TrackBefore&&i<e||r==us.TrackAfter&&h>e))return null;if(h>e||h==e&&n<0&&!l)return e==i||n<0?s:s+u;s+=u}i=h}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let s=this.sections[r++],o=this.sections[r++],l=i+s;if(o>=0&&i<=n&&l>=e)return i<e&&l>n?"cover":!0;i=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ql(e)}static create(e){return new Ql(e)}}class Ci extends Ql{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return sk(this,(n,r,i,s,o)=>e=e.replace(i,i+(r-n),o),!1),e}mapDesc(e,n=!1){return ak(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i<n.length;i+=2){let o=n[i],l=n[i+1];if(l>=0){n[i]=l,n[i+1]=o;let u=i>>1;for(;r.length<u;)r.push(jn.empty);r.push(o?e.slice(s,s+o):jn.empty)}s+=o}return new Ci(n,r)}compose(e){return this.empty?e:e.empty?this:Rq(this,e,!0)}map(e,n=!1){return e.empty?this:ak(this,e,n,!0)}iterChanges(e,n=!1){sk(this,e,n)}get desc(){return Ql.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new cv(this);e:for(let o=0,l=0;;){let u=o==e.length?1e9:e[o++];for(;l<u||l==u&&s.len==0;){if(s.done)break e;let f=Math.min(s.len,u-l);Ts(i,f,-1);let p=s.ins==-1?-1:s.off==0?s.ins:0;Ts(n,f,p),p>0&&xh(r,n,s.text),s.forward(f),l+=f}let h=e[o++];for(;l<h;){if(s.done)break e;let f=Math.min(s.len,h-l);Ts(n,f,-1),Ts(i,f,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(f),l+=f}}return{changes:new Ci(n,r),filtered:Ql.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],o=0,l=null;function u(f=!1){if(!f&&!i.length)return;o<n&&Ts(i,n-o,-1);let p=new Ci(i,s);l=l?l.compose(p.map(l)):p,i=[],s=[],o=0}function h(f){if(Array.isArray(f))for(let p of f)h(p);else if(f instanceof Ci){if(f.length!=n)throw new RangeError(`Mismatched change set length (got ${f.length}, expected ${n})`);u(),l=l?l.compose(f.map(l)):f}else{let{from:p,to:m=p,insert:v}=f;if(p>m||p<0||m>n)throw new RangeError(`Invalid change range ${p} to ${m} (in doc of length ${n})`);let b=v?typeof v=="string"?jn.of(v.split(r||ik)):v:jn.empty,x=b.length;if(p==m&&x==0)return;p<o&&u(),p>o&&Ts(i,p-o,-1),Ts(i,m-p,x),xh(s,i,b),o=m}}return h(e),u(!l),l}static empty(e){return new Ci(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(jn.empty);r[i]=jn.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new Ci(n,r)}static createSet(e,n){return new Ci(e,n)}}function Ts(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function xh(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(jn.empty);t.push(n)}}function sk(t,e,n){let r=t.inserted;for(let i=0,s=0,o=0;o<t.sections.length;){let l=t.sections[o++],u=t.sections[o++];if(u<0)i+=l,s+=l;else{let h=i,f=s,p=jn.empty;for(;h+=l,f+=u,u&&r&&(p=p.append(r[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],u=t.sections[o++];e(i,h,s,f,p),i=h,s=f}}}function ak(t,e,n,r=!1){let i=[],s=r?[]:null,o=new cv(t),l=new cv(e);for(let u=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);Ts(i,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||u==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!n))){let h=l.len;for(Ts(i,l.ins,-1);h;){let f=Math.min(o.len,h);o.ins>=0&&u<o.i&&o.len<=f&&(Ts(i,0,o.ins),s&&xh(s,i,o.text),u=o.i),o.forward(f),h-=f}l.next()}else if(o.ins>=0){let h=0,f=o.len;for(;f;)if(l.ins==-1){let p=Math.min(f,l.len);h+=p,f-=p,l.forward(p)}else if(l.ins==0&&l.len<f)f-=l.len,l.next();else break;Ts(i,h,u<o.i?o.ins:0),s&&u<o.i&&xh(s,i,o.text),u=o.i,o.forward(o.len-f)}else{if(o.done&&l.done)return s?Ci.createSet(i,s):Ql.create(i);throw new Error("Mismatched change set lengths")}}}function Rq(t,e,n=!1){let r=[],i=n?[]:null,s=new cv(t),o=new cv(e);for(let l=!1;;){if(s.done&&o.done)return i?Ci.createSet(r,i):Ql.create(r);if(s.ins==0)Ts(r,s.len,0,l),s.next();else if(o.len==0&&!o.done)Ts(r,0,o.ins,l),i&&xh(i,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let u=Math.min(s.len2,o.len),h=r.length;if(s.ins==-1){let f=o.ins==-1?-1:o.off?0:o.ins;Ts(r,u,f,l),i&&f&&xh(i,r,o.text)}else o.ins==-1?(Ts(r,s.off?0:s.len,u,l),i&&xh(i,r,s.textBit(u))):(Ts(r,s.off?0:s.len,o.off?0:o.ins,l),i&&!o.off&&xh(i,r,o.text));l=(s.ins>u||o.ins>=0&&o.len>u)&&(l||r.length>h),s.forward2(u),o.forward(u)}}}}class cv{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[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:e}=this.set,n=this.i-2>>1;return n>=e.length?jn.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?jn.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Bd{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}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 bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Bd(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return $e.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return $e.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return $e.range(e.anchor,e.head)}static create(e,n,r){return new Bd(e,n,r)}}class $e{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:$e.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new $e([this.main],0)}addRange(e,n=!0){return $e.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,$e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new $e(e.ranges.map(n=>Bd.fromJSON(n)),e.main)}static single(e,n=e){return new $e([$e.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return $e.normalized(e.slice(),n);r=s.to}return new $e(e,n)}static cursor(e,n=0,r,i){return Bd.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i){let s=(r??16777215)<<6|(i==null?7:Math.min(6,i));return n<e?Bd.create(n,e,48|s):Bd.create(e,n,(n>e?8:0)|s)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],o=e[i-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,u=Math.max(s.to,o.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.head?$e.range(u,l):$e.range(l,u))}}return new $e(e,n)}}function Dq(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let V4=0;class ft{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=V4++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new ft(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:U4),!!e.static,e.enables)}of(e){return new ex([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new ex(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new ex(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function U4(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class ex{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=V4++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,u=!1,h=!1,f=[];for(let p of this.dependencies)p=="doc"?u=!0:p=="selection"?h=!0:(((n=e[p.id])!==null&&n!==void 0?n:1)&1)==0&&f.push(e[p.id]);return{create(p){return p.values[o]=r(p),1},update(p,m){if(u&&m.docChanged||h&&(m.docChanged||m.selection)||ok(p,f)){let v=r(p);if(l?!PD(v,p.values[o],i):!i(v,p.values[o]))return p.values[o]=v,1}return 0},reconfigure:(p,m)=>{let v,b=m.config.address[s];if(b!=null){let x=Kx(m,b);if(this.dependencies.every(w=>w instanceof ft?m.facet(w)===p.facet(w):w instanceof Xi?m.field(w,!1)==p.field(w,!1):!0)||(l?PD(v=r(p),x,i):i(v=r(p),x)))return p.values[o]=x,0}else v=r(p);return p.values[o]=v,1}}}}function PD(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function ok(t,e){let n=!1;for(let r of e)Dg(t,r)&1&&(n=!0);return n}function efe(t,e,n){let r=n.map(u=>t[u.id]),i=n.map(u=>u.type),s=r.filter(u=>!(u&1)),o=t[e.id]>>1;function l(u){let h=[];for(let f=0;f<r.length;f++){let p=Kx(u,r[f]);if(i[f]==2)for(let m of p)h.push(m);else h.push(p)}return e.combine(h)}return{create(u){for(let h of r)Dg(u,h);return u.values[o]=l(u),1},update(u,h){if(!ok(u,s))return 0;let f=l(u);return e.compare(f,u.values[o])?0:(u.values[o]=f,1)},reconfigure(u,h){let f=ok(u,r),p=h.config.facets[e.id],m=h.facet(e);if(p&&!f&&U4(n,p))return u.values[o]=m,0;let v=l(u);return e.compare(v,m)?(u.values[o]=m,0):(u.values[o]=v,1)}}}const Ky=ft.define({static:!0});class Xi{constructor(e,n,r,i,s){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let n=new Xi(V4++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Ky).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[n]=o,1)},reconfigure:(r,i)=>{let s=r.facet(Ky),o=i.facet(Ky),l;return(l=s.find(u=>u.field==this))&&l!=o.find(u=>u.field==this)?(r.values[n]=l.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Ky.of({field:this,create:e})]}get extension(){return this}}const Dd={lowest:4,low:3,default:2,high:1,highest:0};function tg(t){return e=>new Nq(e,t)}const lu={highest:tg(Dd.highest),high:tg(Dd.high),default:tg(Dd.default),low:tg(Dd.low),lowest:tg(Dd.lowest)};class Nq{constructor(e,n){this.inner=e,this.prec=n}}class nS{of(e){return new lk(this,e)}reconfigure(e){return nS.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class lk{constructor(e,n){this.compartment=e,this.inner=n}}class Gx{constructor(e,n,r,i,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],s=Object.create(null),o=new Map;for(let m of tfe(e,n,o))m instanceof Xi?i.push(m):(s[m.facet.id]||(s[m.facet.id]=[])).push(m);let l=Object.create(null),u=[],h=[];for(let m of i)l[m.id]=h.length<<1,h.push(v=>m.slot(v));let f=r==null?void 0:r.config.facets;for(let m in s){let v=s[m],b=v[0].facet,x=f&&f[m]||[];if(v.every(w=>w.type==0))if(l[b.id]=u.length<<1|1,U4(x,v))u.push(r.facet(b));else{let w=b.combine(v.map(S=>S.value));u.push(r&&b.compare(w,r.facet(b))?r.facet(b):w)}else{for(let w of v)w.type==0?(l[w.id]=u.length<<1|1,u.push(w.value)):(l[w.id]=h.length<<1,h.push(S=>w.dynamicSlot(S)));l[b.id]=h.length<<1,h.push(w=>efe(w,b,v))}}let p=h.map(m=>m(l));return new Gx(e,o,p,l,u,s)}}function tfe(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(o,l){let u=i.get(o);if(u!=null){if(u<=l)return;let h=r[u].indexOf(o);h>-1&&r[u].splice(h,1),o instanceof lk&&n.delete(o.compartment)}if(i.set(o,l),Array.isArray(o))for(let h of o)s(h,l);else if(o instanceof lk){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;n.set(o.compartment,h),s(h,l)}else if(o instanceof Nq)s(o.inner,o.prec);else if(o instanceof Xi)r[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof ex)r[l].push(o),o.facet.extensions&&s(o.facet.extensions,Dd.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,l)}}return s(t,Dd.default),r.reduce((o,l)=>o.concat(l))}function Dg(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function Kx(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Pq=ft.define(),ck=ft.define({combine:t=>t.some(e=>e),static:!0}),Lq=ft.define({combine:t=>t.length?t[0]:void 0,static:!0}),$q=ft.define(),Iq=ft.define(),Bq=ft.define(),zq=ft.define({combine:t=>t.length?t[0]:!1});class ic{constructor(e,n){this.type=e,this.value=n}static define(){return new nfe}}class nfe{of(e){return new ic(this,e)}}class rfe{constructor(e){this.map=e}of(e){return new qt(this,e)}}class qt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new qt(this.type,n)}is(e){return this.type==e}static define(e={}){return new rfe(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}qt.reconfigure=qt.define();qt.appendConfig=qt.define();class gi{constructor(e,n,r,i,s,o){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&Dq(r,n.newLength),s.some(l=>l.type==gi.time)||(this.annotations=s.concat(gi.time.of(Date.now())))}static create(e,n,r,i,s,o){return new gi(e,n,r,i,s,o)}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(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(gi.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}gi.time=ic.define();gi.userEvent=ic.define();gi.addToHistory=ic.define();gi.remote=ic.define();function ife(t,e){let n=[];for(let r=0,i=0;;){let s,o;if(r<t.length&&(i==e.length||e[i]>=t[r]))s=t[r++],o=t[r++];else if(i<e.length)s=e[i++],o=e[i++];else return n;!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function qq(t,e,n){var r;let i,s,o;return n?(i=e.changes,s=Ci.empty(e.changes.length),o=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(s):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:qt.mapEffects(t.effects,i).concat(qt.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function uk(t,e,n){let r=e.selection,i=zp(e.annotations);return e.userEvent&&(i=i.concat(gi.userEvent.of(e.userEvent))),{changes:e.changes instanceof Ci?e.changes:Ci.of(e.changes||[],n,t.facet(Lq)),selection:r&&(r instanceof $e?r:$e.single(r.anchor,r.head)),effects:zp(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function Fq(t,e,n){let r=uk(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let o=!!e[s].sequential;r=qq(r,uk(t,e[s],o?r.changes.newLength:t.doc.length),o)}let i=gi.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return afe(n?sfe(i):i)}function sfe(t){let e=t.startState,n=!0;for(let i of e.facet($q)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:ife(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=Ci.empty(e.doc.length);else{let o=t.changes.filter(n);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=gi.create(e,i,t.selection&&t.selection.map(s),qt.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(Iq);for(let i=r.length-1;i>=0;i--){let s=r[i](t);s instanceof gi?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof gi?t=s[0]:t=Fq(e,zp(s),!1)}return t}function afe(t){let e=t.startState,n=e.facet(Bq),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=qq(r,uk(e,s,t.changes.newLength),!0))}return r==t?t:gi.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const ofe=[];function zp(t){return t==null?ofe:Array.isArray(t)?t:[t]}var Rr=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Rr||(Rr={}));const lfe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let hk;try{hk=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function cfe(t){if(hk)return hk.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||lfe.test(n)))return!0}return!1}function ufe(t){return e=>{if(!/\S/.test(e))return Rr.Space;if(cfe(e))return Rr.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Rr.Word;return Rr.Other}}class gn{constructor(e,n,r,i,s,o){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Dg(this,l<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return Dg(this,r),Kx(this,r)}update(...e){return Fq(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let l of e.effects)l.is(nS.reconfigure)?(n&&(i=new Map,n.compartments.forEach((u,h)=>i.set(h,u)),n=null),i.set(l.value.compartment,l.value.extension)):l.is(qt.reconfigure)?(n=null,r=l.value):l.is(qt.appendConfig)&&(n=null,r=zp(r).concat(l.value));let s;n?s=e.startState.values.slice():(n=Gx.resolve(r,i,this),s=new gn(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(u,h)=>h.reconfigure(u,this),null).values);let o=e.startState.facet(ck)?e.newSelection:e.newSelection.asSingle();new gn(n,e.newDoc,o,s,(l,u)=>u.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:$e.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],o=zp(r.effects);for(let l=1;l<n.ranges.length;l++){let u=e(n.ranges[l]),h=this.changes(u.changes),f=h.map(i);for(let m=0;m<l;m++)s[m]=s[m].map(f);let p=i.mapDesc(h,!0);s.push(u.range.map(p)),i=i.compose(f),o=qt.mapEffects(o,f).concat(qt.mapEffects(zp(u.effects),p))}return{changes:i,selection:$e.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof Ci?e:Ci.of(e,this.doc.length,this.facet(gn.lineSeparator))}toText(e){return jn.of(e.split(this.facet(gn.lineSeparator)||ik))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Dg(this,n),Kx(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof Xi&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let o=r[s],l=e[s];i.push(o.init(u=>o.spec.fromJSON(l,u)))}}return gn.create({doc:e.doc,selection:$e.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Gx.resolve(e.extensions||[],new Map),r=e.doc instanceof jn?e.doc:jn.of((e.doc||"").split(n.staticFacet(gn.lineSeparator)||ik)),i=e.selection?e.selection instanceof $e?e.selection:$e.single(e.selection.anchor,e.selection.head):$e.single(0);return Dq(i,r.length),n.staticFacet(ck)||(i=i.asSingle()),new gn(n,r,i,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(gn.tabSize)}get lineBreak(){return this.facet(gn.lineSeparator)||`
`}get readOnly(){return this.facet(zq)}phrase(e,...n){for(let r of this.facet(gn.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(Pq))for(let o of s(this,n,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return ufe(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,l=e-r;for(;o>0;){let u=ki(n,o,!1);if(s(n.slice(u,o))!=Rr.Word)break;o=u}for(;l<i;){let u=ki(n,l);if(s(n.slice(l,u))!=Rr.Word)break;l=u}return o==l?null:$e.range(o+r,l+r)}}gn.allowMultipleSelections=ck;gn.tabSize=ft.define({combine:t=>t.length?t[0]:4});gn.lineSeparator=Lq;gn.readOnly=zq;gn.phrases=ft.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});gn.languageData=Pq;gn.changeFilter=$q;gn.transactionFilter=Iq;gn.transactionExtender=Bq;nS.reconfigure=qt.define();function sc(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let o=i[s],l=r[s];if(l===void 0)r[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class Dh{eq(e){return this==e}range(e,n=e){return uv.create(e,n,this)}}Dh.prototype.startSide=Dh.prototype.endSide=0;Dh.prototype.point=!1;Dh.prototype.mapMode=us.TrackDel;function Q4(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}class uv{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new uv(e,n,r)}}function dk(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class W4{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let o=i,l=s.length;;){if(o==l)return o;let u=o+l>>1,h=s[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-n;if(u==o)return h>=0?o:l;h>=0?l=u:o=u+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let r=[],i=[],s=[],o=-1,l=-1;for(let u=0;u<this.value.length;u++){let h=this.value[u],f=this.from[u]+e,p=this.to[u]+e,m,v;if(f==p){let b=n.mapPos(f,h.startSide,h.mapMode);if(b==null||(m=v=b,h.startSide!=h.endSide&&(v=n.mapPos(f,h.endSide),v<m)))continue}else if(m=n.mapPos(f,h.startSide),v=n.mapPos(p,h.endSide),m>v||m==v&&h.startSide>0&&h.endSide<=0)continue;(v-m||h.endSide-h.startSide)<0||(o<0&&(o=m),h.point&&(l=Math.max(l,v-m)),r.push(h),i.push(m-o),s.push(v-o))}return{mapped:r.length?new W4(i,s,r,l):null,pos:o}}}class dn{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new dn(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(dk)),this.isEmpty)return n.length?dn.of(n):this;let l=new Hq(this,null,-1).goto(0),u=0,h=[],f=new Jc;for(;l.value||u<n.length;)if(u<n.length&&(l.from-n[u].from||l.startSide-n[u].value.startSide)>=0){let p=n[u++];f.addInner(p.from,p.to,p.value)||h.push(p)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(u==n.length||this.chunkEnd(l.chunkIndex)<n[u].from)&&(!o||i>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&f.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||i>l.to||s<l.from||o(l.from,l.to,l.value))&&(f.addInner(l.from,l.to,l.value)||h.push(uv.create(l.from,l.to,l.value))),l.next());return f.finishInner(this.nextLayer.isEmpty&&!h.length?dn.empty:this.nextLayer.update({add:h,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],u=this.chunk[o],h=e.touchesRange(l,l+u.length);if(h===!1)i=Math.max(i,u.maxPoint),n.push(u),r.push(e.mapPos(l));else if(h===!0){let{mapped:f,pos:p}=u.map(l,e);f&&(i=Math.max(i,f.maxPoint),n.push(f),r.push(p))}}let s=this.nextLayer.map(e);return n.length==0?s:new dn(r,n,s||dn.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(n>=s&&e<=s+o.length&&o.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return hv.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return hv.from(e).goto(n)}static compare(e,n,r,i,s=-1){let o=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),l=n.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),u=LD(o,l,r),h=new ng(o,u,s),f=new ng(l,u,s);r.iterGaps((p,m,v)=>$D(h,p,f,m,v,i)),r.empty&&r.length==0&&$D(h,0,f,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(f=>!f.isEmpty&&n.indexOf(f)<0),o=n.filter(f=>!f.isEmpty&&e.indexOf(f)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=LD(s,o),u=new ng(s,l,0).goto(r),h=new ng(o,l,0).goto(r);for(;;){if(u.to!=h.to||!fk(u.active,h.active)||u.point&&(!h.point||!Q4(u.point,h.point)))return!1;if(u.to>i)return!0;u.next(),h.next()}}static spans(e,n,r,i,s=-1){let o=new ng(e,null,s).goto(n),l=n,u=o.openStart;for(;;){let h=Math.min(o.to,r);if(o.point){let f=o.activeForPoint(o.to),p=o.pointFrom<n?f.length+1:o.point.startSide<0?f.length:Math.min(f.length,u);i.point(l,h,o.point,f,p,o.pointRank),u=Math.min(o.openEnd(h),f.length)}else h>l&&(i.span(l,h,o.active,u),u=o.openEnd(h));if(o.to>r)return u+(o.point&&o.to>r?1:0);l=o.to,o.next()}}static of(e,n=!1){let r=new Jc;for(let i of e instanceof uv?[e]:n?hfe(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return dn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=dn.empty;i=i.nextLayer)n=new dn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}dn.empty=new dn([],[],null,-1);function hfe(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(dk(e,r)>0)return t.slice().sort(dk);e=r}return t}dn.empty.nextLayer=dn.empty;class Jc{finishChunk(e){this.chunks.push(new W4(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,e&&(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(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Jc)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-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=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-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(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(dn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=dn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function LD(t,e,n){let r=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&r.set(s.chunk[o],s.chunkPos[o]);let i=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=r.get(s.chunk[o]);l!=null&&(n?n.mapPos(l):l)==s.chunkPos[o]&&!(n!=null&&n.touchesRange(l,l+s.chunk[o].length))&&i.add(s.chunk[o])}return i}class Hq{constructor(e,n,r,i=0){this.layer=e,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(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,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)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+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(e){if(e==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=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class hv{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=r&&i.push(new Hq(o,n,r,s));return i.length==1?i[0]:new hv(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)T3(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)T3(this.heap,r);(this.to-e||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 e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),T3(this.heap,0)}}}function T3(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class ng{constructor(e,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=hv.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Zy(this.active,e),Zy(this.activeTo,e),Zy(this.activeRank,e),this.minActive=ID(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)n++;Jy(this.active,n,r),Jy(this.activeTo,n,i),Jy(this.activeRank,n,s),e&&Jy(e,n,this.cursor.from),this.minActive=ID(this.active,this.activeTo)}next(){let e=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]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Zy(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.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=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.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]<e;i--)this.openStart++}}activeForPoint(e){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]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function $D(t,e,n,r,i,s){t.goto(e),n.goto(r);let o=r+i,l=r,u=r-e,h=!!s.boundChange;for(let f=!1;;){let p=t.to+u-n.to,m=p||t.endSide-n.endSide,v=m<0?t.to+u:n.to,b=Math.min(v,o);if(t.point||n.point?(t.point&&n.point&&Q4(t.point,n.point)&&fk(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,b,t.point,n.point),f=!1):(f&&s.boundChange(l),b>l&&!fk(t.active,n.active)&&s.compareRange(l,b,t.active,n.active),h&&b<o&&(p||t.openEnd(v)!=n.openEnd(v))&&(f=!0)),v>o)break;l=v,m<=0&&t.next(),m>=0&&n.next()}}function fk(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!Q4(t[n],e[n]))return!1;return!0}function Zy(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function Jy(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function ID(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function Xm(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=ki(t,i));return r}function pk(t,e,n,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=ki(t,i)}return r===!0?-1:t.length}const mk="ͼ",BD=typeof Symbol>"u"?"__"+mk:Symbol.for(mk),gk=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),zD=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Nh{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,u,h){let f=[],p=/^@(\w+)\b/.exec(o[0]),m=p&&p[1]=="keyframes";if(p&&l==null)return u.push(o[0]+";");for(let v in l){let b=l[v];if(/&/.test(v))s(v.split(/,\s*/).map(x=>o.map(w=>x.replace(/&/,w))).reduce((x,w)=>x.concat(w)),b,u);else if(b&&typeof b=="object"){if(!p)throw new RangeError("The value of a property ("+v+") should be a primitive value.");s(i(v),b,f,m)}else b!=null&&f.push(v.replace(/_.*/,"").replace(/[A-Z]/g,x=>"-"+x.toLowerCase())+": "+b+";")}(f.length||m)&&u.push((r&&!p&&!h?o.map(r):o).join(", ")+" {"+f.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let e=zD[BD]||1;return zD[BD]=e+1,mk+e.toString(36)}static mount(e,n,r){let i=e[gk],s=r&&r.nonce;i?s&&i.setNonce(s):i=new dfe(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let qD=new Map;class dfe{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=qD.get(r);if(s)return e[gk]=s;this.sheet=new i.CSSStyleSheet,qD.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[gk]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],u=this.modules.indexOf(l);if(u<s&&u>-1&&(this.modules.splice(u,1),s--,u=-1),u==-1){if(this.modules.splice(s++,0,l),r)for(let h=0;h<l.rules.length;h++)r.insertRule(l.rules[h],i++)}else{for(;s<u;)i+=this.modules[s++].rules.length;i+=l.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let o="";for(let u=0;u<this.modules.length;u++)o+=this.modules[u].getRules()+`
`;this.styleTag.textContent=o;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Ph={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:"'"},dv={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ffe=typeof navigator<"u"&&/Mac/.test(navigator.platform),pfe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var cs=0;cs<10;cs++)Ph[48+cs]=Ph[96+cs]=String(cs);for(var cs=1;cs<=24;cs++)Ph[cs+111]="F"+cs;for(var cs=65;cs<=90;cs++)Ph[cs]=String.fromCharCode(cs+32),dv[cs]=String.fromCharCode(cs);for(var C3 in Ph)dv.hasOwnProperty(C3)||(dv[C3]=Ph[C3]);function mfe(t){var e=ffe&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||pfe&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?dv:Ph)[t.keyCode]||t.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 mr(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=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"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e<arguments.length;e++)Vq(t,arguments[e]);return t}function Vq(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)Vq(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let qs=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},vk=typeof document<"u"?document:{documentElement:{style:{}}};const bk=/Edge\/(\d+)/.exec(qs.userAgent),Uq=/MSIE \d/.test(qs.userAgent),yk=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(qs.userAgent),rS=!!(Uq||yk||bk),FD=!rS&&/gecko\/(\d+)/i.test(qs.userAgent),k3=!rS&&/Chrome\/(\d+)/.exec(qs.userAgent),gfe="webkitFontSmoothing"in vk.documentElement.style,xk=!rS&&/Apple Computer/.test(qs.vendor),HD=xk&&(/Mobile\/\w+/.test(qs.userAgent)||qs.maxTouchPoints>2);var pt={mac:HD||/Mac/.test(qs.platform),windows:/Win/.test(qs.platform),linux:/Linux|X11/.test(qs.platform),ie:rS,ie_version:Uq?vk.documentMode||6:yk?+yk[1]:bk?+bk[1]:0,gecko:FD,gecko_version:FD?+(/Firefox\/(\d+)/.exec(qs.userAgent)||[0,0])[1]:0,chrome:!!k3,chrome_version:k3?+k3[1]:0,ios:HD,android:/Android\b/.test(qs.userAgent),webkit_version:gfe?+(/\bAppleWebKit\/(\d+)/.exec(qs.userAgent)||[0,0])[1]:0,safari:xk,safari_version:xk?+(/\bVersion\/(\d+(\.\d+)?)/.exec(qs.userAgent)||[0,0])[1]:0,tabSize:vk.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Y4(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Zx=Object.create(null);function X4(t,e,n){if(t==e)return!0;t||(t=Zx),e||(e=Zx);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function vfe(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function VD(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function bfe(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class fl{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var hs=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(hs||(hs={}));class Ct extends Dh{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new ib(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new mf(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=Qq(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(o?n?2e8:1:-6e8)+1}return new mf(e,r,i,n,e.widget||null,!0)}static line(e){return new sb(e)}static set(e,n=!1){return dn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ct.none=dn.empty;class ib extends Ct{constructor(e){let{start:n,end:r}=Qq(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Y4(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Zx}eq(e){return this==e||e instanceof ib&&this.tagName==e.tagName&&X4(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}ib.prototype.point=!1;class sb extends Ct{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof sb&&this.spec.class==e.spec.class&&X4(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}sb.prototype.mapMode=us.TrackBefore;sb.prototype.point=!0;class mf extends Ct{constructor(e,n,r,i,s,o){super(n,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?n<=0?us.TrackBefore:us.TrackAfter:us.TrackDel}get type(){return this.startSide!=this.endSide?hs.WidgetRange:this.startSide<=0?hs.WidgetBefore:hs.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof mf&&yfe(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}mf.prototype.point=!0;function Qq(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function yfe(t,e){return t==e||!!(t&&e&&t.compare(e))}function qp(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class fv extends Dh{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof fv&&this.tagName==e.tagName&&X4(this.attributes,e.attributes)}static create(e){return new fv(e.tagName,e.attributes||Zx)}static set(e,n=!1){return dn.of(e,n)}}fv.prototype.startSide=fv.prototype.endSide=-1;function jm(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function wk(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Ng(t,e){if(!e.anchorNode)return!1;try{return wk(t,e.anchorNode)}catch{return!1}}function Pg(t){return t.nodeType==3?mv(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Lg(t,e,n,r){return n?UD(t,e,n,r,-1)||UD(t,e,n,r,1):!1}function Lh(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Jx(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function UD(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:eu(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=Lh(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?eu(t):0}else return!1}}function eu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function pv(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function xfe(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Wq(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function wfe(t,e,n,r,i,s,o,l){let u=t.ownerDocument,h=u.defaultView||window;for(let f=t,p=!1;f&&!p;)if(f.nodeType==1){let m,v=f==u.body,b=1,x=1;if(v)m=xfe(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(f).position)&&(p=!0),f.scrollHeight<=f.clientHeight&&f.scrollWidth<=f.clientWidth){f=f.assignedSlot||f.parentNode;continue}let _=f.getBoundingClientRect();({scaleX:b,scaleY:x}=Wq(f,_)),m={left:_.left,right:_.left+f.clientWidth*b,top:_.top,bottom:_.top+f.clientHeight*x}}let w=0,S=0;if(i=="nearest")e.top<m.top?(S=e.top-(m.top+o),n>0&&e.bottom>m.bottom+S&&(S=e.bottom-m.bottom+o)):e.bottom>m.bottom&&(S=e.bottom-m.bottom+o,n<0&&e.top-S<m.top&&(S=e.top-(m.top+o)));else{let _=e.bottom-e.top,T=m.bottom-m.top;S=(i=="center"&&_<=T?e.top+_/2-T/2:i=="start"||i=="center"&&n<0?e.top-o:e.bottom-T+o)-m.top}if(r=="nearest"?e.left<m.left?(w=e.left-(m.left+s),n>0&&e.right>m.right+w&&(w=e.right-m.right+s)):e.right>m.right&&(w=e.right-m.right+s,n<0&&e.left<m.left+w&&(w=e.left-(m.left+s))):w=(r=="center"?e.left+(e.right-e.left)/2-(m.right-m.left)/2:r=="start"==l?e.left-s:e.right-(m.right-m.left)+s)-m.left,w||S)if(v)h.scrollBy(w,S);else{let _=0,T=0;if(S){let C=f.scrollTop;f.scrollTop+=S/x,T=(f.scrollTop-C)*x}if(w){let C=f.scrollLeft;f.scrollLeft+=w/b,_=(f.scrollLeft-C)*b}e={left:e.left-_,top:e.top-T,right:e.right-_,bottom:e.bottom-T},_&&Math.abs(_-w)<1&&(r="nearest"),T&&Math.abs(T-S)<1&&(i="nearest")}if(v)break;(e.top<m.top||e.bottom>m.bottom||e.left<m.left||e.right>m.right)&&(e={left:Math.max(e.left,m.left),right:Math.min(e.right,m.right),top:Math.max(e.top,m.top),bottom:Math.min(e.bottom,m.bottom)}),f=f.assignedSlot||f.parentNode}else if(f.nodeType==11)f=f.host;else break}function Sfe(t){let e=t.ownerDocument,n,r;for(let i=t.parentNode;i&&!(i==e.body||n&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class jfe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?eu(n):0),r,Math.min(e.focusOffset,r?eu(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Cd=null;pt.safari&&pt.safari_version>=26&&(Cd=!1);function Yq(t){if(t.setActive)return t.setActive();if(Cd)return t.focus(Cd);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Cd==null?{get preventScroll(){return Cd={preventScroll:!0},!0}}:void 0),!Cd){Cd=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],s=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let QD;function mv(t,e,n=e){let r=QD||(QD=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function Fp(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function _fe(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function Tfe(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,eu(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=eu(n))}else{if(n==t)return!0;r=Lh(n),n=n.parentNode}}function Xq(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function Gq(t,e){for(let n=t,r=e;;){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=eu(n)}else if(n.parentNode&&!Jx(n))r=Lh(n),n=n.parentNode;else return null}}function Kq(t,e){for(let n=t,r=e;;){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&&!Jx(n))r=Lh(n)+1,n=n.parentNode;else return null}}class rl{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new rl(e.parentNode,Lh(e),n)}static after(e,n){return new rl(e.parentNode,Lh(e)+1,n)}}var ur=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(ur||(ur={}));const gf=ur.LTR,G4=ur.RTL;function Zq(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const Cfe=Zq("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),kfe=Zq("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Sk=Object.create(null),kl=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Sk[e]=n,Sk[n]=-e}function Jq(t){return t<=247?Cfe[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?kfe[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const Ofe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Vc{get dir(){return this.level%2?G4:gf}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=n&&l.to>=n){if(l.level==r)return o;(s<0||(i!=0?i<0?l.from<n:l.to>n:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function eF(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!eF(r.inner,i.inner))return!1}return!0}const ar=[];function Efe(t,e,n,r,i){for(let s=0;s<=r.length;s++){let o=s?r[s-1].to:e,l=s<r.length?r[s].from:n,u=s?256:i;for(let h=o,f=u,p=u;h<l;h++){let m=Jq(t.charCodeAt(h));m==512?m=f:m==8&&p==4&&(m=16),ar[h]=m==4?2:m,m&7&&(p=m),f=m}for(let h=o,f=u,p=u;h<l;h++){let m=ar[h];if(m==128)h<l-1&&f==ar[h+1]&&f&24?m=ar[h]=f:ar[h]=256;else if(m==64){let v=h+1;for(;v<l&&ar[v]==64;)v++;let b=h&&f==8||v<n&&ar[v]==8?p==1?1:8:256;for(let x=h;x<v;x++)ar[x]=b;h=v-1}else m==8&&p==1&&(ar[h]=1);f=m,m&7&&(p=m)}}}function Afe(t,e,n,r,i){let s=i==1?2:1;for(let o=0,l=0,u=0;o<=r.length;o++){let h=o?r[o-1].to:e,f=o<r.length?r[o].from:n;for(let p=h,m,v,b;p<f;p++)if(v=Sk[m=t.charCodeAt(p)])if(v<0){for(let x=l-3;x>=0;x-=3)if(kl[x+1]==-v){let w=kl[x+2],S=w&2?i:w&4?w&1?s:i:0;S&&(ar[p]=ar[kl[x]]=S),l=x;break}}else{if(kl.length==189)break;kl[l++]=p,kl[l++]=m,kl[l++]=u}else if((b=ar[p])==2||b==1){let x=b==i;u=x?0:1;for(let w=l-3;w>=0;w-=3){let S=kl[w+2];if(S&2)break;if(x)kl[w+2]|=2;else{if(S&4)break;kl[w+2]|=4}}}}}function Mfe(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let o=i?n[i-1].to:t,l=i<n.length?n[i].from:e;for(let u=o;u<l;){let h=ar[u];if(h==256){let f=u+1;for(;;)if(f==l){if(i==n.length)break;f=n[i++].to,l=i<n.length?n[i].from:e}else if(ar[f]==256)f++;else break;let p=s==1,m=(f<e?ar[f]:r)==1,v=p==m?p?1:2:r;for(let b=f,x=i,w=x?n[x-1].to:t;b>u;)b==w&&(b=n[--x].from,w=x?n[x-1].to:t),ar[--b]=v;u=f}else s=h,u++}}}function jk(t,e,n,r,i,s,o){let l=r%2?2:1;if(r%2==i%2)for(let u=e,h=0;u<n;){let f=!0,p=!1;if(h==s.length||u<s[h].from){let x=ar[u];x!=l&&(f=!1,p=x==16)}let m=!f&&l==1?[]:null,v=f?r:r+1,b=u;e:for(;;)if(h<s.length&&b==s[h].from){if(p)break e;let x=s[h];if(!f)for(let w=x.to,S=h+1;;){if(w==n)break e;if(S<s.length&&s[S].from==w)w=s[S++].to;else{if(ar[w]==l)break e;break}}if(h++,m)m.push(x);else{x.from>u&&o.push(new Vc(u,x.from,v));let w=x.direction==gf!=!(v%2);_k(t,w?r+1:r,i,x.inner,x.from,x.to,o),u=x.to}b=x.to}else{if(b==n||(f?ar[b]!=l:ar[b]==l))break;b++}m?jk(t,u,b,r+1,i,m,o):u<b&&o.push(new Vc(u,b,v)),u=b}else for(let u=n,h=s.length;u>e;){let f=!0,p=!1;if(!h||u>s[h-1].to){let x=ar[u-1];x!=l&&(f=!1,p=x==16)}let m=!f&&l==1?[]:null,v=f?r:r+1,b=u;e:for(;;)if(h&&b==s[h-1].to){if(p)break e;let x=s[--h];if(!f)for(let w=x.from,S=h;;){if(w==e)break e;if(S&&s[S-1].to==w)w=s[--S].from;else{if(ar[w-1]==l)break e;break}}if(m)m.push(x);else{x.to<u&&o.push(new Vc(x.to,u,v));let w=x.direction==gf!=!(v%2);_k(t,w?r+1:r,i,x.inner,x.from,x.to,o),u=x.from}b=x.from}else{if(b==e||(f?ar[b-1]!=l:ar[b-1]==l))break;b--}m?jk(t,b,u,r+1,i,m,o):b<u&&o.push(new Vc(b,u,v)),u=b}}function _k(t,e,n,r,i,s,o){let l=e%2?2:1;Efe(t,i,s,r,l),Afe(t,i,s,r,l),Mfe(i,s,r,l),jk(t,i,s,e,n,r,o)}function Rfe(t,e,n){if(!t)return[new Vc(0,0,e==G4?1:0)];if(e==gf&&!n.length&&!Ofe.test(t))return tF(t.length);if(n.length)for(;t.length>ar.length;)ar[ar.length]=256;let r=[],i=e==gf?0:1;return _k(t,i,i,n,0,t.length,r),r}function tF(t){return[new Vc(0,t,0)]}let nF="";function Dfe(t,e,n,r,i){var s;let o=r.head-t.from,l=Vc.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),u=e[l],h=u.side(i,n);if(o==h){let m=l+=i?1:-1;if(m<0||m>=e.length)return null;u=e[l=m],o=u.side(!i,n),h=u.side(i,n)}let f=ki(t.text,o,u.forward(i,n));(f<u.from||f>u.to)&&(f=h),nF=t.text.slice(Math.min(o,f),Math.max(o,f));let p=l==(i?e.length-1:0)?null:e[l+(i?1:-1)];return p&&f==h&&p.level+(i?0:1)<u.level?$e.cursor(p.side(!i,n)+t.from,p.forward(i,n)?1:-1,p.level):$e.cursor(f+t.from,u.forward(i,n)?-1:1,u.level)}function Nfe(t,e,n){for(let r=e;r<n;r++){let i=Jq(t.charCodeAt(r));if(i==1)return gf;if(i==2||i==4)return G4}return gf}const rF=ft.define(),iF=ft.define(),sF=ft.define(),aF=ft.define(),Tk=ft.define(),oF=ft.define(),lF=ft.define(),K4=ft.define(),Z4=ft.define(),cF=ft.define({combine:t=>t.some(e=>e)}),uF=ft.define({combine:t=>t.some(e=>e)}),hF=ft.define();class Hp{constructor(e,n="nearest",r="nearest",i=5,s=5,o=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new Hp(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Hp($e.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const e1=qt.define({map:(t,e)=>t.map(e)}),dF=qt.define();function Hs(t,e,n){let r=t.facet(aF);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Fc=ft.define({combine:t=>t.length?t[0]:!0});let Pfe=0;const Tp=ft.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class Zr{constructor(e,n,r,i,s){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Tp.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Tp.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:o}=n||{};return new Zr(Pfe++,e,r,i,l=>{let u=[];return o&&u.push(iS.of(h=>{let f=h.plugin(l);return f?o(f):Ct.none})),s&&u.push(s(l)),u})}static fromClass(e,n){return Zr.define((r,i)=>new e(r,i),n)}}class O3{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){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(Hs(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(e,this.spec.arg)}catch(n){Hs(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Hs(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const fF=ft.define(),J4=ft.define(),iS=ft.define(),pF=ft.define(),eE=ft.define(),ab=ft.define(),mF=ft.define();function WD(t,e){let n=t.state.facet(mF);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return dn.spans(r,e.from,e.to,{point(){},span(s,o,l,u){let h=s-e.from,f=o-e.from,p=i;for(let m=l.length-1;m>=0;m--,u--){let v=l[m].spec.bidiIsolate,b;if(v==null&&(v=Nfe(e.text,h,f)),u>0&&p.length&&(b=p[p.length-1]).to==h&&b.direction==v)b.to=f,p=b.inner;else{let x={from:h,to:f,direction:v,inner:[]};p.push(x),p=x.inner}}}}),i}const gF=ft.define();function tE(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(gF)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:n,top:r,bottom:i}}const vg=ft.define();class po{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new po(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,s=0,o=0;;){let l=i<e.length?e[i].fromB:1e9,u=s<n.length?n[s]:1e9,h=Math.min(l,u);if(h==1e9)break;let f=h+o,p=h,m=f;for(;;)if(s<n.length&&n[s]<=p){let v=n[s+1];s+=2,p=Math.max(p,v);for(let b=i;b<e.length&&e[b].fromB<=p;b++)o=e[b].toA-e[b].toB;m=Math.max(m,v+o)}else if(i<e.length&&e[i].fromB<=p){let v=e[i++];p=Math.max(p,v.toB),m=Math.max(m,v.toA),o=v.toA-v.toB}else break;r.push(new po(f,m,h,p))}return r}}class ew{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Ci.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,l,u)=>i.push(new po(s,o,l,u))),this.changedRanges=i}static create(e,n,r){return new ew(e,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(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const Lfe=[];class vi{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Lfe}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&vfe(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=Lh(this.dom),i=this.length?e>0:n>0;return new rl(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof aS)return e;return null}static get(e){return e.cmTile}}class sS extends vi{constructor(e){super(e,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(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,i,s=(e==null?void 0:e.node)==n?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;i&&i!=l.dom;)i=YD(i);else n.insertBefore(l.dom,i);r=l.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=YD(i);this.length=o}}function YD(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class aS extends sS{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=vi.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let o=r.children[i++];if(o instanceof Th)n.push(i),r=o,i=0;else{let l=s+o.length,u=e(o,s);if(u!==void 0)return u;s=l+o.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,o=-1;if(this.blockTiles((l,u)=>{let h=u+l.length;if(e>=u&&e<=h){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(r=void 0)}(u<e||e==h&&(n<-1?l.length:l.covers(1)))&&(!r||!l.isWidget()&&r.isWidget())&&(r=l,i=e-u),(h>e||e==u&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-u)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:o}}}class Th extends sS{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new Th(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class _m extends sS{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new _m(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,s=-1,o=null,l=-1;function u(f,p){for(let m=0,v=0;m<f.children.length&&v<=p;m++){let b=f.children[m],x=v+b.length;x>=p&&(b.isComposite()?u(b,p-v):(!o||o.isHidden&&(n>0||r&&Ife(o,b)))&&(x>p||b.flags&32)?(o=b,l=p-v):(v<p||b.flags&16&&!b.isHidden)&&(i=b,s=p-v)),v=x}}u(this,e);let h=(n<0?i:o)||i||o;return h?{tile:h,offset:h==i?s:l}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):$fe(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new rl(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let o=r.tile.parent,l=!1;for(let u of o.children){if(l)return new rl(u.dom,0);u==r.tile&&(l=!0)}}return new rl(this.dom,0)}}function $fe(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Pg(e);return n[n.length-1]||null}function Ife(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class ha extends sS{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new ha(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class zd extends vi{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,s=e,o=0;e==0&&n<0||e==r&&n>=0?pt.chrome||pt.gecko||(e?(i--,o=1):s<r&&(s++,o=-1)):n<0?i--:s<r&&s++;let l=mv(this.dom,i,s).getClientRects();if(!l.length)return null;let u=l[(o?o<0:n>=0)?0:l.length-1];return pt.safari&&!o&&u.width==0&&(u=Array.prototype.find.call(l,h=>h.width)||u),o?pv(u,o<0):u||null}static of(e,n){let r=new zd(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class vf extends vi{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return pv(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let u=l?s.length-1:0;o=s[u],!(e>0?u==0:u==s.length-1||o.top<o.bottom);u+=l?-1:1);return pv(o,!l)}}get overrideDOMText(){if(!this.length)return jn.empty;let{root:e}=this;if(!e)return jn.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new vf(s,r,e,i)}}class tw extends vi{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return jn.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class Bfe{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:s,beforeBreak:o,parents:l}=this;for(;e||n>0;)if(i.isComposite())if(o){if(!e)break;r&&r.break(),e--,o=!1}else if(s==i.children.length){if(!e&&!l.length)break;r&&r.leave(i),o=!!i.breakAfter,{tile:i,index:s}=l.pop(),s++}else{let u=i.children[s],h=u.breakAfter;(n>0?u.length<=e:u.length<e)&&(!r||r.skip(u,0,u.length)!==!1||!u.isComposite)?(o=!!h,s++,e-=u.length):(l.push({tile:i,index:s}),i=u,s=0,r&&u.isComposite()&&r.enter(u))}else if(s==i.length)o=!!i.breakAfter,{tile:i,index:s}=l.pop(),s++;else if(e){let u=Math.min(e,i.length-s);r&&r.skip(i,s,s+u),e-=u,s+=u}else break;return this.tile=i,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class zfe{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class qfe{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var s;this.flushBuffer();let o=this.ensureMarks(n,r),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let u=o.children[o.children.length-1]=new zd(l.dom,l.text+e);u.parent=o}else o.append(i||zd.of(e,(s=this.cache.find(zd))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?E3(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let l=n.marks.length-1;l>=0;l--){let u=n.marks[l],h=i.lastChild;if(h instanceof ha&&h.mark.eq(u.mark))h.dom!=u.dom&&h.setDOM(E3(u.dom)),i=h;else{if(this.cache.reused.get(u)){let p=vi.get(u.dom);p&&p.setDOM(E3(u.dom))}let f=ha.of(u.mark,u.dom);i.append(f),i=f}this.cache.reused.set(u,2)}let s=vi.get(e.text);s&&this.cache.reused.set(s,2);let o=new zd(e.text,e.text.nodeValue);o.flags|=8,i.append(o)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=vF);let i=_m.start(e,n||((r=this.cache.find(_m))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(n>0&&(l=i.lastChild)&&l instanceof ha&&l.mark.eq(o))i=l,n--;else{let u=ha.of(o,(r=this.cache.find(ha,h=>h.mark.eq(o)))===null||r===void 0?void 0:r.dom);i.append(u),i=u,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!XD(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(pt.ios&&XD(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(A3,0,32)||new vf(A3.toDOM(),0,A3,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new zfe(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof Th&&i.wrapper.eq(r.wrapper))n=i;else{let s=Th.of(r.wrapper,(e=this.cache.find(Th,o=>o.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(tw,void 0,1);return r&&(r.flags=n),r||new tw(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Ffe{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=i;let l=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const nw=[vf,_m,zd,ha,tw,Th,aS];for(let t=0;t<nw.length;t++)nw[t].bucket=t;class Hfe{constructor(e){this.view=e,this.buckets=nw.map(()=>[]),this.index=nw.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,s=this.buckets[i],o=this.index[i];for(let l=s.length-1;l>=0;l--){let u=(l+o)%s.length,h=s[u];if((!n||n(h))&&!this.reused.has(h))return s.splice(u,1),u<o&&this.index[i]--,this.reused.set(h,r),h}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let s=0,o=0;;s++){if(s==i.length){if(o)return null;o=1,s=0}let l=i[s];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==r?(this.reused.set(l,1),l):(this.reused.set(l,2),new vf(l.dom,n,e,l.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Vfe{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new Hfe(e),this.text=new Ffe(e.state.doc),this.builder=new qfe(this.cache,new aS(e,e.contentDOM),dn.iter(r)),this.cache.reused.set(n,2),this.old=new Bfe(n),this.reuseWalker={skip:(o,l,u)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,o=0;;){let l=o<e.length?e[o++]:null,u=l?l.fromA:this.old.root.length;if(u>i){let h=u-i;this.preserve(h,!o,!l),i=u,s+=h}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,l.toA),this.emit(n.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,i=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=Wfe(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(o,l,u)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(u-l);else{let h=u>0||l<o.length?vf.of(o.widget,this.view,u-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,i,s),s=i.length)}else if(o.isText())this.builder.ensureLine(null),!l&&u==o.length?this.builder.addText(o.text,i,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,u),i,s)),s=i.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof tw)this.cache.add(o);else if(o instanceof ha)this.builder.ensureLine(null),this.builder.addMark(o,i,s),this.cache.reused.set(o,1),s=i.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof ha&&i.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?i.length&&(i.length=s=0):o instanceof ha&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,s=0,o=dn.spans(this.decorations,e,n,{point:(l,u,h,f,p,m)=>{if(h instanceof mf){if(this.disallowBlockEffectsFor[m]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(u>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=f.length,p>f.length)i.continueWidget(u-l);else{let v=h.widget||(h.block?Tm.block:Tm.inline),b=Ufe(h),x=this.cache.findWidget(v,u-l,b)||vf.of(v,this.view,u-l,b);h.block?(h.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(x)):(i.ensureLine(r),i.addInlineWidget(x,f,p))}r=null}else r=Qfe(r,h);u>l&&this.text.skip(u-l)},span:(l,u,h,f)=>{for(let p=l;p<u;){let m=this.text.next(Math.min(512,u-p));m==null?(i.addLineStartIfNotCovered(r),i.addBreak(),p++):(i.ensureLine(r),i.addText(m,h,p==l?f:h.length),p+=m.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=o>s,this.openMarks=o}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=vi.get(i);if(i==this.view.contentDOM)break;s instanceof ha?n.push(s):s!=null&&s.isLine()?r=s:i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new _m(i,vF):n.push(ha.of(new ib({tagName:i.nodeName.toLowerCase(),attributes:bfe(i)}),i))}return{line:r,marks:n}}}function XD(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function Ufe(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const vF={class:"cm-line"};function Qfe(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&Y4(n,t),r&&(t.class+=" "+r)),t}function Wfe(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof ha&&e.push(r.mark)}return e}function E3(t){let e=vi.get(t);return e&&e.setDOM(t.cloneNode()),t}class Tm extends fl{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Tm.inline=new Tm("span");Tm.block=new Tm("div");const A3=new class extends fl{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class GD{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Ct.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 aS(e,e.contentDOM),this.updateInner([new po(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:f,toA:p})=>p<this.minWidthFrom||f>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);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:!npe(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?Xfe(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:f,to:p}=this.hasComposition;r=new po(f,p,e.changes.mapPos(f,-1),e.changes.mapPos(p,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(pt.ie||pt.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let u=Zfe(o,this.decorations,e.changes);u.length&&(r=po.extendWithRanges(r,u));let h=epe(l,this.blockWrappers,e.changes);return h.length&&(r=po.extendWithRanges(r,h)),s&&!r.some(f=>f.fromA<=s.range.fromA&&f.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let o=this.tile,l=new Vfe(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=l.run(e,n),Ck(o,l.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 s=pt.chrome||pt.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.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 s of this.tile.children)s.isWidget()&&s.widget instanceof M3&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(dF)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,o=!s&&!(this.view.state.facet(Fc)||r.tabIndex>-1)&&Ng(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let u=this.view.state.selection.main,h,f;if(u.empty?f=h=this.inlineDOMNearPos(u.anchor,u.assoc||1):(f=this.inlineDOMNearPos(u.head,u.head==u.from?1:-1),h=this.inlineDOMNearPos(u.anchor,u.anchor==u.from?1:-1)),pt.gecko&&u.empty&&!this.hasComposition&&Yfe(h)){let m=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(m,h.node.childNodes[h.offset]||null)),h=f=new rl(m,0),l=!0}let p=this.view.observer.selectionRange;(l||!p.focusNode||(!Lg(h.node,h.offset,p.anchorNode,p.anchorOffset)||!Lg(f.node,f.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,u))&&(this.view.observer.ignore(()=>{pt.android&&pt.chrome&&r.contains(p.focusNode)&&tpe(p.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let m=jm(this.view.root);if(m)if(u.empty){if(pt.gecko){let v=Gfe(h.node,h.offset);if(v&&v!=3){let b=(v==1?Gq:Kq)(h.node,h.offset);b&&(h=new rl(b.node,b.offset))}}m.collapse(h.node,h.offset),u.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=u.bidiLevel)}else if(m.extend){m.collapse(h.node,h.offset);try{m.extend(f.node,f.offset)}catch{}}else{let v=document.createRange();u.anchor>u.head&&([h,f]=[f,h]),v.setEnd(f.node,f.offset),v.setStart(h.node,h.offset),m.removeAllRanges(),m.addRange(v)}o&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(h,f)),this.impreciseAnchor=h.precise?null:new rl(p.anchorNode,p.anchorOffset),this.impreciseHead=f.precise?null:new rl(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Lg(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=jm(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let u=this.coordsAt(n.head,-1),h=this.coordsAt(n.head,1);if(!u||!h||u.bottom>h.top)return;let f=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(f.node,f.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[n];else{let o=eu(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==r.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!vi.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let o=0,l=i;;o++){let u=r.children[o];if(u.dom==s)return l;l+=u.length+u.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,s=!1,o,l=-1,u=!1;return this.tile.blockTiles((h,f)=>{if(h.isWidget()){if(h.flags&32&&f>=e)return!0;h.flags&16&&(s=!0)}else{let p=f+h.length;if(f<=e&&(r=h,i=e-f,s=p<e),p>=e&&!o&&(o=h,l=e-f,u=f>e),f>e&&o)return!0}}),!r&&!o?this.domAtPos(e,n):(s&&o?r=null:u&&r&&(o=null),r&&n<0||!o?r.domIn(i,n):o.domIn(l,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof M3?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let u=i(l,o);if(u)return u}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=ki(s.text,o);if(l==o)return null;let u=mv(s.dom,o,l).getClientRects();for(let h=0;h<u.length;h++){let f=u[h];if(h==u.length-1||f.top<f.bottom&&f.left<f.right)return f}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,u=this.view.textDirection==ur.LTR,h=0,f=(p,m,v)=>{for(let b=0;b<p.children.length&&!(m>i);b++){let x=p.children[b],w=m+x.length,S=x.dom.getBoundingClientRect(),{height:_}=S;if(v&&!b&&(h+=S.top-v.top),x instanceof Th)w>r&&f(x,m,S);else if(m>=r&&(h>0&&n.push(-h),n.push(_+h),h=0,o)){let T=x.dom.lastChild,C=T?Pg(T):[];if(C.length){let j=C[C.length-1],A=u?j.right-S.left:S.right-j.left;A>l&&(l=A,this.minWidth=s,this.minWidthFrom=m,this.minWidthTo=w)}}v&&b==p.children.length-1&&(h+=v.bottom-S.bottom),m=w+x.breakAfter}};return f(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?ur.RTL:ur.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,u;for(let h of o.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let f=Pg(h.dom);if(f.length!=1)return;l+=f[0].width,u=f[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:u}}});if(e)return e;let n=document.createElement("div"),r,i,s;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 o=Pg(n.firstChild)[0];r=n.getBoundingClientRect().height,i=o&&o.width?o.width/27:7,s=o&&o.height?o.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],o=s?s.from-1:this.view.state.doc.length;if(o>r){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Ct.replace({widget:new M3(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return Ct.set(e)}updateDeco(){let e=1,n=this.view.state.facet(iS).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(eE).map((s,o)=>{let l=typeof s=="function";return l&&(r=!0),l?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(dn.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(pF).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(hF))try{if(h(this.view,e.range,e))return!0}catch(f){Hs(this.view.state,f,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,n.empty?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 s=tE(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:l,offsetHeight:u}=this.view.scrollDOM;wfe(this.view.scrollDOM,o,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,u),-u),this.view.textDirection==ur.LTR)}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Ck(this.tile)}}function Ck(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)Ck(r,e)}}function Yfe(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function bF(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=Gq(n.focusNode,n.focusOffset),i=Kq(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let l=vi.get(i.node);if(!l||l.isText()&&l.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let u=vi.get(r.node);!u||u.isText()&&u.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function Xfe(t,e,n){let r=bF(t,n);if(!r)return null;let{node:i,from:s,to:o}=r,l=i.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(r.from,r.to)!=l)return null;let u=e.invertedDesc;return{range:new po(u.mapPos(s),u.mapPos(o),s,o),text:i}}function Gfe(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let Kfe=class{constructor(){this.changes=[]}compareRange(e,n){qp(e,n,this.changes)}comparePoint(e,n){qp(e,n,this.changes)}boundChange(e){qp(e,e,this.changes)}};function Zfe(t,e,n){let r=new Kfe;return dn.compare(t,e,n,r),r.changes}class Jfe{constructor(){this.changes=[]}compareRange(e,n){qp(e,n,this.changes)}comparePoint(){}boundChange(e){qp(e,e,this.changes)}}function epe(t,e,n){let r=new Jfe;return dn.compare(t,e,n,r),r.changes}function tpe(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function npe(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class M3 extends fl{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function rpe(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return $e.cursor(e);s==0?n=1:s==i.length&&(n=-1);let o=s,l=s;n<0?o=ki(i.text,s,!1):l=ki(i.text,s);let u=r(i.text.slice(o,l));for(;o>0;){let h=ki(i.text,o,!1);if(r(i.text.slice(h,o))!=u)break;o=h}for(;l<i.length;){let h=ki(i.text,l);if(r(i.text.slice(l,h))!=u)break;l=h}return $e.range(o+i.from,l+i.from)}function ipe(t,e,n,r,i){let s=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,u=Math.floor((i-n.top-(t.defaultLineHeight-l)*.5)/l);s+=u*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+pk(o,s,t.state.tabSize)}function kk(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==hs.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function spe(t,e,n,r){let i=kk(t,e.head,e.assoc||-1),s=!r||i.type!=hs.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(i.from),u=t.posAtCoords({x:n==(l==ur.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(u!=null)return $e.cursor(u,n?-1:1)}return $e.cursor(n?i.to:i.from,n?-1:1)}function KD(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),o=t.textDirectionAt(i.from);for(let l=e,u=null;;){let h=Dfe(i,s,o,l,n),f=nF;if(!h){if(i.number==(n?t.state.doc.lines:1))return l;f=`
`,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),h=t.visualLineSide(i,!n)}if(u){if(!u(f))return l}else{if(!r)return h;u=r(f)}l=h}}function ape(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let o=r(s);return i==Rr.Space&&(i=o),i==o}}function ope(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return $e.cursor(i,e.assoc);let o=e.goalColumn,l,u=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(i,e.assoc||-1),f=t.documentTop;if(h)o==null&&(o=h.left-u.left),l=s<0?h.top:h.bottom;else{let b=t.viewState.lineBlockAt(i);o==null&&(o=Math.min(u.right-u.left,t.defaultCharacterWidth*(i-b.from))),l=(s<0?b.top:b.bottom)+f}let p=u.left+o,m=r??t.viewState.heightOracle.textHeight>>1,v=Ok(t,{x:p,y:l+m*s},!1,s);return $e.cursor(v.pos,v.assoc,void 0,o)}function $g(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let u=r||n||(e-s<o-e?-1:1);e=u<0?s:o,r=u}});if(!r)return e}}function yF(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let o=$g(t,i.from,0);o!=i.from&&(s=$e.cursor(o,-1))}else{let o=$g(t,i.from,-1),l=$g(t,i.to,1);(o!=i.from||l!=i.to)&&(s=$e.range(i.from==i.anchor?o:l,i.from==i.head?o:l))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?$e.create(n,e.mainIndex):e}function R3(t,e,n){let r=$g(t.state.facet(ab).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:$e.cursor(r,r<n.from?1:-1)}class zl{constructor(e,n){this.pos=e,this.assoc=n}}function Ok(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:o,y:l}=e,u=l-s,h;for(;;){if(u<0)return new zl(0,1);if(u>t.viewState.docHeight)return new zl(t.state.doc.length,-1);if(h=t.elementAtHeight(u),r==null)break;if(h.type==hs.Text){if(r<0?h.to<t.viewport.from:h.from>t.viewport.to)break;let m=t.docView.coordsAt(r<0?h.from:h.to,r);if(m&&(r<0?m.top<=u+s:m.bottom>=u+s))break}let p=t.viewState.heightOracle.textHeight/2;u=r>0?h.bottom+p:h.top-p}if(t.viewport.from>=h.to||t.viewport.to<=h.from){if(n)return null;if(h.type==hs.Text){let p=ipe(t,i,h,o,l);return new zl(p,p==h.from?1:-1)}}if(h.type!=hs.Text)return u<(h.top+h.bottom)/2?new zl(h.from,1):new zl(h.to,-1);let f=t.docView.lineAt(h.from,2);return(!f||f.length!=h.length)&&(f=t.docView.lineAt(h.from,-2)),xF(t,f,h.from,o,l)}function xF(t,e,n,r,i){let s=-1,o=null,l=1e9,u=1e9,h=i,f=i,p=(m,v)=>{for(let b=0;b<m.length;b++){let x=m[b];if(x.top==x.bottom)continue;let w=x.left>r?x.left-r:x.right<r?r-x.right:0,S=x.top>i?x.top-i:x.bottom<i?i-x.bottom:0;x.top<=f&&x.bottom>=h&&(h=Math.min(x.top,h),f=Math.max(x.bottom,f),S=0),(s<0||(S-u||w-l)<0)&&(s>=0&&u&&l<w&&o.top<=f-2&&o.bottom>=h+2?u=0:(s=v,l=w,u=S,o=x))}};if(e.isText()){for(let v=0;v<e.length;){let b=ki(e.text,v);if(p(mv(e.dom,v,b).getClientRects(),v),!l&&!u)break;v=b}return r>(o.left+o.right)/2==(ZD(t,s+n)==ur.LTR)?new zl(n+ki(e.text,s),-1):new zl(n+s,1)}else{if(!e.length)return new zl(n,1);for(let x=0;x<e.children.length;x++){let w=e.children[x];if(w.flags&48)continue;let S=(w.dom.nodeType==1?w.dom:mv(w.dom,0,w.length)).getClientRects();if(p(S,x),!l&&!u)break}let m=e.children[s],v=e.posBefore(m,n);return m.isComposite()||m.isText()?xF(t,m,v,Math.max(o.left,Math.min(o.right,r)),i):r>(o.left+o.right)/2==(ZD(t,s+n)==ur.LTR)?new zl(v+m.length,-1):new zl(v,1)}}function ZD(t,e){let n=t.state.doc.lineAt(e);return t.bidiSpans(n)[Vc.find(t.bidiSpans(n),e-n.from,-1,1)].dir}const bg="";class lpe{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(gn.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=bg}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let o=vi.get(i),l=i.nextSibling;if(l==n){o!=null&&o.breakAfter&&!l&&r!=this.view.contentDOM&&this.lineBreak();break}let u=vi.get(l);(o&&u?o.breakAfter:(o?o.breakAfter:Jx(i))||Jx(l)&&(i.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!upe(l,n)&&this.lineBreak(),i=l}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(l=i.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=o-1);r=s+o}}readNode(e){let n=vi.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(cpe(e,r.node,r.offset)?n:0))}}function cpe(t,e,n){for(;;){if(!e||n<eu(e))return!1;if(e==t)return!0;n=Lh(e)+1,e=e.parentNode}}function upe(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=vi.get(t);if(!(r!=null&&r.isWidget()))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i!=null&&i.length)return!1}return!0}class JD{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class hpe{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=wF(e.docView.tile,n,r,0))){let l=s||o?[]:fpe(e),u=new lpe(l,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=ppe(l,this.bounds.from)}else{let l=e.observer.selectionRange,u=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!wk(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!wk(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),f=e.viewport;if((pt.ios||pt.chrome)&&e.state.selection.main.empty&&u!=h&&(f.from>0||f.to<e.state.doc.length)){let p=Math.min(u,h),m=Math.max(u,h),v=f.from-p,b=f.to-m;(v==0||v==1||p==0)&&(b==0||b==-1||m==e.state.doc.length)&&(u=0,h=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange($e.range(h,u)):this.newSel=$e.single(h,u)}}}function wF(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,o=-1,l=-1;for(let u=0,h=r,f=r;u<t.children.length;u++){let p=t.children[u],m=h+p.length;if(h<e&&m>n)return wF(p,e,n,h);if(m>=e&&i==-1&&(i=u,s=h),h>n&&p.dom.parentNode==t.dom){o=u,l=f;break}f=m,h=m+p.breakAfter}return{from:s,to:l<0?r+t.length:l,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function SF(t,e){let n,{newSel:r}=e,i=t.state.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,u=i.from,h=null;(s===8||pt.android&&e.text.length<l-o)&&(u=i.to,h="end");let f=jF(t.state.doc.sliceString(o,l,bg),e.text,u-o,h);f&&(pt.chrome&&s==13&&f.toB==f.from+2&&e.text.slice(f.from,f.toB)==bg+bg&&f.toB--,n={from:o+f.from,to:o+f.toA,insert:jn.of(e.text.slice(f.from,f.toB).split(bg))})}else r&&(!t.hasFocus&&t.state.facet(Fc)||rw(r,i))&&(r=null);if(!n&&!r)return!1;if(!n&&e.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,i.to)}:(pt.mac||pt.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=$e.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:jn.of([n.insert.toString().replace("."," ")])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:t.state.doc.lineAt(i.from).to<i.to&&t.docView.lineHasWidget(i.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:i.from,to:i.to,insert:t.state.toText(t.inputState.insertingText)}:pt.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
 `&&t.lineWrapping&&(r&&(r=$e.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:jn.of([" "])}),n)return nE(t,n,r,s);if(r&&!rw(r,i)){let o=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=yF(t.state.facet(ab).map(u=>u(t)),r))),t.dispatch({selection:r,scrollIntoView:o,userEvent:l}),!0}else return!1}function nE(t,e,n,r=-1){if(pt.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(pt.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Fp(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&Fp(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Fp(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=dpe(t,e,n));return t.state.facet(oF).some(u=>u(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function dpe(t,e,n){let r,i=t.state,s=i.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let u=e.from<s.from?-1:1,h=u<0?s.from:s.to,f=$g(i.facet(ab).map(p=>p(t)),h,u);e.from==f&&(o=f)}if(o>-1)r={changes:e,selection:$e.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let u=s.from<e.from?i.sliceDoc(s.from,e.from):"",h=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(u+e.insert.sliceString(0,void 0,t.state.lineBreak)+h))}else{let u=i.changes(e),h=n&&n.main.to<=u.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let f=t.state.sliceDoc(e.from,e.to),p,m=n&&bF(t,n.main.head);if(m){let b=e.insert.length-(e.to-e.from);p={from:m.from,to:m.to-b}}else p=t.state.doc.lineAt(s.head);let v=s.to-e.to;r=i.changeByRange(b=>{if(b.from==s.from&&b.to==s.to)return{changes:u,range:h||b.map(u)};let x=b.to-v,w=x-f.length;if(t.state.sliceDoc(w,x)!=f||x>=p.from&&w<=p.to)return{range:b};let S=i.changes({from:w,to:x,insert:e.insert}),_=b.to-s.to;return{changes:S,range:h?$e.range(Math.max(0,h.anchor+_),Math.max(0,h.head+_)):b.map(S)}})}else r={changes:u,selection:h&&i.selection.replaceRange(h)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:l,scrollIntoView:!0})}function jF(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(r=="end"){let u=Math.max(0,s-Math.min(o,l));n-=o+u-s}if(o<s&&t.length<e.length){let u=n<=s&&n>=o?s-n:0;s-=u,l=s+(l-o),o=s}else if(l<s){let u=n<=s&&n>=l?s-n:0;s-=u,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function fpe(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new JD(n,r)),(i!=n||s!=r)&&e.push(new JD(i,s))),e}function ppe(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?$e.single(n+e,r+e):null}function rw(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class mpe{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 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=e.hasFocus,pt.safari&&e.contentDOM.addEventListener("input",()=>null),pt.gecko&&Ape(e.contentDOM.ownerDocument)}handleEvent(e){!jpe(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];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(e){let n=gpe(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=r[s];l&&o!=!l.handlers.length&&(i.removeEventListener(s,this.handleEvent),l=null),l||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&TF.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),pt.android&&pt.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return pt.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=_F.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||vpe.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Fp(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:pt.safari&&!pt.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function eN(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Hs(n.state,i)}}}function gpe(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,o=i&&i.plugin.domEventObservers;if(s)for(let l in s){let u=s[l];u&&n(l).handlers.push(eN(r.value,u))}if(o)for(let l in o){let u=o[l];u&&n(l).observers.push(eN(r.value,u))}}for(let r in hl)n(r).handlers.push(hl[r]);for(let r in wo)n(r).observers.push(wo[r]);return e}const _F=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],vpe="dthko",TF=[16,17,18,20,91,92,224,225],t1=6;function n1(t){return Math.max(0,t)*.7+8}function bpe(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class ype{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Sfe(e.contentDOM),this.atoms=e.state.facet(ab).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(gn.allowMultipleSelections)&&xpe(e,n),this.dragging=Spe(e,n)&&OF(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&bpe(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let u=tE(this.view);e.clientX-u.left<=i+t1?n=-n1(i-e.clientX):e.clientX+u.right>=o-t1&&(n=n1(e.clientX-o)),e.clientY-u.top<=s+t1?r=-n1(s-e.clientY):e.clientY+u.bottom>=l-t1&&(r=n1(e.clientY-l)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=yF(this.atoms,this.style.get(e,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(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function xpe(t,e){let n=t.state.facet(rF);return n.length?n[0](e):pt.mac?e.metaKey:e.ctrlKey}function wpe(t,e){let n=t.state.facet(iF);return n.length?n[0](e):pt.mac?!e.altKey:!e.ctrlKey}function Spe(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=jm(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let o=i[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function jpe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=vi.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const hl=Object.create(null),wo=Object.create(null),CF=pt.ie&&pt.ie_version<15||pt.ios&&pt.webkit_version<604;function _pe(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),kF(t,n.value)},50)}function oS(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function kF(t,e){e=oS(t.state,K4,e);let{state:n}=t,r,i=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(Ek!=null&&n.selection.ranges.every(u=>u.empty)&&Ek==s.toString()){let u=-1;r=n.changeByRange(h=>{let f=n.doc.lineAt(h.from);if(f.from==u)return{range:h};u=f.from;let p=n.toText((o?s.line(i++).text:e)+n.lineBreak);return{changes:{from:f.from,insert:p},range:$e.cursor(h.from+p.length)}})}else o?r=n.changeByRange(u=>{let h=s.line(i++);return{changes:{from:u.from,to:u.to,insert:h.text},range:$e.cursor(u.from+h.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}wo.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};hl.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);wo.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};wo.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};hl.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(sF))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=Cpe(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new ype(t,e,n,r)),r&&t.observer.ignore(()=>{Yq(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function tN(t,e,n,r){if(r==1)return $e.cursor(e,n);if(r==2)return rpe(t.state,e,n);{let i=t.docView.lineAt(e,n),s=t.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,l=i?i.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,$e.range(o,l)}}const Tpe=pt.ie&&pt.ie_version<=11;let nN=null,rN=0,iN=0;function OF(t){if(!Tpe)return t.detail;let e=nN,n=iN;return nN=t,iN=Date.now(),rN=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(rN+1)%3:1}function Cpe(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=OF(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,o,l){let u=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),h,f=tN(t,u.pos,u.assoc,r);if(n.pos!=u.pos&&!o){let p=tN(t,n.pos,n.assoc,r),m=Math.min(p.from,f.from),v=Math.max(p.to,f.to);f=m<f.from?$e.range(m,v):$e.range(v,m)}return o?i.replaceRange(i.main.extend(f.from,f.to)):l&&r==1&&i.ranges.length>1&&(h=kpe(i,u.pos))?h:l?i.addRange(f):$e.create([f])}}}function kpe(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return $e.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}hl.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,o=s+i.length;(s>=n.to||o<=n.from)&&(n=$e.range(s,o))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",oS(t.state,Z4,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};hl.dragend=t=>(t.inputState.draggedContent=null,!1);function sN(t,e,n,r){if(n=oS(t.state,K4,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=r&&s&&wpe(t,e)?{from:s.from,to:s.to}:null,l={from:i,insert:n},u=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}hl.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&sN(t,e,r.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<n.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return sN(t,e,r,!0),!0}return!1};hl.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=CF?null:e.clipboardData;return n?(kF(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(_pe(t),!1)};function Ope(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function Epe(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>i&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),i=o.number}r=!0}return{text:oS(t,Z4,e.join(t.lineBreak)),ranges:n,linewise:r}}let Ek=null;hl.copy=hl.cut=(t,e)=>{let n=jm(t.root);if(n&&!Ng(t.contentDOM,n))return!1;let{text:r,ranges:i,linewise:s}=Epe(t.state);if(!r&&!s)return!1;Ek=s?r:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=CF?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",r),!0):(Ope(t,r),!1)};const EF=ic.define();function AF(t,e){let n=[];for(let r of t.facet(lF)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:EF.of(!0)}):null}function MF(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=AF(t.state,e);n?t.dispatch(n):t.update([])}},10)}wo.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),MF(t)};wo.blur=t=>{t.observer.clearSelectionRange(),MF(t)};wo.compositionstart=wo.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};wo.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,pt.chrome&&pt.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};wo.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};hl.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],u=t.posAtDOM(l.startContainer,l.startOffset),h=t.posAtDOM(l.endContainer,l.endOffset);return nE(t,{from:u,to:h,insert:t.state.toText(s)},null),!0}}let i;if(pt.chrome&&pt.android&&(i=_F.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return pt.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),pt.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>wo.compositionend(t,e),20),!1};const aN=new Set;function Ape(t){aN.has(t)||(aN.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const oN=["pre-wrap","normal","pre-line","break-spaces"];let Cm=!1;function lN(){Cm=!1}class Mpe{constructor(e){this.lineWrapping=e,this.doc=jn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return oN.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,s,o){let l=oN.indexOf(e)>-1,u=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,u){this.heightSamples={};for(let h=0;h<o.length;h++){let f=o[h];f<0?h++:this.heightSamples[Math.floor(f*10)]=!0}}return u}}class Rpe{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Zo{constructor(e,n,r,i,s){this.from=e,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?hs.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 mf?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Zo(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var gr=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(gr||(gr={}));const tx=.001;class Qs{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>tx&&(Cm=!0),this.height=e)}replace(e,n,r){return Qs.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,o=r.doc;for(let l=i.length-1;l>=0;l--){let{fromA:u,toA:h,fromB:f,toB:p}=i[l],m=s.lineAt(u,gr.ByPosNoHeight,r.setDoc(n),0,0),v=m.to>=h?m:s.lineAt(h,gr.ByPosNoHeight,r,0,0);for(p+=v.to-h,h=v.to;l>0&&m.from<=i[l-1].toA;)u=i[l-1].fromA,f=i[l-1].fromB,l--,u<m.from&&(m=s.lineAt(u,gr.ByPosNoHeight,r,0,0));f+=m.from-u,u=m.from;let b=rE.build(r.setDoc(o),e,f,p);s=iw(s,s.replace(u,h,b))}return s.updateHeight(r,0)}static empty(){return new La(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,s=0;for(;;)if(n==r)if(i>s*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),r+=1+l.break,i-=l.size}else if(s>i*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,s-=l.size}else break;else if(i<s){let l=e[n++];l&&(i+=l.size)}else{let l=e[--r];l&&(s+=l.size)}let o=0;return e[n-1]==null?(o=1,n--):e[n]==null&&(o=1,r++),new Npe(Qs.of(e.slice(0,n)),o,Qs.of(e.slice(r)))}}function iw(t,e){return t==e?t:(t.constructor!=e.constructor&&(Cm=!0),e)}Qs.prototype.size=1;const Dpe=Ct.replace({});class RF extends Qs{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Zo(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new Zo(i,0,r,this.spaceAbove,Dpe):this.mainBlock(r,i)}lineAt(e,n,r,i,s){let o=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(o):o}forEachLine(e,n,r,i,s,o){e<=s+this.length&&n>=s&&o(this.lineAt(0,gr.ByPos,r,i,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,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 La extends RF{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new Zo(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof La||i instanceof ss&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof ss?i=new La(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Qs.of(r)}updateHeight(e,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,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ss extends Qs{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,o,l=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*s);o=u/s,this.length>s+1&&(l=(this.height-u)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:l}}blockAt(e,n,r,i){let{firstLine:s,lastLine:o,perLine:l,perChar:u}=this.heightMetrics(n,i);if(n.lineWrapping){let h=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),f=n.doc.lineAt(h),p=l+f.length*u,m=Math.max(r,e-p/2);return new Zo(f.from,f.length,m,p,0)}else{let h=Math.max(0,Math.min(o-s,Math.floor((e-r)/l))),{from:f,length:p}=n.doc.line(s+h);return new Zo(f,p,r+l*h,l,0)}}lineAt(e,n,r,i,s){if(n==gr.ByHeight)return this.blockAt(e,r,i,s);if(n==gr.ByPosNoHeight){let{from:v,to:b}=r.doc.lineAt(e);return new Zo(v,b-v,0,0,0)}let{firstLine:o,perLine:l,perChar:u}=this.heightMetrics(r,s),h=r.doc.lineAt(e),f=l+h.length*u,p=h.number-o,m=i+l*p+u*(h.from-s-p);return new Zo(h.from,h.length,Math.max(i,Math.min(m,i+this.height-f)),f,0)}forEachLine(e,n,r,i,s,o){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:l,perLine:u,perChar:h}=this.heightMetrics(r,s);for(let f=e,p=i;f<=n;){let m=r.doc.lineAt(f);if(f==e){let b=m.number-l;p+=u*b+h*(e-s-b)}let v=u+h*m.length;o(new Zo(m.from,m.length,p,v,0)),p+=v,f=m.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let s=r[r.length-1];s instanceof ss?r[r.length-1]=new ss(s.length+i):r.push(null,new ss(i-1))}if(e>0){let s=r[0];s instanceof ss?r[0]=new ss(e+s.length):r.unshift(new ss(e-1),null)}return Qs.of(r)}decomposeLeft(e,n){n.push(new ss(e-1),null)}decomposeRight(e,n){n.push(null,new ss(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let o=[],l=Math.max(n,i.from),u=-1;for(i.from>n&&o.push(new ss(i.from-n-1).updateHeight(e,n));l<=s&&i.more;){let f=e.doc.lineAt(l).length;o.length&&o.push(null);let p=i.heights[i.index++],m=0;p<0&&(m=-p,p=i.heights[i.index++]),u==-1?u=p:Math.abs(p-u)>=tx&&(u=-2);let v=new La(f,p,m);v.outdated=!1,o.push(v),l+=f+1}l<=s&&o.push(null,new ss(s-l).updateHeight(e,l));let h=Qs.of(o);return(u<0||Math.abs(h.height-this.height)>=tx||Math.abs(u-this.heightMetrics(e,n).perLine)>=tx)&&(Cm=!0),iw(this,h)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Npe extends Qs{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,s,i+this.left.length+this.break)}lineAt(e,n,r,i,s){let o=i+this.left.height,l=s+this.left.length+this.break,u=n==gr.ByHeight?e<o:e<l,h=u?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,o,l);if(this.break||(u?h.to<l:h.from>l))return h;let f=n==gr.ByPosNoHeight?gr.ByPosNoHeight:gr.ByPos;return u?h.join(this.right.lineAt(l,f,r,o,l)):this.left.lineAt(l,f,r,i,s).join(h)}forEachLine(e,n,r,i,s,o){let l=i+this.left.height,u=s+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,n,r,i,s,o),n>=u&&this.right.forEachLine(e,n,r,l,u,o);else{let h=this.lineAt(u,gr.ByPos,r,i,s);e<h.from&&this.left.forEachLine(e,h.from-1,r,i,s,o),h.to>=e&&h.from<=n&&o(h),n>h.to&&this.right.forEachLine(h.to+1,n,r,l,u,o)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of r)s.push(l);if(e>0&&cN(s,o-1),n<this.length){let l=s.length;this.decomposeRight(n,s),cN(s,l)}return Qs.of(s)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?Qs.of(this.break?[e,null,n]:[e,n]):(this.left=iw(this.left,e),this.right=iw(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:o}=this,l=n+s.length+this.break,u=null;return i&&i.from<=n+s.length&&i.more?u=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=l+o.length&&i.more?u=o=o.updateHeight(e,l,r,i):o.updateHeight(e,l,r),u?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function cN(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof ss&&(r=t[e+1])instanceof ss&&t.splice(e-1,3,new ss(n.length+1+r.length))}const Ppe=5;class rE{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof La?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new La(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=n-e;r.block?this.addBlock(new RF(o,i,r)):(o||s||i>=Ppe)&&this.addLineDeco(i,s,o)}else n>e&&this.span(e,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:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new La(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new ss(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof La)return e;let n=new La(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof La)&&!this.isCovered?this.nodes.push(new La(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof La&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new rE(r,e);return dn.spans(n,r,i,s,0),s.finish(r)}}function Lpe(t,e,n){let r=new $pe;return dn.compare(t,e,n,r,0),r.changes}class $pe{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&qp(e,n,this.changes,5)}}function Ipe(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),l=Math.max(0,n.top),u=Math.min(i.innerHeight,n.bottom);for(let h=t.parentNode;h&&h!=r.body;)if(h.nodeType==1){let f=h,p=window.getComputedStyle(f);if((f.scrollHeight>f.clientHeight||f.scrollWidth>f.clientWidth)&&p.overflow!="visible"){let m=f.getBoundingClientRect();s=Math.max(s,m.left),o=Math.min(o,m.right),l=Math.max(l,m.top),u=Math.min(h==t.parentNode?i.innerHeight:u,m.bottom)}h=p.position=="absolute"||p.position=="fixed"?f.offsetParent:f.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+e),bottom:Math.max(l,u)-(n.top+e)}}function Bpe(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function zpe(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class D3{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,n){return Ct.replace({widget:new qpe(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class qpe extends fl{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class uN{constructor(e){this.state=e,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.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=hN,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ur.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(J4).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Mpe(n),this.stateDeco=dN(e),this.heightMap=Qs.empty().applyChanges(this.stateDeco,jn.empty,this.heightOracle.setDoc(e.doc),[new po(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ct.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new r1(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?hN:new iE(this.heightOracle,this.heightMap,this.viewports),e.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,e=>{this.viewportLines.push(yg(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=dN(this.state);let i=e.changedRanges,s=po.extendWithRanges(i,Lpe(r,this.stateDeco,e?e.changes:Ci.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);lN(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Cm)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let u=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<u.from||n.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,n));let h=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(uF)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?ur.RTL:ur.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent,l=n.getBoundingClientRect(),u=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,f=0;if(l.width&&l.height){let{scaleX:C,scaleY:j}=Wq(n,l);(C>.005&&Math.abs(this.scaleX-C)>.005||j>.005&&Math.abs(this.scaleY-j)>.005)&&(this.scaleX=C,this.scaleY=j,h|=16,o=u=!0)}let p=(parseInt(r.paddingTop)||0)*this.scaleY,m=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=m)&&(this.paddingTop=p,this.paddingBottom=m,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let v=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=v&&(this.scrollAnchorHeight=-1,this.scrollTop=v),this.scrolledToBottom=Xq(e.scrollDOM);let b=(this.printing?zpe:Ipe)(n,this.paddingTop),x=b.top-this.pixelViewport.top,w=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let S=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(S!=this.inView&&(this.inView=S,S&&(u=!0)),!this.inView&&!this.scrollTarget&&!Bpe(e.dom))return 0;let _=l.width;if((this.contentDOMWidth!=_||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),u){let C=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(C)&&(o=!0),o||i.lineWrapping&&Math.abs(_-this.contentDOMWidth)>i.charWidth){let{lineHeight:j,charWidth:A,textHeight:E}=e.docView.measureTextSize();o=j>0&&i.refresh(s,j,A,E,Math.max(5,_/A),C),o&&(e.docView.minWidth=0,h|=16)}x>0&&w>0?f=Math.max(x,w):x<0&&w<0&&(f=Math.min(x,w)),lN();for(let j of this.viewports){let A=j.from==this.viewport.from?C:e.docView.measureVisibleLineHeights(j);this.heightMap=(o?Qs.empty().applyChanges(this.stateDeco,jn.empty,this.heightOracle,[new po(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new Rpe(j.from,A))}Cm&&(h|=2)}let T=!this.viewportIsAppropriate(this.viewport,f)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return T&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(f,this.scrollTarget),h|=this.updateForViewport()),(h&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,u=new r1(i.lineAt(o-r*1e3,gr.ByHeight,s,0,0).from,i.lineAt(l+(1-r)*1e3,gr.ByHeight,s,0,0).to);if(n){let{head:h}=n.range;if(h<u.from||h>u.to){let f=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=i.lineAt(h,gr.ByPos,s,0,0),m;n.y=="center"?m=(p.top+p.bottom)/2-f/2:n.y=="start"||n.y=="nearest"&&h<u.from?m=p.top:m=p.bottom-f,u=new r1(i.lineAt(m-1e3/2,gr.ByHeight,s,0,0).from,i.lineAt(m+f+1e3/2,gr.ByHeight,s,0,0).to)}}return u}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new r1(this.heightMap.lineAt(r,gr.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,gr.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,gr.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,gr.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||i<=o-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new D3(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,o=i<<1;if(this.defaultTextDirection!=ur.LTR&&!r)return[];let l=[],u=(f,p,m,v)=>{if(p-f<s)return;let b=this.state.selection.main,x=[b.from];b.empty||x.push(b.to);for(let S of x)if(S>f&&S<p){u(f,S-10,m,v),u(S+10,p,m,v);return}let w=Hpe(e,S=>S.from>=m.from&&S.to<=m.to&&Math.abs(S.from-f)<s&&Math.abs(S.to-p)<s&&!x.some(_=>S.from<_&&S.to>_));if(!w){if(p<m.to&&n&&r&&n.visibleRanges.some(T=>T.from<=p&&T.to>=p)){let T=n.moveToLineBoundary($e.cursor(p),!1,!0).head;T>f&&(p=T)}let S=this.gapSize(m,f,p,v),_=r||S<2e6?S:2e6;w=new D3(f,p,S,_)}l.push(w)},h=f=>{if(f.length<o||f.type!=hs.Text)return;let p=Fpe(f.from,f.to,this.stateDeco);if(p.total<o)return;let m=this.scrollTarget?this.scrollTarget.range.head:null,v,b;if(r){let x=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,S;if(m!=null){let _=s1(p,m),T=((this.visibleBottom-this.visibleTop)/2+x)/f.height;w=_-T,S=_+T}else w=(this.visibleTop-f.top-x)/f.height,S=(this.visibleBottom-f.top+x)/f.height;v=i1(p,w),b=i1(p,S)}else{let x=p.total*this.heightOracle.charWidth,w=i*this.heightOracle.charWidth,S=0;if(x>2e6)for(let A of e)A.from>=f.from&&A.from<f.to&&A.size!=A.displaySize&&A.from*this.heightOracle.charWidth+S<this.pixelViewport.left&&(S=A.size-A.displaySize);let _=this.pixelViewport.left+S,T=this.pixelViewport.right+S,C,j;if(m!=null){let A=s1(p,m),E=((T-_)/2+w)/x;C=A-E,j=A+E}else C=(_-w)/x,j=(T+w)/x;v=i1(p,C),b=i1(p,j)}v>f.from&&u(f.from,v,f,p),b<f.to&&u(b,f.to,f,p)};for(let f of this.viewportLines)Array.isArray(f.type)?f.type.forEach(h):h(f);return l}gapSize(e,n,r,i){let s=s1(i,r)-s1(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){D3.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Ct.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];dn.spans(n,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let o=this.visibleRanges[s],l=r[s];(o.from!=l.from||o.to!=l.to)&&(i|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||yg(this.heightMap.lineAt(e,gr.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||yg(this.heightMap.lineAt(this.scaler.fromDOM(e),gr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return yg(this.heightMap.blockAt(this.scaler.fromDOM(e),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 r1{constructor(e,n){this.from=e,this.to=n}}function Fpe(t,e,n){let r=[],i=t,s=0;return dn.spans(n,t,e,{span(){},point(o,l){o>i&&(r.push({from:i,to:o}),s+=o-i),i=l}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function i1({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:o}=e[i],l=o-s;if(r<=l)return s+r;r-=l}}function s1(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function Hpe(t,e){for(let n of t)if(e(n))return n}const hN={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function dN(t){let e=t.facet(iS).filter(r=>typeof r!="function"),n=t.facet(eE).filter(r=>typeof r!="function");return n.length&&e.push(dn.join(n)),e}class iE{constructor(e,n,r){let i=0,s=0,o=0;this.viewports=r.map(({from:l,to:u})=>{let h=n.lineAt(l,gr.ByPos,e,0,0).top,f=n.lineAt(u,gr.ByPos,e,0,0).bottom;return i+=f-h,{from:l,to:u,top:h,bottom:f,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof iE?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function yg(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Zo(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>yg(i,e)):t._content)}const a1=ft.define({combine:t=>t.join(" ")}),Ak=ft.define({combine:t=>t.indexOf(!0)>-1}),Mk=Nh.newName(),DF=Nh.newName(),NF=Nh.newName(),PF={"&light":"."+DF,"&dark":"."+NF};function Rk(t,e,n){return new Nh(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const Vpe=Rk("."+Mk,{"&":{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":{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-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"}},PF),Upe={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},N3=pt.ie&&pt.ie_version<=11;class Qpe{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new jfe,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=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(pt.ie&&pt.ie_version<=11||pt.ios&&e.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&&pt.android&&e.constructor.EDIT_CONTEXT!==!1&&!(pt.chrome&&pt.chrome_version<126)&&(this.editContext=new Ype(e),e.state.facet(Fc)&&(e.contentDOM.editContext=this.editContext.editContext)),N3&&(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(e.scrollDOM)),this.addWindowListeners(this.win=e.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(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Fc)?r.root.activeElement!=this.dom:!Ng(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(pt.ie&&pt.ie_version<=11||pt.android&&pt.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Lg(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=jm(e.root);if(!n)return!1;let r=pt.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Wpe(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=Ng(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Tfe(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),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(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,Upe),N3&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),N3&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Fp(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,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 e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),n==-1?{from:n,to:r}=o:(n=Math.min(o.from,n),r=Math.max(o.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Ng(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new hpe(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=SF(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!rw(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=fN(n,e.previousSibling||e.target.previousSibling,-1),i=fN(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Fc)!=e.state.facet(Fc)&&(e.view.contentDOM.editContext=e.state.facet(Fc)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.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 fN(t,e,n){for(;e;){let r=vi.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function pN(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return Lg(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function Wpe(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return pN(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?pN(t,n):null}class Ype{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,l=this.toEditorPos(r.updateRangeStart),u=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:l,drifted:!1});let h=u-l>r.text.length;l==this.from&&s<this.from?l=s:u==this.to&&s>this.to&&(u=s);let f=jF(e.state.sliceDoc(l,u),r.text,(h?i.from:i.to)-l,h?"end":null);if(!f){let m=$e.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));rw(m,i)||e.dispatch({selection:m,userEvent:"select"});return}let p={from:f.from+l,to:f.toA+l,insert:jn.of(r.text.slice(f.from,f.toB).split(`
`))};if((pt.mac||pt.android)&&p.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:l,to:u,insert:jn.of([r.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let m=this.to-this.from+(p.to-p.from+p.insert.length);nE(e,p,$e.single(this.toEditorPos(r.selectionStart,m),this.toEditorPos(r.selectionEnd,m)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.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=[],s=null;for(let o=this.toEditorPos(r.rangeStart),l=this.toEditorPos(r.rangeEnd);o<l;o++){let u=e.coordsForChar(o);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let u=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(u<h){let f=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;i.push(Ct.mark({attributes:{style:f}}).range(u,h))}}}e.dispatch({effects:dF.of(Ct.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=jm(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,l,u,h)=>{if(r)return;let f=h.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(h)){i=this.pendingContextChange=null,n+=f,this.to+=f;return}else i=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=f,this.to+=f;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+h.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),h.toString()),this.to+=f}n+=f}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.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(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class it{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(e={}){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),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||_fe(e.parent)||document,this.viewState=new uN(e.state||gn.create(e)),e.scrollTo&&e.scrollTo.is(e1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Tp).map(i=>new O3(i));for(let i of this.plugins)i.update(this);this.observer=new Qpe(this),this.inputState=new mpe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new GD(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=!0,this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof gi?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){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,s=this.state;for(let m of e){if(m.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=m.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,u=null;e.some(m=>m.annotation(EF))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,u=AF(s,o),u||(l=1));let h=this.observer.delayedAndroidKey,f=null;if(h?(this.observer.clearDelayedAndroidKey(),f=this.observer.readChange(),(f&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(f=null)):this.observer.clear(),s.facet(gn.phrases)!=this.state.facet(gn.phrases))return this.setState(s);i=ew.create(this,s,e),i.flags|=l;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let m of e){if(p&&(p=p.map(m.changes)),m.scrollIntoView){let{main:v}=m.state.selection;p=new Hp(v.empty?v:$e.cursor(v.head,v.head>v.anchor?-1:1))}for(let v of m.effects)v.is(e1)&&(p=v.value.clip(this.state))}this.viewState.update(i,p),this.bidiCache=sw.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(vg)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(m=>m.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(a1)!=i.state.facet(a1)&&(this.viewState.mustMeasureContent=!0),(n||r||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let m of this.state.facet(Tk))try{m(i)}catch(v){Hs(this.state,v,"update listener")}(u||f)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),f&&!SF(this,f)&&h.force&&Fp(this.contentDOM,h.key,h.keyCode)})}setState(e){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=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new uN(e),this.plugins=e.facet(Tp).map(r=>new O3(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new GD(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Tp),r=e.state.facet(Tp);if(n!=r){let i=[];for(let s of r){let o=n.indexOf(s);if(o<0)i.push(new O3(s));else{let l=this.plugins[o];l.mustUpdate=e,i.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Hs(this.state,r,"doc view update listener")}}}measure(e=!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,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Xq(r))s=-1,o=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(i);s=v.from,o=v.top}this.updateState=1;let u=this.viewState.measure(this);if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];u&4||([this.measureRequests,h]=[h,this.measureRequests]);let f=h.map(v=>{try{return v.read(this)}catch(b){return Hs(this.state,b),mN}}),p=ew.create(this,this.state,[]),m=!1;p.flags|=u,n?n.flags|=u:n=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),m=this.docView.update(p),m&&this.docViewUpdate());for(let v=0;v<h.length;v++)if(f[v]!=mN)try{let b=h[v];b.write&&b.write(f[v],this)}catch(b){Hs(this.state,b)}if(m&&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,o=-1;continue}else{let b=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(b>1||b<-1){i=i+b,r.scrollTop=i/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Tk))l(n)}get themeClasses(){return Mk+" "+(this.state.facet(Ak)?NF:DF)+" "+this.state.facet(a1)}updateAttrs(){let e=gN(this,fF,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Fc)?"true":"false",class:"cm-content",style:`${pt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),gN(this,J4,n);let r=this.observer.ignore(()=>{let i=VD(this.contentDOM,this.contentAttrs,n),s=VD(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(it.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(vg);let e=this.state.facet(it.cspNonce);Nh.mount(this.root,this.styleModules.concat(Vpe).reverse(),e?{nonce:e}: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(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||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(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return R3(this,e,KD(this,e,n,r))}moveByGroup(e,n){return R3(this,e,KD(this,e,n,r=>ape(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return $e.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return spe(this,e,n,r)}moveVertically(e,n,r){return R3(this,e,ope(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=Ok(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Ok(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[Vc.find(s,e-i.from,-1,n)];return pv(r,o.dir==ur.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(cF)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Xpe)return tF(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||eF(s.isolates,r=WD(this,e))))return s.order;r||(r=WD(this,e));let i=Rfe(e.text,n,r);return this.bidiCache.push(new sw(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||pt.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Yq(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.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(e,n={}){return e1.of(new Hp(typeof e=="number"?$e.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return e1.of(new Hp($e.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Zr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Zr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Nh.newName(),i=[a1.of(r),vg.of(Rk(`.${r}`,e))];return n&&n.dark&&i.push(Ak.of(!0)),i}static baseTheme(e){return lu.lowest(vg.of(Rk("."+Mk,e,PF)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&vi.get(r)||vi.get(e);return((n=i==null?void 0:i.root)===null||n===void 0?void 0:n.view)||null}}it.styleModule=vg;it.inputHandler=oF;it.clipboardInputFilter=K4;it.clipboardOutputFilter=Z4;it.scrollHandler=hF;it.focusChangeEffect=lF;it.perLineTextDirection=cF;it.exceptionSink=aF;it.updateListener=Tk;it.editable=Fc;it.mouseSelectionStyle=sF;it.dragMovesSelection=iF;it.clickAddsSelectionRange=rF;it.decorations=iS;it.blockWrappers=pF;it.outerDecorations=eE;it.atomicRanges=ab;it.bidiIsolatedRanges=mF;it.scrollMargins=gF;it.darkTheme=Ak;it.cspNonce=ft.define({combine:t=>t.length?t[0]:""});it.contentAttributes=J4;it.editorAttributes=fF;it.lineWrapping=it.contentAttributes.of({class:"cm-lineWrapping"});it.announce=qt.define();const Xpe=4096,mN={};class sw{constructor(e,n,r,i,s,o){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:ur.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new sw(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function gN(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],o=typeof s=="function"?s(t):s;o&&Y4(o,n)}return n}const Gpe=pt.mac?"mac":pt.windows?"win":pt.linux?"linux":"key";function Kpe(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,o,l;for(let u=0;u<n.length-1;++u){const h=n[u];if(/^(cmd|meta|m)$/i.test(h))l=!0;else if(/^a(lt)?$/i.test(h))i=!0;else if(/^(c|ctrl|control)$/i.test(h))s=!0;else if(/^s(hift)?$/i.test(h))o=!0;else if(/^mod$/i.test(h))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+h)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),l&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function o1(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const Zpe=lu.default(it.domEventHandlers({keydown(t,e){return $F(LF(e.state),t,e,"editor")}})),Ch=ft.define({enables:Zpe}),vN=new WeakMap;function LF(t){let e=t.facet(Ch),n=vN.get(e);return n||vN.set(e,n=tme(e.reduce((r,i)=>r.concat(i),[]))),n}function Jpe(t,e,n){return $F(LF(t.state),e,t,n)}let ah=null;const eme=4e3;function tme(t,e=Gpe){let n=Object.create(null),r=Object.create(null),i=(o,l)=>{let u=r[o];if(u==null)r[o]=l;else if(u!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,u,h,f)=>{var p,m;let v=n[o]||(n[o]=Object.create(null)),b=l.split(/ (?!$)/).map(S=>Kpe(S,e));for(let S=1;S<b.length;S++){let _=b.slice(0,S).join(" ");i(_,!0),v[_]||(v[_]={preventDefault:!0,stopPropagation:!1,run:[T=>{let C=ah={view:T,prefix:_,scope:o};return setTimeout(()=>{ah==C&&(ah=null)},eme),!0}]})}let x=b.join(" ");i(x,!1);let w=v[x]||(v[x]={preventDefault:!1,stopPropagation:!1,run:((m=(p=v._any)===null||p===void 0?void 0:p.run)===null||m===void 0?void 0:m.slice())||[]});u&&w.run.push(u),h&&(w.preventDefault=!0),f&&(w.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let f=n[h]||(n[h]=Object.create(null));f._any||(f._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=o;for(let m in f)f[m].run.push(v=>p(v,Dk))}let u=o[e]||o.key;if(u)for(let h of l)s(h,u,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(h,"Shift-"+u,o.shift,o.preventDefault,o.stopPropagation)}return n}let Dk=null;function $F(t,e,n,r){Dk=e;let i=mfe(e),s=la(i,0),o=Bl(s)==i.length&&i!=" ",l="",u=!1,h=!1,f=!1;ah&&ah.view==n&&ah.scope==r&&(l=ah.prefix+" ",TF.indexOf(e.keyCode)<0&&(h=!0,ah=null));let p=new Set,m=w=>{if(w){for(let S of w.run)if(!p.has(S)&&(p.add(S),S(n)))return w.stopPropagation&&(f=!0),!0;w.preventDefault&&(w.stopPropagation&&(f=!0),h=!0)}return!1},v=t[r],b,x;return v&&(m(v[l+o1(i,e,!o)])?u=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(pt.windows&&e.ctrlKey&&e.altKey)&&!(pt.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(b=Ph[e.keyCode])&&b!=i?(m(v[l+o1(b,e,!0)])||e.shiftKey&&(x=dv[e.keyCode])!=i&&x!=b&&m(v[l+o1(x,e,!1)]))&&(u=!0):o&&e.shiftKey&&m(v[l+o1(i,e,!0)])&&(u=!0),!u&&m(v._any)&&(u=!0)),h&&(u=!0),u&&f&&e.stopPropagation(),Dk=null,u}class ob{constructor(e,n,r,i,s){this.className=e,this.left=n,this.top=r,this.width=i,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let s=IF(e);return[new ob(n,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return nme(e,n,r)}}function IF(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==ur.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function bN(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let s=t.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,l=t.posAtCoords({x:s.left+1,y:o}),u=t.posAtCoords({x:s.right-1,y:o});return l==null||u==null?r:{from:Math.max(r.from,Math.min(l,u)),to:Math.min(r.to,Math.max(l,u))}}function nme(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),s=t.textDirection==ur.LTR,o=t.contentDOM,l=o.getBoundingClientRect(),u=IF(t),h=o.querySelector(".cm-line"),f=h&&window.getComputedStyle(h),p=l.left+(f?parseInt(f.paddingLeft)+Math.min(0,parseInt(f.textIndent)):0),m=l.right-(f?parseInt(f.paddingRight):0),v=kk(t,r,1),b=kk(t,i,-1),x=v.type==hs.Text?v:null,w=b.type==hs.Text?b:null;if(x&&(t.lineWrapping||v.widgetLineBreaks)&&(x=bN(t,r,1,x)),w&&(t.lineWrapping||b.widgetLineBreaks)&&(w=bN(t,i,-1,w)),x&&w&&x.from==w.from&&x.to==w.to)return _(T(n.from,n.to,x));{let j=x?T(n.from,null,x):C(v,!1),A=w?T(null,n.to,w):C(b,!0),E=[];return(x||v).to<(w||b).from-(x&&w?1:0)||v.widgetLineBreaks>1&&j.bottom+t.defaultLineHeight/2<A.top?E.push(S(p,j.bottom,m,A.top)):j.bottom<A.top&&t.elementAtHeight((j.bottom+A.top)/2).type==hs.Text&&(j.bottom=A.top=(j.bottom+A.top)/2),_(j).concat(E).concat(_(A))}function S(j,A,E,R){return new ob(e,j-u.left,A-u.top,Math.max(0,E-j),R-A)}function _({top:j,bottom:A,horizontal:E}){let R=[];for(let N=0;N<E.length;N+=2)R.push(S(E[N],j,E[N+1],A));return R}function T(j,A,E){let R=1e9,N=-1e9,$=[];function D(H,q,P,I,U){let Z=t.coordsAtPos(H,H==E.to?-2:2),X=t.coordsAtPos(P,P==E.from?2:-2);!Z||!X||(R=Math.min(Z.top,X.top,R),N=Math.max(Z.bottom,X.bottom,N),U==ur.LTR?$.push(s&&q?p:Z.left,s&&I?m:X.right):$.push(!s&&I?p:X.left,!s&&q?m:Z.right))}let F=j??E.from,Q=A??E.to;for(let H of t.visibleRanges)if(H.to>F&&H.from<Q)for(let q=Math.max(H.from,F),P=Math.min(H.to,Q);;){let I=t.state.doc.lineAt(q);for(let U of t.bidiSpans(I)){let Z=U.from+I.from,X=U.to+I.from;if(Z>=P)break;X>q&&D(Math.max(Z,q),j==null&&Z<=F,Math.min(X,P),A==null&&X>=Q,U.dir)}if(q=I.to+1,q>=P)break}return $.length==0&&D(F,j==null,Q,A==null,t.textDirection),{top:R,bottom:N,horizontal:$}}function C(j,A){let E=l.top+(A?j.top:j.bottom);return{top:E,bottom:E,horizontal:[]}}}function rme(t,e){return t.constructor==e.constructor&&t.eq(e)}class ime{constructor(e,n){this.view=e,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=e.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(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(nx)!=e.state.facet(nx)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(nx);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:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!rme(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)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=e,pt.safari&&pt.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const nx=ft.define();function BF(t){return[Zr.define(e=>new ime(e,t)),nx.of(t)]}const gv=ft.define({combine(t){return sc(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function sme(t={}){return[gv.of(t),ame,ome,lme,uF.of(!0)]}function zF(t){return t.startState.facet(gv)!=t.state.facet(gv)}const ame=BF({above:!0,markers(t){let{state:e}=t,n=e.facet(gv),r=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||n.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=i.empty?i:$e.cursor(i.head,i.head>i.anchor?-1:1);for(let u of ob.forRange(t,o,l))r.push(u)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=zF(t);return n&&yN(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){yN(e.state,t)},class:"cm-cursorLayer"});function yN(t,e){e.style.animationDuration=t.facet(gv).cursorBlinkRate+"ms"}const ome=BF({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:ob.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||zF(t)},class:"cm-selectionLayer"}),lme=lu.highest(it.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"}}}})),qF=qt.define({map(t,e){return t==null?null:e.mapPos(t)}}),xg=Xi.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(qF)?r.value:n,t)}}),cme=Zr.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(xg);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(xg)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(xg),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(xg)!=t&&this.view.dispatch({effects:qF.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function ume(){return[xg,cme]}function xN(t,e,n,r,i){e.lastIndex=0;for(let s=t.iterRange(n,r),o=n,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=e.exec(s.value);)i(o+l.index,l)}function hme(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:s}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=s:r.push({from:i,to:s});return r}class dme{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:s,maxLength:o=1e3}=e;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=(l,u,h,f)=>i(f,h,h+l[0].length,l,u);else if(typeof r=="function")this.addMatch=(l,u,h,f)=>{let p=r(l,u,h);p&&f(h,h+l[0].length,p)};else if(r)this.addMatch=(l,u,h,f)=>f(h,h+l[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let n=new Jc,r=n.add.bind(n);for(let{from:i,to:s}of hme(e,this.maxLength))xN(e.state.doc,this.regexp,i,s,(o,l)=>this.addMatch(l,e,o,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((s,o,l,u)=>{u>=e.view.viewport.from&&l<=e.view.viewport.to&&(r=Math.min(l,r),i=Math.max(u,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let s of e.visibleRanges){let o=Math.max(s.from,r),l=Math.min(s.to,i);if(l>=o){let u=e.state.doc.lineAt(o),h=u.to<l?e.state.doc.lineAt(l):u,f=Math.max(s.from,u.from),p=Math.min(s.to,h.to);if(this.boundary){for(;o>u.from;o--)if(this.boundary.test(u.text[o-1-u.from])){f=o;break}for(;l<h.to;l++)if(this.boundary.test(h.text[l-h.from])){p=l;break}}let m=[],v,b=(x,w,S)=>m.push(S.range(x,w));if(u==h)for(this.regexp.lastIndex=f-u.from;(v=this.regexp.exec(u.text))&&v.index<p-u.from;)this.addMatch(v,e,v.index+u.from,b);else xN(e.state.doc,this.regexp,f,p,(x,w)=>this.addMatch(w,e,x,b));n=n.update({filterFrom:f,filterTo:p,filter:(x,w)=>x<f||w>p,add:m})}}return n}}const Nk=/x/.unicode!=null?"gu":"g",fme=new RegExp(`[\0-\b
--­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF￹-￼]`,Nk),pme={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 P3=null;function mme(){var t;if(P3==null&&typeof document<"u"&&document.body){let e=document.body.style;P3=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return P3||!1}const rx=ft.define({combine(t){let e=sc(t,{render:null,specialChars:fme,addSpecialChars:null});return(e.replaceTabs=!mme())&&(e.specialChars=new RegExp("	|"+e.specialChars.source,Nk)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Nk)),e}});function FF(t={}){return[rx.of(t),gme()]}let wN=null;function gme(){return wN||(wN=Zr.fromClass(class{constructor(t){this.view=t,this.decorations=Ct.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(rx)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new dme({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,s=la(e[0],0);if(s==9){let o=i.lineAt(r),l=n.state.tabSize,u=Xm(o.text,l,r-o.from);return Ct.replace({widget:new xme((l-u%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Ct.replace({widget:new yme(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(rx);t.startState.facet(rx)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const vme="•";function bme(t){return t>=32?vme:t==10?"␤":String.fromCharCode(9216+t)}class yme extends fl{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=bme(this.code),r=e.state.phrase("Control character")+" "+(pme[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let s=document.createElement("span");return s.textContent=n,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class xme extends fl{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="	",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function wme(){return jme}const Sme=Ct.line({class:"cm-activeLine"}),jme=Zr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(Sme.range(i.from)),e=i.from)}return Ct.set(n)}},{decorations:t=>t.decorations});class _me extends fl{constructor(e){super(),this.content=e}toDOM(e){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(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Pg(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=pv(n[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function HF(t){let e=Zr.fromClass(class{constructor(n){this.view=n,this.placeholder=t?Ct.set([Ct.widget({widget:new _me(t),side:1}).range(0)]):Ct.none}get decorations(){return this.view.state.doc.length?Ct.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,it.contentAttributes.of({"aria-placeholder":t})]:e}const Pk=2e3;function Tme(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),s=[];if(e.off>Pk||n.off>Pk||e.col<0||n.col<0){let o=Math.min(e.off,n.off),l=Math.max(e.off,n.off);for(let u=r;u<=i;u++){let h=t.doc.line(u);h.length<=l&&s.push($e.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,n.col),l=Math.max(e.col,n.col);for(let u=r;u<=i;u++){let h=t.doc.line(u),f=pk(h.text,o,t.tabSize,!0);if(f<0)s.push($e.cursor(h.to));else{let p=pk(h.text,l,t.tabSize);s.push($e.range(h.from+f,h.from+p))}}}return s}function Cme(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function SN(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,s=i>Pk?-1:i==r.length?Cme(t,e.clientX):Xm(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:s,off:i}}function kme(t,e){let n=SN(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let s=i.changes.mapPos(i.startState.doc.line(n.line).from),o=i.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},r=r.map(i.changes)}},get(i,s,o){let l=SN(t,i);if(!l)return r;let u=Tme(t.state,n,l);return u.length?o?$e.create(u.concat(r.ranges)):$e.create(u):r}}:null}function Ome(t){let e=n=>n.altKey&&n.button==0;return it.mouseSelectionStyle.of((n,r)=>e(r)?kme(n,r):null)}const Eme={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Ame={style:"cursor: crosshair"};function Mme(t={}){let[e,n]=Eme[t.key||"Alt"],r=Zr.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==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,it.contentAttributes.of(i=>{var s;return!((s=i.plugin(r))===null||s===void 0)&&s.isDown?Ame:null})]}const l1="-10000px";class VF{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=r(o,s))}update(e,n){var r;let i=e.state.facet(this.facet),s=i.filter(u=>u);if(i===this.input){for(let u of this.tooltipViews)u.update&&u.update(e);return!1}let o=[],l=n?[]:null;for(let u=0;u<s.length;u++){let h=s[u],f=-1;if(h){for(let p=0;p<this.tooltips.length;p++){let m=this.tooltips[p];m&&m.create==h.create&&(f=p)}if(f<0)o[u]=this.createTooltipView(h,u?o[u-1]:null),l&&(l[u]=!!h.above);else{let p=o[u]=this.tooltipViews[f];l&&(l[u]=n[f]),p.update&&p.update(e)}}}for(let u of this.tooltipViews)o.indexOf(u)<0&&(this.removeTooltipView(u),(r=u.destroy)===null||r===void 0||r.call(u));return n&&(l.forEach((u,h)=>n[h]=u),n.length=l.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function Rme(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const L3=ft.define({combine:t=>{var e,n,r;return{position:pt.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||Rme}}}),jN=new WeakMap,sE=Zr.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(L3);this.position=e.position,this.parent=e.parent,this.classes=t.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 VF(t,aE,(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(),t.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 t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(L3);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(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.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=l1,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 t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(pt.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=tE(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((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(L3).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:s}=t,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let u=this.manager.tooltips[l],h=this.manager.tooltipViews[l],{dom:f}=h,p=t.pos[l],m=t.size[l];if(!p||u.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)){f.style.top=l1;continue}let v=u.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,b=v?7:0,x=m.right-m.left,w=(e=jN.get(h))!==null&&e!==void 0?e:m.bottom-m.top,S=h.offset||Nme,_=this.view.textDirection==ur.LTR,T=m.width>r.right-r.left?_?r.left:r.right-m.width:_?Math.max(r.left,Math.min(p.left-(v?14:0)+S.x,r.right-x)):Math.min(Math.max(r.left,p.left-x+(v?14:0)-S.x),r.right-x),C=this.above[l];!u.strictSide&&(C?p.top-w-b-S.y<r.top:p.bottom+w+b+S.y>r.bottom)&&C==r.bottom-p.bottom>p.top-r.top&&(C=this.above[l]=!C);let j=(C?p.top-r.top:r.bottom-p.bottom)-b;if(j<w&&h.resize!==!1){if(j<this.view.defaultLineHeight){f.style.top=l1;continue}jN.set(h,w),f.style.height=(w=j)/s+"px"}else f.style.height&&(f.style.height="");let A=C?p.top-w-b-S.y:p.bottom+b+S.y,E=T+x;if(h.overlap!==!0)for(let R of o)R.left<E&&R.right>T&&R.top<A+w&&R.bottom>A&&(A=C?R.top-w-2-b:R.bottom+b+2);if(this.position=="absolute"?(f.style.top=(A-t.parent.top)/s+"px",_N(f,(T-t.parent.left)/i)):(f.style.top=A/s+"px",_N(f,T/i)),v){let R=p.left+(_?S.x:-S.x)-(T+14-7);v.style.left=R/i+"px"}h.overlap!==!0&&o.push({left:T,top:A,right:E,bottom:A+w}),f.classList.toggle("cm-tooltip-above",C),f.classList.toggle("cm-tooltip-below",!C),h.positioned&&h.positioned(t.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 t of this.manager.tooltipViews)t.dom.style.top=l1}},{eventObservers:{scroll(){this.maybeMeasure()}}});function _N(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const Dme=it.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:`${7*2}px`,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"}}}),Nme={x:0,y:0},aE=ft.define({enables:[sE,Dme]}),aw=ft.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class lS{static create(e){return new lS(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new VF(e,aw,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.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(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];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 Pme=aE.compute([aw],t=>{let e=t.facet(aw);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:lS.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class Lme{constructor(e,n,r,i,s){this.view=e,this.source=n,this.field=r,this.setHover=i,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){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 e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,r=e.docView.tile.nearest(n.target);if(!r)return;let i,s=1;if(r.isWidget())i=r.posAtStart;else{if(i=e.posAtCoords(n),i==null)return;let l=e.coordsAtPos(i);if(!l||n.y<l.top||n.y>l.bottom||n.x<l.left-e.defaultCharacterWidth||n.x>l.right+e.defaultCharacterWidth)return;let u=e.bidiSpans(e.state.doc.lineAt(i)).find(f=>f.from<=i&&f.to>=i),h=u&&u.dir==ur.RTL?-1:1;s=n.x<l.left?-h:h}let o=this.source(e,i,s);if(o!=null&&o.then){let l=this.pending={pos:i};o.then(u=>{this.pending==l&&(this.pending=null,u&&!(Array.isArray(u)&&!u.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(u)?u:[u])}))},u=>Hs(e.state,u,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(sE),n=e?e.manager.tooltips.findIndex(r=>r.create==lS.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:s}=this;if(i.length&&s&&!$me(s.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,l=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!Ime(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.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 c1=4;function $me(t,e){let{left:n,right:r,top:i,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();i=Math.min(l.top,i),s=Math.max(l.bottom,s)}return e.clientX>=n-c1&&e.clientX<=r+c1&&e.clientY>=i-c1&&e.clientY<=s+c1}function Ime(t,e,n,r,i,s){let o=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,l)<i)return!1;let u=t.posAtCoords({x:r,y:i},!1);return u>=e&&u<=n}function Bme(t,e={}){let n=qt.define(),r=Xi.define({create(){return[]},update(i,s){if(i.length&&(e.hideOnChange&&(s.docChanged||s.selection)?i=[]:e.hideOn&&(i=i.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let l of i){let u=s.changes.mapPos(l.pos,-1,us.TrackDel);if(u!=null){let h=Object.assign(Object.create(null),l);h.pos=u,h.end!=null&&(h.end=s.changes.mapPos(h.end)),o.push(h)}}i=o}for(let o of s.effects)o.is(n)&&(i=o.value),o.is(zme)&&(i=[]);return i},provide:i=>aw.from(i)});return{active:r,extension:[r,Zr.define(i=>new Lme(i,t,r,n,e.hoverTime||300)),Pme]}}function UF(t,e){let n=t.plugin(sE);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const zme=qt.define(),TN=ft.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function vv(t,e){let n=t.plugin(QF),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const QF=Zr.fromClass(class{constructor(t){this.input=t.state.facet(bv),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(TN);this.top=new u1(t,!0,e.topContainer),this.bottom=new u1(t,!1,e.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(t){let e=t.state.facet(TN);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new u1(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new u1(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(bv);if(n!=this.input){let r=n.filter(u=>u),i=[],s=[],o=[],l=[];for(let u of r){let h=this.specs.indexOf(u),f;h<0?(f=u(t.view),l.push(f)):(f=this.panels[h],f.update&&f.update(t)),i.push(f),(f.top?s:o).push(f)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let u of l)u.dom.classList.add("cm-panel"),u.mount&&u.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>it.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class u1{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,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 e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=CN(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=CN(e)}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 e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function CN(t){let e=t.nextSibling;return t.remove(),e}const bv=ft.define({enables:QF});class tu extends Dh{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}tu.prototype.elementClass="";tu.prototype.toDOM=void 0;tu.prototype.mapMode=us.TrackBefore;tu.prototype.startSide=tu.prototype.endSide=-1;tu.prototype.point=!0;const ix=ft.define(),qme=ft.define(),Fme={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>dn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Ig=ft.define();function Hme(t){return[WF(),Ig.of({...Fme,...t})]}const kN=ft.define({combine:t=>t.some(e=>e)});function WF(t){return[Vme]}const Vme=Zr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.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=t.state.facet(Ig).map(e=>new EN(t,e)),this.fixed=!t.state.facet(kN);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.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(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(kN)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=dn.iter(this.view.state.facet(ix),this.view.viewport.from),r=[],i=this.gutters.map(s=>new Ume(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==hs.Text&&o){Lk(n,r,l.from);for(let u of i)u.line(this.view,l,r);o=!1}else if(l.widget)for(let u of i)u.widget(this.view,l)}else if(s.type==hs.Text){Lk(n,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Ig),n=t.state.facet(Ig),r=t.docChanged||t.heightChanged||t.viewportChanged||!dn.eq(t.startState.facet(ix),t.state.facet(ix),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let s of n){let o=e.indexOf(s);o<0?i.push(new EN(this.view,s)):(this.gutters[o].update(t),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>it.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==ur.LTR?{left:r,right:i}:{right:r,left:i}})});function ON(t){return Array.isArray(t)?t:[t]}function Lk(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class Ume{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=dn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==i.elements.length){let l=new YF(e,o,s,r);i.elements.push(l),i.dom.appendChild(l.dom)}else i.elements[this.i].update(e,o,s,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];Lk(this.cursor,i,n.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,n,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let s of e.state.facet(qme)){let o=s(e,n.widget,n);o&&(i||(i=[])).push(o)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class EN{constructor(e,n){this.view=e,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 s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let u=s.getBoundingClientRect();o=(u.top+u.bottom)/2}else o=i.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[r](e,l,i)&&i.preventDefault()});this.markers=ON(n.markers(e)),n.initialSpacer&&(this.spacer=new YF(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=ON(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!dn.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class YF{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,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":""),Qme(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let l=o,u=s<n.length?n[s++]:null,h=!1;if(u){let f=u.elementClass;f&&(r+=" "+f);for(let p=o;p<this.markers.length;p++)if(this.markers[p].compare(u)){l=p,h=!0;break}}else l=this.markers.length;for(;o<l;){let f=this.markers[o++];if(f.toDOM){f.destroy(i);let p=i.nextSibling;i.remove(),i=p}}if(!u)break;u.toDOM&&(h?i=i.nextSibling:this.dom.insertBefore(u.toDOM(e),i)),h&&o++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function Qme(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const Wme=ft.define(),Yme=ft.define(),Cp=ft.define({combine(t){return sc(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let s=r[i],o=n[i];r[i]=s?(l,u,h)=>s(l,u,h)||o(l,u,h):o}return r}})}});class $3 extends tu{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function I3(t,e){return t.state.facet(Cp).formatNumber(e,t.state)}const Xme=Ig.compute([Cp],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Wme)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new $3(I3(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(Yme)){let s=i(e,n,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Cp)!=e.state.facet(Cp),initialSpacer(e){return new $3(I3(e,AN(e.state.doc.lines)))},updateSpacer(e,n){let r=I3(n.view,AN(n.view.state.doc.lines));return r==e.number?e:new $3(r)},domEventHandlers:t.facet(Cp).domEventHandlers,side:"before"}));function Gme(t={}){return[Cp.of(t),WF(),Xme]}function AN(t){let e=9;for(;e<t;)e=e*10+9;return e}const Kme=new class extends tu{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Zme=ix.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(Kme.range(i)))}return dn.of(e)});function Jme(){return Zme}var B3;const kp=new on;function e0e(t){return ft.define({combine:t?e=>e.concat(t):void 0})}const t0e=new on;class il{constructor(e,n,r=[],i=""){this.data=e,this.name=i,gn.prototype.hasOwnProperty("tree")||Object.defineProperty(gn.prototype,"tree",{get(){return Ai(this)}}),this.parser=n,this.extension=[$h.of(this),gn.languageData.of((s,o,l)=>{let u=MN(s,o,l),h=u.type.prop(kp);if(!h)return[];let f=s.facet(h),p=u.type.prop(t0e);if(p){let m=u.resolve(o-u.from,l);for(let v of p)if(v.test(m,s)){let b=s.facet(v.facet);return v.type=="replace"?b:b.concat(f)}}return f})].concat(r)}isActiveAt(e,n,r=-1){return MN(e,n,r).type.prop(kp)==this.data}findRegions(e){let n=e.facet($h);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(kp)==this.data){r.push({from:o,to:o+s.length});return}let l=s.prop(on.mounted);if(l){if(l.tree.prop(kp)==this.data){if(l.overlay)for(let u of l.overlay)r.push({from:u.from+o,to:u.to+o});else r.push({from:o,to:o+s.length});return}else if(l.overlay){let u=r.length;if(i(l.tree,l.overlay[0].from+o),r.length>u)return}}for(let u=0;u<s.children.length;u++){let h=s.children[u];h instanceof si&&i(h,s.positions[u]+o)}};return i(Ai(e),0),r}get allowsNesting(){return!0}}il.setState=qt.define();function MN(t,e,n){let r=t.facet($h),i=Ai(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,Yr.ExcludeBuffers|Yr.EnterBracketed))s.type.isTop&&(i=s);return i}class ow extends il{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=e0e(e.languageData);return new ow(n,e.parser.configure({props:[kp.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new ow(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ai(t){let e=t.field(il.state,!1);return e?e.tree:si.empty}class n0e{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let rg=null;class lw{constructor(e,n,r=[],i,s,o,l,u){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new lw(e,n,[],si.empty,0,r,[],null)}startParse(){return this.parser.startParse(new n0e(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=si.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>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(af.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(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(af.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=rg;rg=this;try{return e()}finally{rg=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=RN(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((h,f,p,m)=>u.push({fromA:h,toA:f,fromB:p,toB:m})),r=af.applyChanges(r,u),i=si.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let f=e.mapPos(h.from,1),p=e.mapPos(h.to,-1);f<p&&l.push({from:f,to:p})}}}return new lw(this.parser,n,r,i,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=RN(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends sq{createParse(n,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let u=rg;if(u){for(let h of i)u.tempSkipped.push(h);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=o,new si(pa.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return rg}}function RN(t,e,n){return af.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class km{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new km(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=lw.create(e.facet($h).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new km(r)}}il.state=Xi.define({create:km.init,update(t,e){for(let n of e.effects)if(n.is(il.setState))return n.value;return e.startState.facet($h)!=e.state.facet($h)?km.init(e.state):t.apply(e)}});let XF=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(XF=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const z3=typeof navigator<"u"&&(!((B3=navigator.scheduling)===null||B3===void 0)&&B3.isInputPending)?()=>navigator.scheduling.isInputPending():null,r0e=Zr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(il.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(il.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=XF(this.work))}work(e){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,s=r.field(il.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!z3?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<i&&r.doc.length>i+1e3,u=s.context.work(()=>z3&&z3()||Date.now()>o,i+(l?0:1e5));this.chunkBudget-=Date.now()-n,(u||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:il.setState.of(new km(s.context))})),this.chunkBudget>0&&!(u&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Hs(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),$h=ft.define({combine(t){return t.length?t[0]:null},enables:t=>[il.state,r0e,it.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),i0e=ft.define(),lb=ft.define({combine:t=>{if(!t.length)return"  ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function cw(t){let e=t.facet(lb);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function yv(t,e){let n="",r=t.tabSize,i=t.facet(lb)[0];if(i=="	"){for(;e>=r;)n+="	",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function oE(t,e){t instanceof gn&&(t=new cS(t));for(let r of t.state.facet(i0e)){let i=r(t,e);if(i!==void 0)return i}let n=Ai(t.state);return n.length>=e?a0e(t,n,e):null}class cS{constructor(e,n={}){this.state=e,this.options=n,this.unit=cw(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return Xm(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const s0e=new on;function a0e(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return GF(r,t,n)}function GF(t,e,n){for(let r=t;r;r=r.next){let i=l0e(r.node);if(i)return i(lE.create(e,n,r))}return 0}function o0e(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function l0e(t){let e=t.type.prop(s0e);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(on.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>d0e(o,!0,1,void 0,s&&!o0e(o)?i.from:void 0)}return t.parent==null?c0e:null}function c0e(){return 0}class lE extends cS{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new lE(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(u0e(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return GF(this.context.next,this.base,this.pos)}}function u0e(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function h0e(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let l=n.to;;){let u=e.childAfter(l);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=o)return null;let h=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+h}}l=u.to}}function d0e(t,e,n,r,i){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=r&&s.slice(o,o+r.length)==r||i==t.pos+o,u=h0e(t);return u?l?t.column(u.from):t.column(u.to):t.baseIndent+(l?0:t.unit*n)}const f0e=200;function KF(){return gn.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+f0e)return t;let s=n.sliceString(i.from,r);if(!e.some(h=>h.test(s)))return t;let{state:o}=t,l=-1,u=[];for(let{head:h}of o.selection.ranges){let f=o.doc.lineAt(h);if(f.from==l)continue;l=f.from;let p=oE(o,f.from);if(p==null)continue;let m=/^\s*/.exec(f.text)[0],v=yv(o,p);m!=v&&u.push({from:f.from,to:f.from+m.length,insert:v})}return u.length?[t,{changes:u,sequential:!0}]:t})}const p0e=ft.define(),m0e=new on;function g0e(t,e,n){let r=Ai(t);if(r.length<n)return null;let i=r.resolveStack(n,1),s=null;for(let o=i;o;o=o.next){let l=o.node;if(l.to<=n||l.from>n)continue;if(s&&l.from<e)break;let u=l.type.prop(m0e);if(u&&(l.to<r.length-50||r.length==t.doc.length||!v0e(l))){let h=u(l,t);h&&h.from<=n&&h.from>=e&&h.to>n&&(s=h)}}return s}function v0e(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function uw(t,e,n){for(let r of t.facet(p0e)){let i=r(t,e,n);if(i)return i}return g0e(t,e,n)}function ZF(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const uS=qt.define({map:ZF}),cb=qt.define({map:ZF});function JF(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const bf=Xi.define({create(){return Ct.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=DN(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(uS)&&!b0e(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(nH),i=r?Ct.replace({widget:new T0e(r(e.state,n.value))}):NN;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(cb)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=DN(t,e.selection.main.head)),t},provide:t=>it.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(NN.range(r,i))}return Ct.set(e,!0)}});function DN(t,e,n=e){let r=!1;return t.between(e,n,(i,s)=>{i<n&&s>e&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,s)=>i>=n||s<=e}):t}function hw(t,e,n){var r;let i=null;return(r=t.field(bf,!1))===null||r===void 0||r.between(e,n,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function b0e(t,e,n){let r=!1;return t.between(e,e,(i,s)=>{i==e&&s==n&&(r=!0)}),r}function eH(t,e){return t.field(bf,!1)?e:e.concat(qt.appendConfig.of(rH()))}const y0e=t=>{for(let e of JF(t)){let n=uw(t.state,e.from,e.to);if(n)return t.dispatch({effects:eH(t.state,[uS.of(n),tH(t,n)])}),!0}return!1},x0e=t=>{if(!t.state.field(bf,!1))return!1;let e=[];for(let n of JF(t)){let r=hw(t.state,n.from,n.to);r&&e.push(cb.of(r),tH(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function tH(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return it.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const w0e=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let i=t.lineBlockAt(r),s=uw(e,i.from,i.to);s&&n.push(uS.of(s)),r=(s?t.lineBlockAt(s.to):i).to+1}return n.length&&t.dispatch({effects:eH(t.state,n)}),!!n.length},S0e=t=>{let e=t.state.field(bf,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(cb.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},j0e=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:y0e},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:x0e},{key:"Ctrl-Alt-[",run:w0e},{key:"Ctrl-Alt-]",run:S0e}],_0e={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},nH=ft.define({combine(t){return sc(t,_0e)}});function rH(t){return[bf,O0e]}function iH(t,e){let{state:n}=t,r=n.facet(nH),i=o=>{let l=t.lineBlockAt(t.posAtDOM(o.target)),u=hw(t.state,l.from,l.to);u&&t.dispatch({effects:cb.of(u)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const NN=Ct.replace({widget:new class extends fl{toDOM(t){return iH(t,null)}}});class T0e extends fl{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return iH(e,this.value)}}const C0e={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class q3 extends tu{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){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=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function k0e(t={}){let e={...C0e,...t},n=new q3(e,!0),r=new q3(e,!1),i=Zr.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet($h)!=o.state.facet($h)||o.startState.field(bf,!1)!=o.state.field(bf,!1)||Ai(o.startState)!=Ai(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new Jc;for(let u of o.viewportLineBlocks){let h=hw(o.state,u.from,u.to)?r:uw(o.state,u.from,u.to)?n:null;h&&l.add(u.from,u.from,h)}return l.finish()}}),{domEventHandlers:s}=e;return[i,Hme({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(i))===null||l===void 0?void 0:l.markers)||dn.empty},initialSpacer(){return new q3(e,!1)},domEventHandlers:{...s,click:(o,l,u)=>{if(s.click&&s.click(o,l,u))return!0;let h=hw(o.state,l.from,l.to);if(h)return o.dispatch({effects:cb.of(h)}),!0;let f=uw(o.state,l.from,l.to);return f?(o.dispatch({effects:uS.of(f)}),!0):!1}}}),rH()]}const O0e=it.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 Of{constructor(e,n){this.specs=e;let r;function i(l){let u=Nh.newName();return(r||(r=Object.create(null)))["."+u]=l,u}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,o=n.scope;this.scope=o instanceof il?l=>l.prop(kp)==o.data:o?l=>l==o:void 0,this.style=lq(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=r?new Nh(r):null,this.themeType=n.themeType}static define(e,n){return new Of(e,n||{})}}const $k=ft.define(),sH=ft.define({combine(t){return t.length?[t[0]]:null}});function F3(t){let e=t.facet($k);return e.length?e:t.facet(sH)}function hS(t,e){let n=[A0e],r;return t instanceof Of&&(t.module&&n.push(it.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(sH.of(t)):r?n.push($k.computeN([it.darkTheme],i=>i.facet(it.darkTheme)==(r=="dark")?[t]:[])):n.push($k.of(t)),n}class E0e{constructor(e){this.markCache=Object.create(null),this.tree=Ai(e.state),this.decorations=this.buildDeco(e,F3(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Ai(e.state),r=F3(e.state),i=r!=F3(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!i&&n.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return Ct.none;let r=new Jc;for(let{from:i,to:s}of e.visibleRanges)gue(this.tree,n,(o,l,u)=>{r.add(o,l,this.markCache[u]||(this.markCache[u]=Ct.mark({class:u})))},i,s);return r.finish()}}const A0e=lu.high(Zr.fromClass(E0e,{decorations:t=>t.decorations})),M0e=Of.define([{tag:pe.meta,color:"#404740"},{tag:pe.link,textDecoration:"underline"},{tag:pe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:pe.emphasis,fontStyle:"italic"},{tag:pe.strong,fontWeight:"bold"},{tag:pe.strikethrough,textDecoration:"line-through"},{tag:pe.keyword,color:"#708"},{tag:[pe.atom,pe.bool,pe.url,pe.contentSeparator,pe.labelName],color:"#219"},{tag:[pe.literal,pe.inserted],color:"#164"},{tag:[pe.string,pe.deleted],color:"#a11"},{tag:[pe.regexp,pe.escape,pe.special(pe.string)],color:"#e40"},{tag:pe.definition(pe.variableName),color:"#00f"},{tag:pe.local(pe.variableName),color:"#30a"},{tag:[pe.typeName,pe.namespace],color:"#085"},{tag:pe.className,color:"#167"},{tag:[pe.special(pe.variableName),pe.macroName],color:"#256"},{tag:pe.definition(pe.propertyName),color:"#00c"},{tag:pe.comment,color:"#940"},{tag:pe.invalid,color:"#f00"}]),R0e=it.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),aH=1e4,oH="()[]{}",lH=ft.define({combine(t){return sc(t,{afterCursor:!0,brackets:oH,maxScanDistance:aH,renderMatch:P0e})}}),D0e=Ct.mark({class:"cm-matchingBracket"}),N0e=Ct.mark({class:"cm-nonmatchingBracket"});function P0e(t){let e=[],n=t.matched?D0e:N0e;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const L0e=Xi.define({create(){return Ct.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(lH);for(let i of e.state.selection.ranges){if(!i.empty)continue;let s=ql(e.state,i.head,-1,r)||i.head>0&&ql(e.state,i.head-1,1,r)||r.afterCursor&&(ql(e.state,i.head,1,r)||i.head<e.state.doc.length&&ql(e.state,i.head+1,-1,r));s&&(n=n.concat(r.renderMatch(s,e.state)))}return Ct.set(n,!0)},provide:t=>it.decorations.from(t)}),$0e=[L0e,R0e];function cH(t={}){return[lH.of(t),$0e]}const I0e=new on;function Ik(t,e,n){let r=t.prop(e<0?on.openedBy:on.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function Bk(t){let e=t.type.prop(I0e);return e?e(t.node):t}function ql(t,e,n,r={}){let i=r.maxScanDistance||aH,s=r.brackets||oH,o=Ai(t),l=o.resolveInner(e,n);for(let u=l;u;u=u.parent){let h=Ik(u.type,n,s);if(h&&u.from<u.to){let f=Bk(u);if(f&&(n>0?e>=f.from&&e<f.to:e>f.from&&e<=f.to))return B0e(t,e,n,u,f,h,s)}}return z0e(t,e,n,o,l.type,i,s)}function B0e(t,e,n,r,i,s,o){let l=r.parent,u={from:i.from,to:i.to},h=0,f=l==null?void 0:l.cursor();if(f&&(n<0?f.childBefore(r.from):f.childAfter(r.to)))do if(n<0?f.to<=r.from:f.from>=r.to){if(h==0&&s.indexOf(f.type.name)>-1&&f.from<f.to){let p=Bk(f);return{start:u,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(Ik(f.type,n,o))h++;else if(Ik(f.type,-n,o)){if(h==0){let p=Bk(f);return{start:u,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}h--}}while(n<0?f.prevSibling():f.nextSibling());return{start:u,matched:!1}}function z0e(t,e,n,r,i,s,o){let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=o.indexOf(l);if(u<0||u%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},f=t.doc.iterRange(e,n>0?t.doc.length:0),p=0;for(let m=0;!f.next().done&&m<=s;){let v=f.value;n<0&&(m+=v.length);let b=e+m*n;for(let x=n>0?0:v.length-1,w=n>0?v.length:-1;x!=w;x+=n){let S=o.indexOf(v[x]);if(!(S<0||r.resolveInner(b+x,1).type!=i))if(S%2==0==n>0)p++;else{if(p==1)return{start:h,end:{from:b+x,to:b+x+1},matched:S>>1==u>>1};p--}}n>0&&(m+=v.length)}return f.done?{start:h,matched:!1}:null}const q0e=Object.create(null),PN=[pa.none],LN=[],$N=Object.create(null),F0e=Object.create(null);for(let[t,e]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"]])F0e[t]=H0e(q0e,e);function H3(t,e){LN.indexOf(t)>-1||(LN.push(t),console.warn(e))}function H0e(t,e){let n=[];for(let l of e.split(" ")){let u=[];for(let h of l.split(".")){let f=t[h]||pe[h];f?typeof f=="function"?u.length?u=u.map(f):H3(h,`Modifier ${h} used at start of tag`):u.length?H3(h,`Tag ${h} used as modifier`):u=Array.isArray(f)?f:[f]:H3(h,`Unknown highlighting tag ${h}`)}for(let h of u)n.push(h)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(l=>l.id),s=$N[i];if(s)return s.id;let o=$N[i]=pa.define({id:PN.length,name:r,props:[aq({[r]:n})]});return PN.push(o),o.id}ur.RTL,ur.LTR;function V0e(t,e){if(!e||e.type.id!==Ip)return null;const n={card:$l.CardOneToOne,matchingLabels:[],on:!1,include:[],fill:{lhs:null,rhs:null}},r=e.getChild(dhe);if(r){n.on=r.getChild(she)!==null;const o=r.getChild($p),l=o?o.getChildren(sv):[];for(const p of l)n.matchingLabels.push(t.sliceDoc(p.from,p.to));const u=r.getChild(ahe),h=r.getChild(ohe),f=u||h;if(f){n.card=u?$l.CardManyToOne:$l.CardOneToMany;const p=f.nextSibling,m=(p==null?void 0:p.getChildren(sv))||[];for(const v of m)n.include.push(t.sliceDoc(v.from,v.to))}}const i=e.getChild(fhe);if(i){const o=i.getChild(phe),l=i.getChild(mhe),u=i.getChild(ghe),h=f=>{const p=f.getChild(tS);return p?parseFloat(t.sliceDoc(p.from,p.to)):null};if(o){const f=h(o);n.fill.lhs=f,n.fill.rhs=f}l&&(n.fill.lhs=h(l)),u&&(n.fill.rhs=h(u))}return yh(e,I4,B4,z4)&&n.card===$l.CardOneToOne&&(n.card=$l.CardManyToMany),n}let U0e=class{constructor(e){this.tree=Ai(e),this.state=e,this.diagnostics=[]}getDiagnostics(){return this.diagnostics.sort((e,n)=>e.from-n.from)}analyze(){this.checkAST(this.tree.topNode.firstChild),this.diagnoseAllErrorNodes()}diagnoseAllErrorNodes(){const e=this.tree.cursor();for(;e.next();)if(e.type.id===0&&e.to!==this.tree.topNode.to){const n=e.node.parent;this.diagnostics.push({severity:"error",message:"unexpected expression",from:n?n.from:e.from,to:n?n.to:e.to})}}checkAST(e){if(!e)return se.none;switch(e.type.id){case eS:this.checkAggregationExpr(e);break;case Ip:this.checkBinaryExpr(e);break;case JC:this.checkCallFunction(e);break;case yq:this.checkAST(e.getChild("Expr"));break;case xq:{const n=this.checkAST(e.getChild("Expr"));n!==se.scalar&&n!==se.vector&&this.addDiagnostic(e,`unary expression only allowed on expressions of type scalar or instant vector, got ${n}`);break}case bq:{this.checkAnchoredSmoothedExpr(e,[nk,tk,ek]);break}case vq:{this.checkAnchoredSmoothedExpr(e,[gq,mq,nk,tk,ek]);break}case pf:{const n=this.checkAST(e.getChild("Expr"));n!==se.vector&&this.addDiagnostic(e,`subquery is only allowed on instant vector, got ${n} in ${e.name} instead`);break}case wm:this.checkAST(e.getChild("Expr"));break;case nb:this.checkVectorSelector(e);break;case q4:{const n=this.checkAST(e.getChild("Expr"));n!==se.vector&&n!==se.matrix&&this.addDiagnostic(e,"@ modifier must be preceded by an instant selector vector or range vector selector or a subquery");break}}return Ml(e)}checkAggregationExpr(e){var n;const r=(n=e.firstChild)===null||n===void 0?void 0:n.firstChild;if(!r){this.addDiagnostic(e,"aggregation operator expected in aggregation expression but got nothing");return}const i=e.getChild(_h),s=i?i.getChildren("Expr"):[];if(!s.length){this.addDiagnostic(e,"unable to find the parameter for the expression");return}this.expectType(s[s.length-1],se.vector,"aggregation expression"),(r.type.id===fq||r.type.id===cq||r.type.id===hq||r.type.id===dq||r.type.id===lhe)&&this.expectType(s[0],se.scalar,"aggregation parameter"),r.type.id===uq&&this.expectType(s[0],se.string,"aggregation parameter")}checkBinaryExpr(e){const n=e.firstChild,r=e.lastChild;if(!n||!r){this.addDiagnostic(e,"left or right expression is missing in binary expression");return}const i=this.checkAST(n),s=this.checkAST(r),o=e.getChild(pq),l=yh(e,YC,ov,KC,ZC,XC,GC),u=yh(e,I4,B4,z4);o?l||this.addDiagnostic(e,"bool modifier can only be used on comparison operators"):l&&i===se.scalar&&s===se.scalar&&this.addDiagnostic(e,"comparisons between scalars must use BOOL modifier");const h=V0e(this.state,e);if(h!==null&&h.on)for(const f of h.matchingLabels)for(const p of h.include)f===p&&this.addDiagnostic(e,`label "${f}" must not occur in ON and GROUP clause at once`);i!==se.scalar&&i!==se.vector&&this.addDiagnostic(n,"binary expression must contain only scalar and instant vector types"),s!==se.scalar&&s!==se.vector&&this.addDiagnostic(r,"binary expression must contain only scalar and instant vector types"),(i!==se.vector||s!==se.vector)&&h!==null?h.matchingLabels.length>0&&this.addDiagnostic(e,"vector matching only allowed between instant vectors"):u&&(((h==null?void 0:h.card)===$l.CardOneToMany||(h==null?void 0:h.card)===$l.CardManyToOne)&&this.addDiagnostic(e,"no grouping allowed for set operations"),(h==null?void 0:h.card)!==$l.CardManyToMany&&this.addDiagnostic(e,"set operations must always be many-to-many")),(i===se.scalar||s===se.scalar)&&u&&this.addDiagnostic(e,"set operator not allowed in binary scalar expression")}checkCallFunction(e){var n;const r=(n=e.firstChild)===null||n===void 0?void 0:n.firstChild;if(!r){this.addDiagnostic(e,"function not defined");return}const i=e.getChild(_h),s=i?i.getChildren("Expr"):[],o=jq(r.type.id),l=o.argTypes.length;if(o.variadic===0)s.length!==l&&this.addDiagnostic(e,`expected ${l} argument(s) in call to "${o.name}", got ${s.length}`);else{const h=l-1;if(h>s.length)this.addDiagnostic(e,`expected at least ${h} argument(s) in call to "${o.name}", got ${s.length}`);else{const f=h+o.variadic;o.variadic>0&&f<s.length&&this.addDiagnostic(e,`expected at most ${f} argument(s) in call to "${o.name}", got ${s.length}`)}}o.name==="info"&&s.length>1&&s[1].getChild(Wx)&&this.addDiagnostic(e,`expected label selectors as the second argument to "info" function, got ${s[1].type}`);let u=0;for(let h=0;h<s.length;h++){if(u=h,u>=o.argTypes.length){if(o.variadic===0)break;u=o.argTypes.length-1}this.expectType(s[h],o.argTypes[u],`call to function "${o.name}"`)}}checkAnchoredSmoothedExpr(e,n){var r,i;const s=Ml(e);if(s!==se.vector&&s!==se.matrix){this.addDiagnostic(e,`smoothed/anchored expression only allowed on instant vector or range vector selector, got ${s} instead`);return}const o=(r=e.parent)===null||r===void 0?void 0:r.parent;if(!o||o.type.id!==JC)return;const l=(i=o.firstChild)===null||i===void 0?void 0:i.firstChild;if(!l){this.addDiagnostic(e,"function not defined");return}n.includes(l.type.id)||this.addDiagnostic(e,"smoothed/anchored expression can only be used in specific functions")}checkVectorSelector(e){const n=e.getChild(Bp),r=[av,of,bh];let i=[];for(const u of r)i=i.concat(Tq(n?n.getChildren(u):[],this.state));let s="";const o=e.getChild(Wx);if(o&&(s=this.state.sliceDoc(o.from,o.to)),s!==""){const u=i.find(h=>h.name==="__name__");u&&this.addDiagnostic(e,`metric name must not be set twice: ${s} or ${u.value}`),i.push(new _q(rb,"__name__",s))}else{const u=i.filter(h=>h.name==="__name__");u.length>1&&this.addDiagnostic(e,`metric name must not be set twice: ${u[0].value} or ${u[1].value}`)}i.every(u=>u.matchesEmpty())&&this.addDiagnostic(e,"vector selector must contain at least one non-empty matcher")}expectType(e,n,r){const i=this.checkAST(e);i!==n&&this.addDiagnostic(e,`expected type ${n} in ${r}, got ${i}`)}addDiagnostic(e,n){this.diagnostics.push({severity:"error",message:n,from:e.from,to:e.to})}};class uH{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Ai(this.state).resolveInner(this.pos,-1);for(;n&&e.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(e){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),s=i.search(hH(e,!1));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function IN(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Q0e(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;s<i.length;s++)n[i[s]]=!0}let r=IN(e)+IN(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function W0e(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:Q0e(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}class BN{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function lf(t){return t.selection.main.from}function hH(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",s=r[r.length-1]!="$";return!i&&!s?t:new RegExp(`${i?"^":""}(?:${r})${s?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const cE=ic.define();function Y0e(t,e,n,r){let{main:i}=t.selection,s=n-i.from,o=r-i.from;return{...t.changeByRange(l=>{if(l!=i&&n!=r&&t.sliceDoc(l.from+s,l.from+o)!=t.sliceDoc(n,r))return{range:l};let u=t.toText(e);return{changes:{from:l.from+s,to:r==i.from?l.to:l.from+o,insert:u},range:$e.cursor(l.from+s+u.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const zN=new WeakMap;function X0e(t){if(!Array.isArray(t))return t;let e=zN.get(t);return e||zN.set(t,e=W0e(t)),e}const dw=qt.define(),xv=qt.define();class G0e{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=la(e,n),i=Bl(r);this.chars.push(r);let s=e.slice(n,n+i),o=s.toUpperCase();this.folded.push(la(o==s?s.toLowerCase():o,0)),n+=i}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:s,byWord:o}=this;if(n.length==1){let _=la(e,0),T=Bl(_),C=T==e.length?0:-100;if(_!=n[0])if(_==r[0])C+=-200;else return null;return this.ret(C,[0,T])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let u=n.length,h=0;if(l<0){for(let _=0,T=Math.min(e.length,200);_<T&&h<u;){let C=la(e,_);(C==n[h]||C==r[h])&&(i[h++]=_),_+=Bl(C)}if(h<u)return null}let f=0,p=0,m=!1,v=0,b=-1,x=-1,w=/[a-z]/.test(e),S=!0;for(let _=0,T=Math.min(e.length,200),C=0;_<T&&p<u;){let j=la(e,_);l<0&&(f<u&&j==n[f]&&(s[f++]=_),v<u&&(j==n[v]||j==r[v]?(v==0&&(b=_),x=_+1,v++):v=0));let A,E=j<255?j>=48&&j<=57||j>=97&&j<=122?2:j>=65&&j<=90?1:0:(A=H4(j))!=A.toLowerCase()?1:A!=A.toUpperCase()?2:0;(!_||E==1&&w||C==0&&E!=0)&&(n[p]==j||r[p]==j&&(m=!0)?o[p++]=_:o.length&&(S=!1)),C=E,_+=Bl(j)}return p==u&&o[0]==0&&S?this.result(-100+(m?-200:0),o,e):v==u&&b==0?this.ret(-200-e.length+(x==e.length?0:-100),[0,x]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):v==u?this.ret(-900-e.length,[b,x]):p==u?this.result(-100+(m?-200:0)+-700+(S?0:-1100),o,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],s=0;for(let o of n){let l=o+(this.astral?Bl(la(r,o)):1);s&&i[s-1]==o?i[s-1]=l:(i[s++]=o,i[s++]=l)}return this.ret(e-r.length,i)}}class K0e{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let n=e.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+(e.length==this.pattern.length?0:-100),this)}}const Fi=ft.define({combine(t){return sc(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Z0e,filterStrict:!1,compareCompletions:(e,n)=>(e.sortText||e.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>qN(e(r),n(r)),optionClass:(e,n)=>r=>qN(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function qN(t,e){return t?e?t+" "+e:t:e}function Z0e(t,e,n,r,i,s){let o=t.textDirection==ur.RTL,l=o,u=!1,h="top",f,p,m=e.left-i.left,v=i.right-e.right,b=r.right-r.left,x=r.bottom-r.top;if(l&&m<Math.min(b,v)?l=!1:!l&&v<Math.min(b,m)&&(l=!0),b<=(l?m:v))f=Math.max(i.top,Math.min(n.top,i.bottom-x))-e.top,p=Math.min(400,l?m:v);else{u=!0,p=Math.min(400,(o?e.right:i.right-e.left)-30);let _=i.bottom-e.bottom;_>=x||_>e.top?f=n.bottom-e.top:(h="bottom",f=e.bottom-n.top)}let w=(e.bottom-e.top)/s.offsetHeight,S=(e.right-e.left)/s.offsetWidth;return{style:`${h}: ${f/w}px; max-width: ${p/S}px`,class:"cm-completionInfo-"+(u?o?"left-narrow":"right-narrow":l?"left":"right")}}function J0e(t){let e=t.addToOptions.slice();return t.icons&&e.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}),e.push({render(n,r,i,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=n.displayLabel||n.label,u=0;for(let h=0;h<s.length;){let f=s[h++],p=s[h++];f>u&&o.appendChild(document.createTextNode(l.slice(u,f)));let m=o.appendChild(document.createElement("span"));m.appendChild(document.createTextNode(l.slice(f,p))),m.className="cm-completionMatchedText",u=p}return u<l.length&&o.appendChild(document.createTextNode(l.slice(u))),o},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}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function V3(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class ege{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:u=>this.placeInfo(u),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:s,selected:o}=i.open,l=e.state.facet(Fi);this.optionContent=J0e(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=V3(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",u=>{let{options:h}=e.state.field(n).open;for(let f=u.target,p;f&&f!=this.dom;f=f.parentNode)if(f.nodeName=="LI"&&(p=/-(\d+)$/.exec(f.id))&&+p[1]<h.length){this.applyCompletion(e,h[+p[1]]),u.preventDefault();return}}),this.dom.addEventListener("focusout",u=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(Fi).closeOnBlur&&u.relatedTarget!=e.contentDOM&&e.dispatch({effects:xv.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:s,selected:o,disabled:l}=r.open;(!i.open||i.open.options!=s)&&(this.range=V3(s.length,o,e.state.facet(Fi).maxRenderedOptions),this.showOptions(s,r.id)),this.updateSel(),l!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let n=this.tooltipClass(e);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(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;(n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=V3(n.options.length,n.selected,this.view.state.facet(Fi).maxRenderedOptions),this.showOptions(n.options,e.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:i}=n.options[n.selected],{info:s}=i;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(i);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,i)}).catch(l=>Hs(this.view.state,l,"completion info")):(this.addInfoPane(o,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,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),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:s}=e;r.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){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==e?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&&nge(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(s.bottom,n.bottom)-10||i.bottom<Math.max(s.top,n.top)+10?null:this.view.state.facet(Fi).positionInfo(this.view,n,i,r,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,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",o=>{o.target==i&&o.preventDefault()});let s=null;for(let o=r.from;o<r.to;o++){let{completion:l,match:u}=e[o],{section:h}=l;if(h){let m=typeof h=="string"?h:h.name;if(m!=s&&(o>r.from||r.from==0))if(s=m,typeof h!="string"&&h.header)i.appendChild(h.header(h));else{let v=i.appendChild(document.createElement("completion-section"));v.textContent=m}}const f=i.appendChild(document.createElement("li"));f.id=n+"-"+o,f.setAttribute("role","option");let p=this.optionClass(l);p&&(f.className=p);for(let m of this.optionContent){let v=m(l,this.view.state,this.view,u);v&&f.appendChild(v)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function tge(t,e){return n=>new ege(n,t,e)}function nge(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function FN(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function rge(t,e){let n=[],r=null,i=null,s=f=>{n.push(f);let{section:p}=f.completion;if(p){r||(r=[]);let m=typeof p=="string"?p:p.name;r.some(v=>v.name==m)||r.push(typeof p=="string"?{name:m}:p)}},o=e.facet(Fi);for(let f of t)if(f.hasResult()){let p=f.result.getMatch;if(f.result.filter===!1)for(let m of f.result.options)s(new BN(m,f.source,p?p(m):[],1e9-n.length));else{let m=e.sliceDoc(f.from,f.to),v,b=o.filterStrict?new K0e(m):new G0e(m);for(let x of f.result.options)if(v=b.match(x.label)){let w=x.displayLabel?p?p(x,v.matched):[]:v.matched,S=v.score+(x.boost||0);if(s(new BN(x,f.source,w,S)),typeof x.section=="object"&&x.section.rank==="dynamic"){let{name:_}=x.section;i||(i=Object.create(null)),i[_]=Math.max(S,i[_]||-1e9)}}}}if(r){let f=Object.create(null),p=0,m=(v,b)=>(v.rank==="dynamic"&&b.rank==="dynamic"?i[b.name]-i[v.name]:0)||(typeof v.rank=="number"?v.rank:1e9)-(typeof b.rank=="number"?b.rank:1e9)||(v.name<b.name?-1:1);for(let v of r.sort(m))p-=1e5,f[v.name]=p;for(let v of n){let{section:b}=v.completion;b&&(v.score+=f[typeof b=="string"?b:b.name])}}let l=[],u=null,h=o.compareCompletions;for(let f of n.sort((p,m)=>m.score-p.score||h(p.completion,m.completion))){let p=f.completion;!u||u.label!=p.label||u.detail!=p.detail||u.type!=null&&p.type!=null&&u.type!=p.type||u.apply!=p.apply||u.boost!=p.boost?l.push(f):FN(f.completion)>FN(u)&&(l[l.length-1]=f),u=f.completion}return l}class Op{constructor(e,n,r,i,s,o){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=s,this.disabled=o}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new Op(this.options,HN(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,s,o){if(i&&!o&&e.some(h=>h.isPending))return i.setDisabled();let l=rge(e,n);if(!l.length)return i&&e.some(h=>h.isPending)?i.setDisabled():null;let u=n.facet(Fi).selectOnOpen?0:-1;if(i&&i.selected!=u&&i.selected!=-1){let h=i.options[i.selected].completion;for(let f=0;f<l.length;f++)if(l[f].completion==h){u=f;break}}return new Op(l,HN(r,u),{pos:e.reduce((h,f)=>f.hasResult()?Math.min(h,f.from):h,1e8),create:cge,above:s.aboveCursor},i?i.timestamp:Date.now(),u,!1)}map(e){return new Op(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Op(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class fw{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new fw(oge,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(Fi),s=(r.override||n.languageDataAt("autocomplete",lf(n)).map(X0e)).map(u=>(this.active.find(f=>f.source==u)||new mo(u,this.active.some(f=>f.state!=0)?1:0)).update(e,r));s.length==this.active.length&&s.every((u,h)=>u==this.active[h])&&(s=this.active);let o=this.open,l=e.effects.some(u=>u.is(uE));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(u=>u.hasResult()&&e.changes.touchesRange(u.from,u.to))||!ige(s,this.active)||l?o=Op.build(s,n,this.id,o,r,l):o&&o.disabled&&!s.some(u=>u.isPending)&&(o=null),!o&&s.every(u=>!u.isPending)&&s.some(u=>u.hasResult())&&(s=s.map(u=>u.hasResult()?new mo(u.source,0):u));for(let u of e.effects)u.is(fH)&&(o=o&&o.setSelected(u.value,this.id));return s==this.active&&o==this.open?this:new fw(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?sge:age}}function ige(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult();)n++;for(;r<e.length&&!e[r].hasResult();)r++;let i=n==t.length,s=r==e.length;if(i||s)return i==s;if(t[n++].result!=e[r++].result)return!1}}const sge={"aria-autocomplete":"list"},age={};function HN(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const oge=[];function dH(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(cE);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class mo{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=dH(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new mo(i.source,0)),r&4&&i.state==0&&(i=new mo(this.source,1)),i=i.updateFor(e,r);for(let s of e.effects)if(s.is(dw))i=new mo(i.source,1,s.value);else if(s.is(xv))i=new mo(i.source,0);else if(s.is(uE))for(let o of s.value)o.source==i.source&&(i=o);return i}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(lf(e.state))}}class Vp extends mo{constructor(e,n,r,i,s,o){super(e,3,n),this.limit=r,this.result=i,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=lf(e.state);if(l>o||!i||n&2&&(lf(e.startState)==this.from||l<this.limit))return new mo(this.source,n&4?1:0);let u=e.changes.mapPos(this.limit);return lge(i.validFor,e.state,s,o)?new Vp(this.source,this.explicit,u,i,s,o):i.update&&(i=i.update(i,s,o,new uH(e.state,l,!1)))?new Vp(this.source,this.explicit,u,i,i.from,(r=i.to)!==null&&r!==void 0?r:lf(e.state)):new mo(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Vp(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new mo(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function lge(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):hH(t,!0).test(i)}const uE=qt.define({map(t,e){return t.map(n=>n.map(e))}}),fH=qt.define(),ca=Xi.define({create(){return fw.start()},update(t,e){return t.update(e)},provide:t=>[aE.from(t,e=>e.tooltip),it.contentAttributes.from(t,e=>e.attrs)]});function hE(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(ca).active.find(i=>i.source==e.source);return r instanceof Vp?(typeof n=="string"?t.dispatch({...Y0e(t.state,n,r.from,r.to),annotations:cE.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const cge=tge(ca,hE);function h1(t,e="option"){return n=>{let r=n.state.field(ca,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Fi).interactionDelay)return!1;let i=1,s;e=="page"&&(s=UF(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:o}=r.open.options,l=r.open.selected>-1?r.open.selected+i*(t?1:-1):t?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),n.dispatch({effects:fH.of(l)}),!0}}const uge=t=>{let e=t.state.field(ca,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Fi).interactionDelay?!1:hE(t,e.open.options[e.open.selected])},U3=t=>t.state.field(ca,!1)?(t.dispatch({effects:dw.of(!0)}),!0):!1,hge=t=>{let e=t.state.field(ca,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:xv.of(null)}),!0)};class dge{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const fge=50,pge=1e3,mge=Zr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(ca).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(ca),n=t.state.facet(Fi);if(!t.selectionSet&&!t.docChanged&&t.startState.field(ca)==e)return;let r=t.transactions.some(s=>{let o=dH(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;s<this.running.length;s++){let o=this.running[s];if(r||o.context.abortOnDocChange&&t.docChanged||o.updates.length+t.transactions.length>fge&&Date.now()-o.time>pge){for(let l of o.context.abortListeners)try{l()}catch(u){Hs(this.view.state,u)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(s=>s.effects.some(o=>o.is(dw)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let s of t.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(ca);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Fi).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=lf(e),r=new uH(e,n,t.explicit,this.view),i=new dge(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:xv.of(null)}),Hs(this.view.state,s)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Fi).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Fi),r=this.view.state.field(ca);for(let i=0;i<this.running.length;i++){let s=this.running[i];if(s.done===void 0)continue;if(this.running.splice(i--,1),s.done){let l=lf(s.updates.length?s.updates[0].startState:this.view.state),u=Math.min(l,s.done.from+(s.active.explicit?0:1)),h=new Vp(s.active.source,s.active.explicit,u,s.done,s.done.from,(t=s.done.to)!==null&&t!==void 0?t:l);for(let f of s.updates)h=h.update(f,n);if(h.hasResult()){e.push(h);continue}}let o=r.active.find(l=>l.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new mo(s.active.source,0);for(let u of s.updates)l=l.update(u,n);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:uE.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(ca,!1);if(e&&e.tooltip&&this.view.state.facet(Fi).closeOnBlur){let n=e.open&&UF(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:xv.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:dw.of(!1)}),20),this.composing=0}}}),gge=typeof navigator=="object"&&/Win/.test(navigator.platform),vge=lu.highest(it.domEventHandlers({keydown(t,e){let n=e.state.field(ca,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(gge&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(o=>o.source==r.source),s=r.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&hE(e,r),!1}})),pH=it.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"},".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"}}});class bge{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class dE{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,us.TrackDel),r=e.mapPos(this.to,1,us.TrackDel);return n==null||r==null?null:new dE(this.field,n,r)}}class fE{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],s=e.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let u of this.lines){if(r.length){let h=o,f=/^\t*/.exec(u)[0].length;for(let p=0;p<f;p++)h+=e.facet(lb);i.push(n+h.length-f),u=h+u.slice(f)}r.push(u),n+=u.length+1}let l=this.fieldPositions.map(u=>new dE(u.field,i[u.line]+u.from,i[u.line]+u.to));return{text:r,ranges:l}}static parse(e){let n=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,u=s[2]||s[3]||"",h=-1,f=u.replace(/\\[{}]/g,p=>p[1]);for(let p=0;p<n.length;p++)(l!=null?n[p].seq==l:f&&n[p].name==f)&&(h=p);if(h<0){let p=0;for(;p<n.length&&(l==null||n[p].seq!=null&&n[p].seq<l);)p++;n.splice(p,0,{seq:l,name:f}),h=p;for(let m of i)m.field>=h&&m.field++}for(let p of i)if(p.line==r.length&&p.from>s.index){let m=s[2]?3+(s[1]||"").length:2;p.from-=m,p.to-=m}i.push(new bge(h,r.length,s.index,s.index+f.length)),o=o.slice(0,s.index)+u+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,u,h)=>{for(let f of i)f.line==r.length&&f.from>h&&(f.from--,f.to--);return u}),r.push(o)}return new fE(r,i)}}let yge=Ct.widget({widget:new class extends fl{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),xge=Ct.mark({class:"cm-snippetField"});class Gm{constructor(e,n){this.ranges=e,this.active=n,this.deco=Ct.set(e.map(r=>(r.from==r.to?yge:xge).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Gm(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const ub=qt.define({map(t,e){return t&&t.map(e)}}),wge=qt.define(),wv=Xi.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(ub))return n.value;if(n.is(wge)&&t)return new Gm(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>it.decorations.from(t,e=>e?e.deco:Ct.none)});function pE(t,e){return $e.create(t.filter(n=>n.field==e).map(n=>$e.range(n.from,n.to)))}function fp(t){let e=fE.parse(t);return(n,r,i,s)=>{let{text:o,ranges:l}=e.instantiate(n.state,i),{main:u}=n.state.selection,h={changes:{from:i,to:s==u.from?u.to:s,insert:jn.of(o)},scrollIntoView:!0,annotations:r?[cE.of(r),gi.userEvent.of("input.complete")]:void 0};if(l.length&&(h.selection=pE(l,0)),l.some(f=>f.field>0)){let f=new Gm(l,0),p=h.effects=[ub.of(f)];n.state.field(wv,!1)===void 0&&p.push(qt.appendConfig.of([wv,Cge,kge,pH]))}n.dispatch(n.state.update(h))}}function mH(t){return({state:e,dispatch:n})=>{let r=e.field(wv,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,s=t>0&&!r.ranges.some(o=>o.field==i+t);return n(e.update({selection:pE(r.ranges,i),effects:ub.of(s?null:new Gm(r.ranges,i)),scrollIntoView:!0})),!0}}const Sge=({state:t,dispatch:e})=>t.field(wv,!1)?(e(t.update({effects:ub.of(null)})),!0):!1,jge=mH(1),_ge=mH(-1),Tge=[{key:"Tab",run:jge,shift:_ge},{key:"Escape",run:Sge}],VN=ft.define({combine(t){return t.length?t[0]:Tge}}),Cge=lu.highest(Ch.compute([VN],t=>t.facet(VN))),kge=it.domEventHandlers({mousedown(t,e){let n=e.state.field(wv,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:pE(n.ranges,i.field),effects:ub.of(n.ranges.some(s=>s.field>i.field)?new Gm(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Sv={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},qd=qt.define({map(t,e){let n=e.mapPos(t,-1,us.TrackAfter);return n??void 0}}),mE=new class extends Dh{};mE.startSide=1;mE.endSide=-1;const gH=Xi.define({create(){return dn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(qd)&&(t=t.update({add:[mE.range(n.value,n.value+1)]}));return t}});function vH(){return[Ege,gH]}const Q3="()[]{}<>«»»«［］｛｝";function bH(t){for(let e=0;e<Q3.length;e+=2)if(Q3.charCodeAt(e)==t)return Q3.charAt(e+1);return H4(t<128?t:t+1)}function yH(t,e){return t.languageDataAt("closeBrackets",e)[0]||Sv}const Oge=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Ege=it.inputHandler.of((t,e,n,r)=>{if((Oge?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Bl(la(r,0))==1||e!=i.from||n!=i.to)return!1;let s=Mge(t.state,r);return s?(t.dispatch(s),!0):!1}),Age=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=yH(t,t.selection.main.head).brackets||Sv.brackets,i=null,s=t.changeByRange(o=>{if(o.empty){let l=Rge(t.doc,o.head);for(let u of r)if(u==l&&dS(t.doc,o.head)==bH(la(u,0)))return{changes:{from:o.head-u.length,to:o.head+u.length},range:$e.cursor(o.head-u.length)}}return{range:i=o}});return i||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},xH=[{key:"Backspace",run:Age}];function Mge(t,e){let n=yH(t,t.selection.main.head),r=n.brackets||Sv.brackets;for(let i of r){let s=bH(la(i,0));if(e==i)return s==i?Pge(t,i,r.indexOf(i+i+i)>-1,n):Dge(t,i,s,n.before||Sv.before);if(e==s&&wH(t,t.selection.main.from))return Nge(t,i,s)}return null}function wH(t,e){let n=!1;return t.field(gH).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function dS(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Bl(la(n,0)))}function Rge(t,e){let n=t.sliceString(e-2,e);return Bl(la(n,0))==n.length?n:n.slice(1)}function Dge(t,e,n,r){let i=null,s=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:n,from:o.to}],effects:qd.of(o.to+e.length),range:$e.range(o.anchor+e.length,o.head+e.length)};let l=dS(t.doc,o.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+n,from:o.head},effects:qd.of(o.head+e.length),range:$e.cursor(o.head+e.length)}:{range:i=o}});return i?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Nge(t,e,n){let r=null,i=t.changeByRange(s=>s.empty&&dS(t.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:$e.cursor(s.head+n.length)}:r={range:s});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Pge(t,e,n,r){let i=r.stringPrefixes||Sv.stringPrefixes,s=null,o=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:qd.of(l.to+e.length),range:$e.range(l.anchor+e.length,l.head+e.length)};let u=l.head,h=dS(t.doc,u),f;if(h==e){if(UN(t,u))return{changes:{insert:e+e,from:u},effects:qd.of(u+e.length),range:$e.cursor(u+e.length)};if(wH(t,u)){let m=n&&t.sliceDoc(u,u+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:u,to:u+m.length,insert:m},range:$e.cursor(u+m.length)}}}else{if(n&&t.sliceDoc(u-2*e.length,u)==e+e&&(f=QN(t,u-2*e.length,i))>-1&&UN(t,f))return{changes:{insert:e+e+e+e,from:u},effects:qd.of(u+e.length),range:$e.cursor(u+e.length)};if(t.charCategorizer(u)(h)!=Rr.Word&&QN(t,u,i)>-1&&!Lge(t,u,e,i))return{changes:{insert:e+e,from:u},effects:qd.of(u+e.length),range:$e.cursor(u+e.length)}}return{range:s=l}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function UN(t,e){let n=Ai(t).resolveInner(e+1);return n.parent&&n.from==e}function Lge(t,e,n,r){let i=Ai(t).resolveInner(e,-1),s=r.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+s)),u=l.indexOf(n);if(!u||u>-1&&r.indexOf(l.slice(0,u))>-1){let f=i.firstChild;for(;f&&f.from==i.from&&f.to-f.from>n.length+u;){if(t.sliceDoc(f.to-n.length,f.to)==n)return!1;f=f.firstChild}return!0}let h=i.to==e&&i.parent;if(!h)break;i=h}return!1}function QN(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Rr.Word)return e;for(let i of n){let s=e-i.length;if(t.sliceDoc(s,e)==i&&r(t.sliceDoc(s-1,s))!=Rr.Word)return s}return-1}function SH(t={}){return[vge,ca,Fi.of(t),mge,$ge,pH]}const gE=[{key:"Ctrl-Space",run:U3},{mac:"Alt-`",run:U3},{mac:"Alt-i",run:U3},{key:"Escape",run:hge},{key:"ArrowDown",run:h1(!0)},{key:"ArrowUp",run:h1(!1)},{key:"PageDown",run:h1(!0,"page")},{key:"PageUp",run:h1(!1,"page")},{key:"Enter",run:uge}],$ge=lu.highest(Ch.computeN([Fi],t=>t.facet(Fi).defaultKeymap?[gE]:[])),vE=[{label:"y"},{label:"w"},{label:"d"},{label:"h"},{label:"m"},{label:"s"},{label:"ms"}],Ige=[{label:"="},{label:"!="},{label:"=~"},{label:"!~"}],jH=[{label:"^"},{label:"*"},{label:"/"},{label:"%"},{label:"+"},{label:"-"},{label:"=="},{label:">="},{label:">"},{label:"<"},{label:"<="},{label:"!="},{label:"atan2"},{label:"and"},{label:"or"},{label:"unless"}],Bge=[{label:"on",info:"Match only on specified labels",type:"keyword"},{label:"ignoring",info:"Ignore specified labels for matching",type:"keyword"},{label:"group_left",info:"Allow many-to-one matching",type:"keyword"},{label:"group_right",info:"Allow one-to-many matching",type:"keyword"},{label:"bool",info:"Return boolean result (0 or 1) instead of filtering",type:"keyword"},{label:"fill",info:"Fill in missing series on both sides",type:"keyword"},{label:"fill_left",info:"Fill in missing series on the left side",type:"keyword"},{label:"fill_right",info:"Fill in missing series on the right side",type:"keyword"}],zge=[{label:"start()",info:"resolve to the start of the query",type:"keyword"},{label:"end()",info:"resolve to the end of the query",type:"keyword"}],qge=[{label:"abs",detail:"function",info:"Return absolute values of input series",type:"function"},{label:"absent",detail:"function",info:"Determine whether input vector is empty",type:"function"},{label:"absent_over_time",detail:"function",info:"Determine whether input range vector is empty",type:"function"},{label:"acos",detail:"function",info:"Calculate the arccosine, in radians, for input series",type:"function"},{label:"acosh",detail:"function",info:"Calculate the inverse hyperbolic cosine, in radians, for input series",type:"function"},{label:"asin",detail:"function",info:"Calculate the arcsine, in radians, for input series",type:"function"},{label:"asinh",detail:"function",info:"Calculate the inverse hyperbolic sine, in radians, for input series",type:"function"},{label:"atan",detail:"function",info:"Calculate the arctangent, in radians, for input series",type:"function"},{label:"atanh",detail:"function",info:"Calculate the inverse hyperbolic tangent, in radians, for input series",type:"function"},{label:"avg_over_time",detail:"function",info:"Average series values over time",type:"function"},{label:"ceil",detail:"function",info:"Round up values of input series to nearest integer",type:"function"},{label:"changes",detail:"function",info:"Return number of value changes in input series over time",type:"function"},{label:"clamp",detail:"function",info:"Limit the value of input series between a minimum and a maximum",type:"function"},{label:"clamp_max",detail:"function",info:"Limit the value of input series to a maximum",type:"function"},{label:"clamp_min",detail:"function",info:"Limit the value of input series to a minimum",type:"function"},{label:"cos",detail:"function",info:"Calculate the cosine, in radians, for input series",type:"function",boost:-1},{label:"cosh",detail:"function",info:"Calculate the hyperbolic cosine, in radians, for input series",type:"function",boost:-1},{label:"count_over_time",detail:"function",info:"Count the number of values for each input series",type:"function"},{label:"days_in_month",detail:"function",info:"Return the number of days in current month for provided timestamps",type:"function"},{label:"day_of_month",detail:"function",info:"Return the day of the month for provided timestamps",type:"function"},{label:"day_of_week",detail:"function",info:"Return the day of the week for provided timestamps",type:"function"},{label:"day_of_year",detail:"function",info:"Return the day of the year for provided timestamps",type:"function"},{label:"deg",detail:"function",info:"Convert radians to degrees for input series",type:"function",boost:-1},{label:"delta",detail:"function",info:"Calculate the difference between beginning and end of a range vector (for gauges)",type:"function"},{label:"deriv",detail:"function",info:"Calculate the per-second derivative over series in a range vector (for gauges)",type:"function"},{label:"exp",detail:"function",info:"Calculate exponential function for input vector values",type:"function"},{label:"floor",detail:"function",info:"Round down values of input series to nearest integer",type:"function"},{label:"histogram_avg",detail:"function",info:"Return the average of observations from a native histogram",type:"function"},{label:"histogram_count",detail:"function",info:"Return the count of observations from a native histogram",type:"function"},{label:"histogram_fraction",detail:"function",info:"Calculate fractions of observations within an interval from a native histogram",type:"function"},{label:"histogram_quantile",detail:"function",info:"Calculate quantiles from native histograms and from conventional histogram buckets",type:"function"},{label:"histogram_sum",detail:"function",info:"Return the sum of observations from a native histogram",type:"function"},{label:"histogram_stddev",detail:"function",info:"Estimate the standard deviation of observations from a native histogram",type:"function"},{label:"histogram_stdvar",detail:"function",info:"Estimate the standard variance of observations from a native histogram",type:"function"},{label:"double_exponential_smoothing",detail:"function",info:"Calculate smoothed value of input series",type:"function"},{label:"hour",detail:"function",info:"Return the hour of the day for provided timestamps",type:"function"},{label:"idelta",detail:"function",info:"Calculate the difference between the last two samples of a range vector (for counters)",type:"function"},{label:"increase",detail:"function",info:"Calculate the increase in value over a range of time (for counters)",type:"function"},{label:"info",detail:"function",info:"Add data labels from corresponding info metrics",type:"function"},{label:"irate",detail:"function",info:"Calculate the per-second increase over the last two samples of a range vector (for counters)",type:"function"},{label:"label_replace",detail:"function",info:"Set or replace label values",type:"function"},{label:"label_join",detail:"function",info:"Join together label values into new label",type:"function"},{label:"last_over_time",detail:"function",info:"The most recent point value in specified interval.",type:"function"},{label:"ln",detail:"function",info:"Calculate natural logarithm of input series",type:"function"},{label:"log10",detail:"function",info:"Calulcate base-10 logarithm of input series",type:"function"},{label:"log2",detail:"function",info:"Calculate base-2 logarithm of input series",type:"function"},{label:"mad_over_time",detail:"function",info:"Return the median absolute deviation over time for input series",type:"function"},{label:"max_over_time",detail:"function",info:"Return the maximum value over time for input series",type:"function"},{label:"min_over_time",detail:"function",info:"Return the minimum value over time for input series",type:"function"},{label:"ts_of_max_over_time",detail:"function",info:"Return the timestamp of the maximum value over time for input series",type:"function"},{label:"ts_of_min_over_time",detail:"function",info:"Return the timestamp of the minimum value over time for input series",type:"function"},{label:"ts_of_last_over_time",detail:"function",info:"Return the timestamp of the last value over time for input series",type:"function"},{label:"minute",detail:"function",info:"Return the minute of the hour for provided timestamps",type:"function"},{label:"month",detail:"function",info:"Return the month for provided timestamps",type:"function"},{label:"pi",detail:"function",info:"Return pi",type:"function"},{label:"predict_linear",detail:"function",info:"Predict the value of a gauge into the future",type:"function"},{label:"present_over_time",detail:"function",info:"the value 1 for any series in the specified interval",type:"function"},{label:"quantile_over_time",detail:"function",info:"Calculate value quantiles over time for input series",type:"function"},{label:"rad",detail:"function",info:"Convert degrees to radians for input series",type:"function",boost:-1},{label:"rate",detail:"function",info:"Calculate per-second increase over a range vector (for counters)",type:"function"},{label:"resets",detail:"function",info:"Return number of value decreases (resets) in input series of time",type:"function"},{label:"round",detail:"function",info:"Round values of input series to nearest integer",type:"function"},{label:"scalar",detail:"function",info:"Convert single-element series vector into scalar value",type:"function"},{label:"sgn",detail:"function",info:"Returns the sign of the instant vector",type:"function"},{label:"sin",detail:"function",info:"Calculate the sine, in radians, for input series",type:"function"},{label:"sinh",detail:"function",info:"Calculate the hyperbolic sine, in radians, for input series",type:"function"},{label:"sort",detail:"function",info:"Sort input series ascendingly by value",type:"function"},{label:"sort_desc",detail:"function",info:"Sort input series descendingly by value",type:"function"},{label:"sort_by_label",detail:"function",info:"Sort input series ascendingly by label value",type:"function"},{label:"sort_by_label_desc",detail:"function",info:"Sort input series descendingly by value value",type:"function"},{label:"sqrt",detail:"function",info:"Return the square root for input series",type:"function"},{label:"stddev_over_time",detail:"function",info:"Calculate the standard deviation within input series over time",type:"function"},{label:"stdvar_over_time",detail:"function",info:"Calculate the standard variance within input series over time",type:"function"},{label:"sum_over_time",detail:"function",info:"Calculate the sum over the values of input series over time",type:"function"},{label:"tan",detail:"function",info:"Calculate the tangent, in radians, for input series",type:"function"},{label:"tanh",detail:"function",info:"Calculate the hyperbolic tangent, in radians, for input series",type:"function"},{label:"time",detail:"function",info:"Return the Unix timestamp at the current evaluation time",type:"function"},{label:"timestamp",detail:"function",info:"Return the Unix timestamp for the samples in the input vector",type:"function"},{label:"vector",detail:"function",info:"Convert a scalar value into a single-element series vector",type:"function"},{label:"year",detail:"function",info:"Return the year for provided timestamps",type:"function"}],_H=[{label:"avg",detail:"aggregation",info:"Calculate the average over dimensions",type:"keyword"},{label:"bottomk",detail:"aggregation",info:"Smallest k elements by sample value",type:"keyword"},{label:"count",detail:"aggregation",info:"Count number of elements in the vector",type:"keyword"},{label:"count_values",detail:"aggregation",info:"Count number of elements with the same value",type:"keyword"},{label:"group",detail:"aggregation",info:"Group series, while setting the sample value to 1",type:"keyword"},{label:"limitk",detail:"aggregation",info:"Sample k elements",type:"keyword"},{label:"limit_ratio",detail:"aggregation",info:"Sample given ratio of elements",type:"keyword"},{label:"max",detail:"aggregation",info:"Select maximum over dimensions",type:"keyword"},{label:"min",detail:"aggregation",info:"Select minimum over dimensions",type:"keyword"},{label:"quantile",detail:"aggregation",info:"Calculate φ-quantile (0 ≤ φ ≤ 1) over dimensions",type:"keyword"},{label:"stddev",detail:"aggregation",info:"Calculate population standard deviation over dimensions",type:"keyword"},{label:"stdvar",detail:"aggregation",info:"Calculate population standard variance over dimensions",type:"keyword"},{label:"sum",detail:"aggregation",info:"Calculate sum over dimensions",type:"keyword"},{label:"topk",detail:"aggregation",info:"Largest k elements by sample value",type:"keyword"}],Fge=[{label:"by",info:"Keep the listed labels, remove all others.",type:"keyword"},{label:"without",info:"Remove the listed labels, preserve all others.",type:"keyword"}],Hge=[{label:"nan",info:"Floating-point NaN value",type:"constant"},{label:"inf",info:"Floating-point infinity",type:"constant"}],Vge=[{label:"sum(rate(__input_vector__[5m]))",type:"function",detail:"snippet",info:"Sum over rates of increase",apply:fp("sum(rate(${__input_vector__}[5m]))")},{label:"histogram_quantile(__quantile__, sum by(le) (rate(__histogram_metric__[5m])))",type:"function",detail:"snippet",info:"Approximate a quantile value from an aggregated histogram",apply:fp("histogram_quantile(${__quantile__}, sum by(le) (rate(${__histogram_metric__}[5m])))")},{label:'label_replace(__input_vector__, "__dst__", "__replacement__", "__src__", "__regex__")',type:"function",detail:"snippet",info:"Set or replace a label value in an input vector",apply:fp('label_replace(${__input_vector__}, "${__dst__}", "${__replacement__}", "${__src__}", "${__regex__}")')},{label:"topk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Largest k elements by sample value",apply:fp("topk(${__rank_number__}, ${__input_vector__})")},{label:"bottomk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Smallest k elements by sample value",apply:fp("bottomk(${__rank_number__}, ${__input_vector__})")},{label:'count_values("__label_name__", __input_vector__)',type:"function",detail:"snippet",info:"Count the number of series per distinct sample value",apply:fp('count_values("${__label_name__}", ${__metric__})')}],Nc={matchOp:Ige,binOp:jH,duration:vE,binOpModifier:Bge,atModifier:zge,functionIdentifier:qge,aggregateOp:_H,aggregateOpModifier:Fge,number:Hge};var bt;(function(t){t[t.MetricName=0]="MetricName",t[t.LabelName=1]="LabelName",t[t.LabelValue=2]="LabelValue",t[t.Function=3]="Function",t[t.Aggregation=4]="Aggregation",t[t.BinOpModifier=5]="BinOpModifier",t[t.BinOp=6]="BinOp",t[t.MatchOp=7]="MatchOp",t[t.AggregateOpModifier=8]="AggregateOpModifier",t[t.Duration=9]="Duration",t[t.Offset=10]="Offset",t[t.Bool=11]="Bool",t[t.AtModifiers=12]="AtModifiers",t[t.Number=13]="Number"})(bt||(bt={}));function Uge(t,e){const n=F4(t,eS);if(!n)return"";let r="";return n.cursor().iterate(i=>{if(i.type.id===nb&&(r=wg(i.node,e),r))return!1}),r}function wg(t,e){let n=F4(t,nb);return!n||(n=n.getChild(Wx),!n)?"":e.sliceDoc(n.from,n.to)}function Qge(t,e,n,r=!1,i=!0){const s=t;return r&&s.push(...Vge),{from:e,to:n,options:s,validFor:i?/^[a-zA-Z0-9_:]+$/:void 0}}function Wge(t,e){var n,r;return t.type.id===0?e:t.type.id===Bp||t.type.id===$p||t.type.id===_h||t.type.id===wm||t.type.id===pf?t.to-1:t.type.id===xm&&(((n=t.parent)===null||n===void 0?void 0:n.type.id)===bh||((r=t.parent)===null||r===void 0?void 0:r.type.id)===of)?t.parent.to-1:t.to}const Yge=new RegExp(`^(\\d+(${vE.map(t=>t.label).join("|")}))+$`);function WN(t,e){if(e.from>=e.to)return!1;const n=t.sliceDoc(e.from,e.to);return Yge.test(n)}function Xge(t,e){let n=t.from+1;return t.firstChild!==null&&(n=e),n}function Gge(t,e,n){var r,i,s,o,l,u,h;const f=t.doc.slice(e.from,n).toString();let p=e.from;return e.type.id===Bp||e.type.id===$p?p=Xge(e,n):e.type.id===_h&&e.firstChild===null||e.type.id===xm&&(((r=e.parent)===null||r===void 0?void 0:r.type.id)===bh||((i=e.parent)===null||i===void 0?void 0:i.type.id)===of)?p++:(e.type.id===lv||e.type.id===Yx&&!vE.map(m=>m.label).includes(f[f.length-1])||e.type.id===tS&&((s=e.parent)===null||s===void 0?void 0:s.type.id)===0&&((o=e.parent.parent)===null||o===void 0?void 0:o.type.id)===pf||e.type.id===_h&&TH(e)&&e.firstChild!==null||e.type.id===0&&(((l=e.parent)===null||l===void 0?void 0:l.type.id)===lv||((u=e.parent)===null||u===void 0?void 0:u.type.id)===wm||((h=e.parent)===null||h===void 0?void 0:h.type.id)===pf&&yh(e.parent,Yx)))&&(p=n),p}function TH(t){var e;const n=t.parent;if(n!==null&&((e=n.firstChild)===null||e===void 0?void 0:e.type.id)===uhe){const r=n.firstChild.firstChild;if(r!==null&&[fq,cq,hq,dq,uq].includes(r.type.id))return!0}return!1}function Kge(t,e,n){var r,i,s,o,l,u,h,f,p,m,v,b,x,w,S,_,T,C,j,A,E;const R=[];switch(e.type.id){case 0:{if(((r=e.parent)===null||r===void 0?void 0:r.type.id)===lv){R.push({kind:bt.Duration});break}if(((i=e.parent)===null||i===void 0?void 0:i.type.id)===bh||((s=e.parent)===null||s===void 0?void 0:s.type.id)===of){R.push({kind:bt.MatchOp});break}if(((o=e.parent)===null||o===void 0?void 0:o.type.id)===wm){R.push({kind:bt.Duration});break}if(((l=e.parent)===null||l===void 0?void 0:l.type.id)===pf&&yh(e.parent,Yx)){R.push({kind:bt.Duration});break}const N=t.sliceDoc(e.from,e.to);jH.filter($=>$.label.includes(N)).length>0&&R.push({kind:bt.BinOp});break}case Wx:{if(((u=e.parent)===null||u===void 0?void 0:u.type.id)===0){const D=e.parent.parent;if((D==null?void 0:D.type.id)===q4){R.push({kind:bt.AtModifiers});break}if((D==null?void 0:D.type.id)===eS){R.push({kind:bt.AggregateOpModifier},{kind:bt.BinOp});break}if((D==null?void 0:D.type.id)===nb){const F=wg(e,t);_H.filter(Q=>Q.label===F).length>0&&R.push({kind:bt.AggregateOpModifier}),R.push({kind:bt.BinOp},{kind:bt.Offset});break}if(D&&AD(D,"Expr")){R.push({kind:bt.BinOp},{kind:bt.Offset});break}}const N=(h=e.parent)===null||h===void 0?void 0:h.parent;if(!N){R.push({kind:bt.MetricName,metricName:t.sliceDoc(e.from,e.to)});break}AD(N,"Expr","Expr")&&N.type.id!==_h?N.type.id===Ip&&!yh(N,0)&&(R.push({kind:bt.MetricName,metricName:t.sliceDoc(e.from,e.to)},{kind:bt.Function},{kind:bt.Aggregation},{kind:bt.BinOpModifier},{kind:bt.Number}),yh(N,YC,XC,GC,KC,ZC,ov)&&!yh(N,pq)&&R.push({kind:bt.Bool})):(R.push({kind:bt.MetricName,metricName:t.sliceDoc(e.from,e.to)},{kind:bt.Function},{kind:bt.Aggregation}),N.type.id!==_h&&N.type.id!==wm&&R.push({kind:bt.Number}));break}case che:e.firstChild!==null&&e.firstChild.type.id===0&&R.push({kind:bt.MetricName,metricName:""},{kind:bt.Function},{kind:bt.Aggregation},{kind:bt.Number});break;case $p:R.push({kind:bt.LabelName,metricName:Uge(e,t)});break;case Bp:{if(n>=e.to)break;R.push({kind:bt.LabelName,metricName:wg(e,t)});break}case sv:((f=e.parent)===null||f===void 0?void 0:f.type.id)===$p?R.push({kind:bt.LabelName}):((p=e.parent)===null||p===void 0?void 0:p.type.id)===bh&&R.push({kind:bt.LabelName,metricName:wg(e,t)});break;case xm:if(((m=e.parent)===null||m===void 0?void 0:m.type.id)===bh||((v=e.parent)===null||v===void 0?void 0:v.type.id)===of){let N="";((b=e.parent.firstChild)===null||b===void 0?void 0:b.type.id)===sv?N=t.sliceDoc(e.parent.firstChild.from,e.parent.firstChild.to):((x=e.parent.firstChild)===null||x===void 0?void 0:x.type.id)===av&&(N=t.sliceDoc(e.parent.firstChild.from,e.parent.firstChild.to).slice(1,-1));const $=wg(e,t),D=F4(e,Bp),F=[av,of,bh];let Q=[];for(const H of F)Q=Q.concat(Tq(D?D.getChildren(H):[],t));R.push({kind:bt.LabelValue,metricName:$,labelName:N,matchers:Q})}else((S=(w=e.parent)===null||w===void 0?void 0:w.parent)===null||S===void 0?void 0:S.type.id)===$p?R.push({kind:bt.LabelName}):((T=(_=e.parent)===null||_===void 0?void 0:_.parent)===null||T===void 0?void 0:T.type.id)===Bp&&R.push({kind:bt.MetricName,metricName:t.sliceDoc(e.from,e.to).slice(1,-1)});break;case tS:((C=e.parent)===null||C===void 0?void 0:C.type.id)===0&&((j=e.parent.parent)===null||j===void 0?void 0:j.type.id)===pf?WN(t,e)||R.push({kind:bt.Duration}):R.push({kind:bt.Number});break;case Yx:WN(t,e)||R.push({kind:bt.Duration});break;case lv:R.push({kind:bt.Duration});break;case _h:if(TH(e)){if(e.firstChild===null||e.firstChild.from<=n&&e.firstChild.to>=n){R.push({kind:bt.Number});break}R.push({kind:bt.MetricName,metricName:""},{kind:bt.Function},{kind:bt.Aggregation});break}R.push({kind:bt.MetricName,metricName:""},{kind:bt.Function},{kind:bt.Aggregation});break;case ov:((A=e.parent)===null||A===void 0?void 0:A.type.id)===Xx?R.push({kind:bt.MatchOp}):((E=e.parent)===null||E===void 0?void 0:E.type.id)===Ip&&R.push({kind:bt.BinOp});break;case rb:case wq:case Sq:case Xx:R.push({kind:bt.MatchOp});break;case hhe:case vhe:case bhe:case yhe:case xhe:case whe:case YC:case XC:case GC:case KC:case ZC:case I4:case z4:case B4:case Ip:R.push({kind:bt.BinOp});break}return R}class W3{constructor(e,n=1e4){this.prometheusClient=e,this.maxMetricsMetadata=n}getPrometheusClient(){return this.prometheusClient}destroy(){var e,n;(n=(e=this.prometheusClient)===null||e===void 0?void 0:e.destroy)===null||n===void 0||n.call(e)}promQL(e){const{state:n,pos:r}=e,i=Ai(n).resolve(r,-1),s=Kge(n,i,r);let o=Promise.resolve([]),l=!1,u=!0;for(const h of s)switch(h.kind){case bt.Aggregation:l=!0,o=o.then(f=>f.concat(Nc.aggregateOp));break;case bt.Function:l=!0,o=o.then(f=>f.concat(Nc.functionIdentifier));break;case bt.BinOpModifier:o=o.then(f=>f.concat(Nc.binOpModifier));break;case bt.BinOp:o=o.then(f=>f.concat(Nc.binOp));break;case bt.MatchOp:o=o.then(f=>f.concat(Nc.matchOp));break;case bt.AggregateOpModifier:o=o.then(f=>f.concat(Nc.aggregateOpModifier));break;case bt.Duration:u=!1,o=o.then(f=>f.concat(Nc.duration));break;case bt.Offset:o=o.then(f=>f.concat([{label:"offset"}]));break;case bt.Bool:o=o.then(f=>f.concat([{label:"bool"}]));break;case bt.AtModifiers:o=o.then(f=>f.concat(Nc.atModifier));break;case bt.Number:o=o.then(f=>f.concat(Nc.number));break;case bt.MetricName:o=o.then(f=>this.autocompleteMetricName(f,h));break;case bt.LabelName:o=o.then(f=>this.autocompleteLabelName(f,h));break;case bt.LabelValue:o=o.then(f=>this.autocompleteLabelValue(f,h))}return o.then(h=>Qge(h,Gge(n,i,r),Wge(i,r),l,u))}autocompleteMetricName(e,n){if(!this.prometheusClient)return e;const r=new Map;return this.prometheusClient.metricNames(n.metricName).then(i=>{var s;for(const o of i)r.set(o,{label:o,type:"constant"});if(i.length<=this.maxMetricsMetadata)return(s=this.prometheusClient)===null||s===void 0?void 0:s.metricMetadata()}).then(i=>{var s;if(i)for(const[o,l]of r){const u=(s=i[o])!==null&&s!==void 0?s:i[o.replace(/(_count|_sum|_bucket|_total)$/,"")];if(u){if(u.length>1)for(const h of u)l.detail===""?l.detail=h.type:l.detail!==h.type&&(l.detail="unknown",l.info="multiple different definitions for this metric"),l.info===""?l.info=h.help:l.info!==h.help&&(l.info="multiple different definitions for this metric");else if(u.length===1){let{type:h,help:f}=u[0];(h==="histogram"||h==="summary")&&(o.endsWith("_count")&&(h="counter",f=`The total number of observations for: ${f}`),o.endsWith("_sum")&&(h="counter",f=`The total sum of observations for: ${f}`),o.endsWith("_bucket")&&(h="counter",f=`The total count of observations for a bucket in the histogram: ${f}`)),l.detail=h,l.info=f}}}return e.concat(Array.from(r.values()))})}autocompleteLabelName(e,n){return this.prometheusClient?this.prometheusClient.labelNames(n.metricName).then(r=>e.concat(r.map(i=>({label:i,type:"constant"})))):e}autocompleteLabelValue(e,n){return!this.prometheusClient||!n.labelName?e:this.prometheusClient.labelValues(n.labelName,n.metricName,n.matchers).then(r=>e.concat(r.map(i=>({label:i,type:"text"}))))}}const Zge=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,CH=new Set,zk=typeof process=="object"&&process?process:{},kH=(t,e,n,r)=>{typeof zk.emitWarning=="function"?zk.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)};let pw=globalThis.AbortController,YN=globalThis.AbortSignal;var u7;if(typeof pw>"u"){YN=class{constructor(){Yn(this,"onabort");Yn(this,"_onabort",[]);Yn(this,"reason");Yn(this,"aborted",!1)}addEventListener(r,i){this._onabort.push(i)}},pw=class{constructor(){Yn(this,"signal",new YN);e()}abort(r){var i,s;if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(const o of this.signal._onabort)o(r);(s=(i=this.signal).onabort)==null||s.call(i,r)}}};let t=((u7=zk.env)==null?void 0:u7.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,kH("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const Jge=t=>!CH.has(t),Ku=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),OH=t=>Ku(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?sx:null:null;class sx extends Array{constructor(e){super(e),this.fill(0)}}var om;const Ld=class Ld{constructor(e,n){Yn(this,"heap");Yn(this,"length");if(!B(Ld,om))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=OH(e);if(!n)return[];Me(Ld,om,!0);const r=new Ld(e,n);return Me(Ld,om,!1),r}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};om=new WeakMap,Je(Ld,om,!1);let qk=Ld;var h7,d7,lo,Aa,Fo,Jd,Ho,lm,cm,Vo,ji,Uo,pi,jr,Ut,Bs,Ma,_s,zi,Qo,qi,Wo,Yo,Ra,Da,Xo,mh,zs,um,ot,Fk,ef,qc,Rv,Na,EH,tf,hm,Dv,Zu,Ju,Hk,ax,ox,Sr,Vk,Sg,eh,Uk;const sA=class sA{constructor(e){Je(this,ot);Je(this,lo);Je(this,Aa);Je(this,Fo);Je(this,Jd);Je(this,Ho);Je(this,lm);Je(this,cm);Je(this,Vo);Yn(this,"ttl");Yn(this,"ttlResolution");Yn(this,"ttlAutopurge");Yn(this,"updateAgeOnGet");Yn(this,"updateAgeOnHas");Yn(this,"allowStale");Yn(this,"noDisposeOnSet");Yn(this,"noUpdateTTL");Yn(this,"maxEntrySize");Yn(this,"sizeCalculation");Yn(this,"noDeleteOnFetchRejection");Yn(this,"noDeleteOnStaleGet");Yn(this,"allowStaleOnFetchAbort");Yn(this,"allowStaleOnFetchRejection");Yn(this,"ignoreFetchAbort");Je(this,ji);Je(this,Uo);Je(this,pi);Je(this,jr);Je(this,Ut);Je(this,Bs);Je(this,Ma);Je(this,_s);Je(this,zi);Je(this,Qo);Je(this,qi);Je(this,Wo);Je(this,Yo);Je(this,Ra);Je(this,Da);Je(this,Xo);Je(this,mh);Je(this,zs);Je(this,um);Je(this,ef,()=>{});Je(this,qc,()=>{});Je(this,Rv,()=>{});Je(this,Na,()=>!1);Je(this,tf,e=>{});Je(this,hm,(e,n,r)=>{});Je(this,Dv,(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Yn(this,h7,"LRUCache");const{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:u,dispose:h,onInsert:f,disposeAfter:p,noDisposeOnSet:m,noUpdateTTL:v,maxSize:b=0,maxEntrySize:x=0,sizeCalculation:w,fetchMethod:S,memoMethod:_,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:j,allowStaleOnFetchAbort:A,ignoreFetchAbort:E,perf:R}=e;if(R!==void 0&&typeof(R==null?void 0:R.now)!="function")throw new TypeError("perf option must have a now() method if specified");if(Me(this,Vo,R??Zge),n!==0&&!Ku(n))throw new TypeError("max option must be a nonnegative integer");const N=n?OH(n):Array;if(!N)throw new Error("invalid max value: "+n);if(Me(this,lo,n),Me(this,Aa,b),this.maxEntrySize=x||B(this,Aa),this.sizeCalculation=w,this.sizeCalculation){if(!B(this,Aa)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(Me(this,cm,_),S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(Me(this,lm,S),Me(this,mh,!!S),Me(this,pi,new Map),Me(this,jr,new Array(n).fill(void 0)),Me(this,Ut,new Array(n).fill(void 0)),Me(this,Bs,new N(n)),Me(this,Ma,new N(n)),Me(this,_s,0),Me(this,zi,0),Me(this,Qo,qk.create(n)),Me(this,ji,0),Me(this,Uo,0),typeof h=="function"&&Me(this,Fo,h),typeof f=="function"&&Me(this,Jd,f),typeof p=="function"?(Me(this,Ho,p),Me(this,qi,[])):(Me(this,Ho,void 0),Me(this,qi,void 0)),Me(this,Xo,!!B(this,Fo)),Me(this,um,!!B(this,Jd)),Me(this,zs,!!B(this,Ho)),this.noDisposeOnSet=!!m,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!j,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(B(this,Aa)!==0&&!Ku(B(this,Aa)))throw new TypeError("maxSize must be a positive integer if specified");if(!Ku(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Ue(this,ot,EH).call(this)}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=Ku(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Ku(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Ue(this,ot,Fk).call(this)}if(B(this,lo)===0&&this.ttl===0&&B(this,Aa)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!B(this,lo)&&!B(this,Aa)){const $="LRU_CACHE_UNBOUNDED";Jge($)&&(CH.add($),kH("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",$,sA))}}get perf(){return B(this,Vo)}static unsafeExposeInternals(e){return{starts:B(e,Yo),ttls:B(e,Ra),autopurgeTimers:B(e,Da),sizes:B(e,Wo),keyMap:B(e,pi),keyList:B(e,jr),valList:B(e,Ut),next:B(e,Bs),prev:B(e,Ma),get head(){return B(e,_s)},get tail(){return B(e,zi)},free:B(e,Qo),isBackgroundFetch:n=>{var r;return Ue(r=e,ot,Sr).call(r,n)},backgroundFetch:(n,r,i,s)=>{var o;return Ue(o=e,ot,ox).call(o,n,r,i,s)},moveToTail:n=>{var r;return Ue(r=e,ot,Sg).call(r,n)},indexes:n=>{var r;return Ue(r=e,ot,Zu).call(r,n)},rindexes:n=>{var r;return Ue(r=e,ot,Ju).call(r,n)},isStale:n=>{var r;return B(r=e,Na).call(r,n)}}}get max(){return B(this,lo)}get maxSize(){return B(this,Aa)}get calculatedSize(){return B(this,Uo)}get size(){return B(this,ji)}get fetchMethod(){return B(this,lm)}get memoMethod(){return B(this,cm)}get dispose(){return B(this,Fo)}get onInsert(){return B(this,Jd)}get disposeAfter(){return B(this,Ho)}getRemainingTTL(e){return B(this,pi).has(e)?1/0:0}*entries(){for(const e of Ue(this,ot,Zu).call(this))B(this,Ut)[e]!==void 0&&B(this,jr)[e]!==void 0&&!Ue(this,ot,Sr).call(this,B(this,Ut)[e])&&(yield[B(this,jr)[e],B(this,Ut)[e]])}*rentries(){for(const e of Ue(this,ot,Ju).call(this))B(this,Ut)[e]!==void 0&&B(this,jr)[e]!==void 0&&!Ue(this,ot,Sr).call(this,B(this,Ut)[e])&&(yield[B(this,jr)[e],B(this,Ut)[e]])}*keys(){for(const e of Ue(this,ot,Zu).call(this)){const n=B(this,jr)[e];n!==void 0&&!Ue(this,ot,Sr).call(this,B(this,Ut)[e])&&(yield n)}}*rkeys(){for(const e of Ue(this,ot,Ju).call(this)){const n=B(this,jr)[e];n!==void 0&&!Ue(this,ot,Sr).call(this,B(this,Ut)[e])&&(yield n)}}*values(){for(const e of Ue(this,ot,Zu).call(this))B(this,Ut)[e]!==void 0&&!Ue(this,ot,Sr).call(this,B(this,Ut)[e])&&(yield B(this,Ut)[e])}*rvalues(){for(const e of Ue(this,ot,Ju).call(this))B(this,Ut)[e]!==void 0&&!Ue(this,ot,Sr).call(this,B(this,Ut)[e])&&(yield B(this,Ut)[e])}[(d7=Symbol.iterator,h7=Symbol.toStringTag,d7)](){return this.entries()}find(e,n={}){for(const r of Ue(this,ot,Zu).call(this)){const i=B(this,Ut)[r],s=Ue(this,ot,Sr).call(this,i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,B(this,jr)[r],this))return this.get(B(this,jr)[r],n)}}forEach(e,n=this){for(const r of Ue(this,ot,Zu).call(this)){const i=B(this,Ut)[r],s=Ue(this,ot,Sr).call(this,i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,B(this,jr)[r],this)}}rforEach(e,n=this){for(const r of Ue(this,ot,Ju).call(this)){const i=B(this,Ut)[r],s=Ue(this,ot,Sr).call(this,i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,B(this,jr)[r],this)}}purgeStale(){let e=!1;for(const n of Ue(this,ot,Ju).call(this,{allowStale:!0}))B(this,Na).call(this,n)&&(Ue(this,ot,eh).call(this,B(this,jr)[n],"expire"),e=!0);return e}info(e){const n=B(this,pi).get(e);if(n===void 0)return;const r=B(this,Ut)[n],i=Ue(this,ot,Sr).call(this,r)?r.__staleWhileFetching:r;if(i===void 0)return;const s={value:i};if(B(this,Ra)&&B(this,Yo)){const o=B(this,Ra)[n],l=B(this,Yo)[n];if(o&&l){const u=o-(B(this,Vo).now()-l);s.ttl=u,s.start=Date.now()}}return B(this,Wo)&&(s.size=B(this,Wo)[n]),s}dump(){const e=[];for(const n of Ue(this,ot,Zu).call(this,{allowStale:!0})){const r=B(this,jr)[n],i=B(this,Ut)[n],s=Ue(this,ot,Sr).call(this,i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;const o={value:s};if(B(this,Ra)&&B(this,Yo)){o.ttl=B(this,Ra)[n];const l=B(this,Vo).now()-B(this,Yo)[n];o.start=Math.floor(Date.now()-l)}B(this,Wo)&&(o.size=B(this,Wo)[n]),e.unshift([r,o])}return e}load(e){this.clear();for(const[n,r]of e){if(r.start){const i=Date.now()-r.start;r.start=B(this,Vo).now()-i}this.set(n,r.value,r)}}set(e,n,r={}){var m,v,b,x,w,S,_;if(n===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=r;let{noUpdateTTL:h=this.noUpdateTTL}=r;const f=B(this,Dv).call(this,e,n,r.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),Ue(this,ot,eh).call(this,e,"set"),this;let p=B(this,ji)===0?void 0:B(this,pi).get(e);if(p===void 0)p=B(this,ji)===0?B(this,zi):B(this,Qo).length!==0?B(this,Qo).pop():B(this,ji)===B(this,lo)?Ue(this,ot,ax).call(this,!1):B(this,ji),B(this,jr)[p]=e,B(this,Ut)[p]=n,B(this,pi).set(e,p),B(this,Bs)[B(this,zi)]=p,B(this,Ma)[p]=B(this,zi),Me(this,zi,p),wd(this,ji)._++,B(this,hm).call(this,p,f,u),u&&(u.set="add"),h=!1,B(this,um)&&((m=B(this,Jd))==null||m.call(this,n,e,"add"));else{Ue(this,ot,Sg).call(this,p);const T=B(this,Ut)[p];if(n!==T){if(B(this,mh)&&Ue(this,ot,Sr).call(this,T)){T.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:C}=T;C!==void 0&&!o&&(B(this,Xo)&&((v=B(this,Fo))==null||v.call(this,C,e,"set")),B(this,zs)&&((b=B(this,qi))==null||b.push([C,e,"set"])))}else o||(B(this,Xo)&&((x=B(this,Fo))==null||x.call(this,T,e,"set")),B(this,zs)&&((w=B(this,qi))==null||w.push([T,e,"set"])));if(B(this,tf).call(this,p),B(this,hm).call(this,p,f,u),B(this,Ut)[p]=n,u){u.set="replace";const C=T&&Ue(this,ot,Sr).call(this,T)?T.__staleWhileFetching:T;C!==void 0&&(u.oldValue=C)}}else u&&(u.set="update");B(this,um)&&((S=this.onInsert)==null||S.call(this,n,e,n===T?"update":"replace"))}if(i!==0&&!B(this,Ra)&&Ue(this,ot,Fk).call(this),B(this,Ra)&&(h||B(this,Rv).call(this,p,i,s),u&&B(this,qc).call(this,u,p)),!o&&B(this,zs)&&B(this,qi)){const T=B(this,qi);let C;for(;C=T==null?void 0:T.shift();)(_=B(this,Ho))==null||_.call(this,...C)}return this}pop(){var e;try{for(;B(this,ji);){const n=B(this,Ut)[B(this,_s)];if(Ue(this,ot,ax).call(this,!0),Ue(this,ot,Sr).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(B(this,zs)&&B(this,qi)){const n=B(this,qi);let r;for(;r=n==null?void 0:n.shift();)(e=B(this,Ho))==null||e.call(this,...r)}}}has(e,n={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=B(this,pi).get(e);if(s!==void 0){const o=B(this,Ut)[s];if(Ue(this,ot,Sr).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(B(this,Na).call(this,s))i&&(i.has="stale",B(this,qc).call(this,i,s));else return r&&B(this,ef).call(this,s),i&&(i.has="hit",B(this,qc).call(this,i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){const{allowStale:r=this.allowStale}=n,i=B(this,pi).get(e);if(i===void 0||!r&&B(this,Na).call(this,i))return;const s=B(this,Ut)[i];return Ue(this,ot,Sr).call(this,s)?s.__staleWhileFetching:s}async fetch(e,n={}){const{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:x,forceRefresh:w=!1,status:S,signal:_}=n;if(!B(this,mh))return S&&(S.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});const T={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:l,size:u,sizeCalculation:h,noUpdateTTL:f,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:b,ignoreFetchAbort:v,status:S,signal:_};let C=B(this,pi).get(e);if(C===void 0){S&&(S.fetch="miss");const j=Ue(this,ot,ox).call(this,e,C,T,x);return j.__returned=j}else{const j=B(this,Ut)[C];if(Ue(this,ot,Sr).call(this,j)){const $=r&&j.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",$&&(S.returnedStale=!0)),$?j.__staleWhileFetching:j.__returned=j}const A=B(this,Na).call(this,C);if(!w&&!A)return S&&(S.fetch="hit"),Ue(this,ot,Sg).call(this,C),i&&B(this,ef).call(this,C),S&&B(this,qc).call(this,S,C),j;const E=Ue(this,ot,ox).call(this,e,C,T,x),N=E.__staleWhileFetching!==void 0&&r;return S&&(S.fetch=A?"stale":"refresh",N&&A&&(S.returnedStale=!0)),N?E.__staleWhileFetching:E.__returned=E}}async forceFetch(e,n={}){const r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){const r=B(this,cm);if(!r)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:s,...o}=n,l=this.get(e,o);if(!s&&l!==void 0)return l;const u=r(e,l,{options:o,context:i});return this.set(e,u,o),u}get(e,n={}){const{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,l=B(this,pi).get(e);if(l!==void 0){const u=B(this,Ut)[l],h=Ue(this,ot,Sr).call(this,u);return o&&B(this,qc).call(this,o,l),B(this,Na).call(this,l)?(o&&(o.get="stale"),h?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(s||Ue(this,ot,eh).call(this,e,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),h?u.__staleWhileFetching:(Ue(this,ot,Sg).call(this,l),i&&B(this,ef).call(this,l),u))}else o&&(o.get="miss")}delete(e){return Ue(this,ot,eh).call(this,e,"delete")}clear(){return Ue(this,ot,Uk).call(this,"delete")}};lo=new WeakMap,Aa=new WeakMap,Fo=new WeakMap,Jd=new WeakMap,Ho=new WeakMap,lm=new WeakMap,cm=new WeakMap,Vo=new WeakMap,ji=new WeakMap,Uo=new WeakMap,pi=new WeakMap,jr=new WeakMap,Ut=new WeakMap,Bs=new WeakMap,Ma=new WeakMap,_s=new WeakMap,zi=new WeakMap,Qo=new WeakMap,qi=new WeakMap,Wo=new WeakMap,Yo=new WeakMap,Ra=new WeakMap,Da=new WeakMap,Xo=new WeakMap,mh=new WeakMap,zs=new WeakMap,um=new WeakMap,ot=new WeakSet,Fk=function(){const e=new sx(B(this,lo)),n=new sx(B(this,lo));Me(this,Ra,e),Me(this,Yo,n);const r=this.ttlAutopurge?new Array(B(this,lo)):void 0;Me(this,Da,r),Me(this,Rv,(o,l,u=B(this,Vo).now())=>{if(n[o]=l!==0?u:0,e[o]=l,r!=null&&r[o]&&(clearTimeout(r[o]),r[o]=void 0),l!==0&&r){const h=setTimeout(()=>{B(this,Na).call(this,o)&&Ue(this,ot,eh).call(this,B(this,jr)[o],"expire")},l+1);h.unref&&h.unref(),r[o]=h}}),Me(this,ef,o=>{n[o]=e[o]!==0?B(this,Vo).now():0}),Me(this,qc,(o,l)=>{if(e[l]){const u=e[l],h=n[l];if(!u||!h)return;o.ttl=u,o.start=h,o.now=i||s();const f=o.now-h;o.remainingTTL=u-f}});let i=0;const s=()=>{const o=B(this,Vo).now();if(this.ttlResolution>0){i=o;const l=setTimeout(()=>i=0,this.ttlResolution);l.unref&&l.unref()}return o};this.getRemainingTTL=o=>{const l=B(this,pi).get(o);if(l===void 0)return 0;const u=e[l],h=n[l];if(!u||!h)return 1/0;const f=(i||s())-h;return u-f},Me(this,Na,o=>{const l=n[o],u=e[o];return!!u&&!!l&&(i||s())-l>u})},ef=new WeakMap,qc=new WeakMap,Rv=new WeakMap,Na=new WeakMap,EH=function(){const e=new sx(B(this,lo));Me(this,Uo,0),Me(this,Wo,e),Me(this,tf,n=>{Me(this,Uo,B(this,Uo)-e[n]),e[n]=0}),Me(this,Dv,(n,r,i,s)=>{if(Ue(this,ot,Sr).call(this,r))return 0;if(!Ku(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!Ku(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),Me(this,hm,(n,r,i)=>{if(e[n]=r,B(this,Aa)){const s=B(this,Aa)-e[n];for(;B(this,Uo)>s;)Ue(this,ot,ax).call(this,!0)}Me(this,Uo,B(this,Uo)+e[n]),i&&(i.entrySize=r,i.totalCalculatedSize=B(this,Uo))})},tf=new WeakMap,hm=new WeakMap,Dv=new WeakMap,Zu=function*({allowStale:e=this.allowStale}={}){if(B(this,ji))for(let n=B(this,zi);!(!Ue(this,ot,Hk).call(this,n)||((e||!B(this,Na).call(this,n))&&(yield n),n===B(this,_s)));)n=B(this,Ma)[n]},Ju=function*({allowStale:e=this.allowStale}={}){if(B(this,ji))for(let n=B(this,_s);!(!Ue(this,ot,Hk).call(this,n)||((e||!B(this,Na).call(this,n))&&(yield n),n===B(this,zi)));)n=B(this,Bs)[n]},Hk=function(e){return e!==void 0&&B(this,pi).get(B(this,jr)[e])===e},ax=function(e){var s,o,l;const n=B(this,_s),r=B(this,jr)[n],i=B(this,Ut)[n];return B(this,mh)&&Ue(this,ot,Sr).call(this,i)?i.__abortController.abort(new Error("evicted")):(B(this,Xo)||B(this,zs))&&(B(this,Xo)&&((s=B(this,Fo))==null||s.call(this,i,r,"evict")),B(this,zs)&&((o=B(this,qi))==null||o.push([i,r,"evict"]))),B(this,tf).call(this,n),(l=B(this,Da))!=null&&l[n]&&(clearTimeout(B(this,Da)[n]),B(this,Da)[n]=void 0),e&&(B(this,jr)[n]=void 0,B(this,Ut)[n]=void 0,B(this,Qo).push(n)),B(this,ji)===1?(Me(this,_s,Me(this,zi,0)),B(this,Qo).length=0):Me(this,_s,B(this,Bs)[n]),B(this,pi).delete(r),wd(this,ji)._--,n},ox=function(e,n,r,i){const s=n===void 0?void 0:B(this,Ut)[n];if(Ue(this,ot,Sr).call(this,s))return s;const o=new pw,{signal:l}=r;l==null||l.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});const u={signal:o.signal,options:r,context:i},h=(x,w=!1)=>{const{aborted:S}=o.signal,_=r.ignoreFetchAbort&&x!==void 0,T=r.ignoreFetchAbort||!!(r.allowStaleOnFetchAbort&&x!==void 0);if(r.status&&(S&&!w?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,_&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),S&&!_&&!w)return p(o.signal.reason,T);const C=v,j=B(this,Ut)[n];return(j===v||_&&w&&j===void 0)&&(x===void 0?C.__staleWhileFetching!==void 0?B(this,Ut)[n]=C.__staleWhileFetching:Ue(this,ot,eh).call(this,e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,x,u.options))),x},f=x=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=x),p(x,!1)),p=(x,w)=>{const{aborted:S}=o.signal,_=S&&r.allowStaleOnFetchAbort,T=_||r.allowStaleOnFetchRejection,C=T||r.noDeleteOnFetchRejection,j=v;if(B(this,Ut)[n]===v&&(!C||!w&&j.__staleWhileFetching===void 0?Ue(this,ot,eh).call(this,e,"fetch"):_||(B(this,Ut)[n]=j.__staleWhileFetching)),T)return r.status&&j.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),j.__staleWhileFetching;if(j.__returned===j)throw x},m=(x,w)=>{var _;const S=(_=B(this,lm))==null?void 0:_.call(this,e,s,u);S&&S instanceof Promise&&S.then(T=>x(T===void 0?void 0:T),w),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(x(void 0),r.allowStaleOnFetchAbort&&(x=T=>h(T,!0)))})};r.status&&(r.status.fetchDispatched=!0);const v=new Promise(m).then(h,f),b=Object.assign(v,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,b,{...u.options,status:void 0}),n=B(this,pi).get(e)):B(this,Ut)[n]=b,b},Sr=function(e){if(!B(this,mh))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof pw},Vk=function(e,n){B(this,Ma)[n]=e,B(this,Bs)[e]=n},Sg=function(e){e!==B(this,zi)&&(e===B(this,_s)?Me(this,_s,B(this,Bs)[e]):Ue(this,ot,Vk).call(this,B(this,Ma)[e],B(this,Bs)[e]),Ue(this,ot,Vk).call(this,B(this,zi),e),Me(this,zi,e))},eh=function(e,n){var i,s,o,l,u,h;let r=!1;if(B(this,ji)!==0){const f=B(this,pi).get(e);if(f!==void 0)if((i=B(this,Da))!=null&&i[f]&&(clearTimeout((s=B(this,Da))==null?void 0:s[f]),B(this,Da)[f]=void 0),r=!0,B(this,ji)===1)Ue(this,ot,Uk).call(this,n);else{B(this,tf).call(this,f);const p=B(this,Ut)[f];if(Ue(this,ot,Sr).call(this,p)?p.__abortController.abort(new Error("deleted")):(B(this,Xo)||B(this,zs))&&(B(this,Xo)&&((o=B(this,Fo))==null||o.call(this,p,e,n)),B(this,zs)&&((l=B(this,qi))==null||l.push([p,e,n]))),B(this,pi).delete(e),B(this,jr)[f]=void 0,B(this,Ut)[f]=void 0,f===B(this,zi))Me(this,zi,B(this,Ma)[f]);else if(f===B(this,_s))Me(this,_s,B(this,Bs)[f]);else{const m=B(this,Ma)[f];B(this,Bs)[m]=B(this,Bs)[f];const v=B(this,Bs)[f];B(this,Ma)[v]=B(this,Ma)[f]}wd(this,ji)._--,B(this,Qo).push(f)}}if(B(this,zs)&&((u=B(this,qi))!=null&&u.length)){const f=B(this,qi);let p;for(;p=f==null?void 0:f.shift();)(h=B(this,Ho))==null||h.call(this,...p)}return r},Uk=function(e){var n,r,i,s;for(const o of Ue(this,ot,Ju).call(this,{allowStale:!0})){const l=B(this,Ut)[o];if(Ue(this,ot,Sr).call(this,l))l.__abortController.abort(new Error("deleted"));else{const u=B(this,jr)[o];B(this,Xo)&&((n=B(this,Fo))==null||n.call(this,l,u,e)),B(this,zs)&&((r=B(this,qi))==null||r.push([l,u,e]))}}if(B(this,pi).clear(),B(this,Ut).fill(void 0),B(this,jr).fill(void 0),B(this,Ra)&&B(this,Yo)){B(this,Ra).fill(0),B(this,Yo).fill(0);for(const o of B(this,Da)??[])o!==void 0&&clearTimeout(o);(i=B(this,Da))==null||i.fill(void 0)}if(B(this,Wo)&&B(this,Wo).fill(0),Me(this,_s,0),Me(this,zi,0),B(this,Qo).length=0,Me(this,Uo,0),Me(this,ji,0),B(this,zs)&&B(this,qi)){const o=B(this,qi);let l;for(;l=o==null?void 0:o.shift();)(s=B(this,Ho))==null||s.call(this,...l)}};let mw=sA;const eve=400,tve=422,nve=503;class rve{constructor(e){this.httpMethod="POST",this.apiPrefix="/api/v1",this.fetchFn=(n,r)=>fetch(n,r),this.requestHeaders=new Headers,this.abortControllers=new Set,this.url=e.url?e.url:"",this.errorHandler=e.httpErrorHandler,this.lookbackInterval=e.lookbackInterval,e.fetchFn&&(this.fetchFn=e.fetchFn),e.httpMethod&&(this.httpMethod=e.httpMethod),e.apiPrefix&&(this.apiPrefix=e.apiPrefix),e.requestHeaders&&(this.requestHeaders=e.requestHeaders)}labelNames(e){const n=new URLSearchParams;if(this.lookbackInterval){const i=new Date,s=new Date(i.getTime()-this.lookbackInterval);n.set("start",s.toISOString()),n.set("end",i.toISOString())}e&&e.length>0&&n.set("match[]",j3(e));const r=this.buildRequest(this.labelsEndpoint(),n);return this.fetchAPI(r.uri,{method:this.httpMethod,body:r.body}).catch(i=>(this.errorHandler&&this.errorHandler(i),[]))}labelValues(e,n,r){const i=new URLSearchParams;if(this.lookbackInterval){const s=new Date,o=new Date(s.getTime()-this.lookbackInterval);i.set("start",o.toISOString()),i.set("end",s.toISOString())}return n&&n.length>0&&i.set("match[]",j3(n,r,e)),this.fetchAPI(`${this.labelValuesEndpoint().replace(/:name/gi,e)}?${i}`).catch(s=>(this.errorHandler&&this.errorHandler(s),[]))}metricMetadata(){return this.fetchAPI(this.metricMetadataEndpoint()).catch(e=>(this.errorHandler&&this.errorHandler(e),{}))}series(e,n,r){const i=new URLSearchParams;if(this.lookbackInterval){const o=new Date,l=new Date(o.getTime()-this.lookbackInterval);i.set("start",l.toISOString()),i.set("end",o.toISOString())}i.set("match[]",j3(e,n,r));const s=this.buildRequest(this.seriesEndpoint(),i);return this.fetchAPI(s.uri,{method:this.httpMethod,body:s.body}).catch(o=>(this.errorHandler&&this.errorHandler(o),[]))}metricNames(){return this.labelValues("__name__")}flags(){return this.fetchAPI(this.flagsEndpoint()).catch(e=>(this.errorHandler&&this.errorHandler(e),{}))}destroy(){for(const e of this.abortControllers)e.abort();this.abortControllers.clear()}fetchAPI(e,n){const r=new AbortController;return this.abortControllers.add(r),n?(n.headers=this.requestHeaders,n.signal=r.signal):n={headers:this.requestHeaders,signal:r.signal},this.fetchFn(this.url+e,n).then(i=>{if(!i.ok&&![eve,tve,nve].includes(i.status))throw new Error(i.statusText);return i}).then(i=>i.json()).then(i=>{if(i.status==="error")throw new Error(i.error!==void 0?i.error:'missing "error" field in response JSON');if(i.data===void 0)throw new Error('missing "data" field in response JSON');return i.data}).finally(()=>{this.abortControllers.delete(r)})}buildRequest(e,n){let r=e,i=n;return this.httpMethod==="GET"&&(r=`${r}?${n}`,i=null),{uri:r,body:i}}labelsEndpoint(){return`${this.apiPrefix}/labels`}labelValuesEndpoint(){return`${this.apiPrefix}/label/:name/values`}seriesEndpoint(){return`${this.apiPrefix}/series`}metricMetadataEndpoint(){return`${this.apiPrefix}/metadata`}flagsEndpoint(){return`${this.apiPrefix}/status/flags`}}class ive{constructor(e){const n={ttl:e&&e.maxAge?e.maxAge:3e5,ttlAutopurge:!0};this.completeAssociation=new mw(n),this.metricMetadata={},this.labelValues=new mw(n),this.labelNames=[],this.flags={},e!=null&&e.initialMetricList&&this.setLabelValues("__name__",e.initialMetricList)}getAssociations(e){let n=this.completeAssociation.get(e);return n||(n=new Map,this.completeAssociation.set(e,n)),n}setAssociations(e,n){n.forEach(r=>{const i=this.getAssociations(e);for(const[s,o]of Object.entries(r)){if(s==="__name__")continue;const l=i.get(s);l===void 0?i.set(s,new Set([o])):l.add(o)}})}setLabelValuesAssociation(e,n,r){const i=this.getAssociations(e),s=i.get(n);s===void 0?i.set(n,new Set(r)):r.forEach(o=>{s.add(o)})}setLabelNamesAssociation(e,n){const r=this.getAssociations(e);n.forEach(i=>{i!=="__name__"&&(r.has(i)||r.set(i,new Set))})}setFlags(e){this.flags=e}getFlags(){return this.flags}setMetricMetadata(e){this.metricMetadata=e}getMetricMetadata(){return this.metricMetadata}setLabelNames(e,n){n&&n.length>0&&this.setLabelNamesAssociation(n,e),this.labelNames=e}getLabelNames(e){if(!e||e.length===0)return this.labelNames;const n=this.completeAssociation.get(e);return n?Array.from(n.keys()):[]}setLabelValues(e,n,r){r&&r.length>0&&this.setLabelValuesAssociation(r,e,n),this.labelValues.set(e,n)}getLabelValues(e,n){if(!n||n.length===0){const i=this.labelValues.get(e);return i||[]}const r=this.completeAssociation.get(n);if(r){const i=r.get(e);return i?Array.from(i):[]}return[]}}class sve{constructor(e,n){this.client=e,this.cache=new ive(n)}labelNames(e){const n=this.cache.getLabelNames(e);return n&&n.length>0?Promise.resolve(n):this.client.labelNames(e).then(r=>(this.cache.setLabelNames(r,e),this.cache.getLabelNames(e)))}labelValues(e,n){const r=this.cache.getLabelValues(e,n);return r&&r.length>0?Promise.resolve(r):this.client.labelValues(e,n).then(i=>(this.cache.setLabelValues(e,i,n),i))}metricMetadata(){const e=this.cache.getMetricMetadata();return e&&Object.keys(e).length>0?Promise.resolve(e):this.client.metricMetadata().then(n=>(this.cache.setMetricMetadata(n),n))}series(e){return this.client.series(e).then(n=>(this.cache.setAssociations(e,n),n))}metricNames(){return this.labelValues("__name__")}flags(){const e=this.cache.getFlags();return e&&Object.keys(e).length>0?Promise.resolve(e):this.client.flags().then(n=>(this.cache.setFlags(n),n))}destroy(){var e,n;(n=(e=this.client).destroy)===null||n===void 0||n.call(e)}}function ave(t){const e=t;return typeof e.labelNames=="function"&&typeof e.labelValues=="function"&&typeof e.metricMetadata=="function"&&typeof e.series=="function"&&typeof e.metricNames=="function"}function Qk(t){return t!=null&&t.completeStrategy?t.completeStrategy:t!=null&&t.remote?ave(t.remote)?new W3(t.remote,t.maxMetricsMetadata):new W3(new sve(new rve(t.remote),t.remote.cache),t.maxMetricsMetadata):new W3}class XN{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class Nd{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=r.facet(Fl).markerFilter;i&&(e=i(e,r));let s=e.slice().sort((v,b)=>v.from-b.from||v.to-b.to),o=new Jc,l=[],u=0,h=r.doc.iter(),f=0,p=r.doc.length;for(let v=0;;){let b=v==s.length?null:s[v];if(!b&&!l.length)break;let x,w;if(l.length)x=u,w=l.reduce((T,C)=>Math.min(T,C.to),b&&b.from>x?b.from:1e8);else{if(x=b.from,x>p)break;w=b.to,l.push(b),v++}for(;v<s.length;){let T=s[v];if(T.from==x&&(T.to>T.from||T.to==x))l.push(T),v++,w=Math.min(T.to,w);else{w=Math.min(T.from,w);break}}w=Math.min(w,p);let S=!1;if(l.some(T=>T.from==x&&(T.to==w||w==p))&&(S=x==w,!S&&w-x<10)){let T=x-(f+h.value.length);T>0&&(h.next(T),f=x);for(let C=x;;){if(C>=w){S=!0;break}if(!h.lineBreak&&f+h.value.length>C)break;C=f+h.value.length,f+=h.value.length,h.next()}}let _=wve(l);if(S)o.add(x,x,Ct.widget({widget:new vve(_),diagnostics:l.slice()}));else{let T=l.reduce((C,j)=>j.markClass?C+" "+j.markClass:C,"");o.add(x,w,Ct.mark({class:"cm-lintRange cm-lintRange-"+_+T,diagnostics:l.slice(),inclusiveEnd:l.some(C=>C.to>w)}))}if(u=w,u==p)break;for(let T=0;T<l.length;T++)l[T].to<=u&&l.splice(T--,1)}let m=o.finish();return new Nd(m,n,Om(m))}}function Om(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new XN(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new XN(r.from,s,r.diagnostic)}}),r}function ove(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(Fl).hideOn(t,n,r);if(i!=null)return i;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(bE))||t.changes.touchesRange(s.from,Math.max(s.to,r)))}function AH(t,e){return t.field(Ia,!1)?e:e.concat(qt.appendConfig.of(PH))}function lve(t,e){return{effects:AH(t,[bE.of(e)])}}const bE=qt.define(),yE=qt.define(),MH=qt.define(),Ia=Xi.define({create(){return new Nd(Ct.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,i=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);r=Om(n,t.selected.diagnostic,s)||Om(n,null,s)}!n.size&&i&&e.state.facet(Fl).autoPanel&&(i=null),t=new Nd(n,i,r)}for(let n of e.effects)if(n.is(bE)){let r=e.state.facet(Fl).autoPanel?n.value.length?jv.open:null:t.panel;t=Nd.init(n.value,r,e.state)}else n.is(yE)?t=new Nd(t.diagnostics,n.value?jv.open:null,t.selected):n.is(MH)&&(t=new Nd(t.diagnostics,t.panel,n.value));return t},provide:t=>[bv.from(t,e=>e.panel),it.decorations.from(t,e=>e.diagnostics)]}),cve=Ct.mark({class:"cm-lintRange cm-lintRange-active"});function uve(t,e,n){let{diagnostics:r}=t.state.field(Ia),i,s=-1,o=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(u,h,{spec:f})=>{if(e>=u&&e<=h&&(u==h||(e>u||n>0)&&(e<h||n<0)))return i=f.diagnostics,s=u,o=h,!1});let l=t.state.facet(Fl).tooltipFilter;return i&&l&&(i=l(i,t.state)),i?{pos:s,end:o,above:t.state.doc.lineAt(s).to<o,create(){return{dom:hve(t,i)}}}:null}function hve(t,e){return mr("ul",{class:"cm-tooltip-lint"},e.map(n=>NH(t,n,!1)))}const dve=t=>{let e=t.state.field(Ia,!1);(!e||!e.panel)&&t.dispatch({effects:AH(t.state,[yE.of(!0)])});let n=vv(t,jv.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},GN=t=>{let e=t.state.field(Ia,!1);return!e||!e.panel?!1:(t.dispatch({effects:yE.of(!1)}),!0)},fve=t=>{let e=t.state.field(Ia,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},RH=[{key:"Mod-Shift-m",run:dve,preventDefault:!0},{key:"F8",run:fve}],pve=Zr.fromClass(class{constructor(t){this.view=t,this.timeout=-1,this.set=!0;let{delay:e}=t.state.facet(Fl);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){clearTimeout(this.timeout);let t=Date.now();if(t<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-t);else{this.set=!1;let{state:e}=this.view,{sources:n}=e.facet(Fl);n.length&&mve(n.map(r=>Promise.resolve(r(this.view))),r=>{this.view.state.doc==e.doc&&this.view.dispatch(lve(this.view.state,r.reduce((i,s)=>i.concat(s))))},r=>{Hs(this.view.state,r)})}}update(t){let e=t.state.facet(Fl);(t.docChanged||e!=t.startState.facet(Fl)||e.needsRefresh&&e.needsRefresh(t))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function mve(t,e,n){let r=[],i=-1;for(let s of t)s.then(o=>{r.push(o),clearTimeout(i),r.length==t.length?e(r):i=setTimeout(()=>e(r),200)},n)}const Fl=ft.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...sc(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:KN,tooltipFilter:KN,needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n,hideOn:(e,n)=>e?n?(r,i,s)=>e(r,i,s)||n(r,i,s):e:n,autoPanel:(e,n)=>e||n})}}});function KN(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function gve(t,e={}){return[Fl.of({source:t,config:e}),pve,PH]}function DH(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!e.some(s=>s.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function NH(t,e,n){var r;let i=n?DH(e.actions):[];return mr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},mr("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let l=!1,u=v=>{if(v.preventDefault(),l)return;l=!0;let b=Om(t.state.field(Ia).diagnostics,e);b&&s.apply(t,b.from,b.to)},{name:h}=s,f=i[o]?h.indexOf(i[o]):-1,p=f<0?h:[h.slice(0,f),mr("u",h.slice(f,f+1)),h.slice(f+1)],m=s.markClass?" "+s.markClass:"";return mr("button",{type:"button",class:"cm-diagnosticAction"+m,onclick:u,onmousedown:u,"aria-label":` Action: ${h}${f<0?"":` (access key "${i[o]})"`}.`},p)}),e.source&&mr("div",{class:"cm-diagnosticSource"},e.source))}class vve extends fl{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return mr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class ZN{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=NH(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class jv{constructor(e){this.view=e,this.items=[];let n=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)GN(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:s}=this.items[this.selectedIndex],o=DH(s.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==i.keyCode){let u=Om(this.view.state.field(Ia).diagnostics,s);u&&s.actions[l].apply(e,u.from,u.to)}}else return;i.preventDefault()}},r=i=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(i.target)&&this.moveSelection(s)};this.list=mr("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=mr("div",{class:"cm-panel-lint"},this.list,mr("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>GN(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Ia).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(Ia),r=0,i=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,u,{spec:h})=>{for(let f of h.diagnostics){if(o.has(f))continue;o.add(f);let p=-1,m;for(let v=r;v<this.items.length;v++)if(this.items[v].diagnostic==f){p=v;break}p<0?(m=new ZN(this.view,f),this.items.splice(r,0,m),i=!0):(m=this.items[p],p>r&&(this.items.splice(r,p-r),i=!0)),n&&m.diagnostic==n.diagnostic?m.dom.hasAttribute("aria-selected")||(m.dom.setAttribute("aria-selected","true"),s=m):m.dom.hasAttribute("aria-selected")&&m.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 ZN(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:u})=>{let h=u.height/this.list.offsetHeight;l.top<u.top?this.list.scrollTop-=(u.top-l.top)/h:l.bottom>u.bottom&&(this.list.scrollTop+=(l.bottom-u.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Ia),r=Om(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:MH.of(r)})}static open(e){return new jv(e)}}function bve(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function d1(t){return bve(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const yve=it.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:d1("#d11")},".cm-lintRange-warning":{backgroundImage:d1("orange")},".cm-lintRange-info":{backgroundImage:d1("#999")},".cm-lintRange-hint":{backgroundImage:d1("#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}}});function xve(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function wve(t){let e="hint",n=1;for(let r of t){let i=xve(r.severity);i>n&&(n=i,e=r.severity)}return e}const PH=[Ia,it.decorations.compute([Ia],t=>{let{selected:e,panel:n}=t.field(Ia);return!e||!n||e.from==e.to?Ct.none:Ct.set([cve.range(e.from,e.to)])}),Bme(uve,{hideOn:ove}),yve];class Sve{promQL(){return e=>{const n=new U0e(e.state);return n.analyze(),n.getDiagnostics()}}}function jve(){return new Sve}function _ve(t,e){return gve(t.call(e))}var Wk;(function(t){t.PromQL="PromQL",t.MetricName="MetricName"})(Wk||(Wk={}));function Tve(t){return ow.define({parser:ihe.configure({top:t}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}})}class LH{constructor(){this.complete=Qk(),this.lint=jve(),this.enableLinter=!0,this.enableCompletion=!0}setComplete(e){return this.complete=Qk(e),this}getComplete(){return this.complete}activateCompletion(e){return this.enableCompletion=e,this}setLinter(e){return this.lint=e,this}getLinter(){return this.lint}activateLinter(e){return this.enableLinter=e,this}destroy(){var e,n;(n=(e=this.complete).destroy)===null||n===void 0||n.call(e)}asExtension(e=Wk.PromQL){const n=Tve(e);let r=[n];if(this.enableCompletion){const i=n.data.of({autocomplete:s=>this.complete.promQL(s)});r=r.concat(i)}return this.enableLinter&&(r=r.concat(_ve(this.lint.promQL,this.lint))),r}}const Cve=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=wE(t.state,n.from);return r.line?kve(t):r.block?Eve(t):!1};function xE(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const kve=xE(Rve,0),Ove=xE($H,0),Eve=xE((t,e)=>$H(t,e,Mve(e)),0);function wE(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const ig=50;function Ave(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-ig,r),o=t.sliceDoc(i,i+ig),l=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(o)[0].length,h=s.length-l;if(s.slice(h-e.length,h)==e&&o.slice(u,u+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:i+u,margin:u&&1}};let f,p;i-r<=2*ig?f=p=t.sliceDoc(r,i):(f=t.sliceDoc(r,r+ig),p=t.sliceDoc(i-ig,i));let m=/^\s*/.exec(f)[0].length,v=/\s*$/.exec(p)[0].length,b=p.length-v-n.length;return f.slice(m,m+e.length)==e&&p.slice(b,b+n.length)==n?{open:{pos:r+m+e.length,margin:/\s/.test(f.charAt(m+e.length))?1:0},close:{pos:i-v-n.length,margin:/\s/.test(p.charAt(b-1))?1:0}}:null}function Mve(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to),s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function $H(t,e,n=e.selection.ranges){let r=n.map(s=>wE(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,o)=>Ave(e,r[o],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,o)=>i[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let o=0,l;o<i.length;o++)if(l=i[o]){let u=r[o],{open:h,close:f}=l;s.push({from:h.pos-u.open.length,to:h.pos+h.margin},{from:f.pos-f.margin,to:f.pos+u.close.length})}return{changes:s}}return null}function Rve(t,e,n=e.selection.ranges){let r=[],i=-1;for(let{from:s,to:o}of n){let l=r.length,u=1e9,h=wE(e,s).line;if(h){for(let f=s;f<=o;){let p=e.doc.lineAt(f);if(p.from>i&&(s==o||o>p.from)){i=p.from;let m=/^\s*/.exec(p.text)[0].length,v=m==p.length,b=p.text.slice(m,m+h.length)==h?m:-1;m<p.text.length&&m<u&&(u=m),r.push({line:p,comment:b,token:h,indent:m,empty:v,single:!1})}f=p.to+1}if(u<1e9)for(let f=l;f<r.length;f++)r[f].indent<r[f].line.text.length&&(r[f].indent=u);r.length==l+1&&(r[l].single=!0)}}if(t!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:u,indent:h,empty:f,single:p}of r)(p||!f)&&s.push({from:l.from+h,insert:u+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:u}of r)if(l>=0){let h=o.from+l,f=h+u.length;o.text[f-o.from]==" "&&f++,s.push({from:h,to:f})}return{changes:s}}return null}const Yk=ic.define(),Dve=ic.define(),Nve=ft.define(),IH=ft.define({combine(t){return sc(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),BH=Xi.define({create(){return Hl.empty},update(t,e){let n=e.state.facet(IH),r=e.annotation(Yk);if(r){let u=da.fromTransaction(e,r.selection),h=r.side,f=h==0?t.undone:t.done;return u?f=gw(f,f.length,n.minDepth,u):f=HH(f,e.startState.selection),new Hl(h==0?r.rest:f,h==0?f:r.rest)}let i=e.annotation(Dve);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(gi.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=da.fromTransaction(e),o=e.annotation(gi.time),l=e.annotation(gi.userEvent);return s?t=t.addChanges(s,o,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Hl(t.done.map(da.fromJSON),t.undone.map(da.fromJSON))}});function zH(t={}){return[BH,IH.of(t),it.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?qH:e.inputType=="historyRedo"?Xk:null;return r?(e.preventDefault(),r(n)):!1}})]}function fS(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(BH,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const qH=fS(0,!1),Xk=fS(1,!1),Pve=fS(0,!0),Lve=fS(1,!0);class da{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new da(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.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(e){return new da(e.changes&&Ci.fromJSON(e.changes),[],e.mapped&&Ql.fromJSON(e.mapped),e.startSelection&&$e.fromJSON(e.startSelection),e.selectionsAfter.map($e.fromJSON))}static fromTransaction(e,n){let r=go;for(let i of e.startState.facet(Nve)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new da(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,go)}static selection(e){return new da(void 0,go,void 0,void 0,e)}}function gw(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function $ve(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,o,l)=>{for(let u=0;u<n.length;){let h=n[u++],f=n[u++];l>=h&&o<=f&&(r=!0)}}),r}function Ive(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function FH(t,e){return t.length?e.length?t.concat(e):t:e}const go=[],Bve=200;function HH(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Bve));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),gw(t,t.length-1,1e9,n.setSelAfter(r)))}else return[da.selection([e])]}function zve(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Y3(t,e){if(!t.length)return t;let n=t.length,r=go;for(;n;){let i=qve(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[da.selection(r)]:go}function qve(t,e,n){let r=FH(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):go,n);if(!t.changes)return da.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new da(i,qt.mapEffects(t.effects,e),o,t.startSelection.map(s),r)}const Fve=/^(input\.type|delete)($|\.)/;class Hl{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Hl(this.done,this.undone):this}addChanges(e,n,r,i,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!r||Fve.test(r))&&(!l.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,$ve(l.changes,e.changes))||r=="input.type.compose")?o=gw(o,o.length-1,i.minDepth,new da(e.changes.compose(l.changes),FH(qt.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,go)):o=gw(o,o.length,i.minDepth,e),new Hl(o,go,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:go;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Ive(s[s.length-1],e)?this:new Hl(HH(this.done,e),this.undone,n,r)}addMapping(e){return new Hl(Y3(this.done,e),Y3(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],o=s.selectionsAfter[0]||n.selection;if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Yk.of({side:e,rest:zve(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=i.length==1?go:i.slice(0,i.length-1);return s.mapped&&(l=Y3(l,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Yk.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Hl.empty=new Hl(go,go);const VH=[{key:"Mod-z",run:qH,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Xk,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Xk,preventDefault:!0},{key:"Mod-u",run:Pve,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Lve,preventDefault:!0}];function Km(t,e){return $e.create(t.ranges.map(e),t.mainIndex)}function ac(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function pl({state:t,dispatch:e},n){let r=Km(t.selection,n);return r.eq(t.selection,!0)?!1:(e(ac(t,r)),!0)}function pS(t,e){return $e.cursor(e?t.to:t.from)}function UH(t,e){return pl(t,n=>n.empty?t.moveByChar(n,e):pS(n,e))}function Ms(t){return t.textDirectionAt(t.state.selection.main.head)==ur.LTR}const QH=t=>UH(t,!Ms(t)),WH=t=>UH(t,Ms(t));function YH(t,e){return pl(t,n=>n.empty?t.moveByGroup(n,e):pS(n,e))}const Hve=t=>YH(t,!Ms(t)),Vve=t=>YH(t,Ms(t));function Uve(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function mS(t,e,n){let r=Ai(t).resolveInner(e.head),i=n?on.closedBy:on.openedBy;for(let u=e.head;;){let h=n?r.childAfter(u):r.childBefore(u);if(!h)break;Uve(t,h,i)?r=h:u=n?h.to:h.from}let s=r.type.prop(i),o,l;return s&&(o=n?ql(t,r.from,1):ql(t,r.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?r.to:r.from,$e.cursor(l,n?-1:1)}const Qve=t=>pl(t,e=>mS(t.state,e,!Ms(t))),Wve=t=>pl(t,e=>mS(t.state,e,Ms(t)));function XH(t,e){return pl(t,n=>{if(!n.empty)return pS(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const GH=t=>XH(t,!1),KH=t=>XH(t,!0);function ZH(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(it.scrollMargins)){let o=s(t);o!=null&&o.top&&(n=Math.max(o==null?void 0:o.top,n)),o!=null&&o.bottom&&(r=Math.max(o==null?void 0:o.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function JH(t,e){let n=ZH(t),{state:r}=t,i=Km(r.selection,o=>o.empty?t.moveVertically(o,e,n.height):pS(o,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(r.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),u=l.top+n.marginTop,h=l.bottom-n.marginBottom;o&&o.top>u&&o.bottom<h&&(s=it.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-u}))}return t.dispatch(ac(r,i),{effects:s}),!0}const JN=t=>JH(t,!1),Gk=t=>JH(t,!0);function Jh(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=$e.cursor(r.from+s))}return i}const Yve=t=>pl(t,e=>Jh(t,e,!0)),Xve=t=>pl(t,e=>Jh(t,e,!1)),Gve=t=>pl(t,e=>Jh(t,e,!Ms(t))),Kve=t=>pl(t,e=>Jh(t,e,Ms(t))),Zve=t=>pl(t,e=>$e.cursor(t.lineBlockAt(e.head).from,1)),Jve=t=>pl(t,e=>$e.cursor(t.lineBlockAt(e.head).to,-1));function ebe(t,e,n){let r=!1,i=Km(t.selection,s=>{let o=ql(t,s.head,-1)||ql(t,s.head,1)||s.head>0&&ql(t,s.head-1,1)||s.head<t.doc.length&&ql(t,s.head+1,-1);if(!o||!o.end)return s;r=!0;let l=o.start.from==s.head?o.end.to:o.end.from;return $e.cursor(l)});return r?(e(ac(t,i)),!0):!1}const tbe=({state:t,dispatch:e})=>ebe(t,e);function Oo(t,e){let n=Km(t.state.selection,r=>{let i=e(r);return $e.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(ac(t.state,n)),!0)}function eV(t,e){return Oo(t,n=>t.moveByChar(n,e))}const tV=t=>eV(t,!Ms(t)),nV=t=>eV(t,Ms(t));function rV(t,e){return Oo(t,n=>t.moveByGroup(n,e))}const nbe=t=>rV(t,!Ms(t)),rbe=t=>rV(t,Ms(t)),ibe=t=>Oo(t,e=>mS(t.state,e,!Ms(t))),sbe=t=>Oo(t,e=>mS(t.state,e,Ms(t)));function iV(t,e){return Oo(t,n=>t.moveVertically(n,e))}const sV=t=>iV(t,!1),aV=t=>iV(t,!0);function oV(t,e){return Oo(t,n=>t.moveVertically(n,e,ZH(t).height))}const eP=t=>oV(t,!1),tP=t=>oV(t,!0),abe=t=>Oo(t,e=>Jh(t,e,!0)),obe=t=>Oo(t,e=>Jh(t,e,!1)),lbe=t=>Oo(t,e=>Jh(t,e,!Ms(t))),cbe=t=>Oo(t,e=>Jh(t,e,Ms(t))),ube=t=>Oo(t,e=>$e.cursor(t.lineBlockAt(e.head).from)),hbe=t=>Oo(t,e=>$e.cursor(t.lineBlockAt(e.head).to)),nP=({state:t,dispatch:e})=>(e(ac(t,{anchor:0})),!0),rP=({state:t,dispatch:e})=>(e(ac(t,{anchor:t.doc.length})),!0),iP=({state:t,dispatch:e})=>(e(ac(t,{anchor:t.selection.main.anchor,head:0})),!0),sP=({state:t,dispatch:e})=>(e(ac(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),dbe=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),fbe=({state:t,dispatch:e})=>{let n=gS(t).map(({from:r,to:i})=>$e.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:$e.create(n),userEvent:"select"})),!0},pbe=({state:t,dispatch:e})=>{let n=Km(t.selection,r=>{var i;let s=Ai(t).resolveStack(r.from,1);for(let o=s;o;o=o.next){let{node:l}=o;if((l.from<r.from&&l.to>=r.to||l.to>r.to&&l.from<=r.from)&&(!((i=l.parent)===null||i===void 0)&&i.parent))return $e.range(l.to,l.from)}return r});return e(ac(t,n)),!0},mbe=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=$e.create([n.main]):n.main.empty||(r=$e.create([$e.cursor(n.main.head)])),r?(e(ac(t,r)),!0):!1};function hb(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let u=e(s);u<o?(n="delete.backward",u=f1(t,u,!1)):u>o&&(n="delete.forward",u=f1(t,u,!0)),o=Math.min(o,u),l=Math.max(l,u)}else o=f1(t,o,!1),l=f1(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:$e.cursor(o,o<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?it.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function f1(t,e,n){if(t instanceof it)for(let r of t.state.facet(it.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=n?s:i)});return e}const lV=(t,e,n)=>hb(t,r=>{let i=r.from,{state:s}=t,o=s.doc.lineAt(i),l,u;if(n&&!e&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,i-o.from))){if(l[l.length-1]=="	")return i-1;let h=Xm(l,s.tabSize),f=h%cw(s)||cw(s);for(let p=0;p<f&&l[l.length-1-p]==" ";p++)i--;u=i}else u=ki(o.text,i-o.from,e,e)+o.from,u==i&&o.number!=(e?s.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(u-o.from,i-o.from))&&(u=ki(o.text,u-o.from,!1,!1)+o.from);return u}),Kk=t=>lV(t,!1,!0),cV=t=>lV(t,!0,!1),uV=(t,e)=>hb(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let l=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let u=ki(s.text,r-s.from,e)+s.from,h=s.text.slice(Math.min(r,u)-s.from,Math.max(r,u)-s.from),f=o(h);if(l!=null&&f!=l)break;(h!=" "||r!=n.head)&&(l=f),r=u}return r}),hV=t=>uV(t,!1),gbe=t=>uV(t,!0),vbe=t=>hb(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),bbe=t=>hb(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),ybe=t=>hb(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),xbe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:jn.of(["",""])},range:$e.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},wbe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),o=i==s.from?i-1:ki(s.text,i-s.from,!1)+s.from,l=i==s.to?i+1:ki(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(i,l).append(t.doc.slice(o,i))},range:$e.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function gS(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function dV(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of gS(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let u of s.ranges)i.push($e.range(Math.min(t.doc.length,u.anchor+l),Math.min(t.doc.length,u.head+l)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let u of s.ranges)i.push($e.range(u.anchor-l,u.head-l))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:$e.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Sbe=({state:t,dispatch:e})=>dV(t,e,!1),jbe=({state:t,dispatch:e})=>dV(t,e,!0);function fV(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of gS(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const _be=({state:t,dispatch:e})=>fV(t,e,!1),Tbe=({state:t,dispatch:e})=>fV(t,e,!0),Cbe=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(gS(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=Km(e.selection,i=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(i.head),l=t.coordsAtPos(i.head,i.assoc||1);l&&(s=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function kbe(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Ai(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(on.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const pV=mV(!1),Obe=mV(!0);function mV(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:o}=i,l=e.doc.lineAt(s),u=!t&&s==o&&kbe(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new cS(e,{simulateBreak:s,simulateDoubleBreak:!!u}),f=oE(h,s);for(f==null&&(f=Xm(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;u?{from:s,to:o}=u:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let p=["",yv(e,f)];return u&&p.push(yv(e,h.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:jn.of(p)},range:$e.cursor(s+1+p[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function SE(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let l=t.doc.lineAt(o);l.number>n&&(r.empty||r.to>l.from)&&(e(l,i,r),n=l.number),o=l.to+1}let s=t.changes(i);return{changes:i,range:$e.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const Ebe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new cS(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),i=SE(t,(s,o,l)=>{let u=oE(r,s.from);if(u==null)return;/\S/.test(s.text)||(u=0);let h=/^\s*/.exec(s.text)[0],f=yv(t,u);(h!=f||l.from<s.from+h.length)&&(n[s.from]=u,o.push({from:s.from,to:s.from+h.length,insert:f}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},gV=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(SE(t,(n,r)=>{r.push({from:n.from,insert:t.facet(lb)})}),{userEvent:"input.indent"})),!0),vV=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(SE(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=Xm(i,t.tabSize),o=0,l=yv(t,Math.max(0,s-cw(t)));for(;o<i.length&&o<l.length&&i.charCodeAt(o)==l.charCodeAt(o);)o++;r.push({from:n.from+o,to:n.from+i.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),Abe=t=>(t.setTabFocusMode(),!0),Mbe=[{key:"Ctrl-b",run:QH,shift:tV,preventDefault:!0},{key:"Ctrl-f",run:WH,shift:nV},{key:"Ctrl-p",run:GH,shift:sV},{key:"Ctrl-n",run:KH,shift:aV},{key:"Ctrl-a",run:Zve,shift:ube},{key:"Ctrl-e",run:Jve,shift:hbe},{key:"Ctrl-d",run:cV},{key:"Ctrl-h",run:Kk},{key:"Ctrl-k",run:vbe},{key:"Ctrl-Alt-h",run:hV},{key:"Ctrl-o",run:xbe},{key:"Ctrl-t",run:wbe},{key:"Ctrl-v",run:Gk}],Rbe=[{key:"ArrowLeft",run:QH,shift:tV,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Hve,shift:nbe,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Gve,shift:lbe,preventDefault:!0},{key:"ArrowRight",run:WH,shift:nV,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Vve,shift:rbe,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Kve,shift:cbe,preventDefault:!0},{key:"ArrowUp",run:GH,shift:sV,preventDefault:!0},{mac:"Cmd-ArrowUp",run:nP,shift:iP},{mac:"Ctrl-ArrowUp",run:JN,shift:eP},{key:"ArrowDown",run:KH,shift:aV,preventDefault:!0},{mac:"Cmd-ArrowDown",run:rP,shift:sP},{mac:"Ctrl-ArrowDown",run:Gk,shift:tP},{key:"PageUp",run:JN,shift:eP},{key:"PageDown",run:Gk,shift:tP},{key:"Home",run:Xve,shift:obe,preventDefault:!0},{key:"Mod-Home",run:nP,shift:iP},{key:"End",run:Yve,shift:abe,preventDefault:!0},{key:"Mod-End",run:rP,shift:sP},{key:"Enter",run:pV},{key:"Mod-a",run:dbe},{key:"Backspace",run:Kk,shift:Kk},{key:"Delete",run:cV},{key:"Mod-Backspace",mac:"Alt-Backspace",run:hV},{key:"Mod-Delete",mac:"Alt-Delete",run:gbe},{mac:"Mod-Backspace",run:bbe},{mac:"Mod-Delete",run:ybe}].concat(Mbe.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),bV=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Qve,shift:ibe},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Wve,shift:sbe},{key:"Alt-ArrowUp",run:Sbe},{key:"Shift-Alt-ArrowUp",run:_be},{key:"Alt-ArrowDown",run:jbe},{key:"Shift-Alt-ArrowDown",run:Tbe},{key:"Escape",run:mbe},{key:"Mod-Enter",run:Obe},{key:"Alt-l",mac:"Ctrl-l",run:fbe},{key:"Mod-i",run:pbe,preventDefault:!0},{key:"Mod-[",run:vV},{key:"Mod-]",run:gV},{key:"Mod-Alt-\\",run:Ebe},{key:"Shift-Mod-k",run:Cbe},{key:"Shift-Mod-\\",run:tbe},{key:"Mod-/",run:Cve},{key:"Alt-A",run:Ove},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Abe}].concat(Rbe),Dbe={key:"Tab",run:gV,shift:vV},aP=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Em{constructor(e,n,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?l=>s(aP(l)):aP,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 la(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=H4(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Bl(e);let i=this.normalize(n);for(let s=0,o=r;;s++){let l=i.charCodeAt(s),u=this.match(l,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(u)return this.value=u,this;break}o==r&&s<n.length&&n.charCodeAt(s)==l&&o++}}}match(e,n,r){let i=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?i={from:this.matches[s+1],to:r}:(this.matches[s]++,l=!0)),l||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:n,to:r}:this.matches.push(1,n)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(Em.prototype[Symbol.iterator]=function(){return this});const yV={from:-1,to:-1,match:/.*/.exec("")},jE="gm"+(/x/.unicode==null?"":"u");class xV{constructor(e,n,r,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=yV,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new wV(e,n,r,i,s);this.re=new RegExp(n,jE+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=vw(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),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 e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;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=vw(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,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const X3=new WeakMap;class Up{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=X3.get(e);if(!i||i.from>=r||i.to<=n){let l=new Up(n,e.sliceString(n,r));return X3.set(e,l),l}if(i.from==n&&i.to==r)return i;let{text:s,from:o}=i;return o>n&&(s=e.sliceString(n,o)+s,o=n),i.to<r&&(s+=e.sliceString(i.to,r)),X3.set(e,new Up(o,s)),new Up(n,s.slice(n-o,r-o))}}class wV{constructor(e,n,r,i,s){this.text=e,this.to=s,this.done=!1,this.value=yV,this.matchPos=vw(e,i),this.re=new RegExp(n,jE+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=Up.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+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,match:n},this.matchPos=vw(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Up.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(xV.prototype[Symbol.iterator]=wV.prototype[Symbol.iterator]=function(){return this});function Nbe(t){try{return new RegExp(t,jE),!0}catch{return!1}}function vw(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}function Zk(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=mr("input",{class:"cm-textfield",name:"line",value:e}),r=mr("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),t.dispatch({effects:bw.of(!1)}),t.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},mr("label",t.state.phrase("Go to line"),": ",n)," ",mr("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!s)return;let{state:o}=t,l=o.doc.lineAt(o.selection.main.head),[,u,h,f,p]=s,m=f?+f.slice(1):0,v=h?+h:l.number;if(h&&p){let w=v/100;u&&(w=w*(u=="-"?-1:1)+l.number/o.doc.lines),v=Math.round(o.doc.lines*w)}else h&&u&&(v=v*(u=="-"?-1:1)+l.number);let b=o.doc.line(Math.max(1,Math.min(o.doc.lines,v))),x=$e.cursor(b.from+Math.max(0,Math.min(m,b.length)));t.dispatch({effects:[bw.of(!1),it.scrollIntoView(x.from,{y:"center"})],selection:x}),t.focus()}return{dom:r}}const bw=qt.define(),oP=Xi.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(bw)&&(t=n.value);return t},provide:t=>bv.from(t,e=>e?Zk:null)}),Pbe=t=>{let e=vv(t,Zk);if(!e){let n=[bw.of(!0)];t.state.field(oP,!1)==null&&n.push(qt.appendConfig.of([oP,Lbe])),t.dispatch({effects:n}),e=vv(t,Zk)}return e&&e.dom.querySelector("input").select(),!0},Lbe=it.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),$be={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ibe=ft.define({combine(t){return sc(t,$be,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function SV(t){return[Hbe,Fbe]}const Bbe=Ct.mark({class:"cm-selectionMatch"}),zbe=Ct.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function lP(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Rr.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Rr.Word)}function qbe(t,e,n,r){return t(e.sliceDoc(n,n+1))==Rr.Word&&t(e.sliceDoc(r-1,r))==Rr.Word}const Fbe=Zr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(Ibe),{state:n}=t,r=n.selection;if(r.ranges.length>1)return Ct.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return Ct.none;let u=n.wordAt(i.head);if(!u)return Ct.none;o=n.charCategorizer(i.head),s=n.sliceDoc(u.from,u.to)}else{let u=i.to-i.from;if(u<e.minSelectionLength||u>200)return Ct.none;if(e.wholeWords){if(s=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(lP(o,n,i.from,i.to)&&qbe(o,n,i.from,i.to)))return Ct.none}else if(s=n.sliceDoc(i.from,i.to),!s)return Ct.none}let l=[];for(let u of t.visibleRanges){let h=new Em(n.doc,s,u.from,u.to);for(;!h.next().done;){let{from:f,to:p}=h.value;if((!o||lP(o,n,f,p))&&(i.empty&&f<=i.from&&p>=i.to?l.push(zbe.range(f,p)):(f>=i.to||p<=i.from)&&l.push(Bbe.range(f,p)),l.length>e.maxMatches))return Ct.none}}return Ct.set(l)}},{decorations:t=>t.decorations}),Hbe=it.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Vbe=({state:t,dispatch:e})=>{let{selection:n}=t,r=$e.create(n.ranges.map(i=>t.wordAt(i.head)||$e.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function Ube(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),s=i&&i.from==n.from&&i.to==n.to;for(let o=!1,l=new Em(t.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Em(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(u=>u.from==l.value.from))continue;if(s){let u=t.wordAt(l.value.from);if(!u||u.from!=l.value.from||u.to!=l.value.to)continue}return l.value}}const Qbe=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(s=>s.from===s.to))return Vbe({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=r))return!1;let i=Ube(t,r);return i?(e(t.update({selection:t.selection.addRange($e.range(i.from,i.to),!1),effects:it.scrollIntoView(i.to)})),!0):!1},Zm=ft.define({combine(t){return sc(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new iye(e),scrollToMatch:e=>it.scrollIntoView(e)})}});class jV{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Nbe(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
`:r=="r"?"\r":r=="t"?"	":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Gbe(this):new Ybe(this)}getCursor(e,n=0,r){let i=e.doc?e:gn.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?xp(this,i,n,r):yp(this,i,n,r)}}class _V{constructor(e){this.spec=e}}function yp(t,e,n,r){return new Em(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?Wbe(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Wbe(t,e){return(n,r,i,s)=>((s>n||s+i.length<r)&&(s=Math.max(0,n-2),i=t.sliceString(s,Math.min(t.length,r+2))),(e(yw(i,n-s))!=Rr.Word||e(xw(i,n-s))!=Rr.Word)&&(e(xw(i,r-s))!=Rr.Word||e(yw(i,r-s))!=Rr.Word))}class Ybe extends _V{constructor(e){super(e)}nextMatch(e,n,r){let i=yp(this.spec,e,r,e.doc.length).nextOverlapping();return i.done&&(i=yp(this.spec,e,0,n).nextOverlapping()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let s=Math.max(n,i-1e4-this.spec.unquoted.length),o=yp(this.spec,e,s,i),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(s==n)return null;i-=1e4}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=yp(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=yp(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function xp(t,e,n,r){return new xV(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?Xbe(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function yw(t,e){return t.slice(ki(t,e,!1),e)}function xw(t,e){return t.slice(e,ki(t,e))}function Xbe(t){return(e,n,r)=>!r[0].length||(t(yw(r.input,r.index))!=Rr.Word||t(xw(r.input,r.index))!=Rr.Word)&&(t(xw(r.input,r.index+r[0].length))!=Rr.Word||t(yw(r.input,r.index+r[0].length))!=Rr.Word)}class Gbe extends _V{nextMatch(e,n,r){let i=xp(this.spec,e,r,e.doc.length).next();return i.done&&(i=xp(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let s=Math.max(n,r-i*1e4),o=xp(this.spec,e,s,r),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(n,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r<e.match.length?e.match[r]:n)}matchAll(e,n){let r=xp(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=xp(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const _v=qt.define(),_E=qt.define(),kh=Xi.define({create(t){return new G3(Jk(t).create(),null)},update(t,e){for(let n of e.effects)n.is(_v)?t=new G3(n.value.create(),t.panel):n.is(_E)&&(t=new G3(t.query,n.value?TE:null));return t},provide:t=>bv.from(t,e=>e.panel)});class G3{constructor(e,n){this.query=e,this.panel=n}}const Kbe=Ct.mark({class:"cm-searchMatch"}),Zbe=Ct.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Jbe=Zr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(kh))}update(t){let e=t.state.field(kh);(e!=t.startState.field(kh)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Ct.none;let{view:n}=this,r=new Jc;for(let i=0,s=n.visibleRanges,o=s.length;i<o;i++){let{from:l,to:u}=s[i];for(;i<o-1&&u>s[i+1].from-2*250;)u=s[++i].to;t.highlight(n.state,l,u,(h,f)=>{let p=n.state.selection.ranges.some(m=>m.from==h&&m.to==f);r.add(h,f,p?Zbe:Kbe)})}return r.finish()}},{decorations:t=>t.decorations});function db(t){return e=>{let n=e.state.field(kh,!1);return n&&n.query.spec.valid?t(e,n):kV(e)}}const ww=db((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=$e.single(r.from,r.to),s=t.state.facet(Zm);return t.dispatch({selection:i,effects:[CE(t,r),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),CV(t),!0}),Sw=db((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let s=$e.single(i.from,i.to),o=t.state.facet(Zm);return t.dispatch({selection:s,effects:[CE(t,i),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),CV(t),!0}),eye=db((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:$e.create(n.map(r=>$e.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),tye=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,s=[],o=0;for(let l=new Em(t.doc,t.sliceDoc(r,i));!l.next().done;){if(s.length>1e3)return!1;l.value.from==r&&(o=s.length),s.push($e.range(l.value.from,l.value.to))}return e(t.update({selection:$e.create(s,o),userEvent:"select.search.matches"})),!0},cP=db((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let s=e.nextMatch(n,r,r);if(!s)return!1;let o=[],l,u,h=[];if(s.from==r&&s.to==i&&(u=n.toText(e.getReplacement(s)),o.push({from:s.from,to:s.to,insert:u}),s=e.nextMatch(n,s.from,s.to),h.push(it.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),s){let f=o.length==0||o[0].from>=s.to?0:s.to-s.from-u.length;l=$e.single(s.from-f,s.to-f),h.push(CE(t,s)),h.push(n.facet(Zm).scrollToMatch(l.main,t))}return t.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),nye=db((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:it.announce.of(r),userEvent:"input.replace.all"}),!0});function TE(t){return t.state.facet(Zm).createPanel(t)}function Jk(t,e){var n,r,i,s,o;let l=t.selection.main,u=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!u)return e;let h=t.facet(Zm);return new jV({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:h.literal)?u:u.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:h.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:h.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function TV(t){let e=vv(t,TE);return e&&e.dom.querySelector("[main-field]")}function CV(t){let e=TV(t);e&&e==t.root.activeElement&&e.select()}const kV=t=>{let e=t.state.field(kh,!1);if(e&&e.panel){let n=TV(t);if(n&&n!=t.root.activeElement){let r=Jk(t.state,e.query.spec);r.valid&&t.dispatch({effects:_v.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[_E.of(!0),e?_v.of(Jk(t.state,e.query.spec)):qt.appendConfig.of(aye)]});return!0},OV=t=>{let e=t.state.field(kh,!1);if(!e||!e.panel)return!1;let n=vv(t,TE);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:_E.of(!1)}),!0},rye=[{key:"Mod-f",run:kV,scope:"editor search-panel"},{key:"F3",run:ww,shift:Sw,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:ww,shift:Sw,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:OV,scope:"editor search-panel"},{key:"Mod-Shift-l",run:tye},{key:"Mod-Alt-g",run:Pbe},{key:"Mod-d",run:Qbe,preventDefault:!0}];class iye{constructor(e){this.view=e;let n=this.query=e.state.field(kh).query.spec;this.commit=this.commit.bind(this),this.searchField=mr("input",{value:n.search,placeholder:Ca(e,"Find"),"aria-label":Ca(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=mr("input",{value:n.replace,placeholder:Ca(e,"Replace"),"aria-label":Ca(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=mr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=mr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=mr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,s,o){return mr("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=mr("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>ww(e),[Ca(e,"next")]),r("prev",()=>Sw(e),[Ca(e,"previous")]),r("select",()=>eye(e),[Ca(e,"all")]),mr("label",null,[this.caseField,Ca(e,"match case")]),mr("label",null,[this.reField,Ca(e,"regexp")]),mr("label",null,[this.wordField,Ca(e,"by word")]),...e.state.readOnly?[]:[mr("br"),this.replaceField,r("replace",()=>cP(e),[Ca(e,"replace")]),r("replaceAll",()=>nye(e),[Ca(e,"replace all")])],mr("button",{name:"close",onclick:()=>OV(e),"aria-label":Ca(e,"close"),type:"button"},["×"])])}commit(){let e=new jV({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:_v.of(e)}))}keydown(e){Jpe(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Sw:ww)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),cP(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(_v)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Zm).top}}function Ca(t,e){return t.state.phrase(e)}const p1=30,m1=/[\s\.,:;?!]/;function CE(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,s=Math.max(r.from,e-p1),o=Math.min(i,n+p1),l=t.state.sliceDoc(s,o);if(s!=r.from){for(let u=0;u<p1;u++)if(!m1.test(l[u+1])&&m1.test(l[u])){l=l.slice(u);break}}if(o!=i){for(let u=l.length-1;u>l.length-p1;u--)if(!m1.test(l[u-1])&&m1.test(l[u])){l=l.slice(0,u);break}}return it.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${r.number}.`)}const sye=it.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"}}),aye=[kh,lu.low(Jbe),sye];var uP=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(xH)),e.defaultKeymap!==!1&&(r=r.concat(bV)),e.searchKeymap!==!1&&(r=r.concat(rye)),e.historyKeymap!==!1&&(r=r.concat(VH)),e.foldKeymap!==!1&&(r=r.concat(j0e)),e.completionKeymap!==!1&&(r=r.concat(gE)),e.lintKeymap!==!1&&(r=r.concat(RH));var i=[];return e.lineNumbers!==!1&&i.push(Gme()),e.highlightActiveLineGutter!==!1&&i.push(Jme()),e.highlightSpecialChars!==!1&&i.push(FF()),e.history!==!1&&i.push(zH()),e.foldGutter!==!1&&i.push(k0e()),e.drawSelection!==!1&&i.push(sme()),e.dropCursor!==!1&&i.push(ume()),e.allowMultipleSelections!==!1&&i.push(gn.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&i.push(KF()),e.syntaxHighlighting!==!1&&i.push(hS(M0e,{fallback:!0})),e.bracketMatching!==!1&&i.push(cH()),e.closeBrackets!==!1&&i.push(vH()),e.autocompletion!==!1&&i.push(SH()),e.rectangularSelection!==!1&&i.push(Ome()),n!==!1&&i.push(Mme()),e.highlightActiveLine!==!1&&i.push(wme()),e.highlightSelectionMatches!==!1&&i.push(SV()),e.tabSize&&typeof e.tabSize=="number"&&i.push(lb.of(" ".repeat(e.tabSize))),i.concat([Ch.of(r.flat())]).filter(Boolean)};const oye="#e5c07b",hP="#e06c75",lye="#56b6c2",cye="#ffffff",lx="#abb2bf",e6="#7d8799",uye="#61afef",hye="#98c379",dP="#d19a66",dye="#c678dd",fye="#21252b",fP="#2c313a",pP="#282c34",K3="#353a42",pye="#3E4451",mP="#528bff",mye=it.theme({"&":{color:lx,backgroundColor:pP},".cm-content":{caretColor:mP},".cm-cursor, .cm-dropCursor":{borderLeftColor:mP},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:pye},".cm-panels":{backgroundColor:fye,color:lx},".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:pP,color:e6,border:"none"},".cm-activeLineGutter":{backgroundColor:fP},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:K3},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:K3,borderBottomColor:K3},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:fP,color:lx}}},{dark:!0}),gye=Of.define([{tag:pe.keyword,color:dye},{tag:[pe.name,pe.deleted,pe.character,pe.propertyName,pe.macroName],color:hP},{tag:[pe.function(pe.variableName),pe.labelName],color:uye},{tag:[pe.color,pe.constant(pe.name),pe.standard(pe.name)],color:dP},{tag:[pe.definition(pe.name),pe.separator],color:lx},{tag:[pe.typeName,pe.className,pe.number,pe.changed,pe.annotation,pe.modifier,pe.self,pe.namespace],color:oye},{tag:[pe.operator,pe.operatorKeyword,pe.url,pe.escape,pe.regexp,pe.link,pe.special(pe.string)],color:lye},{tag:[pe.meta,pe.comment],color:e6},{tag:pe.strong,fontWeight:"bold"},{tag:pe.emphasis,fontStyle:"italic"},{tag:pe.strikethrough,textDecoration:"line-through"},{tag:pe.link,color:e6,textDecoration:"underline"},{tag:pe.heading,fontWeight:"bold",color:hP},{tag:[pe.atom,pe.bool,pe.special(pe.variableName)],color:dP},{tag:[pe.processingInstruction,pe.string,pe.inserted],color:hye},{tag:pe.invalid,color:cye}]),vye=[mye,hS(gye)];var bye=it.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),yye=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:s="light",placeholder:o="",basicSetup:l=!0}=e,u=[];switch(n&&u.unshift(Ch.of([Dbe])),l&&(typeof l=="boolean"?u.unshift(uP()):u.unshift(uP(l))),o&&u.unshift(HF(o)),s){case"light":u.push(bye);break;case"dark":u.push(vye);break;case"none":break;default:u.push(s);break}return r===!1&&u.push(it.editable.of(!1)),i&&u.push(gn.readOnly.of(!0)),[...u]},xye=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class wye{constructor(e,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(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.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 gP{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Z3=null,Sye=()=>typeof window>"u"?new gP:(Z3||(Z3=new gP),Z3),vP=ic.define(),jye=200,_ye=[];function Tye(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:s,onUpdate:o,extensions:l=_ye,autoFocus:u,theme:h="light",height:f=null,minHeight:p=null,maxHeight:m=null,width:v=null,minWidth:b=null,maxWidth:x=null,placeholder:w="",editable:S=!0,readOnly:_=!1,indentWithTab:T=!0,basicSetup:C=!0,root:j,initialState:A}=t,[E,R]=M.useState(),[N,$]=M.useState(),[D,F]=M.useState(),Q=M.useState(()=>({current:null}))[0],H=M.useState(()=>({current:null}))[0],q=it.theme({"&":{height:f,minHeight:p,maxHeight:m,width:v,minWidth:b,maxWidth:x},"& .cm-scroller":{height:"100% !important"}}),P=it.updateListener.of(Z=>{if(Z.docChanged&&typeof r=="function"&&!Z.transactions.some(G=>G.annotation(vP))){Q.current?Q.current.reset():(Q.current=new wye(()=>{if(H.current){var G=H.current;H.current=null,G()}Q.current=null},jye),Sye().add(Q.current));var X=Z.state.doc,V=X.toString();r(V,Z)}i&&i(xye(Z))}),I=yye({theme:h,editable:S,readOnly:_,placeholder:w,indentWithTab:T,basicSetup:C}),U=[P,q,...I];return o&&typeof o=="function"&&U.push(it.updateListener.of(o)),U=U.concat(l),M.useLayoutEffect(()=>{if(E&&!D){var Z={doc:e,selection:n,extensions:U},X=A?gn.fromJSON(A.json,Z,A.fields):gn.create(Z);if(F(X),!N){var V=new it({state:X,parent:E,root:j});$(V),s&&s(V,X)}}return()=>{N&&(F(void 0),$(void 0))}},[E,D]),M.useEffect(()=>{t.container&&R(t.container)},[t.container]),M.useEffect(()=>()=>{N&&(N.destroy(),$(void 0)),Q.current&&(Q.current.cancel(),Q.current=null)},[N]),M.useEffect(()=>{u&&N&&N.focus()},[u,N]),M.useEffect(()=>{N&&N.dispatch({effects:qt.reconfigure.of(U)})},[h,l,f,p,m,v,b,x,w,S,_,T,C,r,o]),M.useEffect(()=>{if(e!==void 0){var Z=N?N.state.doc.toString():"";if(N&&e!==Z){var X=Q.current&&!Q.current.isDone,V=()=>{N&&e!==N.state.doc.toString()&&N.dispatch({changes:{from:0,to:N.state.doc.toString().length,insert:e||""},annotations:[vP.of(!0)]})};X?H.current=V:V()}}},[e,N]),{state:D,setState:F,view:N,setView:$,container:E,setContainer:R}}var Cye=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],kE=M.forwardRef((t,e)=>{var{className:n,value:r="",selection:i,extensions:s=[],onChange:o,onStatistics:l,onCreateEditor:u,onUpdate:h,autoFocus:f,theme:p="light",height:m,minHeight:v,maxHeight:b,width:x,minWidth:w,maxWidth:S,basicSetup:_,placeholder:T,indentWithTab:C,editable:j,readOnly:A,root:E,initialState:R}=t,N=EO(t,Cye),$=M.useRef(null),{state:D,view:F,container:Q,setContainer:H}=Tye({root:E,value:r,autoFocus:f,theme:p,height:m,minHeight:v,maxHeight:b,width:x,minWidth:w,maxWidth:S,basicSetup:_,placeholder:T,indentWithTab:C,editable:j,readOnly:A,selection:i,onChange:o,onStatistics:l,onCreateEditor:u,onUpdate:h,extensions:s,initialState:R});M.useImperativeHandle(e,()=>({editor:$.current,state:D,view:F}),[$,Q,D,F]);var q=M.useCallback(I=>{$.current=I,H(I)},[H]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var P=typeof p=="string"?"cm-theme-"+p:"cm-theme";return a.jsx("div",kx({ref:q,className:""+P+(n?" "+n:"")},N))});kE.displayName="CodeMirror";const EV=it.theme({".cm-content":{paddingTop:"3px",paddingBottom:"0px"},"&.cm-editor":{"&.cm-focused":{outline:"none",outline_fallback:"none"},backgroundColor:"transparent"},".cm-scroller":{overflow:"hidden",fontFamily:'"DejaVu Sans Mono", monospace'},".cm-placeholder":{fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'},".cm-matchingBracket":{fontWeight:"bold",outline:"1px dashed transparent"},".cm-nonmatchingBracket":{borderColor:"red"},".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{maxHeight:"350px",fontFamily:'"DejaVu Sans Mono", monospace',maxWidth:"unset"},"& > ul > li":{padding:"2px 1em 2px 3px"},minWidth:"30%"},".cm-completionDetail":{float:"right",color:"#999"},".cm-tooltip.cm-completionInfo":{padding:"10px",fontFamily:"'Open Sans', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;",border:"none",minWidth:"250px",maxWidth:"min-content"},".cm-completionInfo.cm-completionInfo-right":{"&:before":{content:"' '",height:"0",position:"absolute",width:"0",left:"-20px",borderWidth:"10px",borderStyle:"solid",borderColor:"transparent"},marginTop:"-11px",marginLeft:"12px"},".cm-completionInfo.cm-completionInfo-left":{"&:before":{content:"' '",height:"0",position:"absolute",width:"0",right:"-20px",borderWidth:"10px",borderStyle:"solid",borderColor:"transparent"},marginTop:"-11px",marginRight:"12px"},".cm-completionInfo.cm-completionInfo-right-narrow":{"&:before":{content:"' '",height:"0",position:"absolute",width:"0",top:"-20px",borderWidth:"10px",borderStyle:"solid",borderColor:"transparent"},marginTop:"10px",marginLeft:"150px"},".cm-completionMatchedText":{textDecoration:"none",fontWeight:"bold"},".cm-selectionMatch":{backgroundColor:"#e6f3ff"},".cm-diagnostic":{"&.cm-diagnostic-error":{borderLeft:"3px solid #e65013"}},".cm-completionIcon":{boxSizing:"content-box",fontSize:"16px",lineHeight:"1",marginRight:"10px",verticalAlign:"top","&:after":{content:"'\\ea88'"},fontFamily:"codicon",paddingRight:"0",opacity:"1"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\\ea8c'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'\\eb5f'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\\eb62'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'\\ea95'"},color:"#ee9d28"}}),AV=it.theme({".cm-tooltip":{backgroundColor:"#f8f8f8",borderColor:"rgba(52, 79, 113, 0.2)"},".cm-tooltip.cm-tooltip-autocomplete":{"& li:hover":{backgroundColor:"#ddd"},"& > ul > li[aria-selected]":{backgroundColor:"#d6ebff",color:"unset"}},".cm-tooltip.cm-completionInfo":{backgroundColor:"#d6ebff"},".cm-tooltip > .cm-completionInfo.cm-completionInfo-right":{"&:before":{borderRightColor:"#d6ebff"}},".cm-tooltip > .cm-completionInfo.cm-completionInfo-right-narrow":{"&:before":{borderBottomColor:"#d6ebff"}},".cm-tooltip > .cm-completionInfo.cm-completionInfo-left":{"&:before":{borderLeftColor:"#d6ebff"}},".cm-line":{"&::selection":{backgroundColor:"#add6ff"},"& > span::selection":{backgroundColor:"#add6ff"}},".cm-matchingBracket":{color:"#000",backgroundColor:"#dedede"},".cm-completionMatchedText":{color:"#0066bf"},".cm-completionIcon":{color:"#007acc"},".cm-completionIcon-constant":{color:"#007acc"},".cm-completionIcon-function, .cm-completionIcon-method":{color:"#652d90"},".cm-completionIcon-keyword":{color:"#616161"}},{dark:!1}),kye=it.theme({".cm-content":{caretColor:"#fff"},".cm-tooltip.cm-completionInfo":{backgroundColor:"#333338"},".cm-tooltip > .cm-completionInfo.cm-completionInfo-right":{"&:before":{borderRightColor:"#333338"}},".cm-tooltip > .cm-completionInfo.cm-completionInfo-right-narrow":{"&:before":{borderBottomColor:"#333338"}},".cm-tooltip > .cm-completionInfo.cm-completionInfo-left":{"&:before":{borderLeftColor:"#333338"}},".cm-line":{"&::selection":{backgroundColor:"#767676"},"& > span::selection":{backgroundColor:"#767676"}},".cm-matchingBracket, &.cm-focused .cm-matchingBracket":{backgroundColor:"#616161"},".cm-completionMatchedText":{color:"#7dd3fc"},".cm-completionIcon, .cm-completionIcon-constant":{color:"#7dd3fc"},".cm-completionIcon-function, .cm-completionIcon-method":{color:"#d8b4fe"},".cm-completionIcon-keyword":{color:"#cbd5e1 !important"}},{dark:!0}),MV=Of.define([{tag:pe.number,color:"#09885a"},{tag:pe.string,color:"#a31515"},{tag:pe.keyword,color:"#008080"},{tag:pe.function(pe.variableName),color:"#008080"},{tag:pe.labelName,color:"#800000"},{tag:pe.operator},{tag:pe.modifier,color:"#008080"},{tag:pe.paren},{tag:pe.squareBracket},{tag:pe.brace},{tag:pe.invalid,color:"red"},{tag:pe.comment,color:"#888",fontStyle:"italic"}]),RV=Of.define([{tag:pe.number,color:"#22c55e"},{tag:pe.string,color:"#fca5a5"},{tag:pe.keyword,color:"#14bfad"},{tag:pe.function(pe.variableName),color:"#14bfad"},{tag:pe.labelName,color:"#ff8585"},{tag:pe.operator},{tag:pe.modifier,color:"#14bfad"},{tag:pe.paren},{tag:pe.squareBracket},{tag:pe.brace},{tag:pe.invalid,color:"#ff3d3d"},{tag:pe.comment,color:"#9ca3af",fontStyle:"italic"}]),Oye="_input_k0obd_1",Eye={input:Oye},Aye="api/v1",DV=({pathPrefix:t,path:e,params:n,recordResponseTime:r})=>async({signal:i})=>{var o;const s=n?`?${new URLSearchParams(n).toString()}`:"";try{const l=Date.now(),u=await fetch(`${t}/${Aye}${e}${s}`,{cache:"no-store",credentials:"same-origin",signal:i});if(!u.ok&&!((o=u.headers.get("content-type"))!=null&&o.startsWith("application/json")))throw new Error(u.statusText);const h=await u.json();if(r&&r(Date.now()-l),h.status==="error")throw new Error(h.error!==void 0?h.error:'missing "error" field in response JSON');return h}catch(l){if(!(l instanceof Error))throw new Error("Unknown error");switch(l.name){case"TypeError":throw new Error("Network error or unable to reach the server");case"SyntaxError":throw new Error("Invalid JSON response");default:throw l}}},Ih=({key:t,path:e,params:n,enabled:r,recordResponseTime:i,refetchInterval:s})=>{const{pathPrefix:o}=ai();return Vae({queryKey:t!==void 0?t:[e,n],retry:!1,refetchOnWindowFocus:!1,refetchInterval:s,gcTime:0,enabled:r,queryFn:DV({pathPrefix:o,path:e,params:n,recordResponseTime:i})})},bi=({key:t,path:e,params:n})=>{const{pathPrefix:r}=ai();return XB({queryKey:t!==void 0?t:[e,n],retry:!1,refetchOnWindowFocus:!1,staleTime:1/0,gcTime:0,queryFn:DV({pathPrefix:r,path:e,params:n})})};function Mye(t){let e=t,n=!1;const r=new Set;return{getState(){return e},updateState(i){e=typeof i=="function"?i(e):i},setState(i){this.updateState(i),r.forEach(s=>s(e))},initialize(i){n||(e=i,n=!0)},subscribe(i){return r.add(i),()=>r.delete(i)}}}function Rye(t){return M.useSyncExternalStore(t.subscribe,()=>t.getState(),()=>t.getState())}function Dye(t,e,n){const r=[],i=[],s={};for(const o of t){const l=o.position||e;s[l]=s[l]||0,s[l]+=1,s[l]<=n?i.push(o):r.push(o)}return{notifications:i,queue:r}}const Nye=()=>Mye({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Ef=Nye(),Pye=(t=Ef)=>Rye(t);function Jm(t,e){const n=t.getState(),r=e([...n.notifications,...n.queue]),i=Dye(r,n.defaultPosition,n.limit);t.setState({notifications:i.notifications,queue:i.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Lye(t,e=Ef){const n=t.id||dm();return Jm(e,r=>t.id&&r.some(i=>i.id===t.id)?r:[...r,{...t,id:n}]),n}function NV(t,e=Ef){return Jm(e,n=>n.filter(r=>{var i;return r.id===t?((i=r.onClose)==null||i.call(r,r),!1):!0})),t}function $ye(t,e=Ef){return Jm(e,n=>n.map(r=>r.id===t.id?{...r,...t}:r)),t.id}function Iye(t=Ef){Jm(t,()=>[])}function Bye(t=Ef){Jm(t,e=>e.slice(0,t.getState().limit))}const al={show:Lye,hide:NV,update:$ye,clean:Iye,cleanQueue:Bye,updateState:Jm};function t6(t,e){return t6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},t6(t,e)}function PV(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t6(t,e)}const bP={disabled:!1},jw=_n.createContext(null);var zye=function(e){return e.scrollTop},jg="unmounted",kd="exited",Od="entering",wp="entered",n6="exiting",cu=function(t){PV(e,t);function e(r,i){var s;s=t.call(this,r,i)||this;var o=i,l=o&&!o.isMounting?r.enter:r.appear,u;return s.appearStatus=null,r.in?l?(u=kd,s.appearStatus=Od):u=wp:r.unmountOnExit||r.mountOnEnter?u=jg:u=kd,s.state={status:u},s.nextCallback=null,s}e.getDerivedStateFromProps=function(i,s){var o=i.in;return o&&s.status===jg?{status:kd}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var s=null;if(i!==this.props){var o=this.state.status;this.props.in?o!==Od&&o!==wp&&(s=Od):(o===Od||o===wp)&&(s=n6)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,s,o,l;return s=o=l=i,i!=null&&typeof i!="number"&&(s=i.exit,o=i.enter,l=i.appear!==void 0?i.appear:o),{exit:s,enter:o,appear:l}},n.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===Od){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:dg.findDOMNode(this);o&&zye(o)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===kd&&this.setState({status:jg})},n.performEnter=function(i){var s=this,o=this.props.enter,l=this.context?this.context.isMounting:i,u=this.props.nodeRef?[l]:[dg.findDOMNode(this),l],h=u[0],f=u[1],p=this.getTimeouts(),m=l?p.appear:p.enter;if(!i&&!o||bP.disabled){this.safeSetState({status:wp},function(){s.props.onEntered(h)});return}this.props.onEnter(h,f),this.safeSetState({status:Od},function(){s.props.onEntering(h,f),s.onTransitionEnd(m,function(){s.safeSetState({status:wp},function(){s.props.onEntered(h,f)})})})},n.performExit=function(){var i=this,s=this.props.exit,o=this.getTimeouts(),l=this.props.nodeRef?void 0:dg.findDOMNode(this);if(!s||bP.disabled){this.safeSetState({status:kd},function(){i.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:n6},function(){i.props.onExiting(l),i.onTransitionEnd(o.exit,function(){i.safeSetState({status:kd},function(){i.props.onExited(l)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},n.setNextCallback=function(i){var s=this,o=!0;return this.nextCallback=function(l){o&&(o=!1,s.nextCallback=null,i(l))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},n.onTransitionEnd=function(i,s){this.setNextCallback(s);var o=this.props.nodeRef?this.props.nodeRef.current:dg.findDOMNode(this),l=i==null&&!this.props.addEndListener;if(!o||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],h=u[0],f=u[1];this.props.addEndListener(h,f)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===jg)return null;var s=this.props,o=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var l=EO(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return _n.createElement(jw.Provider,{value:null},typeof o=="function"?o(i,l):_n.cloneElement(_n.Children.only(o),l))},e}(_n.Component);cu.contextType=jw;cu.propTypes={};function pp(){}cu.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:pp,onEntering:pp,onEntered:pp,onExit:pp,onExiting:pp,onExited:pp};cu.UNMOUNTED=jg;cu.EXITED=kd;cu.ENTERING=Od;cu.ENTERED=wp;cu.EXITING=n6;function qye(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function OE(t,e){var n=function(s){return e&&M.isValidElement(s)?e(s):s},r=Object.create(null);return t&&M.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function Fye(t,e){t=t||{},e=e||{};function n(f){return f in e?e[f]:t[f]}var r=Object.create(null),i=[];for(var s in t)s in e?i.length&&(r[s]=i,i=[]):i.push(s);var o,l={};for(var u in e){if(r[u])for(o=0;o<r[u].length;o++){var h=r[u][o];l[r[u][o]]=n(h)}l[u]=n(u)}for(o=0;o<i.length;o++)l[i[o]]=n(i[o]);return l}function Fd(t,e,n){return n[e]!=null?n[e]:t.props[e]}function Hye(t,e){return OE(t.children,function(n){return M.cloneElement(n,{onExited:e.bind(null,n),in:!0,appear:Fd(n,"appear",t),enter:Fd(n,"enter",t),exit:Fd(n,"exit",t)})})}function Vye(t,e,n){var r=OE(t.children),i=Fye(e,r);return Object.keys(i).forEach(function(s){var o=i[s];if(M.isValidElement(o)){var l=s in e,u=s in r,h=e[s],f=M.isValidElement(h)&&!h.props.in;u&&(!l||f)?i[s]=M.cloneElement(o,{onExited:n.bind(null,o),in:!0,exit:Fd(o,"exit",t),enter:Fd(o,"enter",t)}):!u&&l&&!f?i[s]=M.cloneElement(o,{in:!1}):u&&l&&M.isValidElement(h)&&(i[s]=M.cloneElement(o,{onExited:n.bind(null,o),in:h.props.in,exit:Fd(o,"exit",t),enter:Fd(o,"enter",t)}))}}),i}var Uye=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},Qye={component:"div",childFactory:function(e){return e}},rh=function(t){PV(e,t);function e(r,i){var s;s=t.call(this,r,i)||this;var o=s.handleExited.bind(qye(s));return s.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},s}var n=e.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},e.getDerivedStateFromProps=function(i,s){var o=s.children,l=s.handleExited,u=s.firstRender;return{children:u?Hye(i,l):Vye(i,o,l),firstRender:!1}},n.handleExited=function(i,s){var o=OE(this.props.children);i.key in o||(i.props.onExited&&i.props.onExited(s),this.mounted&&this.setState(function(l){var u=kx({},l.children);return delete u[i.key],{children:u}}))},n.render=function(){var i=this.props,s=i.component,o=i.childFactory,l=EO(i,["component","childFactory"]),u=this.state.contextValue,h=Uye(this.state.children).map(o);return delete l.appear,delete l.enter,delete l.exit,s===null?_n.createElement(jw.Provider,{value:u},h):_n.createElement(jw.Provider,{value:u},_n.createElement(s,l,h))},e}(_n.Component);rh.propTypes={};rh.defaultProps=Qye;const LV=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function Wye(t,e){return t.reduce((n,r)=>(n[r.position||e].push(r),n),LV.reduce((n,r)=>(n[r]=[],n),{}))}const yP={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},Yye={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function Xye({state:t,maxHeight:e,position:n,transitionDuration:r}){const[i,s]=n.split("-"),o=s==="center"?`${i}-center`:s,l={opacity:0,maxHeight:e,transform:yP[o],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},u={opacity:1,transform:Yye[o]},h={opacity:0,maxHeight:0,transform:yP[o]};return{...l,...{entering:u,entered:u,exiting:h,exited:h}[t]}}function Gye(t,e){return typeof e=="number"?e:e===!1||t===!1?!1:t}const $V=M.forwardRef(({data:t,onHide:e,autoClose:n,...r},i)=>{const{autoClose:s,message:o,...l}=t,u=Gye(n,t.autoClose),h=M.useRef(-1),f=()=>window.clearTimeout(h.current),p=()=>{e(t.id),f()},m=()=>{typeof u=="number"&&(h.current=window.setTimeout(p,u))};return M.useEffect(()=>{var v;(v=t.onOpen)==null||v.call(t,t)},[]),M.useEffect(()=>(m(),f),[u]),a.jsx(FO,{...r,...l,onClose:p,ref:i,onMouseEnter:f,onMouseLeave:m,children:o})});$V.displayName="@mantine/notifications/NotificationContainer";var IV={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const Kye=cu,Zye={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:So("overlay"),store:Ef,withinPortal:!0},Jye=(t,{zIndex:e,containerWidth:n})=>({root:{"--notifications-z-index":e==null?void 0:e.toString(),"--notifications-container-width":de(n)}}),uu=Ae((t,e)=>{const n=Se("Notifications",Zye,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,position:h,autoClose:f,transitionDuration:p,containerWidth:m,notificationMaxHeight:v,limit:b,zIndex:x,store:w,portalProps:S,withinPortal:_,...T}=n,C=yi(),j=Pye(w),A=eX(),E=Lw(),R=M.useRef({}),N=M.useRef(0),D=(C.respectReducedMotion?E:!1)?1:p,F=lt({name:"Notifications",classes:IV,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,vars:u,varsResolver:Jye});M.useEffect(()=>{w==null||w.updateState(q=>({...q,limit:b||5,defaultPosition:h}))},[b,h]),Yl(()=>{j.notifications.length>N.current&&setTimeout(()=>A(),0),N.current=j.notifications.length},[j.notifications]);const Q=Wye(j.notifications,h),H=LV.reduce((q,P)=>(q[P]=Q[P].map(({style:I,...U})=>a.jsx(Kye,{timeout:D,onEnter:()=>R.current[U.id].offsetHeight,nodeRef:{current:R.current[U.id]},children:Z=>a.jsx($V,{ref:X=>{X&&(R.current[U.id]=X)},data:U,onHide:X=>NV(X,w),autoClose:f,...F("notification",{style:{...Xye({state:Z,position:P,transitionDuration:D,maxHeight:v}),...I}})})},U.id)),q),{});return a.jsxs(Eh,{withinPortal:_,...S,children:[a.jsx(ve,{...F("root"),"data-position":"top-center",ref:e,...T,children:a.jsx(rh,{children:H["top-center"]})}),a.jsx(ve,{...F("root"),"data-position":"top-left",...T,children:a.jsx(rh,{children:H["top-left"]})}),a.jsx(ve,{...F("root",{className:uf.classNames.fullWidth}),"data-position":"top-right",...T,children:a.jsx(rh,{children:H["top-right"]})}),a.jsx(ve,{...F("root",{className:uf.classNames.fullWidth}),"data-position":"bottom-right",...T,children:a.jsx(rh,{children:H["bottom-right"]})}),a.jsx(ve,{...F("root"),"data-position":"bottom-left",...T,children:a.jsx(rh,{children:H["bottom-left"]})}),a.jsx(ve,{...F("root"),"data-position":"bottom-center",...T,children:a.jsx(rh,{children:H["bottom-center"]})})]})});uu.classes=IV;uu.displayName="@mantine/notifications/Notifications";uu.show=al.show;uu.hide=al.hide;uu.update=al.update;uu.clean=al.clean;uu.cleanQueue=al.cleanQueue;uu.updateState=al.updateState;function e1e(t){return t.replace(/[&<>"']/g,e=>{switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return"&#039;"}})}function r6(t){return t.to-t.from+1}function BV(t,e){const n=t[e];let r=null;return e===0&&n.from!==0&&(r={from:0,to:n.from-1}),e>0&&(r={from:t[e-1].to+1,to:n.from-1}),r}function t1e(t,e){let n=0;for(let r=0;r<t.length;r++){const i=t[r],s=BV(t,r);s!==null&&(n=n-r6(s)/e),n=n+r6(i)**2}return n}class zV{constructor(e){this.conf={caseSensitive:(e==null?void 0:e.caseSensitive)===void 0?!1:e.caseSensitive,excludedChars:(e==null?void 0:e.excludedChars)===void 0?[]:e.excludedChars,includeMatches:(e==null?void 0:e.includeMatches)===void 0?!1:e.includeMatches,shouldSort:(e==null?void 0:e.shouldSort)===void 0?!1:e.shouldSort,shouldRender:(e==null?void 0:e.shouldRender)===void 0?!0:e.shouldRender,escapeHTML:(e==null?void 0:e.escapeHTML)===void 0?!1:e.escapeHTML,pre:(e==null?void 0:e.pre)===void 0?"":e.pre,post:(e==null?void 0:e.post)===void 0?"":e.post}}filter(e,n,r){const i=(r==null?void 0:r.shouldSort)!==void 0?r.shouldSort:this.conf.shouldSort;let s=[];for(let o=0;o<n.length;o++){const l=this.match(e,n[o],r);l!==null&&(l.index=o,s.push(l))}return i&&(s=s.sort((o,l)=>l.score-o.score)),s}match(e,n,r){let i=e,s=n;const o=(r==null?void 0:r.caseSensitive)!==void 0?r.caseSensitive:this.conf.caseSensitive,l=(r==null?void 0:r.includeMatches)!==void 0?r.includeMatches:this.conf.includeMatches,u=(r==null?void 0:r.shouldRender)!==void 0?r.shouldRender:this.conf.shouldRender;if(o||(i=i.toLowerCase(),s=s.toLowerCase()),i===s){const m=[{from:0,to:e.length-1}],v={original:n,rendered:u?this.render(n,m,r):n,score:1/0};return l&&(v.intervals=m),v}let h=[],f=0;for(let m=0;m<s.length-i.length+1;m++)if(s[m]===i[0]){const v=this.generateMatchingInterval(i,s,m,r);if(v===null)break;v.score>f&&(f=v.score,h=v.intervals)}if(h.length===0)return null;const p={original:n,rendered:u?this.render(n,h,r):n,score:f};return l&&(p.intervals=h),p}render(e,n,r){if(n.length==0)return e;let i="";const s=r!=null&&r.pre?r.pre:this.conf.pre,o=r!=null&&r.post?r.post:this.conf.post;for(let u=0;u<n.length;u++){const h=n[u],f=BV(n,u);let p="";f!==null&&(p=this.extractSubString(e,f,r));const m=this.extractSubString(e,h,r);i=`${i}${p}${s}${m}${o}`}const l=n[n.length-1];return l.to<e.length-1&&(i=i+this.extractSubString(e,{from:l.to+1,to:e.length},r)),i}extractSubString(e,n,r){const i=(r==null?void 0:r.escapeHTML)!==void 0?r.escapeHTML:this.conf.escapeHTML;let s=e.substr(n.from,r6(n));return i&&(s=e1e(s)),s}generateMatchingInterval(e,n,r,i){let s=[];(i==null?void 0:i.excludedChars)!==void 0?s=i.excludedChars:this.conf.excludedChars!==void 0&&(s=this.conf.excludedChars);let o=0;const l=[];for(let u=r;u<n.length&&o<e.length;){if(s.includes(n[u])){u++;continue}if(s.includes(e[o])){o++;continue}if(n[u]===e[o]){const h={from:u,to:u};o++,u++;for(let f=u;f<n.length&&o<e.length&&n[f]===e[o];f++)h.to=f,o++,u=f;l.push(h)}u++}return l.length===0||o!==e.length?null:{score:t1e(l,n.length),intervals:l}}}const qV=new zV;function n1e(t,e,n){return qV.match(t,e,n)}function xP(t,e,n){return qV.render(t,e,n)}var Po={},Lo={},J3={},$o={},g1={},wP;function r1e(){return wP||(wP=1,Object.defineProperty(g1,"__esModule",{value:!0}),g1.default=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(function(t){return t.charCodeAt(0)}))),g1}var v1={},SP;function i1e(){return SP||(SP=1,Object.defineProperty(v1,"__esModule",{value:!0}),v1.default=new Uint16Array("Ȁaglq	\x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(function(t){return t.charCodeAt(0)}))),v1}var eT={},jP;function _P(){return jP||(jP=1,function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.replaceCodePoint=t.fromCodePoint=void 0;var n=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);t.fromCodePoint=(e=String.fromCodePoint)!==null&&e!==void 0?e:function(s){var o="";return s>65535&&(s-=65536,o+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),o+=String.fromCharCode(s),o};function r(s){var o;return s>=55296&&s<=57343||s>1114111?65533:(o=n.get(s))!==null&&o!==void 0?o:s}t.replaceCodePoint=r;function i(s){return(0,t.fromCodePoint)(r(s))}t.default=i}(eT)),eT}var TP;function _w(){return TP||(TP=1,function(t){var e=$o&&$o.__createBinding||(Object.create?function(D,F,Q,H){H===void 0&&(H=Q);var q=Object.getOwnPropertyDescriptor(F,Q);(!q||("get"in q?!F.__esModule:q.writable||q.configurable))&&(q={enumerable:!0,get:function(){return F[Q]}}),Object.defineProperty(D,H,q)}:function(D,F,Q,H){H===void 0&&(H=Q),D[H]=F[Q]}),n=$o&&$o.__setModuleDefault||(Object.create?function(D,F){Object.defineProperty(D,"default",{enumerable:!0,value:F})}:function(D,F){D.default=F}),r=$o&&$o.__importStar||function(D){if(D&&D.__esModule)return D;var F={};if(D!=null)for(var Q in D)Q!=="default"&&Object.prototype.hasOwnProperty.call(D,Q)&&e(F,D,Q);return n(F,D),F},i=$o&&$o.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXML=t.decodeHTMLStrict=t.decodeHTMLAttribute=t.decodeHTML=t.determineBranch=t.EntityDecoder=t.DecodingMode=t.BinTrieFlags=t.fromCodePoint=t.replaceCodePoint=t.decodeCodePoint=t.xmlDecodeTree=t.htmlDecodeTree=void 0;var s=i(r1e());t.htmlDecodeTree=s.default;var o=i(i1e());t.xmlDecodeTree=o.default;var l=r(_P());t.decodeCodePoint=l.default;var u=_P();Object.defineProperty(t,"replaceCodePoint",{enumerable:!0,get:function(){return u.replaceCodePoint}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return u.fromCodePoint}});var h;(function(D){D[D.NUM=35]="NUM",D[D.SEMI=59]="SEMI",D[D.EQUALS=61]="EQUALS",D[D.ZERO=48]="ZERO",D[D.NINE=57]="NINE",D[D.LOWER_A=97]="LOWER_A",D[D.LOWER_F=102]="LOWER_F",D[D.LOWER_X=120]="LOWER_X",D[D.LOWER_Z=122]="LOWER_Z",D[D.UPPER_A=65]="UPPER_A",D[D.UPPER_F=70]="UPPER_F",D[D.UPPER_Z=90]="UPPER_Z"})(h||(h={}));var f=32,p;(function(D){D[D.VALUE_LENGTH=49152]="VALUE_LENGTH",D[D.BRANCH_LENGTH=16256]="BRANCH_LENGTH",D[D.JUMP_TABLE=127]="JUMP_TABLE"})(p=t.BinTrieFlags||(t.BinTrieFlags={}));function m(D){return D>=h.ZERO&&D<=h.NINE}function v(D){return D>=h.UPPER_A&&D<=h.UPPER_F||D>=h.LOWER_A&&D<=h.LOWER_F}function b(D){return D>=h.UPPER_A&&D<=h.UPPER_Z||D>=h.LOWER_A&&D<=h.LOWER_Z||m(D)}function x(D){return D===h.EQUALS||b(D)}var w;(function(D){D[D.EntityStart=0]="EntityStart",D[D.NumericStart=1]="NumericStart",D[D.NumericDecimal=2]="NumericDecimal",D[D.NumericHex=3]="NumericHex",D[D.NamedEntity=4]="NamedEntity"})(w||(w={}));var S;(function(D){D[D.Legacy=0]="Legacy",D[D.Strict=1]="Strict",D[D.Attribute=2]="Attribute"})(S=t.DecodingMode||(t.DecodingMode={}));var _=function(){function D(F,Q,H){this.decodeTree=F,this.emitCodePoint=Q,this.errors=H,this.state=w.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=S.Strict}return D.prototype.startEntity=function(F){this.decodeMode=F,this.state=w.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},D.prototype.write=function(F,Q){switch(this.state){case w.EntityStart:return F.charCodeAt(Q)===h.NUM?(this.state=w.NumericStart,this.consumed+=1,this.stateNumericStart(F,Q+1)):(this.state=w.NamedEntity,this.stateNamedEntity(F,Q));case w.NumericStart:return this.stateNumericStart(F,Q);case w.NumericDecimal:return this.stateNumericDecimal(F,Q);case w.NumericHex:return this.stateNumericHex(F,Q);case w.NamedEntity:return this.stateNamedEntity(F,Q)}},D.prototype.stateNumericStart=function(F,Q){return Q>=F.length?-1:(F.charCodeAt(Q)|f)===h.LOWER_X?(this.state=w.NumericHex,this.consumed+=1,this.stateNumericHex(F,Q+1)):(this.state=w.NumericDecimal,this.stateNumericDecimal(F,Q))},D.prototype.addToNumericResult=function(F,Q,H,q){if(Q!==H){var P=H-Q;this.result=this.result*Math.pow(q,P)+parseInt(F.substr(Q,P),q),this.consumed+=P}},D.prototype.stateNumericHex=function(F,Q){for(var H=Q;Q<F.length;){var q=F.charCodeAt(Q);if(m(q)||v(q))Q+=1;else return this.addToNumericResult(F,H,Q,16),this.emitNumericEntity(q,3)}return this.addToNumericResult(F,H,Q,16),-1},D.prototype.stateNumericDecimal=function(F,Q){for(var H=Q;Q<F.length;){var q=F.charCodeAt(Q);if(m(q))Q+=1;else return this.addToNumericResult(F,H,Q,10),this.emitNumericEntity(q,2)}return this.addToNumericResult(F,H,Q,10),-1},D.prototype.emitNumericEntity=function(F,Q){var H;if(this.consumed<=Q)return(H=this.errors)===null||H===void 0||H.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(F===h.SEMI)this.consumed+=1;else if(this.decodeMode===S.Strict)return 0;return this.emitCodePoint((0,l.replaceCodePoint)(this.result),this.consumed),this.errors&&(F!==h.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed},D.prototype.stateNamedEntity=function(F,Q){for(var H=this.decodeTree,q=H[this.treeIndex],P=(q&p.VALUE_LENGTH)>>14;Q<F.length;Q++,this.excess++){var I=F.charCodeAt(Q);if(this.treeIndex=C(H,q,this.treeIndex+Math.max(1,P),I),this.treeIndex<0)return this.result===0||this.decodeMode===S.Attribute&&(P===0||x(I))?0:this.emitNotTerminatedNamedEntity();if(q=H[this.treeIndex],P=(q&p.VALUE_LENGTH)>>14,P!==0){if(I===h.SEMI)return this.emitNamedEntityData(this.treeIndex,P,this.consumed+this.excess);this.decodeMode!==S.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},D.prototype.emitNotTerminatedNamedEntity=function(){var F,Q=this,H=Q.result,q=Q.decodeTree,P=(q[H]&p.VALUE_LENGTH)>>14;return this.emitNamedEntityData(H,P,this.consumed),(F=this.errors)===null||F===void 0||F.missingSemicolonAfterCharacterReference(),this.consumed},D.prototype.emitNamedEntityData=function(F,Q,H){var q=this.decodeTree;return this.emitCodePoint(Q===1?q[F]&~p.VALUE_LENGTH:q[F+1],H),Q===3&&this.emitCodePoint(q[F+2],H),H},D.prototype.end=function(){var F;switch(this.state){case w.NamedEntity:return this.result!==0&&(this.decodeMode!==S.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case w.NumericDecimal:return this.emitNumericEntity(0,2);case w.NumericHex:return this.emitNumericEntity(0,3);case w.NumericStart:return(F=this.errors)===null||F===void 0||F.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case w.EntityStart:return 0}},D}();t.EntityDecoder=_;function T(D){var F="",Q=new _(D,function(H){return F+=(0,l.fromCodePoint)(H)});return function(q,P){for(var I=0,U=0;(U=q.indexOf("&",U))>=0;){F+=q.slice(I,U),Q.startEntity(P);var Z=Q.write(q,U+1);if(Z<0){I=U+Q.end();break}I=U+Z,U=Z===0?I+1:I}var X=F+q.slice(I);return F="",X}}function C(D,F,Q,H){var q=(F&p.BRANCH_LENGTH)>>7,P=F&p.JUMP_TABLE;if(q===0)return P!==0&&H===P?Q:-1;if(P){var I=H-P;return I<0||I>=q?-1:D[Q+I]-1}for(var U=Q,Z=U+q-1;U<=Z;){var X=U+Z>>>1,V=D[X];if(V<H)U=X+1;else if(V>H)Z=X-1;else return D[X+q]}return-1}t.determineBranch=C;var j=T(s.default),A=T(o.default);function E(D,F){return F===void 0&&(F=S.Legacy),j(D,F)}t.decodeHTML=E;function R(D){return j(D,S.Attribute)}t.decodeHTMLAttribute=R;function N(D){return j(D,S.Strict)}t.decodeHTMLStrict=N;function $(D){return A(D,S.Strict)}t.decodeXML=$}($o)),$o}var CP;function FV(){return CP||(CP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.QuoteType=void 0;var e=_w(),n;(function(m){m[m.Tab=9]="Tab",m[m.NewLine=10]="NewLine",m[m.FormFeed=12]="FormFeed",m[m.CarriageReturn=13]="CarriageReturn",m[m.Space=32]="Space",m[m.ExclamationMark=33]="ExclamationMark",m[m.Number=35]="Number",m[m.Amp=38]="Amp",m[m.SingleQuote=39]="SingleQuote",m[m.DoubleQuote=34]="DoubleQuote",m[m.Dash=45]="Dash",m[m.Slash=47]="Slash",m[m.Zero=48]="Zero",m[m.Nine=57]="Nine",m[m.Semi=59]="Semi",m[m.Lt=60]="Lt",m[m.Eq=61]="Eq",m[m.Gt=62]="Gt",m[m.Questionmark=63]="Questionmark",m[m.UpperA=65]="UpperA",m[m.LowerA=97]="LowerA",m[m.UpperF=70]="UpperF",m[m.LowerF=102]="LowerF",m[m.UpperZ=90]="UpperZ",m[m.LowerZ=122]="LowerZ",m[m.LowerX=120]="LowerX",m[m.OpeningSquareBracket=91]="OpeningSquareBracket"})(n||(n={}));var r;(function(m){m[m.Text=1]="Text",m[m.BeforeTagName=2]="BeforeTagName",m[m.InTagName=3]="InTagName",m[m.InSelfClosingTag=4]="InSelfClosingTag",m[m.BeforeClosingTagName=5]="BeforeClosingTagName",m[m.InClosingTagName=6]="InClosingTagName",m[m.AfterClosingTagName=7]="AfterClosingTagName",m[m.BeforeAttributeName=8]="BeforeAttributeName",m[m.InAttributeName=9]="InAttributeName",m[m.AfterAttributeName=10]="AfterAttributeName",m[m.BeforeAttributeValue=11]="BeforeAttributeValue",m[m.InAttributeValueDq=12]="InAttributeValueDq",m[m.InAttributeValueSq=13]="InAttributeValueSq",m[m.InAttributeValueNq=14]="InAttributeValueNq",m[m.BeforeDeclaration=15]="BeforeDeclaration",m[m.InDeclaration=16]="InDeclaration",m[m.InProcessingInstruction=17]="InProcessingInstruction",m[m.BeforeComment=18]="BeforeComment",m[m.CDATASequence=19]="CDATASequence",m[m.InSpecialComment=20]="InSpecialComment",m[m.InCommentLike=21]="InCommentLike",m[m.BeforeSpecialS=22]="BeforeSpecialS",m[m.SpecialStartSequence=23]="SpecialStartSequence",m[m.InSpecialTag=24]="InSpecialTag",m[m.BeforeEntity=25]="BeforeEntity",m[m.BeforeNumericEntity=26]="BeforeNumericEntity",m[m.InNamedEntity=27]="InNamedEntity",m[m.InNumericEntity=28]="InNumericEntity",m[m.InHexEntity=29]="InHexEntity"})(r||(r={}));function i(m){return m===n.Space||m===n.NewLine||m===n.Tab||m===n.FormFeed||m===n.CarriageReturn}function s(m){return m===n.Slash||m===n.Gt||i(m)}function o(m){return m>=n.Zero&&m<=n.Nine}function l(m){return m>=n.LowerA&&m<=n.LowerZ||m>=n.UpperA&&m<=n.UpperZ}function u(m){return m>=n.UpperA&&m<=n.UpperF||m>=n.LowerA&&m<=n.LowerF}var h;(function(m){m[m.NoValue=0]="NoValue",m[m.Unquoted=1]="Unquoted",m[m.Single=2]="Single",m[m.Double=3]="Double"})(h=t.QuoteType||(t.QuoteType={}));var f={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])},p=function(){function m(v,b){var x=v.xmlMode,w=x===void 0?!1:x,S=v.decodeEntities,_=S===void 0?!0:S;this.cbs=b,this.state=r.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=r.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=w,this.decodeEntities=_,this.entityTrie=w?e.xmlDecodeTree:e.htmlDecodeTree}return m.prototype.reset=function(){this.state=r.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=r.Text,this.currentSequence=void 0,this.running=!0,this.offset=0},m.prototype.write=function(v){this.offset+=this.buffer.length,this.buffer=v,this.parse()},m.prototype.end=function(){this.running&&this.finish()},m.prototype.pause=function(){this.running=!1},m.prototype.resume=function(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()},m.prototype.getIndex=function(){return this.index},m.prototype.getSectionStart=function(){return this.sectionStart},m.prototype.stateText=function(v){v===n.Lt||!this.decodeEntities&&this.fastForwardTo(n.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=r.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&v===n.Amp&&(this.state=r.BeforeEntity)},m.prototype.stateSpecialStartSequence=function(v){var b=this.sequenceIndex===this.currentSequence.length,x=b?s(v):(v|32)===this.currentSequence[this.sequenceIndex];if(!x)this.isSpecial=!1;else if(!b){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=r.InTagName,this.stateInTagName(v)},m.prototype.stateInSpecialTag=function(v){if(this.sequenceIndex===this.currentSequence.length){if(v===n.Gt||i(v)){var b=this.index-this.currentSequence.length;if(this.sectionStart<b){var x=this.index;this.index=b,this.cbs.ontext(this.sectionStart,b),this.index=x}this.isSpecial=!1,this.sectionStart=b+2,this.stateInClosingTagName(v);return}this.sequenceIndex=0}(v|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===f.TitleEnd?this.decodeEntities&&v===n.Amp&&(this.state=r.BeforeEntity):this.fastForwardTo(n.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(v===n.Lt)},m.prototype.stateCDATASequence=function(v){v===f.Cdata[this.sequenceIndex]?++this.sequenceIndex===f.Cdata.length&&(this.state=r.InCommentLike,this.currentSequence=f.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=r.InDeclaration,this.stateInDeclaration(v))},m.prototype.fastForwardTo=function(v){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===v)return!0;return this.index=this.buffer.length+this.offset-1,!1},m.prototype.stateInCommentLike=function(v){v===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===f.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=r.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):v!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)},m.prototype.isTagStartChar=function(v){return this.xmlMode?!s(v):l(v)},m.prototype.startSpecial=function(v,b){this.isSpecial=!0,this.currentSequence=v,this.sequenceIndex=b,this.state=r.SpecialStartSequence},m.prototype.stateBeforeTagName=function(v){if(v===n.ExclamationMark)this.state=r.BeforeDeclaration,this.sectionStart=this.index+1;else if(v===n.Questionmark)this.state=r.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(v)){var b=v|32;this.sectionStart=this.index,!this.xmlMode&&b===f.TitleEnd[2]?this.startSpecial(f.TitleEnd,3):this.state=!this.xmlMode&&b===f.ScriptEnd[2]?r.BeforeSpecialS:r.InTagName}else v===n.Slash?this.state=r.BeforeClosingTagName:(this.state=r.Text,this.stateText(v))},m.prototype.stateInTagName=function(v){s(v)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(v))},m.prototype.stateBeforeClosingTagName=function(v){i(v)||(v===n.Gt?this.state=r.Text:(this.state=this.isTagStartChar(v)?r.InClosingTagName:r.InSpecialComment,this.sectionStart=this.index))},m.prototype.stateInClosingTagName=function(v){(v===n.Gt||i(v))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.AfterClosingTagName,this.stateAfterClosingTagName(v))},m.prototype.stateAfterClosingTagName=function(v){(v===n.Gt||this.fastForwardTo(n.Gt))&&(this.state=r.Text,this.baseState=r.Text,this.sectionStart=this.index+1)},m.prototype.stateBeforeAttributeName=function(v){v===n.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=r.InSpecialTag,this.sequenceIndex=0):this.state=r.Text,this.baseState=this.state,this.sectionStart=this.index+1):v===n.Slash?this.state=r.InSelfClosingTag:i(v)||(this.state=r.InAttributeName,this.sectionStart=this.index)},m.prototype.stateInSelfClosingTag=function(v){v===n.Gt?(this.cbs.onselfclosingtag(this.index),this.state=r.Text,this.baseState=r.Text,this.sectionStart=this.index+1,this.isSpecial=!1):i(v)||(this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(v))},m.prototype.stateInAttributeName=function(v){(v===n.Eq||s(v))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.AfterAttributeName,this.stateAfterAttributeName(v))},m.prototype.stateAfterAttributeName=function(v){v===n.Eq?this.state=r.BeforeAttributeValue:v===n.Slash||v===n.Gt?(this.cbs.onattribend(h.NoValue,this.index),this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(v)):i(v)||(this.cbs.onattribend(h.NoValue,this.index),this.state=r.InAttributeName,this.sectionStart=this.index)},m.prototype.stateBeforeAttributeValue=function(v){v===n.DoubleQuote?(this.state=r.InAttributeValueDq,this.sectionStart=this.index+1):v===n.SingleQuote?(this.state=r.InAttributeValueSq,this.sectionStart=this.index+1):i(v)||(this.sectionStart=this.index,this.state=r.InAttributeValueNq,this.stateInAttributeValueNoQuotes(v))},m.prototype.handleInAttributeValue=function(v,b){v===b||!this.decodeEntities&&this.fastForwardTo(b)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(b===n.DoubleQuote?h.Double:h.Single,this.index),this.state=r.BeforeAttributeName):this.decodeEntities&&v===n.Amp&&(this.baseState=this.state,this.state=r.BeforeEntity)},m.prototype.stateInAttributeValueDoubleQuotes=function(v){this.handleInAttributeValue(v,n.DoubleQuote)},m.prototype.stateInAttributeValueSingleQuotes=function(v){this.handleInAttributeValue(v,n.SingleQuote)},m.prototype.stateInAttributeValueNoQuotes=function(v){i(v)||v===n.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(h.Unquoted,this.index),this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(v)):this.decodeEntities&&v===n.Amp&&(this.baseState=this.state,this.state=r.BeforeEntity)},m.prototype.stateBeforeDeclaration=function(v){v===n.OpeningSquareBracket?(this.state=r.CDATASequence,this.sequenceIndex=0):this.state=v===n.Dash?r.BeforeComment:r.InDeclaration},m.prototype.stateInDeclaration=function(v){(v===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=r.Text,this.sectionStart=this.index+1)},m.prototype.stateInProcessingInstruction=function(v){(v===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=r.Text,this.sectionStart=this.index+1)},m.prototype.stateBeforeComment=function(v){v===n.Dash?(this.state=r.InCommentLike,this.currentSequence=f.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=r.InDeclaration},m.prototype.stateInSpecialComment=function(v){(v===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=r.Text,this.sectionStart=this.index+1)},m.prototype.stateBeforeSpecialS=function(v){var b=v|32;b===f.ScriptEnd[3]?this.startSpecial(f.ScriptEnd,4):b===f.StyleEnd[3]?this.startSpecial(f.StyleEnd,4):(this.state=r.InTagName,this.stateInTagName(v))},m.prototype.stateBeforeEntity=function(v){this.entityExcess=1,this.entityResult=0,v===n.Number?this.state=r.BeforeNumericEntity:v===n.Amp||(this.trieIndex=0,this.trieCurrent=this.entityTrie[0],this.state=r.InNamedEntity,this.stateInNamedEntity(v))},m.prototype.stateInNamedEntity=function(v){if(this.entityExcess+=1,this.trieIndex=(0,e.determineBranch)(this.entityTrie,this.trieCurrent,this.trieIndex+1,v),this.trieIndex<0){this.emitNamedEntity(),this.index--;return}this.trieCurrent=this.entityTrie[this.trieIndex];var b=this.trieCurrent&e.BinTrieFlags.VALUE_LENGTH;if(b){var x=(b>>14)-1;if(!this.allowLegacyEntity()&&v!==n.Semi)this.trieIndex+=x;else{var w=this.index-this.entityExcess+1;w>this.sectionStart&&this.emitPartial(this.sectionStart,w),this.entityResult=this.trieIndex,this.trieIndex+=x,this.entityExcess=0,this.sectionStart=this.index+1,x===0&&this.emitNamedEntity()}}},m.prototype.emitNamedEntity=function(){if(this.state=this.baseState,this.entityResult!==0){var v=(this.entityTrie[this.entityResult]&e.BinTrieFlags.VALUE_LENGTH)>>14;switch(v){case 1:{this.emitCodePoint(this.entityTrie[this.entityResult]&~e.BinTrieFlags.VALUE_LENGTH);break}case 2:{this.emitCodePoint(this.entityTrie[this.entityResult+1]);break}case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}}},m.prototype.stateBeforeNumericEntity=function(v){(v|32)===n.LowerX?(this.entityExcess++,this.state=r.InHexEntity):(this.state=r.InNumericEntity,this.stateInNumericEntity(v))},m.prototype.emitNumericEntity=function(v){var b=this.index-this.entityExcess-1,x=b+2+ +(this.state===r.InHexEntity);x!==this.index&&(b>this.sectionStart&&this.emitPartial(this.sectionStart,b),this.sectionStart=this.index+Number(v),this.emitCodePoint((0,e.replaceCodePoint)(this.entityResult))),this.state=this.baseState},m.prototype.stateInNumericEntity=function(v){v===n.Semi?this.emitNumericEntity(!0):o(v)?(this.entityResult=this.entityResult*10+(v-n.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},m.prototype.stateInHexEntity=function(v){v===n.Semi?this.emitNumericEntity(!0):o(v)?(this.entityResult=this.entityResult*16+(v-n.Zero),this.entityExcess++):u(v)?(this.entityResult=this.entityResult*16+((v|32)-n.LowerA+10),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},m.prototype.allowLegacyEntity=function(){return!this.xmlMode&&(this.baseState===r.Text||this.baseState===r.InSpecialTag)},m.prototype.cleanup=function(){this.running&&this.sectionStart!==this.index&&(this.state===r.Text||this.state===r.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===r.InAttributeValueDq||this.state===r.InAttributeValueSq||this.state===r.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))},m.prototype.shouldContinue=function(){return this.index<this.buffer.length+this.offset&&this.running},m.prototype.parse=function(){for(;this.shouldContinue();){var v=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case r.Text:{this.stateText(v);break}case r.SpecialStartSequence:{this.stateSpecialStartSequence(v);break}case r.InSpecialTag:{this.stateInSpecialTag(v);break}case r.CDATASequence:{this.stateCDATASequence(v);break}case r.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(v);break}case r.InAttributeName:{this.stateInAttributeName(v);break}case r.InCommentLike:{this.stateInCommentLike(v);break}case r.InSpecialComment:{this.stateInSpecialComment(v);break}case r.BeforeAttributeName:{this.stateBeforeAttributeName(v);break}case r.InTagName:{this.stateInTagName(v);break}case r.InClosingTagName:{this.stateInClosingTagName(v);break}case r.BeforeTagName:{this.stateBeforeTagName(v);break}case r.AfterAttributeName:{this.stateAfterAttributeName(v);break}case r.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(v);break}case r.BeforeAttributeValue:{this.stateBeforeAttributeValue(v);break}case r.BeforeClosingTagName:{this.stateBeforeClosingTagName(v);break}case r.AfterClosingTagName:{this.stateAfterClosingTagName(v);break}case r.BeforeSpecialS:{this.stateBeforeSpecialS(v);break}case r.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(v);break}case r.InSelfClosingTag:{this.stateInSelfClosingTag(v);break}case r.InDeclaration:{this.stateInDeclaration(v);break}case r.BeforeDeclaration:{this.stateBeforeDeclaration(v);break}case r.BeforeComment:{this.stateBeforeComment(v);break}case r.InProcessingInstruction:{this.stateInProcessingInstruction(v);break}case r.InNamedEntity:{this.stateInNamedEntity(v);break}case r.BeforeEntity:{this.stateBeforeEntity(v);break}case r.InHexEntity:{this.stateInHexEntity(v);break}case r.InNumericEntity:{this.stateInNumericEntity(v);break}default:this.stateBeforeNumericEntity(v)}this.index++}this.cleanup()},m.prototype.finish=function(){this.state===r.InNamedEntity&&this.emitNamedEntity(),this.sectionStart<this.index&&this.handleTrailingData(),this.cbs.onend()},m.prototype.handleTrailingData=function(){var v=this.buffer.length+this.offset;this.state===r.InCommentLike?this.currentSequence===f.CdataEnd?this.cbs.oncdata(this.sectionStart,v,0):this.cbs.oncomment(this.sectionStart,v,0):this.state===r.InNumericEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===r.InHexEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===r.InTagName||this.state===r.BeforeAttributeName||this.state===r.BeforeAttributeValue||this.state===r.AfterAttributeName||this.state===r.InAttributeName||this.state===r.InAttributeValueSq||this.state===r.InAttributeValueDq||this.state===r.InAttributeValueNq||this.state===r.InClosingTagName||this.cbs.ontext(this.sectionStart,v)},m.prototype.emitPartial=function(v,b){this.baseState!==r.Text&&this.baseState!==r.InSpecialTag?this.cbs.onattribdata(v,b):this.cbs.ontext(v,b)},m.prototype.emitCodePoint=function(v){this.baseState!==r.Text&&this.baseState!==r.InSpecialTag?this.cbs.onattribentity(v):this.cbs.ontextentity(v)},m}();t.default=p}(J3)),J3}var kP;function OP(){if(kP)return Lo;kP=1;var t=Lo&&Lo.__createBinding||(Object.create?function(w,S,_,T){T===void 0&&(T=_);var C=Object.getOwnPropertyDescriptor(S,_);(!C||("get"in C?!S.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return S[_]}}),Object.defineProperty(w,T,C)}:function(w,S,_,T){T===void 0&&(T=_),w[T]=S[_]}),e=Lo&&Lo.__setModuleDefault||(Object.create?function(w,S){Object.defineProperty(w,"default",{enumerable:!0,value:S})}:function(w,S){w.default=S}),n=Lo&&Lo.__importStar||function(w){if(w&&w.__esModule)return w;var S={};if(w!=null)for(var _ in w)_!=="default"&&Object.prototype.hasOwnProperty.call(w,_)&&t(S,w,_);return e(S,w),S};Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.Parser=void 0;var r=n(FV()),i=_w(),s=new Set(["input","option","optgroup","select","button","datalist","textarea"]),o=new Set(["p"]),l=new Set(["thead","tbody"]),u=new Set(["dd","dt"]),h=new Set(["rt","rp"]),f=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",o],["h1",o],["h2",o],["h3",o],["h4",o],["h5",o],["h6",o],["select",s],["input",s],["output",s],["button",s],["datalist",s],["textarea",s],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",u],["dt",u],["address",o],["article",o],["aside",o],["blockquote",o],["details",o],["div",o],["dl",o],["fieldset",o],["figcaption",o],["figure",o],["footer",o],["form",o],["header",o],["hr",o],["main",o],["nav",o],["ol",o],["pre",o],["section",o],["table",o],["ul",o],["rt",h],["rp",h],["tbody",l],["tfoot",l]]),p=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),m=new Set(["math","svg"]),v=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),b=/\s|\//,x=function(){function w(S,_){_===void 0&&(_={});var T,C,j,A,E;this.options=_,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=S??{},this.lowerCaseTagNames=(T=_.lowerCaseTags)!==null&&T!==void 0?T:!_.xmlMode,this.lowerCaseAttributeNames=(C=_.lowerCaseAttributeNames)!==null&&C!==void 0?C:!_.xmlMode,this.tokenizer=new((j=_.Tokenizer)!==null&&j!==void 0?j:r.default)(this.options,this),(E=(A=this.cbs).onparserinit)===null||E===void 0||E.call(A,this)}return w.prototype.ontext=function(S,_){var T,C,j=this.getSlice(S,_);this.endIndex=_-1,(C=(T=this.cbs).ontext)===null||C===void 0||C.call(T,j),this.startIndex=_},w.prototype.ontextentity=function(S){var _,T,C=this.tokenizer.getSectionStart();this.endIndex=C-1,(T=(_=this.cbs).ontext)===null||T===void 0||T.call(_,(0,i.fromCodePoint)(S)),this.startIndex=C},w.prototype.isVoidElement=function(S){return!this.options.xmlMode&&p.has(S)},w.prototype.onopentagname=function(S,_){this.endIndex=_;var T=this.getSlice(S,_);this.lowerCaseTagNames&&(T=T.toLowerCase()),this.emitOpenTag(T)},w.prototype.emitOpenTag=function(S){var _,T,C,j;this.openTagStart=this.startIndex,this.tagname=S;var A=!this.options.xmlMode&&f.get(S);if(A)for(;this.stack.length>0&&A.has(this.stack[this.stack.length-1]);){var E=this.stack.pop();(T=(_=this.cbs).onclosetag)===null||T===void 0||T.call(_,E,!0)}this.isVoidElement(S)||(this.stack.push(S),m.has(S)?this.foreignContext.push(!0):v.has(S)&&this.foreignContext.push(!1)),(j=(C=this.cbs).onopentagname)===null||j===void 0||j.call(C,S),this.cbs.onopentag&&(this.attribs={})},w.prototype.endOpenTag=function(S){var _,T;this.startIndex=this.openTagStart,this.attribs&&((T=(_=this.cbs).onopentag)===null||T===void 0||T.call(_,this.tagname,this.attribs,S),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""},w.prototype.onopentagend=function(S){this.endIndex=S,this.endOpenTag(!1),this.startIndex=S+1},w.prototype.onclosetag=function(S,_){var T,C,j,A,E,R;this.endIndex=_;var N=this.getSlice(S,_);if(this.lowerCaseTagNames&&(N=N.toLowerCase()),(m.has(N)||v.has(N))&&this.foreignContext.pop(),this.isVoidElement(N))!this.options.xmlMode&&N==="br"&&((C=(T=this.cbs).onopentagname)===null||C===void 0||C.call(T,"br"),(A=(j=this.cbs).onopentag)===null||A===void 0||A.call(j,"br",{},!0),(R=(E=this.cbs).onclosetag)===null||R===void 0||R.call(E,"br",!1));else{var $=this.stack.lastIndexOf(N);if($!==-1)if(this.cbs.onclosetag)for(var D=this.stack.length-$;D--;)this.cbs.onclosetag(this.stack.pop(),D!==0);else this.stack.length=$;else!this.options.xmlMode&&N==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=_+1},w.prototype.onselfclosingtag=function(S){this.endIndex=S,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=S+1):this.onopentagend(S)},w.prototype.closeCurrentTag=function(S){var _,T,C=this.tagname;this.endOpenTag(S),this.stack[this.stack.length-1]===C&&((T=(_=this.cbs).onclosetag)===null||T===void 0||T.call(_,C,!S),this.stack.pop())},w.prototype.onattribname=function(S,_){this.startIndex=S;var T=this.getSlice(S,_);this.attribname=this.lowerCaseAttributeNames?T.toLowerCase():T},w.prototype.onattribdata=function(S,_){this.attribvalue+=this.getSlice(S,_)},w.prototype.onattribentity=function(S){this.attribvalue+=(0,i.fromCodePoint)(S)},w.prototype.onattribend=function(S,_){var T,C;this.endIndex=_,(C=(T=this.cbs).onattribute)===null||C===void 0||C.call(T,this.attribname,this.attribvalue,S===r.QuoteType.Double?'"':S===r.QuoteType.Single?"'":S===r.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""},w.prototype.getInstructionName=function(S){var _=S.search(b),T=_<0?S:S.substr(0,_);return this.lowerCaseTagNames&&(T=T.toLowerCase()),T},w.prototype.ondeclaration=function(S,_){this.endIndex=_;var T=this.getSlice(S,_);if(this.cbs.onprocessinginstruction){var C=this.getInstructionName(T);this.cbs.onprocessinginstruction("!".concat(C),"!".concat(T))}this.startIndex=_+1},w.prototype.onprocessinginstruction=function(S,_){this.endIndex=_;var T=this.getSlice(S,_);if(this.cbs.onprocessinginstruction){var C=this.getInstructionName(T);this.cbs.onprocessinginstruction("?".concat(C),"?".concat(T))}this.startIndex=_+1},w.prototype.oncomment=function(S,_,T){var C,j,A,E;this.endIndex=_,(j=(C=this.cbs).oncomment)===null||j===void 0||j.call(C,this.getSlice(S,_-T)),(E=(A=this.cbs).oncommentend)===null||E===void 0||E.call(A),this.startIndex=_+1},w.prototype.oncdata=function(S,_,T){var C,j,A,E,R,N,$,D,F,Q;this.endIndex=_;var H=this.getSlice(S,_-T);this.options.xmlMode||this.options.recognizeCDATA?((j=(C=this.cbs).oncdatastart)===null||j===void 0||j.call(C),(E=(A=this.cbs).ontext)===null||E===void 0||E.call(A,H),(N=(R=this.cbs).oncdataend)===null||N===void 0||N.call(R)):((D=($=this.cbs).oncomment)===null||D===void 0||D.call($,"[CDATA[".concat(H,"]]")),(Q=(F=this.cbs).oncommentend)===null||Q===void 0||Q.call(F)),this.startIndex=_+1},w.prototype.onend=function(){var S,_;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(var T=this.stack.length;T>0;this.cbs.onclosetag(this.stack[--T],!0));}(_=(S=this.cbs).onend)===null||_===void 0||_.call(S)},w.prototype.reset=function(){var S,_,T,C;(_=(S=this.cbs).onreset)===null||_===void 0||_.call(S),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(C=(T=this.cbs).onparserinit)===null||C===void 0||C.call(T,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1},w.prototype.parseComplete=function(S){this.reset(),this.end(S)},w.prototype.getSlice=function(S,_){for(;S-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();for(var T=this.buffers[0].slice(S-this.bufferOffset,_-this.bufferOffset);_-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),T+=this.buffers[0].slice(0,_-this.bufferOffset);return T},w.prototype.shiftBuffer=function(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()},w.prototype.write=function(S){var _,T;if(this.ended){(T=(_=this.cbs).onerror)===null||T===void 0||T.call(_,new Error(".write() after done!"));return}this.buffers.push(S),this.tokenizer.running&&(this.tokenizer.write(S),this.writeIndex++)},w.prototype.end=function(S){var _,T;if(this.ended){(T=(_=this.cbs).onerror)===null||T===void 0||T.call(_,new Error(".end() after done!"));return}S&&this.write(S),this.ended=!0,this.tokenizer.end()},w.prototype.pause=function(){this.tokenizer.pause()},w.prototype.resume=function(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()},w.prototype.parseChunk=function(S){this.write(S)},w.prototype.done=function(S){this.end(S)},w}();return Lo.Parser=x,Lo}var jd={},tT={},EP;function fb(){return EP||(EP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0;var e;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(e=t.ElementType||(t.ElementType={}));function n(r){return r.type===e.Tag||r.type===e.Script||r.type===e.Style}t.isTag=n,t.Root=e.Root,t.Text=e.Text,t.Directive=e.Directive,t.Comment=e.Comment,t.Script=e.Script,t.Style=e.Style,t.Tag=e.Tag,t.CDATA=e.CDATA,t.Doctype=e.Doctype}(tT)),tT}var en={},AP;function MP(){if(AP)return en;AP=1;var t=en&&en.__extends||function(){var j=function(A,E){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,N){R.__proto__=N}||function(R,N){for(var $ in N)Object.prototype.hasOwnProperty.call(N,$)&&(R[$]=N[$])},j(A,E)};return function(A,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");j(A,E);function R(){this.constructor=A}A.prototype=E===null?Object.create(E):(R.prototype=E.prototype,new R)}}(),e=en&&en.__assign||function(){return e=Object.assign||function(j){for(var A,E=1,R=arguments.length;E<R;E++){A=arguments[E];for(var N in A)Object.prototype.hasOwnProperty.call(A,N)&&(j[N]=A[N])}return j},e.apply(this,arguments)};Object.defineProperty(en,"__esModule",{value:!0}),en.cloneNode=en.hasChildren=en.isDocument=en.isDirective=en.isComment=en.isText=en.isCDATA=en.isTag=en.Element=en.Document=en.CDATA=en.NodeWithChildren=en.ProcessingInstruction=en.Comment=en.Text=en.DataNode=en.Node=void 0;var n=fb(),r=function(){function j(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(j.prototype,"parentNode",{get:function(){return this.parent},set:function(A){this.parent=A},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"previousSibling",{get:function(){return this.prev},set:function(A){this.prev=A},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"nextSibling",{get:function(){return this.next},set:function(A){this.next=A},enumerable:!1,configurable:!0}),j.prototype.cloneNode=function(A){return A===void 0&&(A=!1),T(this,A)},j}();en.Node=r;var i=function(j){t(A,j);function A(E){var R=j.call(this)||this;return R.data=E,R}return Object.defineProperty(A.prototype,"nodeValue",{get:function(){return this.data},set:function(E){this.data=E},enumerable:!1,configurable:!0}),A}(r);en.DataNode=i;var s=function(j){t(A,j);function A(){var E=j!==null&&j.apply(this,arguments)||this;return E.type=n.ElementType.Text,E}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),A}(i);en.Text=s;var o=function(j){t(A,j);function A(){var E=j!==null&&j.apply(this,arguments)||this;return E.type=n.ElementType.Comment,E}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),A}(i);en.Comment=o;var l=function(j){t(A,j);function A(E,R){var N=j.call(this,R)||this;return N.name=E,N.type=n.ElementType.Directive,N}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),A}(i);en.ProcessingInstruction=l;var u=function(j){t(A,j);function A(E){var R=j.call(this)||this;return R.children=E,R}return Object.defineProperty(A.prototype,"firstChild",{get:function(){var E;return(E=this.children[0])!==null&&E!==void 0?E:null},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"childNodes",{get:function(){return this.children},set:function(E){this.children=E},enumerable:!1,configurable:!0}),A}(r);en.NodeWithChildren=u;var h=function(j){t(A,j);function A(){var E=j!==null&&j.apply(this,arguments)||this;return E.type=n.ElementType.CDATA,E}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),A}(u);en.CDATA=h;var f=function(j){t(A,j);function A(){var E=j!==null&&j.apply(this,arguments)||this;return E.type=n.ElementType.Root,E}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),A}(u);en.Document=f;var p=function(j){t(A,j);function A(E,R,N,$){N===void 0&&(N=[]),$===void 0&&($=E==="script"?n.ElementType.Script:E==="style"?n.ElementType.Style:n.ElementType.Tag);var D=j.call(this,N)||this;return D.name=E,D.attribs=R,D.type=$,D}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"tagName",{get:function(){return this.name},set:function(E){this.name=E},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"attributes",{get:function(){var E=this;return Object.keys(this.attribs).map(function(R){var N,$;return{name:R,value:E.attribs[R],namespace:(N=E["x-attribsNamespace"])===null||N===void 0?void 0:N[R],prefix:($=E["x-attribsPrefix"])===null||$===void 0?void 0:$[R]}})},enumerable:!1,configurable:!0}),A}(u);en.Element=p;function m(j){return(0,n.isTag)(j)}en.isTag=m;function v(j){return j.type===n.ElementType.CDATA}en.isCDATA=v;function b(j){return j.type===n.ElementType.Text}en.isText=b;function x(j){return j.type===n.ElementType.Comment}en.isComment=x;function w(j){return j.type===n.ElementType.Directive}en.isDirective=w;function S(j){return j.type===n.ElementType.Root}en.isDocument=S;function _(j){return Object.prototype.hasOwnProperty.call(j,"children")}en.hasChildren=_;function T(j,A){A===void 0&&(A=!1);var E;if(b(j))E=new s(j.data);else if(x(j))E=new o(j.data);else if(m(j)){var R=A?C(j.children):[],N=new p(j.name,e({},j.attribs),R);R.forEach(function(Q){return Q.parent=N}),j.namespace!=null&&(N.namespace=j.namespace),j["x-attribsNamespace"]&&(N["x-attribsNamespace"]=e({},j["x-attribsNamespace"])),j["x-attribsPrefix"]&&(N["x-attribsPrefix"]=e({},j["x-attribsPrefix"])),E=N}else if(v(j)){var R=A?C(j.children):[],$=new h(R);R.forEach(function(H){return H.parent=$}),E=$}else if(S(j)){var R=A?C(j.children):[],D=new f(R);R.forEach(function(H){return H.parent=D}),j["x-mode"]&&(D["x-mode"]=j["x-mode"]),E=D}else if(w(j)){var F=new l(j.name,j.data);j["x-name"]!=null&&(F["x-name"]=j["x-name"],F["x-publicId"]=j["x-publicId"],F["x-systemId"]=j["x-systemId"]),E=F}else throw new Error("Not implemented yet: ".concat(j.type));return E.startIndex=j.startIndex,E.endIndex=j.endIndex,j.sourceCodeLocation!=null&&(E.sourceCodeLocation=j.sourceCodeLocation),E}en.cloneNode=T;function C(j){for(var A=j.map(function(R){return T(R,!0)}),E=1;E<A.length;E++)A[E].prev=A[E-1],A[E-1].next=A[E];return A}return en}var RP;function Bh(){return RP||(RP=1,function(t){var e=jd&&jd.__createBinding||(Object.create?function(l,u,h,f){f===void 0&&(f=h);var p=Object.getOwnPropertyDescriptor(u,h);(!p||("get"in p?!u.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return u[h]}}),Object.defineProperty(l,f,p)}:function(l,u,h,f){f===void 0&&(f=h),l[f]=u[h]}),n=jd&&jd.__exportStar||function(l,u){for(var h in l)h!=="default"&&!Object.prototype.hasOwnProperty.call(u,h)&&e(u,l,h)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var r=fb(),i=MP();n(MP(),t);var s={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},o=function(){function l(u,h,f){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof h=="function"&&(f=h,h=s),typeof u=="object"&&(h=u,u=void 0),this.callback=u??null,this.options=h??s,this.elementCB=f??null}return l.prototype.onparserinit=function(u){this.parser=u},l.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},l.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},l.prototype.onerror=function(u){this.handleCallback(u)},l.prototype.onclosetag=function(){this.lastNode=null;var u=this.tagStack.pop();this.options.withEndIndices&&(u.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(u)},l.prototype.onopentag=function(u,h){var f=this.options.xmlMode?r.ElementType.Tag:void 0,p=new i.Element(u,h,void 0,f);this.addNode(p),this.tagStack.push(p)},l.prototype.ontext=function(u){var h=this.lastNode;if(h&&h.type===r.ElementType.Text)h.data+=u,this.options.withEndIndices&&(h.endIndex=this.parser.endIndex);else{var f=new i.Text(u);this.addNode(f),this.lastNode=f}},l.prototype.oncomment=function(u){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=u;return}var h=new i.Comment(u);this.addNode(h),this.lastNode=h},l.prototype.oncommentend=function(){this.lastNode=null},l.prototype.oncdatastart=function(){var u=new i.Text(""),h=new i.CDATA([u]);this.addNode(h),u.parent=h,this.lastNode=u},l.prototype.oncdataend=function(){this.lastNode=null},l.prototype.onprocessinginstruction=function(u,h){var f=new i.ProcessingInstruction(u,h);this.addNode(f)},l.prototype.handleCallback=function(u){if(typeof this.callback=="function")this.callback(u,this.dom);else if(u)throw u},l.prototype.addNode=function(u){var h=this.tagStack[this.tagStack.length-1],f=h.children[h.children.length-1];this.options.withStartIndices&&(u.startIndex=this.parser.startIndex),this.options.withEndIndices&&(u.endIndex=this.parser.endIndex),h.children.push(u),f&&(u.prev=f,f.next=u),u.parent=h,this.lastNode=null},l}();t.DomHandler=o,t.default=o}(jd)),jd}var _d={},Ps={},ia={},nT={},Pc={},b1={},DP;function s1e(){if(DP)return b1;DP=1,Object.defineProperty(b1,"__esModule",{value:!0});function t(e){for(var n=1;n<e.length;n++)e[n][0]+=e[n-1][0]+1;return e}return b1.default=new Map(t([[9,"&Tab;"],[0,"&NewLine;"],[22,"&excl;"],[0,"&quot;"],[0,"&num;"],[0,"&dollar;"],[0,"&percnt;"],[0,"&amp;"],[0,"&apos;"],[0,"&lpar;"],[0,"&rpar;"],[0,"&ast;"],[0,"&plus;"],[0,"&comma;"],[1,"&period;"],[0,"&sol;"],[10,"&colon;"],[0,"&semi;"],[0,{v:"&lt;",n:8402,o:"&nvlt;"}],[0,{v:"&equals;",n:8421,o:"&bne;"}],[0,{v:"&gt;",n:8402,o:"&nvgt;"}],[0,"&quest;"],[0,"&commat;"],[26,"&lbrack;"],[0,"&bsol;"],[0,"&rbrack;"],[0,"&Hat;"],[0,"&lowbar;"],[0,"&DiacriticalGrave;"],[5,{n:106,o:"&fjlig;"}],[20,"&lbrace;"],[0,"&verbar;"],[0,"&rbrace;"],[34,"&nbsp;"],[0,"&iexcl;"],[0,"&cent;"],[0,"&pound;"],[0,"&curren;"],[0,"&yen;"],[0,"&brvbar;"],[0,"&sect;"],[0,"&die;"],[0,"&copy;"],[0,"&ordf;"],[0,"&laquo;"],[0,"&not;"],[0,"&shy;"],[0,"&circledR;"],[0,"&macr;"],[0,"&deg;"],[0,"&PlusMinus;"],[0,"&sup2;"],[0,"&sup3;"],[0,"&acute;"],[0,"&micro;"],[0,"&para;"],[0,"&centerdot;"],[0,"&cedil;"],[0,"&sup1;"],[0,"&ordm;"],[0,"&raquo;"],[0,"&frac14;"],[0,"&frac12;"],[0,"&frac34;"],[0,"&iquest;"],[0,"&Agrave;"],[0,"&Aacute;"],[0,"&Acirc;"],[0,"&Atilde;"],[0,"&Auml;"],[0,"&angst;"],[0,"&AElig;"],[0,"&Ccedil;"],[0,"&Egrave;"],[0,"&Eacute;"],[0,"&Ecirc;"],[0,"&Euml;"],[0,"&Igrave;"],[0,"&Iacute;"],[0,"&Icirc;"],[0,"&Iuml;"],[0,"&ETH;"],[0,"&Ntilde;"],[0,"&Ograve;"],[0,"&Oacute;"],[0,"&Ocirc;"],[0,"&Otilde;"],[0,"&Ouml;"],[0,"&times;"],[0,"&Oslash;"],[0,"&Ugrave;"],[0,"&Uacute;"],[0,"&Ucirc;"],[0,"&Uuml;"],[0,"&Yacute;"],[0,"&THORN;"],[0,"&szlig;"],[0,"&agrave;"],[0,"&aacute;"],[0,"&acirc;"],[0,"&atilde;"],[0,"&auml;"],[0,"&aring;"],[0,"&aelig;"],[0,"&ccedil;"],[0,"&egrave;"],[0,"&eacute;"],[0,"&ecirc;"],[0,"&euml;"],[0,"&igrave;"],[0,"&iacute;"],[0,"&icirc;"],[0,"&iuml;"],[0,"&eth;"],[0,"&ntilde;"],[0,"&ograve;"],[0,"&oacute;"],[0,"&ocirc;"],[0,"&otilde;"],[0,"&ouml;"],[0,"&div;"],[0,"&oslash;"],[0,"&ugrave;"],[0,"&uacute;"],[0,"&ucirc;"],[0,"&uuml;"],[0,"&yacute;"],[0,"&thorn;"],[0,"&yuml;"],[0,"&Amacr;"],[0,"&amacr;"],[0,"&Abreve;"],[0,"&abreve;"],[0,"&Aogon;"],[0,"&aogon;"],[0,"&Cacute;"],[0,"&cacute;"],[0,"&Ccirc;"],[0,"&ccirc;"],[0,"&Cdot;"],[0,"&cdot;"],[0,"&Ccaron;"],[0,"&ccaron;"],[0,"&Dcaron;"],[0,"&dcaron;"],[0,"&Dstrok;"],[0,"&dstrok;"],[0,"&Emacr;"],[0,"&emacr;"],[2,"&Edot;"],[0,"&edot;"],[0,"&Eogon;"],[0,"&eogon;"],[0,"&Ecaron;"],[0,"&ecaron;"],[0,"&Gcirc;"],[0,"&gcirc;"],[0,"&Gbreve;"],[0,"&gbreve;"],[0,"&Gdot;"],[0,"&gdot;"],[0,"&Gcedil;"],[1,"&Hcirc;"],[0,"&hcirc;"],[0,"&Hstrok;"],[0,"&hstrok;"],[0,"&Itilde;"],[0,"&itilde;"],[0,"&Imacr;"],[0,"&imacr;"],[2,"&Iogon;"],[0,"&iogon;"],[0,"&Idot;"],[0,"&imath;"],[0,"&IJlig;"],[0,"&ijlig;"],[0,"&Jcirc;"],[0,"&jcirc;"],[0,"&Kcedil;"],[0,"&kcedil;"],[0,"&kgreen;"],[0,"&Lacute;"],[0,"&lacute;"],[0,"&Lcedil;"],[0,"&lcedil;"],[0,"&Lcaron;"],[0,"&lcaron;"],[0,"&Lmidot;"],[0,"&lmidot;"],[0,"&Lstrok;"],[0,"&lstrok;"],[0,"&Nacute;"],[0,"&nacute;"],[0,"&Ncedil;"],[0,"&ncedil;"],[0,"&Ncaron;"],[0,"&ncaron;"],[0,"&napos;"],[0,"&ENG;"],[0,"&eng;"],[0,"&Omacr;"],[0,"&omacr;"],[2,"&Odblac;"],[0,"&odblac;"],[0,"&OElig;"],[0,"&oelig;"],[0,"&Racute;"],[0,"&racute;"],[0,"&Rcedil;"],[0,"&rcedil;"],[0,"&Rcaron;"],[0,"&rcaron;"],[0,"&Sacute;"],[0,"&sacute;"],[0,"&Scirc;"],[0,"&scirc;"],[0,"&Scedil;"],[0,"&scedil;"],[0,"&Scaron;"],[0,"&scaron;"],[0,"&Tcedil;"],[0,"&tcedil;"],[0,"&Tcaron;"],[0,"&tcaron;"],[0,"&Tstrok;"],[0,"&tstrok;"],[0,"&Utilde;"],[0,"&utilde;"],[0,"&Umacr;"],[0,"&umacr;"],[0,"&Ubreve;"],[0,"&ubreve;"],[0,"&Uring;"],[0,"&uring;"],[0,"&Udblac;"],[0,"&udblac;"],[0,"&Uogon;"],[0,"&uogon;"],[0,"&Wcirc;"],[0,"&wcirc;"],[0,"&Ycirc;"],[0,"&ycirc;"],[0,"&Yuml;"],[0,"&Zacute;"],[0,"&zacute;"],[0,"&Zdot;"],[0,"&zdot;"],[0,"&Zcaron;"],[0,"&zcaron;"],[19,"&fnof;"],[34,"&imped;"],[63,"&gacute;"],[65,"&jmath;"],[142,"&circ;"],[0,"&caron;"],[16,"&breve;"],[0,"&DiacriticalDot;"],[0,"&ring;"],[0,"&ogon;"],[0,"&DiacriticalTilde;"],[0,"&dblac;"],[51,"&DownBreve;"],[127,"&Alpha;"],[0,"&Beta;"],[0,"&Gamma;"],[0,"&Delta;"],[0,"&Epsilon;"],[0,"&Zeta;"],[0,"&Eta;"],[0,"&Theta;"],[0,"&Iota;"],[0,"&Kappa;"],[0,"&Lambda;"],[0,"&Mu;"],[0,"&Nu;"],[0,"&Xi;"],[0,"&Omicron;"],[0,"&Pi;"],[0,"&Rho;"],[1,"&Sigma;"],[0,"&Tau;"],[0,"&Upsilon;"],[0,"&Phi;"],[0,"&Chi;"],[0,"&Psi;"],[0,"&ohm;"],[7,"&alpha;"],[0,"&beta;"],[0,"&gamma;"],[0,"&delta;"],[0,"&epsi;"],[0,"&zeta;"],[0,"&eta;"],[0,"&theta;"],[0,"&iota;"],[0,"&kappa;"],[0,"&lambda;"],[0,"&mu;"],[0,"&nu;"],[0,"&xi;"],[0,"&omicron;"],[0,"&pi;"],[0,"&rho;"],[0,"&sigmaf;"],[0,"&sigma;"],[0,"&tau;"],[0,"&upsi;"],[0,"&phi;"],[0,"&chi;"],[0,"&psi;"],[0,"&omega;"],[7,"&thetasym;"],[0,"&Upsi;"],[2,"&phiv;"],[0,"&piv;"],[5,"&Gammad;"],[0,"&digamma;"],[18,"&kappav;"],[0,"&rhov;"],[3,"&epsiv;"],[0,"&backepsilon;"],[10,"&IOcy;"],[0,"&DJcy;"],[0,"&GJcy;"],[0,"&Jukcy;"],[0,"&DScy;"],[0,"&Iukcy;"],[0,"&YIcy;"],[0,"&Jsercy;"],[0,"&LJcy;"],[0,"&NJcy;"],[0,"&TSHcy;"],[0,"&KJcy;"],[1,"&Ubrcy;"],[0,"&DZcy;"],[0,"&Acy;"],[0,"&Bcy;"],[0,"&Vcy;"],[0,"&Gcy;"],[0,"&Dcy;"],[0,"&IEcy;"],[0,"&ZHcy;"],[0,"&Zcy;"],[0,"&Icy;"],[0,"&Jcy;"],[0,"&Kcy;"],[0,"&Lcy;"],[0,"&Mcy;"],[0,"&Ncy;"],[0,"&Ocy;"],[0,"&Pcy;"],[0,"&Rcy;"],[0,"&Scy;"],[0,"&Tcy;"],[0,"&Ucy;"],[0,"&Fcy;"],[0,"&KHcy;"],[0,"&TScy;"],[0,"&CHcy;"],[0,"&SHcy;"],[0,"&SHCHcy;"],[0,"&HARDcy;"],[0,"&Ycy;"],[0,"&SOFTcy;"],[0,"&Ecy;"],[0,"&YUcy;"],[0,"&YAcy;"],[0,"&acy;"],[0,"&bcy;"],[0,"&vcy;"],[0,"&gcy;"],[0,"&dcy;"],[0,"&iecy;"],[0,"&zhcy;"],[0,"&zcy;"],[0,"&icy;"],[0,"&jcy;"],[0,"&kcy;"],[0,"&lcy;"],[0,"&mcy;"],[0,"&ncy;"],[0,"&ocy;"],[0,"&pcy;"],[0,"&rcy;"],[0,"&scy;"],[0,"&tcy;"],[0,"&ucy;"],[0,"&fcy;"],[0,"&khcy;"],[0,"&tscy;"],[0,"&chcy;"],[0,"&shcy;"],[0,"&shchcy;"],[0,"&hardcy;"],[0,"&ycy;"],[0,"&softcy;"],[0,"&ecy;"],[0,"&yucy;"],[0,"&yacy;"],[1,"&iocy;"],[0,"&djcy;"],[0,"&gjcy;"],[0,"&jukcy;"],[0,"&dscy;"],[0,"&iukcy;"],[0,"&yicy;"],[0,"&jsercy;"],[0,"&ljcy;"],[0,"&njcy;"],[0,"&tshcy;"],[0,"&kjcy;"],[1,"&ubrcy;"],[0,"&dzcy;"],[7074,"&ensp;"],[0,"&emsp;"],[0,"&emsp13;"],[0,"&emsp14;"],[1,"&numsp;"],[0,"&puncsp;"],[0,"&ThinSpace;"],[0,"&hairsp;"],[0,"&NegativeMediumSpace;"],[0,"&zwnj;"],[0,"&zwj;"],[0,"&lrm;"],[0,"&rlm;"],[0,"&dash;"],[2,"&ndash;"],[0,"&mdash;"],[0,"&horbar;"],[0,"&Verbar;"],[1,"&lsquo;"],[0,"&CloseCurlyQuote;"],[0,"&lsquor;"],[1,"&ldquo;"],[0,"&CloseCurlyDoubleQuote;"],[0,"&bdquo;"],[1,"&dagger;"],[0,"&Dagger;"],[0,"&bull;"],[2,"&nldr;"],[0,"&hellip;"],[9,"&permil;"],[0,"&pertenk;"],[0,"&prime;"],[0,"&Prime;"],[0,"&tprime;"],[0,"&backprime;"],[3,"&lsaquo;"],[0,"&rsaquo;"],[3,"&oline;"],[2,"&caret;"],[1,"&hybull;"],[0,"&frasl;"],[10,"&bsemi;"],[7,"&qprime;"],[7,{v:"&MediumSpace;",n:8202,o:"&ThickSpace;"}],[0,"&NoBreak;"],[0,"&af;"],[0,"&InvisibleTimes;"],[0,"&ic;"],[72,"&euro;"],[46,"&tdot;"],[0,"&DotDot;"],[37,"&complexes;"],[2,"&incare;"],[4,"&gscr;"],[0,"&hamilt;"],[0,"&Hfr;"],[0,"&Hopf;"],[0,"&planckh;"],[0,"&hbar;"],[0,"&imagline;"],[0,"&Ifr;"],[0,"&lagran;"],[0,"&ell;"],[1,"&naturals;"],[0,"&numero;"],[0,"&copysr;"],[0,"&weierp;"],[0,"&Popf;"],[0,"&Qopf;"],[0,"&realine;"],[0,"&real;"],[0,"&reals;"],[0,"&rx;"],[3,"&trade;"],[1,"&integers;"],[2,"&mho;"],[0,"&zeetrf;"],[0,"&iiota;"],[2,"&bernou;"],[0,"&Cayleys;"],[1,"&escr;"],[0,"&Escr;"],[0,"&Fouriertrf;"],[1,"&Mellintrf;"],[0,"&order;"],[0,"&alefsym;"],[0,"&beth;"],[0,"&gimel;"],[0,"&daleth;"],[12,"&CapitalDifferentialD;"],[0,"&dd;"],[0,"&ee;"],[0,"&ii;"],[10,"&frac13;"],[0,"&frac23;"],[0,"&frac15;"],[0,"&frac25;"],[0,"&frac35;"],[0,"&frac45;"],[0,"&frac16;"],[0,"&frac56;"],[0,"&frac18;"],[0,"&frac38;"],[0,"&frac58;"],[0,"&frac78;"],[49,"&larr;"],[0,"&ShortUpArrow;"],[0,"&rarr;"],[0,"&darr;"],[0,"&harr;"],[0,"&updownarrow;"],[0,"&nwarr;"],[0,"&nearr;"],[0,"&LowerRightArrow;"],[0,"&LowerLeftArrow;"],[0,"&nlarr;"],[0,"&nrarr;"],[1,{v:"&rarrw;",n:824,o:"&nrarrw;"}],[0,"&Larr;"],[0,"&Uarr;"],[0,"&Rarr;"],[0,"&Darr;"],[0,"&larrtl;"],[0,"&rarrtl;"],[0,"&LeftTeeArrow;"],[0,"&mapstoup;"],[0,"&map;"],[0,"&DownTeeArrow;"],[1,"&hookleftarrow;"],[0,"&hookrightarrow;"],[0,"&larrlp;"],[0,"&looparrowright;"],[0,"&harrw;"],[0,"&nharr;"],[1,"&lsh;"],[0,"&rsh;"],[0,"&ldsh;"],[0,"&rdsh;"],[1,"&crarr;"],[0,"&cularr;"],[0,"&curarr;"],[2,"&circlearrowleft;"],[0,"&circlearrowright;"],[0,"&leftharpoonup;"],[0,"&DownLeftVector;"],[0,"&RightUpVector;"],[0,"&LeftUpVector;"],[0,"&rharu;"],[0,"&DownRightVector;"],[0,"&dharr;"],[0,"&dharl;"],[0,"&RightArrowLeftArrow;"],[0,"&udarr;"],[0,"&LeftArrowRightArrow;"],[0,"&leftleftarrows;"],[0,"&upuparrows;"],[0,"&rightrightarrows;"],[0,"&ddarr;"],[0,"&leftrightharpoons;"],[0,"&Equilibrium;"],[0,"&nlArr;"],[0,"&nhArr;"],[0,"&nrArr;"],[0,"&DoubleLeftArrow;"],[0,"&DoubleUpArrow;"],[0,"&DoubleRightArrow;"],[0,"&dArr;"],[0,"&DoubleLeftRightArrow;"],[0,"&DoubleUpDownArrow;"],[0,"&nwArr;"],[0,"&neArr;"],[0,"&seArr;"],[0,"&swArr;"],[0,"&lAarr;"],[0,"&rAarr;"],[1,"&zigrarr;"],[6,"&larrb;"],[0,"&rarrb;"],[15,"&DownArrowUpArrow;"],[7,"&loarr;"],[0,"&roarr;"],[0,"&hoarr;"],[0,"&forall;"],[0,"&comp;"],[0,{v:"&part;",n:824,o:"&npart;"}],[0,"&exist;"],[0,"&nexist;"],[0,"&empty;"],[1,"&Del;"],[0,"&Element;"],[0,"&NotElement;"],[1,"&ni;"],[0,"&notni;"],[2,"&prod;"],[0,"&coprod;"],[0,"&sum;"],[0,"&minus;"],[0,"&MinusPlus;"],[0,"&dotplus;"],[1,"&Backslash;"],[0,"&lowast;"],[0,"&compfn;"],[1,"&radic;"],[2,"&prop;"],[0,"&infin;"],[0,"&angrt;"],[0,{v:"&ang;",n:8402,o:"&nang;"}],[0,"&angmsd;"],[0,"&angsph;"],[0,"&mid;"],[0,"&nmid;"],[0,"&DoubleVerticalBar;"],[0,"&NotDoubleVerticalBar;"],[0,"&and;"],[0,"&or;"],[0,{v:"&cap;",n:65024,o:"&caps;"}],[0,{v:"&cup;",n:65024,o:"&cups;"}],[0,"&int;"],[0,"&Int;"],[0,"&iiint;"],[0,"&conint;"],[0,"&Conint;"],[0,"&Cconint;"],[0,"&cwint;"],[0,"&ClockwiseContourIntegral;"],[0,"&awconint;"],[0,"&there4;"],[0,"&becaus;"],[0,"&ratio;"],[0,"&Colon;"],[0,"&dotminus;"],[1,"&mDDot;"],[0,"&homtht;"],[0,{v:"&sim;",n:8402,o:"&nvsim;"}],[0,{v:"&backsim;",n:817,o:"&race;"}],[0,{v:"&ac;",n:819,o:"&acE;"}],[0,"&acd;"],[0,"&VerticalTilde;"],[0,"&NotTilde;"],[0,{v:"&eqsim;",n:824,o:"&nesim;"}],[0,"&sime;"],[0,"&NotTildeEqual;"],[0,"&cong;"],[0,"&simne;"],[0,"&ncong;"],[0,"&ap;"],[0,"&nap;"],[0,"&ape;"],[0,{v:"&apid;",n:824,o:"&napid;"}],[0,"&backcong;"],[0,{v:"&asympeq;",n:8402,o:"&nvap;"}],[0,{v:"&bump;",n:824,o:"&nbump;"}],[0,{v:"&bumpe;",n:824,o:"&nbumpe;"}],[0,{v:"&doteq;",n:824,o:"&nedot;"}],[0,"&doteqdot;"],[0,"&efDot;"],[0,"&erDot;"],[0,"&Assign;"],[0,"&ecolon;"],[0,"&ecir;"],[0,"&circeq;"],[1,"&wedgeq;"],[0,"&veeeq;"],[1,"&triangleq;"],[2,"&equest;"],[0,"&ne;"],[0,{v:"&Congruent;",n:8421,o:"&bnequiv;"}],[0,"&nequiv;"],[1,{v:"&le;",n:8402,o:"&nvle;"}],[0,{v:"&ge;",n:8402,o:"&nvge;"}],[0,{v:"&lE;",n:824,o:"&nlE;"}],[0,{v:"&gE;",n:824,o:"&ngE;"}],[0,{v:"&lnE;",n:65024,o:"&lvertneqq;"}],[0,{v:"&gnE;",n:65024,o:"&gvertneqq;"}],[0,{v:"&ll;",n:new Map(t([[824,"&nLtv;"],[7577,"&nLt;"]]))}],[0,{v:"&gg;",n:new Map(t([[824,"&nGtv;"],[7577,"&nGt;"]]))}],[0,"&between;"],[0,"&NotCupCap;"],[0,"&nless;"],[0,"&ngt;"],[0,"&nle;"],[0,"&nge;"],[0,"&lesssim;"],[0,"&GreaterTilde;"],[0,"&nlsim;"],[0,"&ngsim;"],[0,"&LessGreater;"],[0,"&gl;"],[0,"&NotLessGreater;"],[0,"&NotGreaterLess;"],[0,"&pr;"],[0,"&sc;"],[0,"&prcue;"],[0,"&sccue;"],[0,"&PrecedesTilde;"],[0,{v:"&scsim;",n:824,o:"&NotSucceedsTilde;"}],[0,"&NotPrecedes;"],[0,"&NotSucceeds;"],[0,{v:"&sub;",n:8402,o:"&NotSubset;"}],[0,{v:"&sup;",n:8402,o:"&NotSuperset;"}],[0,"&nsub;"],[0,"&nsup;"],[0,"&sube;"],[0,"&supe;"],[0,"&NotSubsetEqual;"],[0,"&NotSupersetEqual;"],[0,{v:"&subne;",n:65024,o:"&varsubsetneq;"}],[0,{v:"&supne;",n:65024,o:"&varsupsetneq;"}],[1,"&cupdot;"],[0,"&UnionPlus;"],[0,{v:"&sqsub;",n:824,o:"&NotSquareSubset;"}],[0,{v:"&sqsup;",n:824,o:"&NotSquareSuperset;"}],[0,"&sqsube;"],[0,"&sqsupe;"],[0,{v:"&sqcap;",n:65024,o:"&sqcaps;"}],[0,{v:"&sqcup;",n:65024,o:"&sqcups;"}],[0,"&CirclePlus;"],[0,"&CircleMinus;"],[0,"&CircleTimes;"],[0,"&osol;"],[0,"&CircleDot;"],[0,"&circledcirc;"],[0,"&circledast;"],[1,"&circleddash;"],[0,"&boxplus;"],[0,"&boxminus;"],[0,"&boxtimes;"],[0,"&dotsquare;"],[0,"&RightTee;"],[0,"&dashv;"],[0,"&DownTee;"],[0,"&bot;"],[1,"&models;"],[0,"&DoubleRightTee;"],[0,"&Vdash;"],[0,"&Vvdash;"],[0,"&VDash;"],[0,"&nvdash;"],[0,"&nvDash;"],[0,"&nVdash;"],[0,"&nVDash;"],[0,"&prurel;"],[1,"&LeftTriangle;"],[0,"&RightTriangle;"],[0,{v:"&LeftTriangleEqual;",n:8402,o:"&nvltrie;"}],[0,{v:"&RightTriangleEqual;",n:8402,o:"&nvrtrie;"}],[0,"&origof;"],[0,"&imof;"],[0,"&multimap;"],[0,"&hercon;"],[0,"&intcal;"],[0,"&veebar;"],[1,"&barvee;"],[0,"&angrtvb;"],[0,"&lrtri;"],[0,"&bigwedge;"],[0,"&bigvee;"],[0,"&bigcap;"],[0,"&bigcup;"],[0,"&diam;"],[0,"&sdot;"],[0,"&sstarf;"],[0,"&divideontimes;"],[0,"&bowtie;"],[0,"&ltimes;"],[0,"&rtimes;"],[0,"&leftthreetimes;"],[0,"&rightthreetimes;"],[0,"&backsimeq;"],[0,"&curlyvee;"],[0,"&curlywedge;"],[0,"&Sub;"],[0,"&Sup;"],[0,"&Cap;"],[0,"&Cup;"],[0,"&fork;"],[0,"&epar;"],[0,"&lessdot;"],[0,"&gtdot;"],[0,{v:"&Ll;",n:824,o:"&nLl;"}],[0,{v:"&Gg;",n:824,o:"&nGg;"}],[0,{v:"&leg;",n:65024,o:"&lesg;"}],[0,{v:"&gel;",n:65024,o:"&gesl;"}],[2,"&cuepr;"],[0,"&cuesc;"],[0,"&NotPrecedesSlantEqual;"],[0,"&NotSucceedsSlantEqual;"],[0,"&NotSquareSubsetEqual;"],[0,"&NotSquareSupersetEqual;"],[2,"&lnsim;"],[0,"&gnsim;"],[0,"&precnsim;"],[0,"&scnsim;"],[0,"&nltri;"],[0,"&NotRightTriangle;"],[0,"&nltrie;"],[0,"&NotRightTriangleEqual;"],[0,"&vellip;"],[0,"&ctdot;"],[0,"&utdot;"],[0,"&dtdot;"],[0,"&disin;"],[0,"&isinsv;"],[0,"&isins;"],[0,{v:"&isindot;",n:824,o:"&notindot;"}],[0,"&notinvc;"],[0,"&notinvb;"],[1,{v:"&isinE;",n:824,o:"&notinE;"}],[0,"&nisd;"],[0,"&xnis;"],[0,"&nis;"],[0,"&notnivc;"],[0,"&notnivb;"],[6,"&barwed;"],[0,"&Barwed;"],[1,"&lceil;"],[0,"&rceil;"],[0,"&LeftFloor;"],[0,"&rfloor;"],[0,"&drcrop;"],[0,"&dlcrop;"],[0,"&urcrop;"],[0,"&ulcrop;"],[0,"&bnot;"],[1,"&profline;"],[0,"&profsurf;"],[1,"&telrec;"],[0,"&target;"],[5,"&ulcorn;"],[0,"&urcorn;"],[0,"&dlcorn;"],[0,"&drcorn;"],[2,"&frown;"],[0,"&smile;"],[9,"&cylcty;"],[0,"&profalar;"],[7,"&topbot;"],[6,"&ovbar;"],[1,"&solbar;"],[60,"&angzarr;"],[51,"&lmoustache;"],[0,"&rmoustache;"],[2,"&OverBracket;"],[0,"&bbrk;"],[0,"&bbrktbrk;"],[37,"&OverParenthesis;"],[0,"&UnderParenthesis;"],[0,"&OverBrace;"],[0,"&UnderBrace;"],[2,"&trpezium;"],[4,"&elinters;"],[59,"&blank;"],[164,"&circledS;"],[55,"&boxh;"],[1,"&boxv;"],[9,"&boxdr;"],[3,"&boxdl;"],[3,"&boxur;"],[3,"&boxul;"],[3,"&boxvr;"],[7,"&boxvl;"],[7,"&boxhd;"],[7,"&boxhu;"],[7,"&boxvh;"],[19,"&boxH;"],[0,"&boxV;"],[0,"&boxdR;"],[0,"&boxDr;"],[0,"&boxDR;"],[0,"&boxdL;"],[0,"&boxDl;"],[0,"&boxDL;"],[0,"&boxuR;"],[0,"&boxUr;"],[0,"&boxUR;"],[0,"&boxuL;"],[0,"&boxUl;"],[0,"&boxUL;"],[0,"&boxvR;"],[0,"&boxVr;"],[0,"&boxVR;"],[0,"&boxvL;"],[0,"&boxVl;"],[0,"&boxVL;"],[0,"&boxHd;"],[0,"&boxhD;"],[0,"&boxHD;"],[0,"&boxHu;"],[0,"&boxhU;"],[0,"&boxHU;"],[0,"&boxvH;"],[0,"&boxVh;"],[0,"&boxVH;"],[19,"&uhblk;"],[3,"&lhblk;"],[3,"&block;"],[8,"&blk14;"],[0,"&blk12;"],[0,"&blk34;"],[13,"&square;"],[8,"&blacksquare;"],[0,"&EmptyVerySmallSquare;"],[1,"&rect;"],[0,"&marker;"],[2,"&fltns;"],[1,"&bigtriangleup;"],[0,"&blacktriangle;"],[0,"&triangle;"],[2,"&blacktriangleright;"],[0,"&rtri;"],[3,"&bigtriangledown;"],[0,"&blacktriangledown;"],[0,"&dtri;"],[2,"&blacktriangleleft;"],[0,"&ltri;"],[6,"&loz;"],[0,"&cir;"],[32,"&tridot;"],[2,"&bigcirc;"],[8,"&ultri;"],[0,"&urtri;"],[0,"&lltri;"],[0,"&EmptySmallSquare;"],[0,"&FilledSmallSquare;"],[8,"&bigstar;"],[0,"&star;"],[7,"&phone;"],[49,"&female;"],[1,"&male;"],[29,"&spades;"],[2,"&clubs;"],[1,"&hearts;"],[0,"&diamondsuit;"],[3,"&sung;"],[2,"&flat;"],[0,"&natural;"],[0,"&sharp;"],[163,"&check;"],[3,"&cross;"],[8,"&malt;"],[21,"&sext;"],[33,"&VerticalSeparator;"],[25,"&lbbrk;"],[0,"&rbbrk;"],[84,"&bsolhsub;"],[0,"&suphsol;"],[28,"&LeftDoubleBracket;"],[0,"&RightDoubleBracket;"],[0,"&lang;"],[0,"&rang;"],[0,"&Lang;"],[0,"&Rang;"],[0,"&loang;"],[0,"&roang;"],[7,"&longleftarrow;"],[0,"&longrightarrow;"],[0,"&longleftrightarrow;"],[0,"&DoubleLongLeftArrow;"],[0,"&DoubleLongRightArrow;"],[0,"&DoubleLongLeftRightArrow;"],[1,"&longmapsto;"],[2,"&dzigrarr;"],[258,"&nvlArr;"],[0,"&nvrArr;"],[0,"&nvHarr;"],[0,"&Map;"],[6,"&lbarr;"],[0,"&bkarow;"],[0,"&lBarr;"],[0,"&dbkarow;"],[0,"&drbkarow;"],[0,"&DDotrahd;"],[0,"&UpArrowBar;"],[0,"&DownArrowBar;"],[2,"&Rarrtl;"],[2,"&latail;"],[0,"&ratail;"],[0,"&lAtail;"],[0,"&rAtail;"],[0,"&larrfs;"],[0,"&rarrfs;"],[0,"&larrbfs;"],[0,"&rarrbfs;"],[2,"&nwarhk;"],[0,"&nearhk;"],[0,"&hksearow;"],[0,"&hkswarow;"],[0,"&nwnear;"],[0,"&nesear;"],[0,"&seswar;"],[0,"&swnwar;"],[8,{v:"&rarrc;",n:824,o:"&nrarrc;"}],[1,"&cudarrr;"],[0,"&ldca;"],[0,"&rdca;"],[0,"&cudarrl;"],[0,"&larrpl;"],[2,"&curarrm;"],[0,"&cularrp;"],[7,"&rarrpl;"],[2,"&harrcir;"],[0,"&Uarrocir;"],[0,"&lurdshar;"],[0,"&ldrushar;"],[2,"&LeftRightVector;"],[0,"&RightUpDownVector;"],[0,"&DownLeftRightVector;"],[0,"&LeftUpDownVector;"],[0,"&LeftVectorBar;"],[0,"&RightVectorBar;"],[0,"&RightUpVectorBar;"],[0,"&RightDownVectorBar;"],[0,"&DownLeftVectorBar;"],[0,"&DownRightVectorBar;"],[0,"&LeftUpVectorBar;"],[0,"&LeftDownVectorBar;"],[0,"&LeftTeeVector;"],[0,"&RightTeeVector;"],[0,"&RightUpTeeVector;"],[0,"&RightDownTeeVector;"],[0,"&DownLeftTeeVector;"],[0,"&DownRightTeeVector;"],[0,"&LeftUpTeeVector;"],[0,"&LeftDownTeeVector;"],[0,"&lHar;"],[0,"&uHar;"],[0,"&rHar;"],[0,"&dHar;"],[0,"&luruhar;"],[0,"&ldrdhar;"],[0,"&ruluhar;"],[0,"&rdldhar;"],[0,"&lharul;"],[0,"&llhard;"],[0,"&rharul;"],[0,"&lrhard;"],[0,"&udhar;"],[0,"&duhar;"],[0,"&RoundImplies;"],[0,"&erarr;"],[0,"&simrarr;"],[0,"&larrsim;"],[0,"&rarrsim;"],[0,"&rarrap;"],[0,"&ltlarr;"],[1,"&gtrarr;"],[0,"&subrarr;"],[1,"&suplarr;"],[0,"&lfisht;"],[0,"&rfisht;"],[0,"&ufisht;"],[0,"&dfisht;"],[5,"&lopar;"],[0,"&ropar;"],[4,"&lbrke;"],[0,"&rbrke;"],[0,"&lbrkslu;"],[0,"&rbrksld;"],[0,"&lbrksld;"],[0,"&rbrkslu;"],[0,"&langd;"],[0,"&rangd;"],[0,"&lparlt;"],[0,"&rpargt;"],[0,"&gtlPar;"],[0,"&ltrPar;"],[3,"&vzigzag;"],[1,"&vangrt;"],[0,"&angrtvbd;"],[6,"&ange;"],[0,"&range;"],[0,"&dwangle;"],[0,"&uwangle;"],[0,"&angmsdaa;"],[0,"&angmsdab;"],[0,"&angmsdac;"],[0,"&angmsdad;"],[0,"&angmsdae;"],[0,"&angmsdaf;"],[0,"&angmsdag;"],[0,"&angmsdah;"],[0,"&bemptyv;"],[0,"&demptyv;"],[0,"&cemptyv;"],[0,"&raemptyv;"],[0,"&laemptyv;"],[0,"&ohbar;"],[0,"&omid;"],[0,"&opar;"],[1,"&operp;"],[1,"&olcross;"],[0,"&odsold;"],[1,"&olcir;"],[0,"&ofcir;"],[0,"&olt;"],[0,"&ogt;"],[0,"&cirscir;"],[0,"&cirE;"],[0,"&solb;"],[0,"&bsolb;"],[3,"&boxbox;"],[3,"&trisb;"],[0,"&rtriltri;"],[0,{v:"&LeftTriangleBar;",n:824,o:"&NotLeftTriangleBar;"}],[0,{v:"&RightTriangleBar;",n:824,o:"&NotRightTriangleBar;"}],[11,"&iinfin;"],[0,"&infintie;"],[0,"&nvinfin;"],[4,"&eparsl;"],[0,"&smeparsl;"],[0,"&eqvparsl;"],[5,"&blacklozenge;"],[8,"&RuleDelayed;"],[1,"&dsol;"],[9,"&bigodot;"],[0,"&bigoplus;"],[0,"&bigotimes;"],[1,"&biguplus;"],[1,"&bigsqcup;"],[5,"&iiiint;"],[0,"&fpartint;"],[2,"&cirfnint;"],[0,"&awint;"],[0,"&rppolint;"],[0,"&scpolint;"],[0,"&npolint;"],[0,"&pointint;"],[0,"&quatint;"],[0,"&intlarhk;"],[10,"&pluscir;"],[0,"&plusacir;"],[0,"&simplus;"],[0,"&plusdu;"],[0,"&plussim;"],[0,"&plustwo;"],[1,"&mcomma;"],[0,"&minusdu;"],[2,"&loplus;"],[0,"&roplus;"],[0,"&Cross;"],[0,"&timesd;"],[0,"&timesbar;"],[1,"&smashp;"],[0,"&lotimes;"],[0,"&rotimes;"],[0,"&otimesas;"],[0,"&Otimes;"],[0,"&odiv;"],[0,"&triplus;"],[0,"&triminus;"],[0,"&tritime;"],[0,"&intprod;"],[2,"&amalg;"],[0,"&capdot;"],[1,"&ncup;"],[0,"&ncap;"],[0,"&capand;"],[0,"&cupor;"],[0,"&cupcap;"],[0,"&capcup;"],[0,"&cupbrcap;"],[0,"&capbrcup;"],[0,"&cupcup;"],[0,"&capcap;"],[0,"&ccups;"],[0,"&ccaps;"],[2,"&ccupssm;"],[2,"&And;"],[0,"&Or;"],[0,"&andand;"],[0,"&oror;"],[0,"&orslope;"],[0,"&andslope;"],[1,"&andv;"],[0,"&orv;"],[0,"&andd;"],[0,"&ord;"],[1,"&wedbar;"],[6,"&sdote;"],[3,"&simdot;"],[2,{v:"&congdot;",n:824,o:"&ncongdot;"}],[0,"&easter;"],[0,"&apacir;"],[0,{v:"&apE;",n:824,o:"&napE;"}],[0,"&eplus;"],[0,"&pluse;"],[0,"&Esim;"],[0,"&Colone;"],[0,"&Equal;"],[1,"&ddotseq;"],[0,"&equivDD;"],[0,"&ltcir;"],[0,"&gtcir;"],[0,"&ltquest;"],[0,"&gtquest;"],[0,{v:"&leqslant;",n:824,o:"&nleqslant;"}],[0,{v:"&geqslant;",n:824,o:"&ngeqslant;"}],[0,"&lesdot;"],[0,"&gesdot;"],[0,"&lesdoto;"],[0,"&gesdoto;"],[0,"&lesdotor;"],[0,"&gesdotol;"],[0,"&lap;"],[0,"&gap;"],[0,"&lne;"],[0,"&gne;"],[0,"&lnap;"],[0,"&gnap;"],[0,"&lEg;"],[0,"&gEl;"],[0,"&lsime;"],[0,"&gsime;"],[0,"&lsimg;"],[0,"&gsiml;"],[0,"&lgE;"],[0,"&glE;"],[0,"&lesges;"],[0,"&gesles;"],[0,"&els;"],[0,"&egs;"],[0,"&elsdot;"],[0,"&egsdot;"],[0,"&el;"],[0,"&eg;"],[2,"&siml;"],[0,"&simg;"],[0,"&simlE;"],[0,"&simgE;"],[0,{v:"&LessLess;",n:824,o:"&NotNestedLessLess;"}],[0,{v:"&GreaterGreater;",n:824,o:"&NotNestedGreaterGreater;"}],[1,"&glj;"],[0,"&gla;"],[0,"&ltcc;"],[0,"&gtcc;"],[0,"&lescc;"],[0,"&gescc;"],[0,"&smt;"],[0,"&lat;"],[0,{v:"&smte;",n:65024,o:"&smtes;"}],[0,{v:"&late;",n:65024,o:"&lates;"}],[0,"&bumpE;"],[0,{v:"&PrecedesEqual;",n:824,o:"&NotPrecedesEqual;"}],[0,{v:"&sce;",n:824,o:"&NotSucceedsEqual;"}],[2,"&prE;"],[0,"&scE;"],[0,"&precneqq;"],[0,"&scnE;"],[0,"&prap;"],[0,"&scap;"],[0,"&precnapprox;"],[0,"&scnap;"],[0,"&Pr;"],[0,"&Sc;"],[0,"&subdot;"],[0,"&supdot;"],[0,"&subplus;"],[0,"&supplus;"],[0,"&submult;"],[0,"&supmult;"],[0,"&subedot;"],[0,"&supedot;"],[0,{v:"&subE;",n:824,o:"&nsubE;"}],[0,{v:"&supE;",n:824,o:"&nsupE;"}],[0,"&subsim;"],[0,"&supsim;"],[2,{v:"&subnE;",n:65024,o:"&varsubsetneqq;"}],[0,{v:"&supnE;",n:65024,o:"&varsupsetneqq;"}],[2,"&csub;"],[0,"&csup;"],[0,"&csube;"],[0,"&csupe;"],[0,"&subsup;"],[0,"&supsub;"],[0,"&subsub;"],[0,"&supsup;"],[0,"&suphsub;"],[0,"&supdsub;"],[0,"&forkv;"],[0,"&topfork;"],[0,"&mlcp;"],[8,"&Dashv;"],[1,"&Vdashl;"],[0,"&Barv;"],[0,"&vBar;"],[0,"&vBarv;"],[1,"&Vbar;"],[0,"&Not;"],[0,"&bNot;"],[0,"&rnmid;"],[0,"&cirmid;"],[0,"&midcir;"],[0,"&topcir;"],[0,"&nhpar;"],[0,"&parsim;"],[9,{v:"&parsl;",n:8421,o:"&nparsl;"}],[44343,{n:new Map(t([[56476,"&Ascr;"],[1,"&Cscr;"],[0,"&Dscr;"],[2,"&Gscr;"],[2,"&Jscr;"],[0,"&Kscr;"],[2,"&Nscr;"],[0,"&Oscr;"],[0,"&Pscr;"],[0,"&Qscr;"],[1,"&Sscr;"],[0,"&Tscr;"],[0,"&Uscr;"],[0,"&Vscr;"],[0,"&Wscr;"],[0,"&Xscr;"],[0,"&Yscr;"],[0,"&Zscr;"],[0,"&ascr;"],[0,"&bscr;"],[0,"&cscr;"],[0,"&dscr;"],[1,"&fscr;"],[1,"&hscr;"],[0,"&iscr;"],[0,"&jscr;"],[0,"&kscr;"],[0,"&lscr;"],[0,"&mscr;"],[0,"&nscr;"],[1,"&pscr;"],[0,"&qscr;"],[0,"&rscr;"],[0,"&sscr;"],[0,"&tscr;"],[0,"&uscr;"],[0,"&vscr;"],[0,"&wscr;"],[0,"&xscr;"],[0,"&yscr;"],[0,"&zscr;"],[52,"&Afr;"],[0,"&Bfr;"],[1,"&Dfr;"],[0,"&Efr;"],[0,"&Ffr;"],[0,"&Gfr;"],[2,"&Jfr;"],[0,"&Kfr;"],[0,"&Lfr;"],[0,"&Mfr;"],[0,"&Nfr;"],[0,"&Ofr;"],[0,"&Pfr;"],[0,"&Qfr;"],[1,"&Sfr;"],[0,"&Tfr;"],[0,"&Ufr;"],[0,"&Vfr;"],[0,"&Wfr;"],[0,"&Xfr;"],[0,"&Yfr;"],[1,"&afr;"],[0,"&bfr;"],[0,"&cfr;"],[0,"&dfr;"],[0,"&efr;"],[0,"&ffr;"],[0,"&gfr;"],[0,"&hfr;"],[0,"&ifr;"],[0,"&jfr;"],[0,"&kfr;"],[0,"&lfr;"],[0,"&mfr;"],[0,"&nfr;"],[0,"&ofr;"],[0,"&pfr;"],[0,"&qfr;"],[0,"&rfr;"],[0,"&sfr;"],[0,"&tfr;"],[0,"&ufr;"],[0,"&vfr;"],[0,"&wfr;"],[0,"&xfr;"],[0,"&yfr;"],[0,"&zfr;"],[0,"&Aopf;"],[0,"&Bopf;"],[1,"&Dopf;"],[0,"&Eopf;"],[0,"&Fopf;"],[0,"&Gopf;"],[1,"&Iopf;"],[0,"&Jopf;"],[0,"&Kopf;"],[0,"&Lopf;"],[0,"&Mopf;"],[1,"&Oopf;"],[3,"&Sopf;"],[0,"&Topf;"],[0,"&Uopf;"],[0,"&Vopf;"],[0,"&Wopf;"],[0,"&Xopf;"],[0,"&Yopf;"],[1,"&aopf;"],[0,"&bopf;"],[0,"&copf;"],[0,"&dopf;"],[0,"&eopf;"],[0,"&fopf;"],[0,"&gopf;"],[0,"&hopf;"],[0,"&iopf;"],[0,"&jopf;"],[0,"&kopf;"],[0,"&lopf;"],[0,"&mopf;"],[0,"&nopf;"],[0,"&oopf;"],[0,"&popf;"],[0,"&qopf;"],[0,"&ropf;"],[0,"&sopf;"],[0,"&topf;"],[0,"&uopf;"],[0,"&vopf;"],[0,"&wopf;"],[0,"&xopf;"],[0,"&yopf;"],[0,"&zopf;"]]))}],[8906,"&fflig;"],[0,"&filig;"],[0,"&fllig;"],[0,"&ffilig;"],[0,"&ffllig;"]])),b1}var rT={},NP;function i6(){return NP||(NP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.getCodePoint=t.xmlReplacer=void 0,t.xmlReplacer=/["&'<>$\x80-\uFFFF]/g;var e=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]);t.getCodePoint=String.prototype.codePointAt!=null?function(i,s){return i.codePointAt(s)}:function(i,s){return(i.charCodeAt(s)&64512)===55296?(i.charCodeAt(s)-55296)*1024+i.charCodeAt(s+1)-56320+65536:i.charCodeAt(s)};function n(i){for(var s="",o=0,l;(l=t.xmlReplacer.exec(i))!==null;){var u=l.index,h=i.charCodeAt(u),f=e.get(h);f!==void 0?(s+=i.substring(o,u)+f,o=u+1):(s+="".concat(i.substring(o,u),"&#x").concat((0,t.getCodePoint)(i,u).toString(16),";"),o=t.xmlReplacer.lastIndex+=+((h&64512)===55296))}return s+i.substr(o)}t.encodeXML=n,t.escape=n;function r(i,s){return function(l){for(var u,h=0,f="";u=i.exec(l);)h!==u.index&&(f+=l.substring(h,u.index)),f+=s.get(u[0].charCodeAt(0)),h=u.index+1;return f+l.substring(h)}}t.escapeUTF8=r(/[&<>'"]/g,e),t.escapeAttribute=r(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),t.escapeText=r(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]))}(rT)),rT}var PP;function LP(){if(PP)return Pc;PP=1;var t=Pc&&Pc.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.encodeNonAsciiHTML=Pc.encodeHTML=void 0;var e=t(s1e()),n=i6(),r=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function i(l){return o(r,l)}Pc.encodeHTML=i;function s(l){return o(n.xmlReplacer,l)}Pc.encodeNonAsciiHTML=s;function o(l,u){for(var h="",f=0,p;(p=l.exec(u))!==null;){var m=p.index;h+=u.substring(f,m);var v=u.charCodeAt(m),b=e.default.get(v);if(typeof b=="object"){if(m+1<u.length){var x=u.charCodeAt(m+1),w=typeof b.n=="number"?b.n===x?b.o:void 0:b.n.get(x);if(w!==void 0){h+=w,f=l.lastIndex+=1;continue}}b=b.v}if(b!==void 0)h+=b,f=m+1;else{var S=(0,n.getCodePoint)(u,m);h+="&#x".concat(S.toString(16),";"),f=l.lastIndex+=+(S!==v)}}return h+u.substr(f)}return Pc}var $P;function a1e(){return $P||($P=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXMLStrict=t.decodeHTML5Strict=t.decodeHTML4Strict=t.decodeHTML5=t.decodeHTML4=t.decodeHTMLAttribute=t.decodeHTMLStrict=t.decodeHTML=t.decodeXML=t.DecodingMode=t.EntityDecoder=t.encodeHTML5=t.encodeHTML4=t.encodeNonAsciiHTML=t.encodeHTML=t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.encode=t.decodeStrict=t.decode=t.EncodingMode=t.EntityLevel=void 0;var e=_w(),n=LP(),r=i6(),i;(function(m){m[m.XML=0]="XML",m[m.HTML=1]="HTML"})(i=t.EntityLevel||(t.EntityLevel={}));var s;(function(m){m[m.UTF8=0]="UTF8",m[m.ASCII=1]="ASCII",m[m.Extensive=2]="Extensive",m[m.Attribute=3]="Attribute",m[m.Text=4]="Text"})(s=t.EncodingMode||(t.EncodingMode={}));function o(m,v){v===void 0&&(v=i.XML);var b=typeof v=="number"?v:v.level;if(b===i.HTML){var x=typeof v=="object"?v.mode:void 0;return(0,e.decodeHTML)(m,x)}return(0,e.decodeXML)(m)}t.decode=o;function l(m,v){var b;v===void 0&&(v=i.XML);var x=typeof v=="number"?{level:v}:v;return(b=x.mode)!==null&&b!==void 0||(x.mode=e.DecodingMode.Strict),o(m,x)}t.decodeStrict=l;function u(m,v){v===void 0&&(v=i.XML);var b=typeof v=="number"?{level:v}:v;return b.mode===s.UTF8?(0,r.escapeUTF8)(m):b.mode===s.Attribute?(0,r.escapeAttribute)(m):b.mode===s.Text?(0,r.escapeText)(m):b.level===i.HTML?b.mode===s.ASCII?(0,n.encodeNonAsciiHTML)(m):(0,n.encodeHTML)(m):(0,r.encodeXML)(m)}t.encode=u;var h=i6();Object.defineProperty(t,"encodeXML",{enumerable:!0,get:function(){return h.encodeXML}}),Object.defineProperty(t,"escape",{enumerable:!0,get:function(){return h.escape}}),Object.defineProperty(t,"escapeUTF8",{enumerable:!0,get:function(){return h.escapeUTF8}}),Object.defineProperty(t,"escapeAttribute",{enumerable:!0,get:function(){return h.escapeAttribute}}),Object.defineProperty(t,"escapeText",{enumerable:!0,get:function(){return h.escapeText}});var f=LP();Object.defineProperty(t,"encodeHTML",{enumerable:!0,get:function(){return f.encodeHTML}}),Object.defineProperty(t,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return f.encodeNonAsciiHTML}}),Object.defineProperty(t,"encodeHTML4",{enumerable:!0,get:function(){return f.encodeHTML}}),Object.defineProperty(t,"encodeHTML5",{enumerable:!0,get:function(){return f.encodeHTML}});var p=_w();Object.defineProperty(t,"EntityDecoder",{enumerable:!0,get:function(){return p.EntityDecoder}}),Object.defineProperty(t,"DecodingMode",{enumerable:!0,get:function(){return p.DecodingMode}}),Object.defineProperty(t,"decodeXML",{enumerable:!0,get:function(){return p.decodeXML}}),Object.defineProperty(t,"decodeHTML",{enumerable:!0,get:function(){return p.decodeHTML}}),Object.defineProperty(t,"decodeHTMLStrict",{enumerable:!0,get:function(){return p.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTMLAttribute",{enumerable:!0,get:function(){return p.decodeHTMLAttribute}}),Object.defineProperty(t,"decodeHTML4",{enumerable:!0,get:function(){return p.decodeHTML}}),Object.defineProperty(t,"decodeHTML5",{enumerable:!0,get:function(){return p.decodeHTML}}),Object.defineProperty(t,"decodeHTML4Strict",{enumerable:!0,get:function(){return p.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTML5Strict",{enumerable:!0,get:function(){return p.decodeHTMLStrict}}),Object.defineProperty(t,"decodeXMLStrict",{enumerable:!0,get:function(){return p.decodeXML}})}(nT)),nT}var Td={},IP;function o1e(){return IP||(IP=1,Object.defineProperty(Td,"__esModule",{value:!0}),Td.attributeNames=Td.elementNames=void 0,Td.elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(function(t){return[t.toLowerCase(),t]})),Td.attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(function(t){return[t.toLowerCase(),t]}))),Td}var BP;function l1e(){if(BP)return ia;BP=1;var t=ia&&ia.__assign||function(){return t=Object.assign||function(C){for(var j,A=1,E=arguments.length;A<E;A++){j=arguments[A];for(var R in j)Object.prototype.hasOwnProperty.call(j,R)&&(C[R]=j[R])}return C},t.apply(this,arguments)},e=ia&&ia.__createBinding||(Object.create?function(C,j,A,E){E===void 0&&(E=A);var R=Object.getOwnPropertyDescriptor(j,A);(!R||("get"in R?!j.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return j[A]}}),Object.defineProperty(C,E,R)}:function(C,j,A,E){E===void 0&&(E=A),C[E]=j[A]}),n=ia&&ia.__setModuleDefault||(Object.create?function(C,j){Object.defineProperty(C,"default",{enumerable:!0,value:j})}:function(C,j){C.default=j}),r=ia&&ia.__importStar||function(C){if(C&&C.__esModule)return C;var j={};if(C!=null)for(var A in C)A!=="default"&&Object.prototype.hasOwnProperty.call(C,A)&&e(j,C,A);return n(j,C),j};Object.defineProperty(ia,"__esModule",{value:!0}),ia.render=void 0;var i=r(fb()),s=a1e(),o=o1e(),l=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function u(C){return C.replace(/"/g,"&quot;")}function h(C,j){var A;if(C){var E=((A=j.encodeEntities)!==null&&A!==void 0?A:j.decodeEntities)===!1?u:j.xmlMode||j.encodeEntities!=="utf8"?s.encodeXML:s.escapeAttribute;return Object.keys(C).map(function(R){var N,$,D=(N=C[R])!==null&&N!==void 0?N:"";return j.xmlMode==="foreign"&&(R=($=o.attributeNames.get(R))!==null&&$!==void 0?$:R),!j.emptyAttrs&&!j.xmlMode&&D===""?R:"".concat(R,'="').concat(E(D),'"')}).join(" ")}}var f=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function p(C,j){j===void 0&&(j={});for(var A=("length"in C)?C:[C],E="",R=0;R<A.length;R++)E+=m(A[R],j);return E}ia.render=p,ia.default=p;function m(C,j){switch(C.type){case i.Root:return p(C.children,j);case i.Doctype:case i.Directive:return w(C);case i.Comment:return T(C);case i.CDATA:return _(C);case i.Script:case i.Style:case i.Tag:return x(C,j);case i.Text:return S(C,j)}}var v=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),b=new Set(["svg","math"]);function x(C,j){var A;j.xmlMode==="foreign"&&(C.name=(A=o.elementNames.get(C.name))!==null&&A!==void 0?A:C.name,C.parent&&v.has(C.parent.name)&&(j=t(t({},j),{xmlMode:!1}))),!j.xmlMode&&b.has(C.name)&&(j=t(t({},j),{xmlMode:"foreign"}));var E="<".concat(C.name),R=h(C.attribs,j);return R&&(E+=" ".concat(R)),C.children.length===0&&(j.xmlMode?j.selfClosingTags!==!1:j.selfClosingTags&&f.has(C.name))?(j.xmlMode||(E+=" "),E+="/>"):(E+=">",C.children.length>0&&(E+=p(C.children,j)),(j.xmlMode||!f.has(C.name))&&(E+="</".concat(C.name,">"))),E}function w(C){return"<".concat(C.data,">")}function S(C,j){var A,E=C.data||"";return((A=j.encodeEntities)!==null&&A!==void 0?A:j.decodeEntities)!==!1&&!(!j.xmlMode&&C.parent&&l.has(C.parent.name))&&(E=j.xmlMode||j.encodeEntities!=="utf8"?(0,s.encodeXML)(E):(0,s.escapeText)(E)),E}function _(C){return"<![CDATA[".concat(C.children[0].data,"]]>")}function T(C){return"<!--".concat(C.data,"-->")}return ia}var zP;function HV(){if(zP)return Ps;zP=1;var t=Ps&&Ps.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.innerText=Ps.textContent=Ps.getText=Ps.getInnerHTML=Ps.getOuterHTML=void 0;var e=Bh(),n=t(l1e()),r=fb();function i(h,f){return(0,n.default)(h,f)}Ps.getOuterHTML=i;function s(h,f){return(0,e.hasChildren)(h)?h.children.map(function(p){return i(p,f)}).join(""):""}Ps.getInnerHTML=s;function o(h){return Array.isArray(h)?h.map(o).join(""):(0,e.isTag)(h)?h.name==="br"?`
`:o(h.children):(0,e.isCDATA)(h)?o(h.children):(0,e.isText)(h)?h.data:""}Ps.getText=o;function l(h){return Array.isArray(h)?h.map(l).join(""):(0,e.hasChildren)(h)&&!(0,e.isComment)(h)?l(h.children):(0,e.isText)(h)?h.data:""}Ps.textContent=l;function u(h){return Array.isArray(h)?h.map(u).join(""):(0,e.hasChildren)(h)&&(h.type===r.ElementType.Tag||(0,e.isCDATA)(h))?u(h.children):(0,e.isText)(h)?h.data:""}return Ps.innerText=u,Ps}var Si={},qP;function c1e(){if(qP)return Si;qP=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.prevElementSibling=Si.nextElementSibling=Si.getName=Si.hasAttrib=Si.getAttributeValue=Si.getSiblings=Si.getParent=Si.getChildren=void 0;var t=Bh();function e(h){return(0,t.hasChildren)(h)?h.children:[]}Si.getChildren=e;function n(h){return h.parent||null}Si.getParent=n;function r(h){var f,p,m=n(h);if(m!=null)return e(m);for(var v=[h],b=h.prev,x=h.next;b!=null;)v.unshift(b),f=b,b=f.prev;for(;x!=null;)v.push(x),p=x,x=p.next;return v}Si.getSiblings=r;function i(h,f){var p;return(p=h.attribs)===null||p===void 0?void 0:p[f]}Si.getAttributeValue=i;function s(h,f){return h.attribs!=null&&Object.prototype.hasOwnProperty.call(h.attribs,f)&&h.attribs[f]!=null}Si.hasAttrib=s;function o(h){return h.name}Si.getName=o;function l(h){for(var f,p=h.next;p!==null&&!(0,t.isTag)(p);)f=p,p=f.next;return p}Si.nextElementSibling=l;function u(h){for(var f,p=h.prev;p!==null&&!(0,t.isTag)(p);)f=p,p=f.prev;return p}return Si.prevElementSibling=u,Si}var Ls={},FP;function u1e(){if(FP)return Ls;FP=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.prepend=Ls.prependChild=Ls.append=Ls.appendChild=Ls.replaceElement=Ls.removeElement=void 0;function t(o){if(o.prev&&(o.prev.next=o.next),o.next&&(o.next.prev=o.prev),o.parent){var l=o.parent.children,u=l.lastIndexOf(o);u>=0&&l.splice(u,1)}o.next=null,o.prev=null,o.parent=null}Ls.removeElement=t;function e(o,l){var u=l.prev=o.prev;u&&(u.next=l);var h=l.next=o.next;h&&(h.prev=l);var f=l.parent=o.parent;if(f){var p=f.children;p[p.lastIndexOf(o)]=l,o.parent=null}}Ls.replaceElement=e;function n(o,l){if(t(l),l.next=null,l.parent=o,o.children.push(l)>1){var u=o.children[o.children.length-2];u.next=l,l.prev=u}else l.prev=null}Ls.appendChild=n;function r(o,l){t(l);var u=o.parent,h=o.next;if(l.next=h,l.prev=o,o.next=l,l.parent=u,h){if(h.prev=l,u){var f=u.children;f.splice(f.lastIndexOf(h),0,l)}}else u&&u.children.push(l)}Ls.append=r;function i(o,l){if(t(l),l.parent=o,l.prev=null,o.children.unshift(l)!==1){var u=o.children[1];u.prev=l,l.next=u}else l.next=null}Ls.prependChild=i;function s(o,l){t(l);var u=o.parent;if(u){var h=u.children;h.splice(h.indexOf(o),0,l)}o.prev&&(o.prev.next=l),l.parent=u,l.prev=o.prev,l.next=o,o.prev=l}return Ls.prepend=s,Ls}var $s={},HP;function VV(){if(HP)return $s;HP=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.findAll=$s.existsOne=$s.findOne=$s.findOneChild=$s.find=$s.filter=void 0;var t=Bh();function e(l,u,h,f){return h===void 0&&(h=!0),f===void 0&&(f=1/0),n(l,Array.isArray(u)?u:[u],h,f)}$s.filter=e;function n(l,u,h,f){for(var p=[],m=[u],v=[0];;){if(v[0]>=m[0].length){if(v.length===1)return p;m.shift(),v.shift();continue}var b=m[0][v[0]++];if(l(b)&&(p.push(b),--f<=0))return p;h&&(0,t.hasChildren)(b)&&b.children.length>0&&(v.unshift(0),m.unshift(b.children))}}$s.find=n;function r(l,u){return u.find(l)}$s.findOneChild=r;function i(l,u,h){h===void 0&&(h=!0);for(var f=null,p=0;p<u.length&&!f;p++){var m=u[p];if((0,t.isTag)(m))l(m)?f=m:h&&m.children.length>0&&(f=i(l,m.children,!0));else continue}return f}$s.findOne=i;function s(l,u){return u.some(function(h){return(0,t.isTag)(h)&&(l(h)||s(l,h.children))})}$s.existsOne=s;function o(l,u){for(var h=[],f=[u],p=[0];;){if(p[0]>=f[0].length){if(f.length===1)return h;f.shift(),p.shift();continue}var m=f[0][p[0]++];(0,t.isTag)(m)&&(l(m)&&h.push(m),m.children.length>0&&(p.unshift(0),f.unshift(m.children)))}}return $s.findAll=o,$s}var ka={},VP;function UV(){if(VP)return ka;VP=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.getElementsByTagType=ka.getElementsByTagName=ka.getElementById=ka.getElements=ka.testElement=void 0;var t=Bh(),e=VV(),n={tag_name:function(p){return typeof p=="function"?function(m){return(0,t.isTag)(m)&&p(m.name)}:p==="*"?t.isTag:function(m){return(0,t.isTag)(m)&&m.name===p}},tag_type:function(p){return typeof p=="function"?function(m){return p(m.type)}:function(m){return m.type===p}},tag_contains:function(p){return typeof p=="function"?function(m){return(0,t.isText)(m)&&p(m.data)}:function(m){return(0,t.isText)(m)&&m.data===p}}};function r(p,m){return typeof m=="function"?function(v){return(0,t.isTag)(v)&&m(v.attribs[p])}:function(v){return(0,t.isTag)(v)&&v.attribs[p]===m}}function i(p,m){return function(v){return p(v)||m(v)}}function s(p){var m=Object.keys(p).map(function(v){var b=p[v];return Object.prototype.hasOwnProperty.call(n,v)?n[v](b):r(v,b)});return m.length===0?null:m.reduce(i)}function o(p,m){var v=s(p);return v?v(m):!0}ka.testElement=o;function l(p,m,v,b){b===void 0&&(b=1/0);var x=s(p);return x?(0,e.filter)(x,m,v,b):[]}ka.getElements=l;function u(p,m,v){return v===void 0&&(v=!0),Array.isArray(m)||(m=[m]),(0,e.findOne)(r("id",p),m,v)}ka.getElementById=u;function h(p,m,v,b){return v===void 0&&(v=!0),b===void 0&&(b=1/0),(0,e.filter)(n.tag_name(p),m,v,b)}ka.getElementsByTagName=h;function f(p,m,v,b){return v===void 0&&(v=!0),b===void 0&&(b=1/0),(0,e.filter)(n.tag_type(p),m,v,b)}return ka.getElementsByTagType=f,ka}var iT={},UP;function h1e(){return UP||(UP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.uniqueSort=t.compareDocumentPosition=t.DocumentPosition=t.removeSubsets=void 0;var e=Bh();function n(o){for(var l=o.length;--l>=0;){var u=o[l];if(l>0&&o.lastIndexOf(u,l-1)>=0){o.splice(l,1);continue}for(var h=u.parent;h;h=h.parent)if(o.includes(h)){o.splice(l,1);break}}return o}t.removeSubsets=n;var r;(function(o){o[o.DISCONNECTED=1]="DISCONNECTED",o[o.PRECEDING=2]="PRECEDING",o[o.FOLLOWING=4]="FOLLOWING",o[o.CONTAINS=8]="CONTAINS",o[o.CONTAINED_BY=16]="CONTAINED_BY"})(r=t.DocumentPosition||(t.DocumentPosition={}));function i(o,l){var u=[],h=[];if(o===l)return 0;for(var f=(0,e.hasChildren)(o)?o:o.parent;f;)u.unshift(f),f=f.parent;for(f=(0,e.hasChildren)(l)?l:l.parent;f;)h.unshift(f),f=f.parent;for(var p=Math.min(u.length,h.length),m=0;m<p&&u[m]===h[m];)m++;if(m===0)return r.DISCONNECTED;var v=u[m-1],b=v.children,x=u[m],w=h[m];return b.indexOf(x)>b.indexOf(w)?v===l?r.FOLLOWING|r.CONTAINED_BY:r.FOLLOWING:v===o?r.PRECEDING|r.CONTAINS:r.PRECEDING}t.compareDocumentPosition=i;function s(o){return o=o.filter(function(l,u,h){return!h.includes(l,u+1)}),o.sort(function(l,u){var h=i(l,u);return h&r.PRECEDING?-1:h&r.FOLLOWING?1:0}),o}t.uniqueSort=s}(iT)),iT}var sg={},QP;function d1e(){if(QP)return sg;QP=1,Object.defineProperty(sg,"__esModule",{value:!0}),sg.getFeed=void 0;var t=HV(),e=UV();function n(m){var v=u(p,m);return v?v.name==="feed"?r(v):i(v):null}sg.getFeed=n;function r(m){var v,b=m.children,x={type:"atom",items:(0,e.getElementsByTagName)("entry",b).map(function(_){var T,C=_.children,j={media:l(C)};f(j,"id","id",C),f(j,"title","title",C);var A=(T=u("link",C))===null||T===void 0?void 0:T.attribs.href;A&&(j.link=A);var E=h("summary",C)||h("content",C);E&&(j.description=E);var R=h("updated",C);return R&&(j.pubDate=new Date(R)),j})};f(x,"id","id",b),f(x,"title","title",b);var w=(v=u("link",b))===null||v===void 0?void 0:v.attribs.href;w&&(x.link=w),f(x,"description","subtitle",b);var S=h("updated",b);return S&&(x.updated=new Date(S)),f(x,"author","email",b,!0),x}function i(m){var v,b,x=(b=(v=u("channel",m.children))===null||v===void 0?void 0:v.children)!==null&&b!==void 0?b:[],w={type:m.name.substr(0,3),id:"",items:(0,e.getElementsByTagName)("item",m.children).map(function(_){var T=_.children,C={media:l(T)};f(C,"id","guid",T),f(C,"title","title",T),f(C,"link","link",T),f(C,"description","description",T);var j=h("pubDate",T)||h("dc:date",T);return j&&(C.pubDate=new Date(j)),C})};f(w,"title","title",x),f(w,"link","link",x),f(w,"description","description",x);var S=h("lastBuildDate",x);return S&&(w.updated=new Date(S)),f(w,"author","managingEditor",x,!0),w}var s=["url","type","lang"],o=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function l(m){return(0,e.getElementsByTagName)("media:content",m).map(function(v){for(var b=v.attribs,x={medium:b.medium,isDefault:!!b.isDefault},w=0,S=s;w<S.length;w++){var _=S[w];b[_]&&(x[_]=b[_])}for(var T=0,C=o;T<C.length;T++){var _=C[T];b[_]&&(x[_]=parseInt(b[_],10))}return b.expression&&(x.expression=b.expression),x})}function u(m,v){return(0,e.getElementsByTagName)(m,v,!0,1)[0]}function h(m,v,b){return b===void 0&&(b=!1),(0,t.textContent)((0,e.getElementsByTagName)(m,v,b,1)).trim()}function f(m,v,b,x,w){w===void 0&&(w=!1);var S=h(b,x,w);S&&(m[v]=S)}function p(m){return m==="rss"||m==="feed"||m==="rdf:RDF"}return sg}var WP;function sT(){return WP||(WP=1,function(t){var e=_d&&_d.__createBinding||(Object.create?function(i,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,l,u)}:function(i,s,o,l){l===void 0&&(l=o),i[l]=s[o]}),n=_d&&_d.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,i,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasChildren=t.isDocument=t.isComment=t.isText=t.isCDATA=t.isTag=void 0,n(HV(),t),n(c1e(),t),n(u1e(),t),n(VV(),t),n(UV(),t),n(h1e(),t),n(d1e(),t);var r=Bh();Object.defineProperty(t,"isTag",{enumerable:!0,get:function(){return r.isTag}}),Object.defineProperty(t,"isCDATA",{enumerable:!0,get:function(){return r.isCDATA}}),Object.defineProperty(t,"isText",{enumerable:!0,get:function(){return r.isText}}),Object.defineProperty(t,"isComment",{enumerable:!0,get:function(){return r.isComment}}),Object.defineProperty(t,"isDocument",{enumerable:!0,get:function(){return r.isDocument}}),Object.defineProperty(t,"hasChildren",{enumerable:!0,get:function(){return r.hasChildren}})}(_d)),_d}var YP;function f1e(){return YP||(YP=1,function(t){var e=Po&&Po.__createBinding||(Object.create?function(S,_,T,C){C===void 0&&(C=T);var j=Object.getOwnPropertyDescriptor(_,T);(!j||("get"in j?!_.__esModule:j.writable||j.configurable))&&(j={enumerable:!0,get:function(){return _[T]}}),Object.defineProperty(S,C,j)}:function(S,_,T,C){C===void 0&&(C=T),S[C]=_[T]}),n=Po&&Po.__setModuleDefault||(Object.create?function(S,_){Object.defineProperty(S,"default",{enumerable:!0,value:_})}:function(S,_){S.default=_}),r=Po&&Po.__importStar||function(S){if(S&&S.__esModule)return S;var _={};if(S!=null)for(var T in S)T!=="default"&&Object.prototype.hasOwnProperty.call(S,T)&&e(_,S,T);return n(_,S),_},i=Po&&Po.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomUtils=t.parseFeed=t.getFeed=t.ElementType=t.Tokenizer=t.createDomStream=t.parseDOM=t.parseDocument=t.DefaultHandler=t.DomHandler=t.Parser=void 0;var s=OP(),o=OP();Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return o.Parser}});var l=Bh(),u=Bh();Object.defineProperty(t,"DomHandler",{enumerable:!0,get:function(){return u.DomHandler}}),Object.defineProperty(t,"DefaultHandler",{enumerable:!0,get:function(){return u.DomHandler}});function h(S,_){var T=new l.DomHandler(void 0,_);return new s.Parser(T,_).end(S),T.root}t.parseDocument=h;function f(S,_){return h(S,_).children}t.parseDOM=f;function p(S,_,T){var C=new l.DomHandler(S,_,T);return new s.Parser(C,_)}t.createDomStream=p;var m=FV();Object.defineProperty(t,"Tokenizer",{enumerable:!0,get:function(){return i(m).default}}),t.ElementType=r(fb());var v=sT(),b=sT();Object.defineProperty(t,"getFeed",{enumerable:!0,get:function(){return b.getFeed}});var x={xmlMode:!0};function w(S,_){return _===void 0&&(_=x),(0,v.getFeed)(f(S,_))}t.parseFeed=w,t.DomUtils=r(sT())}(Po)),Po}var aT,XP;function p1e(){return XP||(XP=1,aT=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}),aT}var y1={},GP;function m1e(){if(GP)return y1;GP=1,Object.defineProperty(y1,"__esModule",{value:!0});/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */function t(n){return Object.prototype.toString.call(n)==="[object Object]"}function e(n){var r,i;return t(n)===!1?!1:(r=n.constructor,r===void 0?!0:(i=r.prototype,!(t(i)===!1||i.hasOwnProperty("isPrototypeOf")===!1)))}return y1.isPlainObject=e,y1}var oT,KP;function g1e(){if(KP)return oT;KP=1;var t=function(_){return e(_)&&!n(_)};function e(S){return!!S&&typeof S=="object"}function n(S){var _=Object.prototype.toString.call(S);return _==="[object RegExp]"||_==="[object Date]"||s(S)}var r=typeof Symbol=="function"&&Symbol.for,i=r?Symbol.for("react.element"):60103;function s(S){return S.$$typeof===i}function o(S){return Array.isArray(S)?[]:{}}function l(S,_){return _.clone!==!1&&_.isMergeableObject(S)?x(o(S),S,_):S}function u(S,_,T){return S.concat(_).map(function(C){return l(C,T)})}function h(S,_){if(!_.customMerge)return x;var T=_.customMerge(S);return typeof T=="function"?T:x}function f(S){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(S).filter(function(_){return Object.propertyIsEnumerable.call(S,_)}):[]}function p(S){return Object.keys(S).concat(f(S))}function m(S,_){try{return _ in S}catch{return!1}}function v(S,_){return m(S,_)&&!(Object.hasOwnProperty.call(S,_)&&Object.propertyIsEnumerable.call(S,_))}function b(S,_,T){var C={};return T.isMergeableObject(S)&&p(S).forEach(function(j){C[j]=l(S[j],T)}),p(_).forEach(function(j){v(S,j)||(m(S,j)&&T.isMergeableObject(_[j])?C[j]=h(j,T)(S[j],_[j],T):C[j]=l(_[j],T))}),C}function x(S,_,T){T=T||{},T.arrayMerge=T.arrayMerge||u,T.isMergeableObject=T.isMergeableObject||t,T.cloneUnlessOtherwiseSpecified=l;var C=Array.isArray(_),j=Array.isArray(S),A=C===j;return A?C?T.arrayMerge(S,_,T):b(S,_,T):l(_,T)}x.all=function(_,T){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(C,j){return x(C,j,T)},{})};var w=x;return oT=w,oT}var cx={exports:{}},v1e=cx.exports,ZP;function b1e(){return ZP||(ZP=1,function(t){(function(e,n){t.exports?t.exports=n():e.parseSrcset=n()})(v1e,function(){return function(e){function n(C){return C===" "||C==="	"||C===`
`||C==="\f"||C==="\r"}function r(C){var j,A=C.exec(e.substring(w));if(A)return j=A[0],w+=j.length,j}for(var i=e.length,s=/^[ \t\n\r\u000c]+/,o=/^[, \t\n\r\u000c]+/,l=/^[^ \t\n\r\u000c]+/,u=/[,]+$/,h=/^\d+$/,f=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,p,m,v,b,x,w=0,S=[];;){if(r(o),w>=i)return S;p=r(l),m=[],p.slice(-1)===","?(p=p.replace(u,""),T()):_()}function _(){for(r(s),v="",b="in descriptor";;){if(x=e.charAt(w),b==="in descriptor")if(n(x))v&&(m.push(v),v="",b="after descriptor");else if(x===","){w+=1,v&&m.push(v),T();return}else if(x==="(")v=v+x,b="in parens";else if(x===""){v&&m.push(v),T();return}else v=v+x;else if(b==="in parens")if(x===")")v=v+x,b="in descriptor";else if(x===""){m.push(v),T();return}else v=v+x;else if(b==="after descriptor"&&!n(x))if(x===""){T();return}else b="in descriptor",w-=1;w+=1}}function T(){var C=!1,j,A,E,R,N={},$,D,F,Q,H;for(R=0;R<m.length;R++)$=m[R],D=$[$.length-1],F=$.substring(0,$.length-1),Q=parseInt(F,10),H=parseFloat(F),h.test(F)&&D==="w"?((j||A)&&(C=!0),Q===0?C=!0:j=Q):f.test(F)&&D==="x"?((j||A||E)&&(C=!0),H<0?C=!0:A=H):h.test(F)&&D==="h"?((E||A)&&(C=!0),Q===0?C=!0:E=Q):C=!0;C?console&&console.log&&console.log("Invalid srcset descriptor found in '"+e+"' at '"+$+"'."):(N.url=p,j&&(N.w=j),A&&(N.d=A),E&&(N.h=E),S.push(N))}}})}(cx)),cx.exports}var x1={exports:{}},JP;function y1e(){if(JP)return x1.exports;JP=1;var t=String,e=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return x1.exports=e(),x1.exports.createColors=e,x1.exports}const x1e={},w1e=Object.freeze(Object.defineProperty({__proto__:null,default:x1e},Symbol.toStringTag,{value:"Module"})),sl=f7(w1e);var lT,e9;function EE(){if(e9)return lT;e9=1;let t=y1e(),e=sl;class n extends Error{constructor(i,s,o,l,u,h){super(i),this.name="CssSyntaxError",this.reason=i,u&&(this.file=u),l&&(this.source=l),h&&(this.plugin=h),typeof s<"u"&&typeof o<"u"&&(typeof s=="number"?(this.line=s,this.column=o):(this.line=s.line,this.column=s.column,this.endLine=o.line,this.endColumn=o.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(i){if(!this.source)return"";let s=this.source;i==null&&(i=t.isColorSupported);let o=v=>v,l=v=>v,u=v=>v;if(i){let{bold:v,gray:b,red:x}=t.createColors(!0);l=w=>v(x(w)),o=w=>b(w),e&&(u=w=>e(w))}let h=s.split(/\r?\n/),f=Math.max(this.line-3,0),p=Math.min(this.line+2,h.length),m=String(p).length;return h.slice(f,p).map((v,b)=>{let x=f+1+b,w=" "+(" "+x).slice(-m)+" | ";if(x===this.line){if(v.length>160){let _=20,T=Math.max(0,this.column-_),C=Math.max(this.column+_,this.endColumn+_),j=v.slice(T,C),A=o(w.replace(/\d/g," "))+v.slice(0,Math.min(this.column-1,_-1)).replace(/[^\t]/g," ");return l(">")+o(w)+u(j)+`
 `+A+l("^")}let S=o(w.replace(/\d/g," "))+v.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+o(w)+u(v)+`
 `+S+l("^")}return" "+o(w)+u(v)}).join(`
`)}toString(){let i=this.showSourceCode();return i&&(i=`

`+i+`
`),this.name+": "+this.message+i}}return lT=n,n.default=n,lT}var cT,t9;function QV(){if(t9)return cT;t9=1;const t={after:`
`,beforeClose:`
`,beforeComment:`
`,beforeDecl:`
`,beforeOpen:" ",beforeRule:`
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:"    ",semicolon:!1};function e(r){return r[0].toUpperCase()+r.slice(1)}class n{constructor(i){this.builder=i}atrule(i,s){let o="@"+i.name,l=i.params?this.rawValue(i,"params"):"";if(typeof i.raws.afterName<"u"?o+=i.raws.afterName:l&&(o+=" "),i.nodes)this.block(i,o+l);else{let u=(i.raws.between||"")+(s?";":"");this.builder(o+l+u,i)}}beforeAfter(i,s){let o;i.type==="decl"?o=this.raw(i,null,"beforeDecl"):i.type==="comment"?o=this.raw(i,null,"beforeComment"):s==="before"?o=this.raw(i,null,"beforeRule"):o=this.raw(i,null,"beforeClose");let l=i.parent,u=0;for(;l&&l.type!=="root";)u+=1,l=l.parent;if(o.includes(`
`)){let h=this.raw(i,null,"indent");if(h.length)for(let f=0;f<u;f++)o+=h}return o}block(i,s){let o=this.raw(i,"between","beforeOpen");this.builder(s+o+"{",i,"start");let l;i.nodes&&i.nodes.length?(this.body(i),l=this.raw(i,"after")):l=this.raw(i,"after","emptyBody"),l&&this.builder(l),this.builder("}",i,"end")}body(i){let s=i.nodes.length-1;for(;s>0&&i.nodes[s].type==="comment";)s-=1;let o=this.raw(i,"semicolon");for(let l=0;l<i.nodes.length;l++){let u=i.nodes[l],h=this.raw(u,"before");h&&this.builder(h),this.stringify(u,s!==l||o)}}comment(i){let s=this.raw(i,"left","commentLeft"),o=this.raw(i,"right","commentRight");this.builder("/*"+s+i.text+o+"*/",i)}decl(i,s){let o=this.raw(i,"between","colon"),l=i.prop+o+this.rawValue(i,"value");i.important&&(l+=i.raws.important||" !important"),s&&(l+=";"),this.builder(l,i)}document(i){this.body(i)}raw(i,s,o){let l;if(o||(o=s),s&&(l=i.raws[s],typeof l<"u"))return l;let u=i.parent;if(o==="before"&&(!u||u.type==="root"&&u.first===i||u&&u.type==="document"))return"";if(!u)return t[o];let h=i.root();if(h.rawCache||(h.rawCache={}),typeof h.rawCache[o]<"u")return h.rawCache[o];if(o==="before"||o==="after")return this.beforeAfter(i,o);{let f="raw"+e(o);this[f]?l=this[f](h,i):h.walk(p=>{if(l=p.raws[s],typeof l<"u")return!1})}return typeof l>"u"&&(l=t[o]),h.rawCache[o]=l,l}rawBeforeClose(i){let s;return i.walk(o=>{if(o.nodes&&o.nodes.length>0&&typeof o.raws.after<"u")return s=o.raws.after,s.includes(`
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawBeforeComment(i,s){let o;return i.walkComments(l=>{if(typeof l.raws.before<"u")return o=l.raws.before,o.includes(`
`)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o>"u"?o=this.raw(s,null,"beforeDecl"):o&&(o=o.replace(/\S/g,"")),o}rawBeforeDecl(i,s){let o;return i.walkDecls(l=>{if(typeof l.raws.before<"u")return o=l.raws.before,o.includes(`
`)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o>"u"?o=this.raw(s,null,"beforeRule"):o&&(o=o.replace(/\S/g,"")),o}rawBeforeOpen(i){let s;return i.walk(o=>{if(o.type!=="decl"&&(s=o.raws.between,typeof s<"u"))return!1}),s}rawBeforeRule(i){let s;return i.walk(o=>{if(o.nodes&&(o.parent!==i||i.first!==o)&&typeof o.raws.before<"u")return s=o.raws.before,s.includes(`
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawColon(i){let s;return i.walkDecls(o=>{if(typeof o.raws.between<"u")return s=o.raws.between.replace(/[^\s:]/g,""),!1}),s}rawEmptyBody(i){let s;return i.walk(o=>{if(o.nodes&&o.nodes.length===0&&(s=o.raws.after,typeof s<"u"))return!1}),s}rawIndent(i){if(i.raws.indent)return i.raws.indent;let s;return i.walk(o=>{let l=o.parent;if(l&&l!==i&&l.parent&&l.parent===i&&typeof o.raws.before<"u"){let u=o.raws.before.split(`
`);return s=u[u.length-1],s=s.replace(/\S/g,""),!1}}),s}rawSemicolon(i){let s;return i.walk(o=>{if(o.nodes&&o.nodes.length&&o.last.type==="decl"&&(s=o.raws.semicolon,typeof s<"u"))return!1}),s}rawValue(i,s){let o=i[s],l=i.raws[s];return l&&l.value===o?l.raw:o}root(i){this.body(i),i.raws.after&&this.builder(i.raws.after)}rule(i){this.block(i,this.rawValue(i,"selector")),i.raws.ownSemicolon&&this.builder(i.raws.ownSemicolon,i,"end")}stringify(i,s){if(!this[i.type])throw new Error("Unknown AST node type "+i.type+". Maybe you need to change PostCSS stringifier.");this[i.type](i,s)}}return cT=n,n.default=n,cT}var uT,n9;function vS(){if(n9)return uT;n9=1;let t=QV();function e(n,r){new t(r).stringify(n)}return uT=e,e.default=e,uT}var w1={},r9;function AE(){return r9||(r9=1,w1.isClean=Symbol("isClean"),w1.my=Symbol("my")),w1}var hT,i9;function bS(){if(i9)return hT;i9=1;let t=EE(),e=QV(),n=vS(),{isClean:r,my:i}=AE();function s(u,h){let f=new u.constructor;for(let p in u){if(!Object.prototype.hasOwnProperty.call(u,p)||p==="proxyCache")continue;let m=u[p],v=typeof m;p==="parent"&&v==="object"?h&&(f[p]=h):p==="source"?f[p]=m:Array.isArray(m)?f[p]=m.map(b=>s(b,f)):(v==="object"&&m!==null&&(m=s(m)),f[p]=m)}return f}function o(u,h){if(h&&typeof h.offset<"u")return h.offset;let f=1,p=1,m=0;for(let v=0;v<u.length;v++){if(p===h.line&&f===h.column){m=v;break}u[v]===`
`?(f=1,p+=1):f+=1}return m}class l{get proxyOf(){return this}constructor(h={}){this.raws={},this[r]=!1,this[i]=!0;for(let f in h)if(f==="nodes"){this.nodes=[];for(let p of h[f])typeof p.clone=="function"?this.append(p.clone()):this.append(p)}else this[f]=h[f]}addToError(h){if(h.postcssNode=this,h.stack&&this.source&&/\n\s{4}at /.test(h.stack)){let f=this.source;h.stack=h.stack.replace(/\n\s{4}at /,`$&${f.input.from}:${f.start.line}:${f.start.column}$&`)}return h}after(h){return this.parent.insertAfter(this,h),this}assign(h={}){for(let f in h)this[f]=h[f];return this}before(h){return this.parent.insertBefore(this,h),this}cleanRaws(h){delete this.raws.before,delete this.raws.after,h||delete this.raws.between}clone(h={}){let f=s(this);for(let p in h)f[p]=h[p];return f}cloneAfter(h={}){let f=this.clone(h);return this.parent.insertAfter(this,f),f}cloneBefore(h={}){let f=this.clone(h);return this.parent.insertBefore(this,f),f}error(h,f={}){if(this.source){let{end:p,start:m}=this.rangeBy(f);return this.source.input.error(h,{column:m.column,line:m.line},{column:p.column,line:p.line},f)}return new t(h)}getProxyProcessor(){return{get(h,f){return f==="proxyOf"?h:f==="root"?()=>h.root().toProxy():h[f]},set(h,f,p){return h[f]===p||(h[f]=p,(f==="prop"||f==="value"||f==="name"||f==="params"||f==="important"||f==="text")&&h.markDirty()),!0}}}markClean(){this[r]=!0}markDirty(){if(this[r]){this[r]=!1;let h=this;for(;h=h.parent;)h[r]=!1}}next(){if(!this.parent)return;let h=this.parent.index(this);return this.parent.nodes[h+1]}positionBy(h={}){let f=this.source.start;if(h.index)f=this.positionInside(h.index);else if(h.word){let p="document"in this.source.input?this.source.input.document:this.source.input.css,v=p.slice(o(p,this.source.start),o(p,this.source.end)).indexOf(h.word);v!==-1&&(f=this.positionInside(v))}return f}positionInside(h){let f=this.source.start.column,p=this.source.start.line,m="document"in this.source.input?this.source.input.document:this.source.input.css,v=o(m,this.source.start),b=v+h;for(let x=v;x<b;x++)m[x]===`
`?(f=1,p+=1):f+=1;return{column:f,line:p,offset:b}}prev(){if(!this.parent)return;let h=this.parent.index(this);return this.parent.nodes[h-1]}rangeBy(h={}){let f="document"in this.source.input?this.source.input.document:this.source.input.css,p={column:this.source.start.column,line:this.source.start.line,offset:o(f,this.source.start)},m=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:o(f,this.source.end)+1}:{column:p.column+1,line:p.line,offset:p.offset+1};if(h.word){let b=f.slice(o(f,this.source.start),o(f,this.source.end)).indexOf(h.word);b!==-1&&(p=this.positionInside(b),m=this.positionInside(b+h.word.length))}else h.start?p={column:h.start.column,line:h.start.line,offset:o(f,h.start)}:h.index&&(p=this.positionInside(h.index)),h.end?m={column:h.end.column,line:h.end.line,offset:o(f,h.end)}:typeof h.endIndex=="number"?m=this.positionInside(h.endIndex):h.index&&(m=this.positionInside(h.index+1));return(m.line<p.line||m.line===p.line&&m.column<=p.column)&&(m={column:p.column+1,line:p.line,offset:p.offset+1}),{end:m,start:p}}raw(h,f){return new e().raw(this,h,f)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...h){if(this.parent){let f=this,p=!1;for(let m of h)m===this?p=!0:p?(this.parent.insertAfter(f,m),f=m):this.parent.insertBefore(f,m);p||this.remove()}return this}root(){let h=this;for(;h.parent&&h.parent.type!=="document";)h=h.parent;return h}toJSON(h,f){let p={},m=f==null;f=f||new Map;let v=0;for(let b in this){if(!Object.prototype.hasOwnProperty.call(this,b)||b==="parent"||b==="proxyCache")continue;let x=this[b];if(Array.isArray(x))p[b]=x.map(w=>typeof w=="object"&&w.toJSON?w.toJSON(null,f):w);else if(typeof x=="object"&&x.toJSON)p[b]=x.toJSON(null,f);else if(b==="source"){if(x==null)continue;let w=f.get(x.input);w==null&&(w=v,f.set(x.input,v),v++),p[b]={end:x.end,inputId:w,start:x.start}}else p[b]=x}return m&&(p.inputs=[...f.keys()].map(b=>b.toJSON())),p}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(h=n){h.stringify&&(h=h.stringify);let f="";return h(this,p=>{f+=p}),f}warn(h,f,p={}){let m={node:this};for(let v in p)m[v]=p[v];return h.warn(f,m)}}return hT=l,l.default=l,hT}var dT,s9;function yS(){if(s9)return dT;s9=1;let t=bS();class e extends t{constructor(r){super(r),this.type="comment"}}return dT=e,e.default=e,dT}var fT,a9;function xS(){if(a9)return fT;a9=1;let t=bS();class e extends t{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(r){r&&typeof r.value<"u"&&typeof r.value!="string"&&(r={...r,value:String(r.value)}),super(r),this.type="decl"}}return fT=e,e.default=e,fT}var pT,o9;function Af(){if(o9)return pT;o9=1;let t=yS(),e=xS(),n=bS(),{isClean:r,my:i}=AE(),s,o,l,u;function h(m){return m.map(v=>(v.nodes&&(v.nodes=h(v.nodes)),delete v.source,v))}function f(m){if(m[r]=!1,m.proxyOf.nodes)for(let v of m.proxyOf.nodes)f(v)}class p extends n{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...v){for(let b of v){let x=this.normalize(b,this.last);for(let w of x)this.proxyOf.nodes.push(w)}return this.markDirty(),this}cleanRaws(v){if(super.cleanRaws(v),this.nodes)for(let b of this.nodes)b.cleanRaws(v)}each(v){if(!this.proxyOf.nodes)return;let b=this.getIterator(),x,w;for(;this.indexes[b]<this.proxyOf.nodes.length&&(x=this.indexes[b],w=v(this.proxyOf.nodes[x],x),w!==!1);)this.indexes[b]+=1;return delete this.indexes[b],w}every(v){return this.nodes.every(v)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let v=this.lastEach;return this.indexes[v]=0,v}getProxyProcessor(){return{get(v,b){return b==="proxyOf"?v:v[b]?b==="each"||typeof b=="string"&&b.startsWith("walk")?(...x)=>v[b](...x.map(w=>typeof w=="function"?(S,_)=>w(S.toProxy(),_):w)):b==="every"||b==="some"?x=>v[b]((w,...S)=>x(w.toProxy(),...S)):b==="root"?()=>v.root().toProxy():b==="nodes"?v.nodes.map(x=>x.toProxy()):b==="first"||b==="last"?v[b].toProxy():v[b]:v[b]},set(v,b,x){return v[b]===x||(v[b]=x,(b==="name"||b==="params"||b==="selector")&&v.markDirty()),!0}}}index(v){return typeof v=="number"?v:(v.proxyOf&&(v=v.proxyOf),this.proxyOf.nodes.indexOf(v))}insertAfter(v,b){let x=this.index(v),w=this.normalize(b,this.proxyOf.nodes[x]).reverse();x=this.index(v);for(let _ of w)this.proxyOf.nodes.splice(x+1,0,_);let S;for(let _ in this.indexes)S=this.indexes[_],x<S&&(this.indexes[_]=S+w.length);return this.markDirty(),this}insertBefore(v,b){let x=this.index(v),w=x===0?"prepend":!1,S=this.normalize(b,this.proxyOf.nodes[x],w).reverse();x=this.index(v);for(let T of S)this.proxyOf.nodes.splice(x,0,T);let _;for(let T in this.indexes)_=this.indexes[T],x<=_&&(this.indexes[T]=_+S.length);return this.markDirty(),this}normalize(v,b){if(typeof v=="string")v=h(o(v).nodes);else if(typeof v>"u")v=[];else if(Array.isArray(v)){v=v.slice(0);for(let w of v)w.parent&&w.parent.removeChild(w,"ignore")}else if(v.type==="root"&&this.type!=="document"){v=v.nodes.slice(0);for(let w of v)w.parent&&w.parent.removeChild(w,"ignore")}else if(v.type)v=[v];else if(v.prop){if(typeof v.value>"u")throw new Error("Value field is missed in node creation");typeof v.value!="string"&&(v.value=String(v.value)),v=[new e(v)]}else if(v.selector||v.selectors)v=[new u(v)];else if(v.name)v=[new s(v)];else if(v.text)v=[new t(v)];else throw new Error("Unknown node type in node creation");return v.map(w=>(w[i]||p.rebuild(w),w=w.proxyOf,w.parent&&w.parent.removeChild(w),w[r]&&f(w),w.raws||(w.raws={}),typeof w.raws.before>"u"&&b&&typeof b.raws.before<"u"&&(w.raws.before=b.raws.before.replace(/\S/g,"")),w.parent=this.proxyOf,w))}prepend(...v){v=v.reverse();for(let b of v){let x=this.normalize(b,this.first,"prepend").reverse();for(let w of x)this.proxyOf.nodes.unshift(w);for(let w in this.indexes)this.indexes[w]=this.indexes[w]+x.length}return this.markDirty(),this}push(v){return v.parent=this,this.proxyOf.nodes.push(v),this}removeAll(){for(let v of this.proxyOf.nodes)v.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(v){v=this.index(v),this.proxyOf.nodes[v].parent=void 0,this.proxyOf.nodes.splice(v,1);let b;for(let x in this.indexes)b=this.indexes[x],b>=v&&(this.indexes[x]=b-1);return this.markDirty(),this}replaceValues(v,b,x){return x||(x=b,b={}),this.walkDecls(w=>{b.props&&!b.props.includes(w.prop)||b.fast&&!w.value.includes(b.fast)||(w.value=w.value.replace(v,x))}),this.markDirty(),this}some(v){return this.nodes.some(v)}walk(v){return this.each((b,x)=>{let w;try{w=v(b,x)}catch(S){throw b.addToError(S)}return w!==!1&&b.walk&&(w=b.walk(v)),w})}walkAtRules(v,b){return b?v instanceof RegExp?this.walk((x,w)=>{if(x.type==="atrule"&&v.test(x.name))return b(x,w)}):this.walk((x,w)=>{if(x.type==="atrule"&&x.name===v)return b(x,w)}):(b=v,this.walk((x,w)=>{if(x.type==="atrule")return b(x,w)}))}walkComments(v){return this.walk((b,x)=>{if(b.type==="comment")return v(b,x)})}walkDecls(v,b){return b?v instanceof RegExp?this.walk((x,w)=>{if(x.type==="decl"&&v.test(x.prop))return b(x,w)}):this.walk((x,w)=>{if(x.type==="decl"&&x.prop===v)return b(x,w)}):(b=v,this.walk((x,w)=>{if(x.type==="decl")return b(x,w)}))}walkRules(v,b){return b?v instanceof RegExp?this.walk((x,w)=>{if(x.type==="rule"&&v.test(x.selector))return b(x,w)}):this.walk((x,w)=>{if(x.type==="rule"&&x.selector===v)return b(x,w)}):(b=v,this.walk((x,w)=>{if(x.type==="rule")return b(x,w)}))}}return p.registerParse=m=>{o=m},p.registerRule=m=>{u=m},p.registerAtRule=m=>{s=m},p.registerRoot=m=>{l=m},pT=p,p.default=p,p.rebuild=m=>{m.type==="atrule"?Object.setPrototypeOf(m,s.prototype):m.type==="rule"?Object.setPrototypeOf(m,u.prototype):m.type==="decl"?Object.setPrototypeOf(m,e.prototype):m.type==="comment"?Object.setPrototypeOf(m,t.prototype):m.type==="root"&&Object.setPrototypeOf(m,l.prototype),m[i]=!0,m.nodes&&m.nodes.forEach(v=>{p.rebuild(v)})},pT}var mT,l9;function ME(){if(l9)return mT;l9=1;let t=Af();class e extends t{constructor(r){super(r),this.type="atrule"}append(...r){return this.proxyOf.nodes||(this.nodes=[]),super.append(...r)}prepend(...r){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...r)}}return mT=e,e.default=e,t.registerAtRule(e),mT}var gT,c9;function RE(){if(c9)return gT;c9=1;let t=Af(),e,n;class r extends t{constructor(s){super({type:"document",...s}),this.nodes||(this.nodes=[])}toResult(s={}){return new e(new n,this,s).stringify()}}return r.registerLazyResult=i=>{e=i},r.registerProcessor=i=>{n=i},gT=r,r.default=r,gT}var vT,u9;function S1e(){if(u9)return vT;u9=1;let t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return vT={nanoid:(r=21)=>{let i="",s=r|0;for(;s--;)i+=t[Math.random()*64|0];return i},customAlphabet:(r,i=21)=>(s=i)=>{let o="",l=s|0;for(;l--;)o+=r[Math.random()*r.length|0];return o}},vT}var bT,h9;function WV(){if(h9)return bT;h9=1;let{existsSync:t,readFileSync:e}=sl,{dirname:n,join:r}=sl,{SourceMapConsumer:i,SourceMapGenerator:s}=sl;function o(u){return Buffer?Buffer.from(u,"base64").toString():window.atob(u)}class l{constructor(h,f){if(f.map===!1)return;this.loadAnnotation(h),this.inline=this.startWith(this.annotation,"data:");let p=f.map?f.map.prev:void 0,m=this.loadMap(f.from,p);!this.mapFile&&f.from&&(this.mapFile=f.from),this.mapFile&&(this.root=n(this.mapFile)),m&&(this.text=m)}consumer(){return this.consumerCache||(this.consumerCache=new i(this.text)),this.consumerCache}decodeInline(h){let f=/^data:application\/json;charset=utf-?8;base64,/,p=/^data:application\/json;base64,/,m=/^data:application\/json;charset=utf-?8,/,v=/^data:application\/json,/,b=h.match(m)||h.match(v);if(b)return decodeURIComponent(h.substr(b[0].length));let x=h.match(f)||h.match(p);if(x)return o(h.substr(x[0].length));let w=h.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+w)}getAnnotationURL(h){return h.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(h){return typeof h!="object"?!1:typeof h.mappings=="string"||typeof h._mappings=="string"||Array.isArray(h.sections)}loadAnnotation(h){let f=h.match(/\/\*\s*# sourceMappingURL=/g);if(!f)return;let p=h.lastIndexOf(f.pop()),m=h.indexOf("*/",p);p>-1&&m>-1&&(this.annotation=this.getAnnotationURL(h.substring(p,m)))}loadFile(h){if(this.root=n(h),t(h))return this.mapFile=h,e(h,"utf-8").toString().trim()}loadMap(h,f){if(f===!1)return!1;if(f){if(typeof f=="string")return f;if(typeof f=="function"){let p=f(h);if(p){let m=this.loadFile(p);if(!m)throw new Error("Unable to load previous source map: "+p.toString());return m}}else{if(f instanceof i)return s.fromSourceMap(f).toString();if(f instanceof s)return f.toString();if(this.isMap(f))return JSON.stringify(f);throw new Error("Unsupported previous source map format: "+f.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let p=this.annotation;return h&&(p=r(n(h),p)),this.loadFile(p)}}}startWith(h,f){return h?h.substr(0,f.length)===f:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return bT=l,l.default=l,bT}var yT,d9;function wS(){if(d9)return yT;d9=1;let{nanoid:t}=S1e(),{isAbsolute:e,resolve:n}=sl,{SourceMapConsumer:r,SourceMapGenerator:i}=sl,{fileURLToPath:s,pathToFileURL:o}=sl,l=EE(),u=WV(),h=sl,f=Symbol("lineToIndexCache"),p=!!(r&&i),m=!!(n&&e);function v(x){if(x[f])return x[f];let w=x.css.split(`
`),S=new Array(w.length),_=0;for(let T=0,C=w.length;T<C;T++)S[T]=_,_+=w[T].length+1;return x[f]=S,S}class b{get from(){return this.file||this.id}constructor(w,S={}){if(w===null||typeof w>"u"||typeof w=="object"&&!w.toString)throw new Error(`PostCSS received ${w} instead of CSS string`);if(this.css=w.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,S.document&&(this.document=S.document.toString()),S.from&&(!m||/^\w+:\/\//.test(S.from)||e(S.from)?this.file=S.from:this.file=n(S.from)),m&&p){let _=new u(this.css,S);if(_.text){this.map=_;let T=_.consumer().file;!this.file&&T&&(this.file=this.mapResolve(T))}}this.file||(this.id="<input css "+t(6)+">"),this.map&&(this.map.file=this.from)}error(w,S,_,T={}){let C,j,A,E,R;if(S&&typeof S=="object"){let $=S,D=_;if(typeof $.offset=="number"){E=$.offset;let F=this.fromOffset(E);S=F.line,_=F.col}else S=$.line,_=$.column,E=this.fromLineAndColumn(S,_);if(typeof D.offset=="number"){A=D.offset;let F=this.fromOffset(A);j=F.line,C=F.col}else j=D.line,C=D.column,A=this.fromLineAndColumn(D.line,D.column)}else if(_)E=this.fromLineAndColumn(S,_);else{E=S;let $=this.fromOffset(E);S=$.line,_=$.col}let N=this.origin(S,_,j,C);return N?R=new l(w,N.endLine===void 0?N.line:{column:N.column,line:N.line},N.endLine===void 0?N.column:{column:N.endColumn,line:N.endLine},N.source,N.file,T.plugin):R=new l(w,j===void 0?S:{column:_,line:S},j===void 0?_:{column:C,line:j},this.css,this.file,T.plugin),R.input={column:_,endColumn:C,endLine:j,endOffset:A,line:S,offset:E,source:this.css},this.file&&(o&&(R.input.url=o(this.file).toString()),R.input.file=this.file),R}fromLineAndColumn(w,S){return v(this)[w-1]+S-1}fromOffset(w){let S=v(this),_=S[S.length-1],T=0;if(w>=_)T=S.length-1;else{let C=S.length-2,j;for(;T<C;)if(j=T+(C-T>>1),w<S[j])C=j-1;else if(w>=S[j+1])T=j+1;else{T=j;break}}return{col:w-S[T]+1,line:T+1}}mapResolve(w){return/^\w+:\/\//.test(w)?w:n(this.map.consumer().sourceRoot||this.map.root||".",w)}origin(w,S,_,T){if(!this.map)return!1;let C=this.map.consumer(),j=C.originalPositionFor({column:S,line:w});if(!j.source)return!1;let A;typeof _=="number"&&(A=C.originalPositionFor({column:T,line:_}));let E;e(j.source)?E=o(j.source):E=new URL(j.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let R={column:j.column,endColumn:A&&A.column,endLine:A&&A.line,line:j.line,url:E.toString()};if(E.protocol==="file:")if(s)R.file=s(E);else throw new Error("file: protocol is not available in this PostCSS build");let N=C.sourceContentFor(j.source);return N&&(R.source=N),R}toJSON(){let w={};for(let S of["hasBOM","css","file","id"])this[S]!=null&&(w[S]=this[S]);return this.map&&(w.map={...this.map},w.map.consumerCache&&(w.map.consumerCache=void 0)),w}}return yT=b,b.default=b,h&&h.registerInput&&h.registerInput(b),yT}var xT,f9;function pb(){if(f9)return xT;f9=1;let t=Af(),e,n;class r extends t{constructor(s){super(s),this.type="root",this.nodes||(this.nodes=[])}normalize(s,o,l){let u=super.normalize(s);if(o){if(l==="prepend")this.nodes.length>1?o.raws.before=this.nodes[1].raws.before:delete o.raws.before;else if(this.first!==o)for(let h of u)h.raws.before=o.raws.before}return u}removeChild(s,o){let l=this.index(s);return!o&&l===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[l].raws.before),super.removeChild(s)}toResult(s={}){return new e(new n,this,s).stringify()}}return r.registerLazyResult=i=>{e=i},r.registerProcessor=i=>{n=i},xT=r,r.default=r,t.registerRoot(r),xT}var wT,p9;function YV(){if(p9)return wT;p9=1;let t={comma(e){return t.split(e,[","],!0)},space(e){let n=[" ",`
`,"	"];return t.split(e,n)},split(e,n,r){let i=[],s="",o=!1,l=0,u=!1,h="",f=!1;for(let p of e)f?f=!1:p==="\\"?f=!0:u?p===h&&(u=!1):p==='"'||p==="'"?(u=!0,h=p):p==="("?l+=1:p===")"?l>0&&(l-=1):l===0&&n.includes(p)&&(o=!0),o?(s!==""&&i.push(s.trim()),s="",o=!1):s+=p;return(r||s!=="")&&i.push(s.trim()),i}};return wT=t,t.default=t,wT}var ST,m9;function DE(){if(m9)return ST;m9=1;let t=Af(),e=YV();class n extends t{get selectors(){return e.comma(this.selector)}set selectors(i){let s=this.selector?this.selector.match(/,\s*/):null,o=s?s[0]:","+this.raw("between","beforeOpen");this.selector=i.join(o)}constructor(i){super(i),this.type="rule",this.nodes||(this.nodes=[])}}return ST=n,n.default=n,t.registerRule(n),ST}var jT,g9;function j1e(){if(g9)return jT;g9=1;let t=ME(),e=yS(),n=xS(),r=wS(),i=WV(),s=pb(),o=DE();function l(u,h){if(Array.isArray(u))return u.map(m=>l(m));let{inputs:f,...p}=u;if(f){h=[];for(let m of f){let v={...m,__proto__:r.prototype};v.map&&(v.map={...v.map,__proto__:i.prototype}),h.push(v)}}if(p.nodes&&(p.nodes=u.nodes.map(m=>l(m,h))),p.source){let{inputId:m,...v}=p.source;p.source=v,m!=null&&(p.source.input=h[m])}if(p.type==="root")return new s(p);if(p.type==="decl")return new n(p);if(p.type==="rule")return new o(p);if(p.type==="comment")return new e(p);if(p.type==="atrule")return new t(p);throw new Error("Unknown node type: "+u.type)}return jT=l,l.default=l,jT}var _T,v9;function XV(){if(v9)return _T;v9=1;let{dirname:t,relative:e,resolve:n,sep:r}=sl,{SourceMapConsumer:i,SourceMapGenerator:s}=sl,{pathToFileURL:o}=sl,l=wS(),u=!!(i&&s),h=!!(t&&n&&e&&r);class f{constructor(m,v,b,x){this.stringify=m,this.mapOpts=b.map||{},this.root=v,this.opts=b,this.css=x,this.originalCSS=x,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let m;this.isInline()?m="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?m=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?m=this.mapOpts.annotation(this.opts.to,this.root):m=this.outputFile()+".map";let v=`
`;this.css.includes(`\r
`)&&(v=`\r
`),this.css+=v+"/*# sourceMappingURL="+m+" */"}applyPrevMaps(){for(let m of this.previous()){let v=this.toUrl(this.path(m.file)),b=m.root||t(m.file),x;this.mapOpts.sourcesContent===!1?(x=new i(m.text),x.sourcesContent&&(x.sourcesContent=null)):x=m.consumer(),this.map.applySourceMap(x,v,this.toUrl(this.path(b)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let m;for(let v=this.root.nodes.length-1;v>=0;v--)m=this.root.nodes[v],m.type==="comment"&&m.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(v)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),h&&u&&this.isMap())return this.generateMap();{let m="";return this.stringify(this.root,v=>{m+=v}),[m]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let m=this.previous()[0].consumer();m.file=this.outputFile(),this.map=s.fromSourceMap(m,{ignoreInvalidMapping:!0})}else this.map=new s({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new s({file:this.outputFile(),ignoreInvalidMapping:!0});let m=1,v=1,b="<no source>",x={generated:{column:0,line:0},original:{column:0,line:0},source:""},w,S;this.stringify(this.root,(_,T,C)=>{if(this.css+=_,T&&C!=="end"&&(x.generated.line=m,x.generated.column=v-1,T.source&&T.source.start?(x.source=this.sourcePath(T),x.original.line=T.source.start.line,x.original.column=T.source.start.column-1,this.map.addMapping(x)):(x.source=b,x.original.line=1,x.original.column=0,this.map.addMapping(x))),S=_.match(/\n/g),S?(m+=S.length,w=_.lastIndexOf(`
`),v=_.length-w):v+=_.length,T&&C!=="start"){let j=T.parent||{raws:{}};(!(T.type==="decl"||T.type==="atrule"&&!T.nodes)||T!==j.last||j.raws.semicolon)&&(T.source&&T.source.end?(x.source=this.sourcePath(T),x.original.line=T.source.end.line,x.original.column=T.source.end.column-1,x.generated.line=m,x.generated.column=v-2,this.map.addMapping(x)):(x.source=b,x.original.line=1,x.original.column=0,x.generated.line=m,x.generated.column=v-1,this.map.addMapping(x)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(m=>m.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let m=this.mapOpts.annotation;return typeof m<"u"&&m!==!0?!1:this.previous().length?this.previous().some(v=>v.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(m=>m.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(m){if(this.mapOpts.absolute||m.charCodeAt(0)===60||/^\w+:\/\//.test(m))return m;let v=this.memoizedPaths.get(m);if(v)return v;let b=this.opts.to?t(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(b=t(n(b,this.mapOpts.annotation)));let x=e(b,m);return this.memoizedPaths.set(m,x),x}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(m=>{if(m.source&&m.source.input.map){let v=m.source.input.map;this.previousMaps.includes(v)||this.previousMaps.push(v)}});else{let m=new l(this.originalCSS,this.opts);m.map&&this.previousMaps.push(m.map)}return this.previousMaps}setSourcesContent(){let m={};if(this.root)this.root.walk(v=>{if(v.source){let b=v.source.input.from;if(b&&!m[b]){m[b]=!0;let x=this.usesFileUrls?this.toFileUrl(b):this.toUrl(this.path(b));this.map.setSourceContent(x,v.source.input.css)}}});else if(this.css){let v=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(v,this.css)}}sourcePath(m){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(m.source.input.from):this.toUrl(this.path(m.source.input.from))}toBase64(m){return Buffer?Buffer.from(m).toString("base64"):window.btoa(unescape(encodeURIComponent(m)))}toFileUrl(m){let v=this.memoizedFileURLs.get(m);if(v)return v;if(o){let b=o(m).toString();return this.memoizedFileURLs.set(m,b),b}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(m){let v=this.memoizedURLs.get(m);if(v)return v;r==="\\"&&(m=m.replace(/\\/g,"/"));let b=encodeURI(m).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(m,b),b}}return _T=f,_T}var TT,b9;function _1e(){if(b9)return TT;b9=1;const t=39,e=34,n=92,r=47,i=10,s=32,o=12,l=9,u=13,h=91,f=93,p=40,m=41,v=123,b=125,x=59,w=42,S=58,_=64,T=/[\t\n\f\r "#'()/;[\\\]{}]/g,C=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,j=/.[\r\n"'(/\\]/,A=/[\da-f]/i;return TT=function(R,N={}){let $=R.css.valueOf(),D=N.ignoreErrors,F,Q,H,q,P,I,U,Z,X,V,G=$.length,W=0,te=[],oe=[];function be(){return W}function ye(ae){throw R.error("Unclosed "+ae,W)}function Ke(){return oe.length===0&&W>=G}function Fe(ae){if(oe.length)return oe.pop();if(W>=G)return;let Te=ae?ae.ignoreUnclosed:!1;switch(F=$.charCodeAt(W),F){case i:case s:case l:case u:case o:{q=W;do q+=1,F=$.charCodeAt(q);while(F===s||F===i||F===l||F===u||F===o);I=["space",$.slice(W,q)],W=q-1;break}case h:case f:case v:case b:case S:case x:case m:{let fe=String.fromCharCode(F);I=[fe,fe,W];break}case p:{if(V=te.length?te.pop()[1]:"",X=$.charCodeAt(W+1),V==="url"&&X!==t&&X!==e&&X!==s&&X!==i&&X!==l&&X!==o&&X!==u){q=W;do{if(U=!1,q=$.indexOf(")",q+1),q===-1)if(D||Te){q=W;break}else ye("bracket");for(Z=q;$.charCodeAt(Z-1)===n;)Z-=1,U=!U}while(U);I=["brackets",$.slice(W,q+1),W,q],W=q}else q=$.indexOf(")",W+1),Q=$.slice(W,q+1),q===-1||j.test(Q)?I=["(","(",W]:(I=["brackets",Q,W,q],W=q);break}case t:case e:{P=F===t?"'":'"',q=W;do{if(U=!1,q=$.indexOf(P,q+1),q===-1)if(D||Te){q=W+1;break}else ye("string");for(Z=q;$.charCodeAt(Z-1)===n;)Z-=1,U=!U}while(U);I=["string",$.slice(W,q+1),W,q],W=q;break}case _:{T.lastIndex=W+1,T.test($),T.lastIndex===0?q=$.length-1:q=T.lastIndex-2,I=["at-word",$.slice(W,q+1),W,q],W=q;break}case n:{for(q=W,H=!0;$.charCodeAt(q+1)===n;)q+=1,H=!H;if(F=$.charCodeAt(q+1),H&&F!==r&&F!==s&&F!==i&&F!==l&&F!==u&&F!==o&&(q+=1,A.test($.charAt(q)))){for(;A.test($.charAt(q+1));)q+=1;$.charCodeAt(q+1)===s&&(q+=1)}I=["word",$.slice(W,q+1),W,q],W=q;break}default:{F===r&&$.charCodeAt(W+1)===w?(q=$.indexOf("*/",W+2)+1,q===0&&(D||Te?q=$.length:ye("comment")),I=["comment",$.slice(W,q+1),W,q],W=q):(C.lastIndex=W+1,C.test($),C.lastIndex===0?q=$.length-1:q=C.lastIndex-2,I=["word",$.slice(W,q+1),W,q],te.push(I),W=q);break}}return W++,I}function Pe(ae){oe.push(ae)}return{back:Pe,endOfFile:Ke,nextToken:Fe,position:be}},TT}var CT,y9;function T1e(){if(y9)return CT;y9=1;let t=ME(),e=yS(),n=xS(),r=pb(),i=DE(),s=_1e();const o={empty:!0,space:!0};function l(h){for(let f=h.length-1;f>=0;f--){let p=h[f],m=p[3]||p[2];if(m)return m}}class u{constructor(f){this.input=f,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:f,start:{column:1,line:1,offset:0}}}atrule(f){let p=new t;p.name=f[1].slice(1),p.name===""&&this.unnamedAtrule(p,f),this.init(p,f[2]);let m,v,b,x=!1,w=!1,S=[],_=[];for(;!this.tokenizer.endOfFile();){if(f=this.tokenizer.nextToken(),m=f[0],m==="("||m==="["?_.push(m==="("?")":"]"):m==="{"&&_.length>0?_.push("}"):m===_[_.length-1]&&_.pop(),_.length===0)if(m===";"){p.source.end=this.getPosition(f[2]),p.source.end.offset++,this.semicolon=!0;break}else if(m==="{"){w=!0;break}else if(m==="}"){if(S.length>0){for(b=S.length-1,v=S[b];v&&v[0]==="space";)v=S[--b];v&&(p.source.end=this.getPosition(v[3]||v[2]),p.source.end.offset++)}this.end(f);break}else S.push(f);else S.push(f);if(this.tokenizer.endOfFile()){x=!0;break}}p.raws.between=this.spacesAndCommentsFromEnd(S),S.length?(p.raws.afterName=this.spacesAndCommentsFromStart(S),this.raw(p,"params",S),x&&(f=S[S.length-1],p.source.end=this.getPosition(f[3]||f[2]),p.source.end.offset++,this.spaces=p.raws.between,p.raws.between="")):(p.raws.afterName="",p.params=""),w&&(p.nodes=[],this.current=p)}checkMissedSemicolon(f){let p=this.colon(f);if(p===!1)return;let m=0,v;for(let b=p-1;b>=0&&(v=f[b],!(v[0]!=="space"&&(m+=1,m===2)));b--);throw this.input.error("Missed semicolon",v[0]==="word"?v[3]+1:v[2])}colon(f){let p=0,m,v,b;for(let[x,w]of f.entries()){if(v=w,b=v[0],b==="("&&(p+=1),b===")"&&(p-=1),p===0&&b===":")if(!m)this.doubleColon(v);else{if(m[0]==="word"&&m[1]==="progid")continue;return x}m=v}return!1}comment(f){let p=new e;this.init(p,f[2]),p.source.end=this.getPosition(f[3]||f[2]),p.source.end.offset++;let m=f[1].slice(2,-2);if(/^\s*$/.test(m))p.text="",p.raws.left=m,p.raws.right="";else{let v=m.match(/^(\s*)([^]*\S)(\s*)$/);p.text=v[2],p.raws.left=v[1],p.raws.right=v[3]}}createTokenizer(){this.tokenizer=s(this.input)}decl(f,p){let m=new n;this.init(m,f[0][2]);let v=f[f.length-1];for(v[0]===";"&&(this.semicolon=!0,f.pop()),m.source.end=this.getPosition(v[3]||v[2]||l(f)),m.source.end.offset++;f[0][0]!=="word";)f.length===1&&this.unknownWord(f),m.raws.before+=f.shift()[1];for(m.source.start=this.getPosition(f[0][2]),m.prop="";f.length;){let _=f[0][0];if(_===":"||_==="space"||_==="comment")break;m.prop+=f.shift()[1]}m.raws.between="";let b;for(;f.length;)if(b=f.shift(),b[0]===":"){m.raws.between+=b[1];break}else b[0]==="word"&&/\w/.test(b[1])&&this.unknownWord([b]),m.raws.between+=b[1];(m.prop[0]==="_"||m.prop[0]==="*")&&(m.raws.before+=m.prop[0],m.prop=m.prop.slice(1));let x=[],w;for(;f.length&&(w=f[0][0],!(w!=="space"&&w!=="comment"));)x.push(f.shift());this.precheckMissedSemicolon(f);for(let _=f.length-1;_>=0;_--){if(b=f[_],b[1].toLowerCase()==="!important"){m.important=!0;let T=this.stringFrom(f,_);T=this.spacesFromEnd(f)+T,T!==" !important"&&(m.raws.important=T);break}else if(b[1].toLowerCase()==="important"){let T=f.slice(0),C="";for(let j=_;j>0;j--){let A=T[j][0];if(C.trim().startsWith("!")&&A!=="space")break;C=T.pop()[1]+C}C.trim().startsWith("!")&&(m.important=!0,m.raws.important=C,f=T)}if(b[0]!=="space"&&b[0]!=="comment")break}f.some(_=>_[0]!=="space"&&_[0]!=="comment")&&(m.raws.between+=x.map(_=>_[1]).join(""),x=[]),this.raw(m,"value",x.concat(f),p),m.value.includes(":")&&!p&&this.checkMissedSemicolon(f)}doubleColon(f){throw this.input.error("Double colon",{offset:f[2]},{offset:f[2]+f[1].length})}emptyRule(f){let p=new i;this.init(p,f[2]),p.selector="",p.raws.between="",this.current=p}end(f){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(f[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(f)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(f){if(this.spaces+=f[1],this.current.nodes){let p=this.current.nodes[this.current.nodes.length-1];p&&p.type==="rule"&&!p.raws.ownSemicolon&&(p.raws.ownSemicolon=this.spaces,this.spaces="",p.source.end=this.getPosition(f[2]),p.source.end.offset+=p.raws.ownSemicolon.length)}}getPosition(f){let p=this.input.fromOffset(f);return{column:p.col,line:p.line,offset:f}}init(f,p){this.current.push(f),f.source={input:this.input,start:this.getPosition(p)},f.raws.before=this.spaces,this.spaces="",f.type!=="comment"&&(this.semicolon=!1)}other(f){let p=!1,m=null,v=!1,b=null,x=[],w=f[1].startsWith("--"),S=[],_=f;for(;_;){if(m=_[0],S.push(_),m==="("||m==="[")b||(b=_),x.push(m==="("?")":"]");else if(w&&v&&m==="{")b||(b=_),x.push("}");else if(x.length===0)if(m===";")if(v){this.decl(S,w);return}else break;else if(m==="{"){this.rule(S);return}else if(m==="}"){this.tokenizer.back(S.pop()),p=!0;break}else m===":"&&(v=!0);else m===x[x.length-1]&&(x.pop(),x.length===0&&(b=null));_=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(p=!0),x.length>0&&this.unclosedBracket(b),p&&v){if(!w)for(;S.length&&(_=S[S.length-1][0],!(_!=="space"&&_!=="comment"));)this.tokenizer.back(S.pop());this.decl(S,w)}else this.unknownWord(S)}parse(){let f;for(;!this.tokenizer.endOfFile();)switch(f=this.tokenizer.nextToken(),f[0]){case"space":this.spaces+=f[1];break;case";":this.freeSemicolon(f);break;case"}":this.end(f);break;case"comment":this.comment(f);break;case"at-word":this.atrule(f);break;case"{":this.emptyRule(f);break;default:this.other(f);break}this.endFile()}precheckMissedSemicolon(){}raw(f,p,m,v){let b,x,w=m.length,S="",_=!0,T,C;for(let j=0;j<w;j+=1)b=m[j],x=b[0],x==="space"&&j===w-1&&!v?_=!1:x==="comment"?(C=m[j-1]?m[j-1][0]:"empty",T=m[j+1]?m[j+1][0]:"empty",!o[C]&&!o[T]?S.slice(-1)===","?_=!1:S+=b[1]:_=!1):S+=b[1];if(!_){let j=m.reduce((A,E)=>A+E[1],"");f.raws[p]={raw:j,value:S}}f[p]=S}rule(f){f.pop();let p=new i;this.init(p,f[0][2]),p.raws.between=this.spacesAndCommentsFromEnd(f),this.raw(p,"selector",f),this.current=p}spacesAndCommentsFromEnd(f){let p,m="";for(;f.length&&(p=f[f.length-1][0],!(p!=="space"&&p!=="comment"));)m=f.pop()[1]+m;return m}spacesAndCommentsFromStart(f){let p,m="";for(;f.length&&(p=f[0][0],!(p!=="space"&&p!=="comment"));)m+=f.shift()[1];return m}spacesFromEnd(f){let p,m="";for(;f.length&&(p=f[f.length-1][0],p==="space");)m=f.pop()[1]+m;return m}stringFrom(f,p){let m="";for(let v=p;v<f.length;v++)m+=f[v][1];return f.splice(p,f.length-p),m}unclosedBlock(){let f=this.current.source.start;throw this.input.error("Unclosed block",f.line,f.column)}unclosedBracket(f){throw this.input.error("Unclosed bracket",{offset:f[2]},{offset:f[2]+1})}unexpectedClose(f){throw this.input.error("Unexpected }",{offset:f[2]},{offset:f[2]+1})}unknownWord(f){throw this.input.error("Unknown word "+f[0][1],{offset:f[0][2]},{offset:f[0][2]+f[0][1].length})}unnamedAtrule(f,p){throw this.input.error("At-rule without name",{offset:p[2]},{offset:p[2]+p[1].length})}}return CT=u,CT}var kT,x9;function NE(){if(x9)return kT;x9=1;let t=Af(),e=wS(),n=T1e();function r(i,s){let o=new e(i,s),l=new n(o);try{l.parse()}catch(u){throw u}return l.root}return kT=r,r.default=r,t.registerParse(r),kT}var OT,w9;function GV(){if(w9)return OT;w9=1;class t{constructor(n,r={}){if(this.type="warning",this.text=n,r.node&&r.node.source){let i=r.node.rangeBy(r);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in r)this[i]=r[i]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return OT=t,t.default=t,OT}var ET,S9;function PE(){if(S9)return ET;S9=1;let t=GV();class e{get content(){return this.css}constructor(r,i,s){this.processor=r,this.messages=[],this.root=i,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(r,i={}){i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);let s=new t(r,i);return this.messages.push(s),s}warnings(){return this.messages.filter(r=>r.type==="warning")}}return ET=e,e.default=e,ET}var AT,j9;function KV(){if(j9)return AT;j9=1;let t=Af(),e=RE(),n=XV(),r=NE(),i=PE(),s=pb(),o=vS(),{isClean:l,my:u}=AE();const h={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},f={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0},m=0;function v(T){return typeof T=="object"&&typeof T.then=="function"}function b(T){let C=!1,j=h[T.type];return T.type==="decl"?C=T.prop.toLowerCase():T.type==="atrule"&&(C=T.name.toLowerCase()),C&&T.append?[j,j+"-"+C,m,j+"Exit",j+"Exit-"+C]:C?[j,j+"-"+C,j+"Exit",j+"Exit-"+C]:T.append?[j,m,j+"Exit"]:[j,j+"Exit"]}function x(T){let C;return T.type==="document"?C=["Document",m,"DocumentExit"]:T.type==="root"?C=["Root",m,"RootExit"]:C=b(T),{eventIndex:0,events:C,iterator:0,node:T,visitorIndex:0,visitors:[]}}function w(T){return T[l]=!1,T.nodes&&T.nodes.forEach(C=>w(C)),T}let S={};class _{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(C,j,A){this.stringified=!1,this.processed=!1;let E;if(typeof j=="object"&&j!==null&&(j.type==="root"||j.type==="document"))E=w(j);else if(j instanceof _||j instanceof i)E=w(j.root),j.map&&(typeof A.map>"u"&&(A.map={}),A.map.inline||(A.map.inline=!1),A.map.prev=j.map);else{let R=r;A.syntax&&(R=A.syntax.parse),A.parser&&(R=A.parser),R.parse&&(R=R.parse);try{E=R(j,A)}catch(N){this.processed=!0,this.error=N}E&&!E[u]&&t.rebuild(E)}this.result=new i(C,E,A),this.helpers={...S,postcss:S,result:this.result},this.plugins=this.processor.plugins.map(R=>typeof R=="object"&&R.prepare?{...R,...R.prepare(this.result)}:R)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(C){return this.async().catch(C)}finally(C){return this.async().then(C,C)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(C,j){let A=this.result.lastPlugin;try{j&&j.addToError(C),this.error=C,C.name==="CssSyntaxError"&&!C.plugin?(C.plugin=A.postcssPlugin,C.setMessage()):A.postcssVersion}catch(E){console&&console.error&&console.error(E)}return C}prepareVisitors(){this.listeners={};let C=(j,A,E)=>{this.listeners[A]||(this.listeners[A]=[]),this.listeners[A].push([j,E])};for(let j of this.plugins)if(typeof j=="object")for(let A in j){if(!f[A]&&/^[A-Z]/.test(A))throw new Error(`Unknown event ${A} in ${j.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[A])if(typeof j[A]=="object")for(let E in j[A])E==="*"?C(j,A,j[A][E]):C(j,A+"-"+E.toLowerCase(),j[A][E]);else typeof j[A]=="function"&&C(j,A,j[A])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let C=0;C<this.plugins.length;C++){let j=this.plugins[C],A=this.runOnRoot(j);if(v(A))try{await A}catch(E){throw this.handleError(E)}}if(this.prepareVisitors(),this.hasListener){let C=this.result.root;for(;!C[l];){C[l]=!0;let j=[x(C)];for(;j.length>0;){let A=this.visitTick(j);if(v(A))try{await A}catch(E){let R=j[j.length-1].node;throw this.handleError(E,R)}}}if(this.listeners.OnceExit)for(let[j,A]of this.listeners.OnceExit){this.result.lastPlugin=j;try{if(C.type==="document"){let E=C.nodes.map(R=>A(R,this.helpers));await Promise.all(E)}else await A(C,this.helpers)}catch(E){throw this.handleError(E)}}}return this.processed=!0,this.stringify()}runOnRoot(C){this.result.lastPlugin=C;try{if(typeof C=="object"&&C.Once){if(this.result.root.type==="document"){let j=this.result.root.nodes.map(A=>C.Once(A,this.helpers));return v(j[0])?Promise.all(j):j}return C.Once(this.result.root,this.helpers)}else if(typeof C=="function")return C(this.result.root,this.result)}catch(j){throw this.handleError(j)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let C=this.result.opts,j=o;C.syntax&&(j=C.syntax.stringify),C.stringifier&&(j=C.stringifier),j.stringify&&(j=j.stringify);let E=new n(j,this.result.root,this.result.opts).generate();return this.result.css=E[0],this.result.map=E[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let C of this.plugins){let j=this.runOnRoot(C);if(v(j))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let C=this.result.root;for(;!C[l];)C[l]=!0,this.walkSync(C);if(this.listeners.OnceExit)if(C.type==="document")for(let j of C.nodes)this.visitSync(this.listeners.OnceExit,j);else this.visitSync(this.listeners.OnceExit,C)}return this.result}then(C,j){return this.async().then(C,j)}toString(){return this.css}visitSync(C,j){for(let[A,E]of C){this.result.lastPlugin=A;let R;try{R=E(j,this.helpers)}catch(N){throw this.handleError(N,j.proxyOf)}if(j.type!=="root"&&j.type!=="document"&&!j.parent)return!0;if(v(R))throw this.getAsyncError()}}visitTick(C){let j=C[C.length-1],{node:A,visitors:E}=j;if(A.type!=="root"&&A.type!=="document"&&!A.parent){C.pop();return}if(E.length>0&&j.visitorIndex<E.length){let[N,$]=E[j.visitorIndex];j.visitorIndex+=1,j.visitorIndex===E.length&&(j.visitors=[],j.visitorIndex=0),this.result.lastPlugin=N;try{return $(A.toProxy(),this.helpers)}catch(D){throw this.handleError(D,A)}}if(j.iterator!==0){let N=j.iterator,$;for(;$=A.nodes[A.indexes[N]];)if(A.indexes[N]+=1,!$[l]){$[l]=!0,C.push(x($));return}j.iterator=0,delete A.indexes[N]}let R=j.events;for(;j.eventIndex<R.length;){let N=R[j.eventIndex];if(j.eventIndex+=1,N===m){A.nodes&&A.nodes.length&&(A[l]=!0,j.iterator=A.getIterator());return}else if(this.listeners[N]){j.visitors=this.listeners[N];return}}C.pop()}walkSync(C){C[l]=!0;let j=b(C);for(let A of j)if(A===m)C.nodes&&C.each(E=>{E[l]||this.walkSync(E)});else{let E=this.listeners[A];if(E&&this.visitSync(E,C.toProxy()))return}}warnings(){return this.sync().warnings()}}return _.registerPostcss=T=>{S=T},AT=_,_.default=_,s.registerLazyResult(_),e.registerLazyResult(_),AT}var MT,_9;function C1e(){if(_9)return MT;_9=1;let t=XV(),e=NE();const n=PE();let r=vS();class i{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let o,l=e;try{o=l(this._css,this._opts)}catch(u){this.error=u}if(this.error)throw this.error;return this._root=o,o}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(o,l,u){l=l.toString(),this.stringified=!1,this._processor=o,this._css=l,this._opts=u,this._map=void 0;let h,f=r;this.result=new n(this._processor,h,this._opts),this.result.css=l;let p=this;Object.defineProperty(this.result,"root",{get(){return p.root}});let m=new t(f,h,this._opts,l);if(m.isMap()){let[v,b]=m.generate();v&&(this.result.css=v),b&&(this.result.map=b)}else m.clearAnnotation(),this.result.css=m.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(o){return this.async().catch(o)}finally(o){return this.async().then(o,o)}sync(){if(this.error)throw this.error;return this.result}then(o,l){return this.async().then(o,l)}toString(){return this._css}warnings(){return[]}}return MT=i,i.default=i,MT}var RT,T9;function k1e(){if(T9)return RT;T9=1;let t=RE(),e=KV(),n=C1e(),r=pb();class i{constructor(o=[]){this.version="8.5.6",this.plugins=this.normalize(o)}normalize(o){let l=[];for(let u of o)if(u.postcss===!0?u=u():u.postcss&&(u=u.postcss),typeof u=="object"&&Array.isArray(u.plugins))l=l.concat(u.plugins);else if(typeof u=="object"&&u.postcssPlugin)l.push(u);else if(typeof u=="function")l.push(u);else if(!(typeof u=="object"&&(u.parse||u.stringify)))throw new Error(u+" is not a PostCSS plugin");return l}process(o,l={}){return!this.plugins.length&&!l.parser&&!l.stringifier&&!l.syntax?new n(this,o,l):new e(this,o,l)}use(o){return this.plugins=this.plugins.concat(this.normalize([o])),this}}return RT=i,i.default=i,r.registerProcessor(i),t.registerProcessor(i),RT}var DT,C9;function O1e(){if(C9)return DT;C9=1;var t={};let e=ME(),n=yS(),r=Af(),i=EE(),s=xS(),o=RE(),l=j1e(),u=wS(),h=KV(),f=YV(),p=bS(),m=NE(),v=k1e(),b=PE(),x=pb(),w=DE(),S=vS(),_=GV();function T(...C){return C.length===1&&Array.isArray(C[0])&&(C=C[0]),new v(C)}return T.plugin=function(j,A){let E=!1;function R(...$){console&&console.warn&&!E&&(E=!0,console.warn(j+`: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),t.LANG&&t.LANG.startsWith("cn")&&console.warn(j+`: 里面 postcss.plugin 被弃用. 迁移指南:
https://www.w3ctech.com/topic/2226`));let D=A(...$);return D.postcssPlugin=j,D.postcssVersion=new v().version,D}let N;return Object.defineProperty(R,"postcss",{get(){return N||(N=R()),N}}),R.process=function($,D,F){return T([R(F)]).process($,D)},R},T.stringify=S,T.parse=m,T.fromJSON=l,T.list=f,T.comment=C=>new n(C),T.atRule=C=>new e(C),T.decl=C=>new s(C),T.rule=C=>new w(C),T.root=C=>new x(C),T.document=C=>new o(C),T.CssSyntaxError=i,T.Declaration=s,T.Container=r,T.Processor=v,T.Document=o,T.Comment=n,T.Warning=_,T.AtRule=e,T.Result=b,T.Input=u,T.Rule=w,T.Root=x,T.Node=p,h.registerPostcss(T),DT=T,T.default=T,DT}var NT,k9;function E1e(){if(k9)return NT;k9=1;const t=f1e(),e=p1e(),{isPlainObject:n}=m1e(),r=g1e(),i=b1e(),{parse:s}=O1e(),o=["img","audio","video","picture","svg","object","map","iframe","embed"],l=["script","style"];function u(w,S){w&&Object.keys(w).forEach(function(_){S(w[_],_)})}function h(w,S){return{}.hasOwnProperty.call(w,S)}function f(w,S){const _=[];return u(w,function(T){S(T)&&_.push(T)}),_}function p(w){for(const S in w)if(h(w,S))return!1;return!0}function m(w){return w.map(function(S){if(!S.url)throw new Error("URL missing");return S.url+(S.w?` ${S.w}w`:"")+(S.h?` ${S.h}h`:"")+(S.d?` ${S.d}x`:"")}).join(", ")}NT=b;const v=/^[^\0\t\n\f\r /<=>]+$/;function b(w,S,_){if(w==null)return"";typeof w=="number"&&(w=w.toString());let T="",C="";function j(ae,Te){const fe=this;this.tag=ae,this.attribs=Te||{},this.tagPosition=T.length,this.text="",this.openingTagLength=0,this.mediaChildren=[],this.updateParentNodeText=function(){if(P.length){const Ee=P[P.length-1];Ee.text+=fe.text}},this.updateParentNodeMediaChildren=function(){P.length&&o.includes(this.tag)&&P[P.length-1].mediaChildren.push(this.tag)}}S=Object.assign({},b.defaults,S),S.parser=Object.assign({},x,S.parser);const A=function(ae){return S.allowedTags===!1||(S.allowedTags||[]).indexOf(ae)>-1};l.forEach(function(ae){A(ae)&&!S.allowVulnerableTags&&console.warn(`

⚠️ Your \`allowedTags\` option includes, \`${ae}\`, which is inherently
vulnerable to XSS attacks. Please remove it from \`allowedTags\`.
Or, to disable this warning, add the \`allowVulnerableTags\` option
and ensure you are accounting for this risk.

`)});const E=S.nonTextTags||["script","style","textarea","option"];let R,N;S.allowedAttributes&&(R={},N={},u(S.allowedAttributes,function(ae,Te){R[Te]=[];const fe=[];ae.forEach(function(Ee){typeof Ee=="string"&&Ee.indexOf("*")>=0?fe.push(e(Ee).replace(/\\\*/g,".*")):R[Te].push(Ee)}),fe.length&&(N[Te]=new RegExp("^("+fe.join("|")+")$"))}));const $={},D={},F={};u(S.allowedClasses,function(ae,Te){if(R&&(h(R,Te)||(R[Te]=[]),R[Te].push("class")),$[Te]=ae,Array.isArray(ae)){const fe=[];$[Te]=[],F[Te]=[],ae.forEach(function(Ee){typeof Ee=="string"&&Ee.indexOf("*")>=0?fe.push(e(Ee).replace(/\\\*/g,".*")):Ee instanceof RegExp?F[Te].push(Ee):$[Te].push(Ee)}),fe.length&&(D[Te]=new RegExp("^("+fe.join("|")+")$"))}});const Q={};let H;u(S.transformTags,function(ae,Te){let fe;typeof ae=="function"?fe=ae:typeof ae=="string"&&(fe=b.simpleTransform(ae)),Te==="*"?H=fe:Q[Te]=fe});let q,P,I,U,Z,X,V=!1;W();const G=new t.Parser({onopentag:function(ae,Te){if(S.onOpenTag&&S.onOpenTag(ae,Te),S.enforceHtmlBoundary&&ae==="html"&&W(),Z){X++;return}const fe=new j(ae,Te);P.push(fe);let Ee=!1;const gt=!!fe.text;let We;if(h(Q,ae)&&(We=Q[ae](ae,Te),fe.attribs=Te=We.attribs,We.text!==void 0&&(fe.innerText=We.text),ae!==We.tagName&&(fe.name=ae=We.tagName,U[q]=We.tagName)),H&&(We=H(ae,Te),fe.attribs=Te=We.attribs,ae!==We.tagName&&(fe.name=ae=We.tagName,U[q]=We.tagName)),(!A(ae)||S.disallowedTagsMode==="recursiveEscape"&&!p(I)||S.nestingLimit!=null&&q>=S.nestingLimit)&&(Ee=!0,I[q]=!0,(S.disallowedTagsMode==="discard"||S.disallowedTagsMode==="completelyDiscard")&&E.indexOf(ae)!==-1&&(Z=!0,X=1)),q++,Ee){if(S.disallowedTagsMode==="discard"||S.disallowedTagsMode==="completelyDiscard"){if(fe.innerText&&!gt){const De=te(fe.innerText);S.textFilter?T+=S.textFilter(De,ae):T+=De,V=!0}return}C=T,T=""}T+="<"+ae,ae==="script"&&(S.allowedScriptHostnames||S.allowedScriptDomains)&&(fe.innerText=""),Ee&&(S.disallowedTagsMode==="escape"||S.disallowedTagsMode==="recursiveEscape")&&S.preserveEscapedAttributes?u(Te,function(De,Ye){T+=" "+Ye+'="'+te(De||"",!0)+'"'}):(!R||h(R,ae)||R["*"])&&u(Te,function(De,Ye){if(!v.test(Ye)){delete fe.attribs[Ye];return}if(De===""&&!S.allowedEmptyAttributes.includes(Ye)&&(S.nonBooleanAttributes.includes(Ye)||S.nonBooleanAttributes.includes("*"))){delete fe.attribs[Ye];return}let $t=!1;if(!R||h(R,ae)&&R[ae].indexOf(Ye)!==-1||R["*"]&&R["*"].indexOf(Ye)!==-1||h(N,ae)&&N[ae].test(Ye)||N["*"]&&N["*"].test(Ye))$t=!0;else if(R&&R[ae]){for(const tt of R[ae])if(n(tt)&&tt.name&&tt.name===Ye){$t=!0;let et="";if(tt.multiple===!0){const Ve=De.split(" ");for(const Le of Ve)tt.values.indexOf(Le)!==-1&&(et===""?et=Le:et+=" "+Le)}else tt.values.indexOf(De)>=0&&(et=De);De=et}}if($t){if(S.allowedSchemesAppliedToAttributes.indexOf(Ye)!==-1&&oe(ae,De)){delete fe.attribs[Ye];return}if(ae==="script"&&Ye==="src"){let tt=!0;try{const et=be(De);if(S.allowedScriptHostnames||S.allowedScriptDomains){const Ve=(S.allowedScriptHostnames||[]).find(function(Ce){return Ce===et.url.hostname}),Le=(S.allowedScriptDomains||[]).find(function(Ce){return et.url.hostname===Ce||et.url.hostname.endsWith(`.${Ce}`)});tt=Ve||Le}}catch{tt=!1}if(!tt){delete fe.attribs[Ye];return}}if(ae==="iframe"&&Ye==="src"){let tt=!0;try{const et=be(De);if(et.isRelativeUrl)tt=h(S,"allowIframeRelativeUrls")?S.allowIframeRelativeUrls:!S.allowedIframeHostnames&&!S.allowedIframeDomains;else if(S.allowedIframeHostnames||S.allowedIframeDomains){const Ve=(S.allowedIframeHostnames||[]).find(function(Ce){return Ce===et.url.hostname}),Le=(S.allowedIframeDomains||[]).find(function(Ce){return et.url.hostname===Ce||et.url.hostname.endsWith(`.${Ce}`)});tt=Ve||Le}}catch{tt=!1}if(!tt){delete fe.attribs[Ye];return}}if(Ye==="srcset")try{let tt=i(De);if(tt.forEach(function(et){oe("srcset",et.url)&&(et.evil=!0)}),tt=f(tt,function(et){return!et.evil}),tt.length)De=m(f(tt,function(et){return!et.evil})),fe.attribs[Ye]=De;else{delete fe.attribs[Ye];return}}catch{delete fe.attribs[Ye];return}if(Ye==="class"){const tt=$[ae],et=$["*"],Ve=D[ae],Le=F[ae],Ce=F["*"],ge=D["*"],Kt=[Ve,ge].concat(Le,Ce).filter(function(qn){return qn});if(tt&&et?De=Pe(De,r(tt,et),Kt):De=Pe(De,tt||et,Kt),!De.length){delete fe.attribs[Ye];return}}if(Ye==="style"){if(S.parseStyleAttributes)try{const tt=s(ae+" {"+De+"}",{map:!1}),et=ye(tt,S.allowedStyles);if(De=Ke(et),De.length===0){delete fe.attribs[Ye];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+ae+" {"+De+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete fe.attribs[Ye];return}else if(S.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}T+=" "+Ye,De&&De.length?T+='="'+te(De,!0)+'"':S.allowedEmptyAttributes.includes(Ye)&&(T+='=""')}else delete fe.attribs[Ye]}),S.selfClosing.indexOf(ae)!==-1?T+=" />":(T+=">",fe.innerText&&!gt&&!S.textFilter&&(T+=te(fe.innerText),V=!0)),Ee&&(T=C+te(T),C=""),fe.openingTagLength=T.length-fe.tagPosition},ontext:function(ae){if(Z)return;const Te=P[P.length-1];let fe;if(Te&&(fe=Te.tag,ae=Te.innerText!==void 0?Te.innerText:ae),S.disallowedTagsMode==="completelyDiscard"&&!A(fe))ae="";else if((S.disallowedTagsMode==="discard"||S.disallowedTagsMode==="completelyDiscard")&&(fe==="script"||fe==="style"))T+=ae;else if(!V){const Ee=te(ae,!1);S.textFilter?T+=S.textFilter(Ee,fe):T+=Ee}if(P.length){const Ee=P[P.length-1];Ee.text+=ae}},onclosetag:function(ae,Te){if(S.onCloseTag&&S.onCloseTag(ae,Te),Z)if(X--,!X)Z=!1;else return;const fe=P.pop();if(!fe)return;if(fe.tag!==ae){P.push(fe);return}Z=S.enforceHtmlBoundary?ae==="html":!1,q--;const Ee=I[q];if(Ee){if(delete I[q],S.disallowedTagsMode==="discard"||S.disallowedTagsMode==="completelyDiscard"){fe.updateParentNodeText();return}C=T,T=""}if(U[q]&&(ae=U[q],delete U[q]),S.exclusiveFilter){const gt=S.exclusiveFilter(fe);if(gt==="excludeTag"){Ee&&(T=C,C=""),T=T.substring(0,fe.tagPosition)+T.substring(fe.tagPosition+fe.openingTagLength);return}else if(gt){T=T.substring(0,fe.tagPosition);return}}if(fe.updateParentNodeMediaChildren(),fe.updateParentNodeText(),S.selfClosing.indexOf(ae)!==-1||Te&&!A(ae)&&["escape","recursiveEscape"].indexOf(S.disallowedTagsMode)>=0){Ee&&(T=C,C="");return}T+="</"+ae+">",Ee&&(T=C+te(T),C=""),V=!1}},S.parser);return G.write(w),G.end(),T;function W(){T="",q=0,P=[],I={},U={},Z=!1,X=0}function te(ae,Te){return typeof ae!="string"&&(ae=ae+""),S.parser.decodeEntities&&(ae=ae.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Te&&(ae=ae.replace(/"/g,"&quot;"))),ae=ae.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Te&&(ae=ae.replace(/"/g,"&quot;")),ae}function oe(ae,Te){for(Te=Te.replace(/[\x00-\x20]+/g,"");;){const gt=Te.indexOf("<!--");if(gt===-1)break;const We=Te.indexOf("-->",gt+4);if(We===-1)break;Te=Te.substring(0,gt)+Te.substring(We+3)}const fe=Te.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!fe)return Te.match(/^[/\\]{2}/)?!S.allowProtocolRelative:!1;const Ee=fe[1].toLowerCase();return h(S.allowedSchemesByTag,ae)?S.allowedSchemesByTag[ae].indexOf(Ee)===-1:!S.allowedSchemes||S.allowedSchemes.indexOf(Ee)===-1}function be(ae){if(ae=ae.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),ae.startsWith("relative:"))throw new Error("relative: exploit attempt");let Te="relative://relative-site";for(let gt=0;gt<100;gt++)Te+=`/${gt}`;const fe=new URL(ae,Te);return{isRelativeUrl:fe&&fe.hostname==="relative-site"&&fe.protocol==="relative:",url:fe}}function ye(ae,Te){if(!Te)return ae;const fe=ae.nodes[0];let Ee;return Te[fe.selector]&&Te["*"]?Ee=r(Te[fe.selector],Te["*"]):Ee=Te[fe.selector]||Te["*"],Ee&&(ae.nodes[0].nodes=fe.nodes.reduce(Fe(Ee),[])),ae}function Ke(ae){return ae.nodes[0].nodes.reduce(function(Te,fe){return Te.push(`${fe.prop}:${fe.value}${fe.important?" !important":""}`),Te},[]).join(";")}function Fe(ae){return function(Te,fe){return h(ae,fe.prop)&&ae[fe.prop].some(function(gt){return gt.test(fe.value)})&&Te.push(fe),Te}}function Pe(ae,Te,fe){return Te?(ae=ae.split(/\s+/),ae.filter(function(Ee){return Te.indexOf(Ee)!==-1||fe.some(function(gt){return gt.test(Ee)})}).join(" ")):ae}}const x={decodeEntities:!0};return b.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","menu","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0,preserveEscapedAttributes:!1},b.simpleTransform=function(w,S,_){return _=_===void 0?!0:_,S=S||{},function(T,C){let j;if(_)for(j in S)C[j]=S[j];else C=S;return{tagName:w,attribs:C}}},NT}var A1e=E1e();const M1e=dl(A1e);var mt=(t=>(t.aggregation="aggregation",t.binaryExpr="binaryExpr",t.call="call",t.matrixSelector="matrixSelector",t.subquery="subquery",t.numberLiteral="numberLiteral",t.parenExpr="parenExpr",t.stringLiteral="stringLiteral",t.unaryExpr="unaryExpr",t.vectorSelector="vectorSelector",t.placeholder="placeholder",t))(mt||{}),tn=(t=>(t.add="+",t.sub="-",t.mul="*",t.div="/",t.mod="%",t.pow="^",t.eql="==",t.neq="!=",t.gtr=">",t.lss="<",t.gte=">=",t.lte="<=",t.and="and",t.or="or",t.unless="unless",t.atan2="atan2",t))(tn||{});const R1e=["==","!=",">","<",">=","<="],D1e=["and","or","unless"];var Tr=(t=>(t.oneToOne="one-to-one",t.manyToOne="many-to-one",t.oneToMany="one-to-many",t.manyToMany="many-to-many",t))(Tr||{}),le=(t=>(t.none="none",t.vector="vector",t.scalar="scalar",t.matrix="matrix",t.string="string",t))(le||{}),vo=(t=>(t.equal="=",t.notEqual="!=",t.matchRegexp="=~",t.matchNotRegexp="!~",t))(vo||{});const Oh=t=>t.replace(/([\\"])/g,"\\$1"),LE=t=>R1e.includes(t),s6=t=>D1e.includes(t),O9={[tn.add]:3,[tn.sub]:3,[tn.mul]:2,[tn.div]:2,[tn.mod]:2,[tn.pow]:1,[tn.eql]:4,[tn.neq]:4,[tn.gtr]:4,[tn.lss]:4,[tn.gte]:4,[tn.lte]:4,[tn.and]:5,[tn.or]:6,[tn.unless]:5,[tn.atan2]:2},Tw=(t,e)=>e.type!==mt.binaryExpr||O9[t]>O9[e.op]?e:{type:mt.parenExpr,expr:e},N1e=t=>{switch(t.type){case mt.aggregation:return t.param===null?[t.expr]:[t.param,t.expr];case mt.subquery:return[t.expr];case mt.parenExpr:return[t.expr];case mt.call:return t.args;case mt.matrixSelector:case mt.vectorSelector:case mt.numberLiteral:case mt.stringLiteral:return[];case mt.placeholder:return t.children;case mt.unaryExpr:return[t.expr];case mt.binaryExpr:return[t.lhs,t.rhs];default:throw new Error("unsupported node type")}},Ep=t=>{switch(t.type){case mt.aggregation:return le.vector;case mt.binaryExpr:{const e=[Ep(t.lhs),Ep(t.rhs)];return e.includes(null)?null:e.includes(le.vector)?le.vector:le.scalar}case mt.call:return t.func.returnType;case mt.matrixSelector:return le.matrix;case mt.numberLiteral:return le.scalar;case mt.parenExpr:return Ep(t.expr);case mt.placeholder:return null;case mt.stringLiteral:return le.string;case mt.subquery:return le.matrix;case mt.unaryExpr:return Ep(t.expr);case mt.vectorSelector:return le.vector;default:throw new Error("invalid node type")}},P1e=["topk","bottomk","quantile","count_values","limitk","limit_ratio"];le.scalar,le.string,le.matrix,le.vector;le.none+"",le.string+"",le.scalar+"",le.vector+"",le.matrix+"";const L1e=/^[a-zA-Z_:][a-zA-Z0-9_:]*$/,$1e=/^[a-zA-Z_][a-zA-Z0-9_]*$/,SS=t=>t!==""&&!L1e.test(t),I1e=t=>!$1e.test(t),os=t=>t.replace(/([\\"])/g,"\\$1"),zh=t=>I1e(t)?`"${os(t)}"`:t,S1=t=>t.map(e=>zh(e)).join(", "),ZV=(t,e,n)=>`${t!==null?` @ ${(t/1e3).toFixed(3)}`:e!==null?` @ ${e}()`:""}${n===0?"":n>0?` offset ${Bn(n)}`:` offset -${Bn(-n)}`}`,E9=t=>{var l;const e=t.matchers.filter(u=>!(u.name==="__name__"&&u.type===vo.equal)).map(u=>`${zh(u.name)}${u.type}"${os(u.value)}"`),n=t.name||((l=t.matchers.find(u=>u.name==="__name__"&&u.type===vo.equal))==null?void 0:l.value)||"",r=SS(n);r&&e.unshift(`"${os(n)}"`);const i=t.type===mt.matrixSelector?`[${Bn(t.range)}]`:"",s=t.anchored?" anchored":t.smoothed?" smoothed":"",o=ZV(t.timestamp,t.startOrEnd,t.offset);return`${r?"":n}${e.length>0?`{${e.join(",")}}`:""}${i}${s}${o}`},as=(t,e=0,n=!1,r=!0)=>{const i=n?`
`:"",s=n?`
`:" ",o=e+2,l=n?" ".repeat(e):"",u=r?l:"";switch(t.type){case mt.aggregation:return`${u}${t.op}${t.without?` without(${S1(t.grouping)}) `:t.grouping.length>0?` by(${S1(t.grouping)}) `:""}(${i}${P1e.includes(t.op)&&t.param!==null?`${as(t.param,o,n)},${s}`:""}${as(t.expr,o,n)}${i}${l})`;case mt.subquery:return`${u}${as(t.expr,e,n)}[${Bn(t.range)}:${t.step!==0?Bn(t.step):""}]${ZV(t.timestamp,t.startOrEnd,t.offset)}`;case mt.parenExpr:return`${u}(${i}${as(t.expr,o,n)}${i}${l})`;case mt.call:{const h=t.args.length>0?i:"";return`${u}${t.func.name}(${h}${t.args.map(f=>as(f,o,n)).join(","+s)}${h}${t.args.length>0?l:""})`}case mt.matrixSelector:return`${u}${E9(t)}`;case mt.vectorSelector:return`${u}${E9(t)}`;case mt.numberLiteral:return`${u}${t.val}`;case mt.stringLiteral:return`${u}"${os(t.val)}"`;case mt.unaryExpr:return`${u}${t.op}${as(t.expr,e,n,!1)}`;case mt.binaryExpr:{let h="",f="",p="";const m=t.matching;if(m!==null){(m.labels.length>0||m.on||m.card===Tr.manyToOne||m.card===Tr.oneToMany)&&(h=` ${m.on?"on":"ignoring"}(${S1(m.labels)})`),(m.card===Tr.manyToOne||m.card===Tr.oneToMany)&&(f=` group_${m.card===Tr.manyToOne?"left":"right"}(${S1(m.include)})`);const v=m.fillValues.lhs,b=m.fillValues.rhs;(v!==null||b!==null)&&(v===b?p=` fill(${v})`:(v!==null&&(p+=` fill_left(${v})`),b!==null&&(p+=` fill_right(${b})`)))}return`${as(Tw(t.op,t.lhs),o,n)}${s}${l}${t.op}${t.bool?" bool":""}${h}${f}${p}${s}${as(Tw(t.op,t.rhs),o,n)}`}case mt.placeholder:return`${u}…${t.children.length>0?`(${i}${t.children.map(h=>as(h,o,n)).join(","+s)}${i}${l})`:""}`;default:throw new Error("unsupported node type")}},ua=t=>t.map((e,n)=>a.jsxs("span",{children:[n!==0&&", ",a.jsx("span",{className:"promql-code promql-label-name",children:zh(e)})]},n)),JV=(t,e,n)=>a.jsxs(a.Fragment,{children:[t!==null?a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-operator",children:"@"})," ",a.jsx("span",{className:"promql-number",children:(t/1e3).toFixed(3)})]}):e!==null?a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-operator",children:"@"})," ",a.jsx("span",{className:"promql-keyword",children:e}),a.jsx("span",{className:"promql-paren",children:"("}),a.jsx("span",{className:"promql-paren",children:")"})]}):a.jsx(a.Fragment,{}),n===0?a.jsx(a.Fragment,{}):n>0?a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:"offset"})," ",a.jsx("span",{className:"promql-duration",children:Bn(n)})]}):a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:"offset"})," ",a.jsxs("span",{className:"promql-duration",children:["-",Bn(-n)]})]})]}),A9=t=>{var i;const e=[],n=t.name||((i=t.matchers.find(s=>s.name==="__name__"&&s.type===vo.equal))==null?void 0:i.value)||"",r=SS(n);return r&&e.push(a.jsx("span",{children:a.jsxs("span",{className:"promql-string",children:['"',os(n),'"']})},"__name__")),e.push(...t.matchers.filter(s=>!(s.name==="__name__"&&s.type===vo.equal)).map((s,o)=>a.jsxs("span",{children:[(o!==0||r)&&",",a.jsx("span",{className:"promql-label-name",children:zh(s.name)}),s.type,a.jsxs("span",{className:"promql-string",children:['"',os(s.value),'"']})]},o))),a.jsxs(a.Fragment,{children:[!r&&a.jsx("span",{className:"promql-metric-name",children:n}),e.length>0&&a.jsxs(a.Fragment,{children:["{",a.jsx("span",{className:"promql-metric-name",children:e}),"}"]}),t.type===mt.matrixSelector&&a.jsxs(a.Fragment,{children:["[",a.jsx("span",{className:"promql-duration",children:Bn(t.range)}),"]"]}),t.anchored&&a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:"anchored"})]}),t.smoothed&&a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:"smoothed"})]}),JV(t.timestamp,t.startOrEnd,t.offset)]})},PT=a.jsx("span",{className:"promql-ellipsis",children:"…"}),B1e=(t,e,n)=>{if(n===0)return PT;const r=n===void 0?void 0:n-1;switch(t.type){case mt.aggregation:return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"promql-keyword",children:t.op}),t.without?a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:"without"}),a.jsx("span",{className:"promql-paren",children:"("}),ua(t.grouping),a.jsx("span",{className:"promql-paren",children:")"})," "]}):t.grouping.length>0&&a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:"by"}),a.jsx("span",{className:"promql-paren",children:"("}),ua(t.grouping),a.jsx("span",{className:"promql-paren",children:")"})," "]}),e&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"promql-paren",children:"("}),t.param!==null&&a.jsxs(a.Fragment,{children:[Bo(t.param,e,r),", "]}),Bo(t.expr,e,r),a.jsx("span",{className:"promql-paren",children:")"})]})]});case mt.subquery:return a.jsxs(a.Fragment,{children:[e&&Bo(t.expr,e,r),"[",a.jsx("span",{className:"promql-duration",children:Bn(t.range)}),":",t.step!==0&&a.jsx("span",{className:"promql-duration",children:Bn(t.step)}),"]",JV(t.timestamp,t.startOrEnd,t.offset)]});case mt.parenExpr:return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"promql-paren",children:"("}),e&&Bo(t.expr,e,r),a.jsx("span",{className:"promql-paren",children:")"})]});case mt.call:{const i=r===void 0||r>0?t.args.map((s,o)=>a.jsxs("span",{children:[o!==0&&", ",Bo(s,e)]},o)):t.args.length>0?PT:"";return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"promql-keyword",children:t.func.name}),e&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"promql-paren",children:"("}),i,a.jsx("span",{className:"promql-paren",children:")"})]})]})}case mt.matrixSelector:return A9(t);case mt.vectorSelector:return A9(t);case mt.numberLiteral:return a.jsx("span",{className:"promql-number",children:t.val});case mt.stringLiteral:return a.jsxs("span",{className:"promql-string",children:['"',os(t.val),'"']});case mt.unaryExpr:return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"promql-operator",children:t.op}),e&&Bo(t.expr,e,r)]});case mt.binaryExpr:{let i=a.jsx(a.Fragment,{}),s=a.jsx(a.Fragment,{}),o=a.jsx(a.Fragment,{});const l=t.matching;if(l!==null){(l.labels.length>0||l.on||l.card===Tr.manyToOne||l.card===Tr.oneToMany)&&(i=a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:l.on?"on":"ignoring"}),a.jsx("span",{className:"promql-paren",children:"("}),ua(l.labels),a.jsx("span",{className:"promql-paren",children:")"})]})),(l.card===Tr.manyToOne||l.card===Tr.oneToMany)&&(s=a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"promql-keyword",children:[" ","group_",l.card===Tr.manyToOne?"left":"right"]}),a.jsx("span",{className:"promql-paren",children:"("}),ua(l.include),a.jsx("span",{className:"promql-paren",children:")"})]}));const u=l.fillValues.lhs,h=l.fillValues.rhs;(u!==null||h!==null)&&(u===h?o=a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:"fill"}),a.jsx("span",{className:"promql-paren",children:"("}),a.jsx("span",{className:"promql-number",children:u}),a.jsx("span",{className:"promql-paren",children:")"})]}):o=a.jsxs(a.Fragment,{children:[u!==null&&a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:"fill_left"}),a.jsx("span",{className:"promql-paren",children:"("}),a.jsx("span",{className:"promql-number",children:u}),a.jsx("span",{className:"promql-paren",children:")"})]}),h!==null&&a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:"fill_right"}),a.jsx("span",{className:"promql-paren",children:"("}),a.jsx("span",{className:"promql-number",children:h}),a.jsx("span",{className:"promql-paren",children:")"})]})]}))}return a.jsxs(a.Fragment,{children:[e&&Bo(Tw(t.op,t.lhs),e,r)," ",["atan2","and","or","unless"].includes(t.op)?a.jsx("span",{className:"promql-keyword",children:t.op}):a.jsx("span",{className:"promql-operator",children:t.op}),t.bool&&a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:"bool"})]}),i,s,o," ",e&&Bo(Tw(t.op,t.rhs),e,r)]})}case mt.placeholder:return PT;default:throw new Error("unsupported node type")}},Bo=(t,e,n)=>a.jsx("span",{className:"promql-code",children:B1e(t,e,n)}),z1e="_labelValue_1cwwq_1",q1e="_promqlPill_1cwwq_13",LT={labelValue:z1e,promqlPill:q1e},Fs={width:de(16),height:de(16)},ag={width:de(14),height:de(14)},Jo={width:As(17),height:As(17)},nu={width:"70%",height:"70%"},Mf={width:As(16),height:As(16)},_g={width:As(20),height:As(20)},F1e={width:As(17.5),height:As(17.5)},Cw={width:As(16),height:As(16)};de(20),de(20);const H1e=({metricName:t,insertText:e,hideLabelsExplorer:n})=>{const[r,i]=M.useState([]),[s,o]=M.useState([]),[l,u]=M.useState(null),[h,f]=M.useState(!0),p=j=>{o(s.filter(A=>A.name!==j))},m=()=>{if(l===null)throw new Error("tried to add null label matcher");o([...s,l]),u(null)},v=j=>a.jsx(Hc,{size:"md",withRemoveButton:!0,onRemove:()=>{p(j.name)},className:LT.promqlPill,children:a.jsxs("span",{className:"promql-code",children:[a.jsx("span",{className:"promql-label-name",children:j.name}),j.type,a.jsxs("span",{className:"promql-string",children:['"',Oh(j.value),'"']})]})},j.name),b={type:mt.vectorSelector,name:t,matchers:s,offset:0,timestamp:null,startOrEnd:null,anchored:!1,smoothed:!1},{data:x,error:w,isLoading:S}=Ih({path:"/series",params:{"match[]":as(b)}}),[_,T,C]=M.useMemo(()=>{const j={},A={},E={};x!==void 0&&(x.data.forEach(N=>{Object.entries(N).forEach(([$,D])=>{$!=="__name__"&&($ in E?D in E[$]?E[$][D]++:E[$][D]=1:E[$]={[D]:1})})}),Object.entries(E).forEach(([N,$])=>{j[N]=Object.keys($).length,A[N]=Object.entries($).sort(([,D],[,F])=>F-D).map(([D,F])=>({value:D,count:F}))}));const R=Object.entries(j).sort((N,$)=>h?$[1]-N[1]:0);return[x==null?void 0:x.data.length,R,A]},[x,h]);return w?a.jsxs(Nt,{color:"red",title:"Error querying series",icon:a.jsx(Ui,{}),children:[a.jsx("strong",{children:"Error:"})," ",w.message]}):a.jsxs(En,{fz:"sm",children:[a.jsxs(En,{style:{overflow:"auto"},children:[a.jsxs(ht,{align:"center",mt:"lg",wrap:"nowrap",children:[a.jsx(ve,{w:70,fw:700,style:{flexShrink:0},children:"Selector:"}),a.jsx(Hc.Group,{children:a.jsx(Hc,{size:"md",className:LT.promqlPill,children:a.jsx("span",{style:{wordBreak:"break-word",whiteSpace:"pre"},children:Bo(b,!1)})})}),a.jsxs(ht,{wrap:"nowrap",children:[a.jsx(ks,{variant:"light",size:"xs",onClick:()=>e(as(b)),leftSection:a.jsx(hB,{style:_g}),title:"Insert selector at cursor and close explorer",children:"Insert"}),a.jsx(kO,{value:as(b),children:({copied:j,copy:A})=>a.jsx(ks,{variant:"light",size:"xs",leftSection:j?a.jsx(cB,{style:_g}):a.jsx(r4,{style:_g}),onClick:A,title:"Copy selector to clipboard",children:"Copy"})})]})]}),a.jsxs(ht,{align:"center",children:[a.jsx(ve,{w:70,fw:700,style:{flexShrink:0},children:"Filters:"}),s.length>0?a.jsx(Hc.Group,{children:s.map(j=>v(j))}):a.jsx(a.Fragment,{children:"No label filters"})]}),a.jsxs(ht,{style:{display:"flex",alignItems:"center",marginBottom:25},children:[a.jsx(ve,{w:70,fw:700,style:{flexShrink:0},children:"Results:"}),a.jsx(a.Fragment,{children:_!==void 0?`${_} series`:"loading..."})]})]}),a.jsxs(ht,{justify:"space-between",children:[a.jsx(ve,{children:a.jsx(ks,{variant:"light",size:"xs",onClick:n,leftSection:a.jsx(Wne,{style:_g}),children:"Back to all metrics"})}),a.jsx(Xv,{w:"fit-content",size:"xs",value:h?"cardinality":"alphabetic",onChange:j=>f(j==="cardinality"),data:[{label:"By cardinality",value:"cardinality"},{label:"Alphabetic",value:"alphabetic"}]})]}),S?a.jsx(ve,{mt:"lg",children:Array.from(Array(10),(j,A)=>a.jsx(xo,{height:40,mb:15,width:"100%"},A))}):a.jsxs(re,{fz:"sm",children:[a.jsx(re.Thead,{children:a.jsxs(re.Tr,{children:[a.jsx(re.Th,{children:"Label"}),a.jsx(re.Th,{children:"Values"})]})}),a.jsx(re.Tbody,{children:T.map(([j,A])=>a.jsxs(re.Tr,{children:[a.jsx(re.Td,{w:"50%",children:a.jsx("form",{onSubmit:E=>{E.preventDefault()},children:a.jsxs(ht,{justify:"space-between",align:"baseline",children:[a.jsx("span",{className:"promql-code promql-label-name",children:j}),s.some(E=>E.name===j)?v(s.find(E=>E.name===j)):(l==null?void 0:l.name)===j?a.jsxs(ht,{wrap:"nowrap",gap:"xs",children:[a.jsx(Qm,{size:"xs",w:50,style:{width:"auto"},value:l.type,data:Object.values(vo).map(E=>({value:E,label:E})),onChange:(E,R)=>u({...l,type:R.value})}),a.jsx(wO,{value:l.value,size:"xs",placeholder:"label value",onChange:E=>u({...l,value:E}),data:C[j].map(E=>E.value),autoFocus:!0}),a.jsx(ks,{variant:"secondary",size:"xs",onClick:()=>m(),style:{flexShrink:0},children:"Apply"}),a.jsx(ks,{variant:"light",w:40,size:"xs",onClick:()=>u(null),title:"Cancel",style:{flexShrink:0},children:a.jsx(yie,{style:{width:de(18),height:de(18)}})})]}):a.jsx(ks,{variant:"light",size:"xs",mr:"xs",onClick:()=>u({name:j,type:vo.equal,value:""}),children:"Filter..."})]})})}),a.jsxs(re.Td,{w:"50%",children:[a.jsxs(ut,{fw:700,fz:"sm",my:"xs",children:[A," value",A>1&&"s"]}),a.jsxs(rr,{size:"sm",listStyleType:"none",children:[(r.includes(j)?C[j]:C[j].slice(0,5)).map(({value:E,count:R})=>a.jsxs(rr.Item,{children:[a.jsxs("span",{className:`${LT.labelValue} promql-code promql-string`,onClick:()=>{o([...s.filter(N=>N.name!==j),{name:j,type:vo.equal,value:E}]),u(null)},title:"Click to filter by value",children:['"',Oh(E),'"']})," ","(",R," series)"]},E)),r.includes(j)?a.jsx(rr.Item,{my:"xs",children:a.jsx(qr,{size:"sm",href:"#",onClick:E=>{E.preventDefault(),i(r.filter(R=>R!=j))},children:"Hide full values"})}):C[j].length>5&&a.jsx(rr.Item,{my:"xs",children:a.jsxs(qr,{size:"sm",href:"#",onClick:E=>{E.preventDefault(),i([...r,j])},children:["Show ",C[j].length-5," more values..."]})})]})]})]},j))})]})]})},V1e="_typeLabel_u9odf_1",U1e="_helpLabel_u9odf_5",M9={typeLabel:V1e,helpLabel:U1e};/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var a6=function(t,e){return a6=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])},a6(t,e)};function Q1e(t,e){a6(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Bg=function(){return Bg=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Bg.apply(this,arguments)};function W1e(t,e,n,r){var i,s=!1,o=0;function l(){i&&clearTimeout(i)}function u(){l(),s=!0}typeof e!="boolean"&&(r=n,n=e,e=void 0);function h(){var f=this,p=Date.now()-o,m=arguments;if(s)return;function v(){o=Date.now(),n.apply(f,m)}function b(){i=void 0}r&&!i&&v(),l(),r===void 0&&p>t?v():e!==!0&&(i=setTimeout(r?b:v,r===void 0?t-p:t))}return h.cancel=u,h}var Qp={Pixel:"Pixel",Percent:"Percent"},R9={unit:Qp.Percent,value:.8};function D9(t){return typeof t=="number"?{unit:Qp.Percent,value:t*100}:typeof t=="string"?t.match(/^(\d*(\.\d+)?)px$/)?{unit:Qp.Pixel,value:parseFloat(t)}:t.match(/^(\d*(\.\d+)?)%$/)?{unit:Qp.Percent,value:parseFloat(t)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),R9):(console.warn("scrollThreshold should be string or number"),R9)}var Y1e=function(t){Q1e(e,t);function e(n){var r=t.call(this,n)||this;return r.lastScrollTop=0,r.actionTriggered=!1,r.startY=0,r.currentY=0,r.dragging=!1,r.maxPullDownDistance=0,r.getScrollableTarget=function(){return r.props.scrollableTarget instanceof HTMLElement?r.props.scrollableTarget:typeof r.props.scrollableTarget=="string"?document.getElementById(r.props.scrollableTarget):(r.props.scrollableTarget===null&&console.warn(`You are trying to pass scrollableTarget but it is null. This might
        happen because the element may not have been added to DOM yet.
        See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.
      `),null)},r.onStart=function(i){r.lastScrollTop||(r.dragging=!0,i instanceof MouseEvent?r.startY=i.pageY:i instanceof TouchEvent&&(r.startY=i.touches[0].pageY),r.currentY=r.startY,r._infScroll&&(r._infScroll.style.willChange="transform",r._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},r.onMove=function(i){r.dragging&&(i instanceof MouseEvent?r.currentY=i.pageY:i instanceof TouchEvent&&(r.currentY=i.touches[0].pageY),!(r.currentY<r.startY)&&(r.currentY-r.startY>=Number(r.props.pullDownToRefreshThreshold)&&r.setState({pullToRefreshThresholdBreached:!0}),!(r.currentY-r.startY>r.maxPullDownDistance*1.5)&&r._infScroll&&(r._infScroll.style.overflow="visible",r._infScroll.style.transform="translate3d(0px, "+(r.currentY-r.startY)+"px, 0px)")))},r.onEnd=function(){r.startY=0,r.currentY=0,r.dragging=!1,r.state.pullToRefreshThresholdBreached&&(r.props.refreshFunction&&r.props.refreshFunction(),r.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){r._infScroll&&(r._infScroll.style.overflow="auto",r._infScroll.style.transform="none",r._infScroll.style.willChange="unset")})},r.onScrollListener=function(i){typeof r.props.onScroll=="function"&&setTimeout(function(){return r.props.onScroll&&r.props.onScroll(i)},0);var s=r.props.height||r._scrollableNode?i.target:document.documentElement.scrollTop?document.documentElement:document.body;if(!r.actionTriggered){var o=r.props.inverse?r.isElementAtTop(s,r.props.scrollThreshold):r.isElementAtBottom(s,r.props.scrollThreshold);o&&r.props.hasMore&&(r.actionTriggered=!0,r.setState({showLoader:!0}),r.props.next&&r.props.next()),r.lastScrollTop=s.scrollTop}},r.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:n.dataLength},r.throttledOnScrollListener=W1e(150,r.onScrollListener).bind(r),r.onStart=r.onStart.bind(r),r.onMove=r.onMove.bind(r),r.onEnd=r.onEnd.bind(r),r}return e.prototype.componentDidMount=function(){if(typeof this.props.dataLength>"u")throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),typeof this.props.initialScrollY=="number"&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),typeof this.props.refreshFunction!="function"))throw new Error(`Mandatory prop "refreshFunction" missing.
          Pull Down To Refresh functionality will not work
          as expected. Check README.md for usage'`)},e.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},e.prototype.componentDidUpdate=function(n){this.props.dataLength!==n.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},e.getDerivedStateFromProps=function(n,r){var i=n.dataLength!==r.prevDataLength;return i?Bg(Bg({},r),{prevDataLength:n.dataLength}):null},e.prototype.isElementAtTop=function(n,r){r===void 0&&(r=.8);var i=n===document.body||n===document.documentElement?window.screen.availHeight:n.clientHeight,s=D9(r);return s.unit===Qp.Pixel?n.scrollTop<=s.value+i-n.scrollHeight+1:n.scrollTop<=s.value/100+i-n.scrollHeight+1},e.prototype.isElementAtBottom=function(n,r){r===void 0&&(r=.8);var i=n===document.body||n===document.documentElement?window.screen.availHeight:n.clientHeight,s=D9(r);return s.unit===Qp.Pixel?n.scrollTop+i>=n.scrollHeight-s.value:n.scrollTop+i>=s.value/100*n.scrollHeight},e.prototype.render=function(){var n=this,r=Bg({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),i=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),s=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return _n.createElement("div",{style:s,className:"infinite-scroll-component__outerdiv"},_n.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(o){return n._infScroll=o},style:r},this.props.pullDownToRefresh&&_n.createElement("div",{style:{position:"relative"},ref:function(o){return n._pullDown=o}},_n.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!i&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},e}(M.Component);const og=50,Am=({allItems:t,child:e})=>{const[n,r]=M.useState(t.slice(0,50)),[i,s]=M.useState(og),[o,l]=M.useState(t.length>og),u=e;M.useEffect(()=>{r(t.slice(0,og)),l(t.length>og)},[t]);const h=()=>{if(n.length===t.length)l(!1);else{const f=i+og;s(f),r(t.slice(0,f))}};return a.jsx(Y1e,{next:h,hasMore:o,loader:a.jsx("h4",{children:"loading..."}),dataLength:n.length,height:n.length>25?"75vh":"",children:a.jsx(u,{items:n})})},X1e=new zV({pre:'<b style="color: rgb(0, 102, 191)">',post:"</b>",shouldSort:!0}),G1e={allowedTags:["b"],allowedAttributes:{b:["style"]}},K1e=(t,e)=>X1e.filter(t.replace(/ /g,""),e,{pre:'<b style="color: rgb(0, 102, 191)">',post:"</b>"}),Z1e=({metricNames:t,insertText:e,close:n})=>{const{data:r}=bi({path:"/metadata"}),[i,s]=M.useState(null),[o,l]=M.useState(""),[u]=Lv(o,250),h=M.useMemo(()=>u===""?t.map(p=>({original:p,rendered:p})):K1e(u,t),[u,t]),f=p=>r.data[p]??r.data[p.replace(/(_count|_sum|_bucket|_total)$/,"")]??[{help:"unknown",type:"unknown",unit:"unknown"}];return i!==null?a.jsx(H1e,{metricName:i,insertText:p=>{e(p),n()},hideLabelsExplorer:()=>s(null)}):a.jsxs(En,{children:[a.jsx(ec,{title:"Filter by text",placeholder:"Enter text to filter metric names by...",value:o,onChange:p=>l(p.target.value),autoFocus:!0}),a.jsx(Am,{allItems:h,child:({items:p})=>a.jsxs(re,{children:[a.jsx(re.Thead,{children:a.jsxs(re.Tr,{children:[a.jsx(re.Th,{children:"Metric"}),a.jsx(re.Th,{children:"Type"}),a.jsx(re.Th,{children:"Help"})]})}),a.jsx(re.Tbody,{children:p.map(m=>a.jsxs(re.Tr,{children:[a.jsx(re.Td,{children:a.jsxs(ht,{justify:"space-between",wrap:"nowrap",children:[u===""?m.original:a.jsx("div",{dangerouslySetInnerHTML:{__html:M1e(m.rendered,G1e)}}),a.jsxs(ht,{gap:"xs",children:[a.jsx(Nr,{size:"sm",color:"gray",variant:"light",title:"Explore metric",onClick:()=>{s(m.original)},children:a.jsx(wie,{style:{width:"70%",height:"70%"},stroke:1.5})}),a.jsx(Nr,{size:"sm",color:"gray",variant:"light",title:"Insert at cursor and close explorer",onClick:()=>{e(m.original),n()},children:a.jsx(hB,{style:{width:"70%",height:"70%"},stroke:1.5})}),a.jsx(kO,{value:m.original,children:({copied:v,copy:b})=>a.jsx(Nr,{size:"sm",color:"gray",variant:"light",title:"Copy to clipboard",onClick:b,children:v?a.jsx(cB,{style:{width:"70%",height:"70%"},stroke:1.5}):a.jsx(r4,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})]})}),a.jsx(re.Td,{px:"lg",children:f(m.original).map((v,b)=>a.jsxs(_n.Fragment,{children:[a.jsx("span",{className:M9.typeLabel,children:v.type}),a.jsx("br",{})]},b))}),a.jsx(re.Td,{children:f(m.original).map((v,b)=>a.jsxs(_n.Fragment,{children:[a.jsx("span",{className:M9.helpLabel,children:v.help}),a.jsx("br",{})]},b))})]},m.original))})]})})]})};class J1e extends M.Component{constructor(){super(...arguments);Yn(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("Uncaught error:",n,r)}render(){return this.state.error!==null?a.jsxs(Nt,{color:"red",title:this.props.title||"Error querying page data",icon:a.jsx(Ui,{}),maw:500,mx:"auto",mt:"lg",children:[a.jsx("strong",{children:"Error:"})," ",this.state.error.message]}):this.props.children}}const yf=t=>{const e=nc();return a.jsx(J1e,{title:t.title,children:t.children},e.pathname)};class exe{constructor(e,n){Yn(this,"complete");Yn(this,"queryHistory");this.complete=e,this.queryHistory=n}promQL(e){return Promise.resolve(this.complete.promQL(e)).then(n=>{const{state:r,pos:i}=e,s=Ai(r).resolve(i,-1),o=n!=null?n.from:s.from;if(o!==0)return n;const l={from:o,to:i,options:this.queryHistory.map(u=>({label:u.length<80?u:u.slice(0,76).concat("..."),detail:"past query",apply:u,info:u.length<80?void 0:u})),validFor:/^[a-zA-Z0-9_:]+$/};return n!==null&&(l.options=l.options.concat(n.options)),l})}}const N9=new LH,txe=({initialExpr:t,metricNames:e,executeQuery:n,duplicatePanel:r,removePanel:i,treeShown:s,setShowTree:o})=>{const l=Fw(),{queryHistory:u}=rc(E=>E.queryPage),{pathPrefix:h,enableAutocomplete:f,enableSyntaxHighlighting:p,enableLinter:m,enableQueryHistory:v}=ai(),[b,x]=M.useState(t);M.useEffect(()=>{x(t)},[t]);const{data:w,error:S,isFetching:_,refetch:T}=Ih({path:"/format_query",params:{query:b},enabled:!1});M.useEffect(()=>{if(S){al.show({color:"red",title:"Error formatting query",message:S.message});return}w&&(x(w.data),al.show({title:"Expression formatted",message:"Expression formatted successfully!"}))},[w,S]);const C=M.useRef(null),[j,A]=M.useState(!1);return M.useEffect(()=>{N9.activateCompletion(f).activateLinter(m).setComplete({completeStrategy:new exe(Qk({remote:{url:h,cache:{initialMetricList:e}}}),v?u:[])})},[h,e,f,m,v,u]),a.jsxs(ht,{align:"flex-start",wrap:"nowrap",gap:"xs",children:[a.jsx(Ha,{leftSection:_?a.jsx(Kl,{size:"xs",color:"gray.5"}):a.jsx(hie,{}),rightSection:a.jsxs(Xn,{shadow:"md",width:200,children:[a.jsx(Xn.Target,{children:a.jsx(Nr,{size:"lg",variant:"transparent",color:"gray","aria-label":"Show query options",children:a.jsx(Cre,{style:Mf})})}),a.jsxs(Xn.Dropdown,{children:[a.jsx(Xn.Label,{children:"Query options"}),a.jsx(Xn.Item,{leftSection:a.jsx(Xh,{style:ag}),onClick:()=>A(!0),children:"Explore metrics"}),a.jsx(Xn.Item,{leftSection:a.jsx(Vne,{style:ag}),onClick:()=>T(),disabled:_||b===""||b===(w==null?void 0:w.data),children:"Format expression"}),a.jsxs(Xn.Item,{leftSection:a.jsx(Zne,{style:ag}),onClick:()=>o(!s),children:[s?"Hide":"Show"," tree view"]}),a.jsx(Xn.Item,{leftSection:a.jsx(r4,{style:ag}),onClick:()=>r(b),children:"Duplicate query"}),a.jsx(Xn.Item,{color:"red",leftSection:a.jsx(mie,{style:ag}),onClick:i,children:"Remove query"})]})]}),component:kE,className:Eye.input,basicSetup:!1,value:b,onChange:x,autoFocus:!0,ref:C,extensions:[EV,FF(),zH(),gn.allowMultipleSelections.of(!0),KF(),cH(),vH(),SH(),SV(),it.lineWrapping,Ch.of([...xH,...bV,...VH,...gE,...RH]),HF("Enter expression (press Shift+Enter for newlines)"),p?hS(l==="light"?MV:RV):[],N9.asExtension(),l==="light"?AV:kye,Ch.of([{key:"Escape",run:E=>(E.contentDOM.blur(),!1)}]),lu.highest(Ch.of([{key:"Enter",run:()=>(n(b),!0)},{key:"Shift-Enter",run:pV}]))],multiline:!0}),a.jsx(ks,{variant:"primary",onClick:()=>n(b),style:{flexShrink:0},children:"Execute"}),a.jsx(Va,{size:"95%",opened:j,onClose:()=>A(!1),title:"Explore metrics",children:a.jsx(yf,{title:"Error showing metrics",children:a.jsx(M.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(20),(E,R)=>a.jsx(xo,{height:30,mb:15,width:"100%"},R))}),children:a.jsx(Z1e,{metricNames:e,insertText:E=>{if(C.current&&C.current.view){const R=C.current.view;R.dispatch(R.state.update({changes:{from:R.state.selection.ranges[0].from,to:R.state.selection.ranges[0].to,insert:E}}))}},close:()=>A(!1)})})},location.pathname)})]})},nxe="_chartWrapper_apsqz_1",rxe="_uplotChart_apsqz_7",eU={chartWrapper:nxe,uplotChart:rxe};var ux={exports:{}};const ixe=!0,Mi="u-",sxe="uplot",axe=Mi+"hz",oxe=Mi+"vt",lxe=Mi+"title",cxe=Mi+"wrap",uxe=Mi+"under",hxe=Mi+"over",dxe=Mi+"axis",Pd=Mi+"off",fxe=Mi+"select",pxe=Mi+"cursor-x",mxe=Mi+"cursor-y",gxe=Mi+"cursor-pt",vxe=Mi+"legend",bxe=Mi+"live",yxe=Mi+"inline",xxe=Mi+"series",wxe=Mi+"marker",P9=Mi+"label",Sxe=Mi+"value",Tg="width",Cg="height",lg="top",L9="bottom",mp="left",$T="right",$E="#000",$9=$E+"0",IT="mousemove",I9="mousedown",BT="mouseup",B9="mouseenter",z9="mouseleave",q9="dblclick",jxe="resize",_xe="scroll",F9="change",kw="dppxchange",IE="--",e0=typeof window<"u",o6=e0?document:null,Wp=e0?window:null,Txe=e0?navigator:null;let Pn,j1;function l6(){let t=devicePixelRatio;Pn!=t&&(Pn=t,j1&&u6(F9,j1,l6),j1=matchMedia(`(min-resolution: ${Pn-.001}dppx) and (max-resolution: ${Pn+.001}dppx)`),cf(F9,j1,l6),Wp.dispatchEvent(new CustomEvent(kw)))}function Oa(t,e){if(e!=null){let n=t.classList;!n.contains(e)&&n.add(e)}}function c6(t,e){let n=t.classList;n.contains(e)&&n.remove(e)}function _r(t,e,n){t.style[e]=n+"px"}function Io(t,e,n,r){let i=o6.createElement(t);return e!=null&&Oa(i,e),n!=null&&n.insertBefore(i,r),i}function so(t,e){return Io("div",t,e)}const H9=new WeakMap;function Ol(t,e,n,r,i){let s="translate("+e+"px,"+n+"px)",o=H9.get(t);s!=o&&(t.style.transform=s,H9.set(t,s),e<0||n<0||e>r||n>i?Oa(t,Pd):c6(t,Pd))}const V9=new WeakMap;function U9(t,e,n){let r=e+n,i=V9.get(t);r!=i&&(V9.set(t,r),t.style.background=e,t.style.borderColor=n)}const Q9=new WeakMap;function W9(t,e,n,r){let i=e+""+n,s=Q9.get(t);i!=s&&(Q9.set(t,i),t.style.height=n+"px",t.style.width=e+"px",t.style.marginLeft=r?-e/2+"px":0,t.style.marginTop=r?-n/2+"px":0)}const BE={passive:!0},Cxe={...BE,capture:!0};function cf(t,e,n,r){e.addEventListener(t,n,r?Cxe:BE)}function u6(t,e,n,r){e.removeEventListener(t,n,BE)}e0&&l6();function Go(t,e,n,r){let i;n=n||0,r=r||e.length-1;let s=r<=2147483647;for(;r-n>1;)i=s?n+r>>1:za((n+r)/2),e[i]<t?n=i:r=i;return t-e[n]<=e[r]-t?n:r}function tU(t){return(n,r,i)=>{let s=-1,o=-1;for(let l=r;l<=i;l++)if(t(n[l])){s=l;break}for(let l=i;l>=r;l--)if(t(n[l])){o=l;break}return[s,o]}}const nU=t=>t!=null,rU=t=>t!=null&&t>0,jS=tU(nU),kxe=tU(rU);function Oxe(t,e,n,r=0,i=!1){let s=i?kxe:jS,o=i?rU:nU;[e,n]=s(t,e,n);let l=t[e],u=t[e];if(e>-1)if(r==1)l=t[e],u=t[n];else if(r==-1)l=t[n],u=t[e];else for(let h=e;h<=n;h++){let f=t[h];o(f)&&(f<l?l=f:f>u&&(u=f))}return[l??or,u??-or]}function _S(t,e,n,r){let i=G9(t),s=G9(e);t==e&&(i==-1?(t*=n,e/=n):(t/=n,e*=n));let o=n==10?Yc:iU,l=i==1?za:uo,u=s==1?uo:za,h=l(o(Ti(t))),f=u(o(Ti(e))),p=Mm(n,h),m=Mm(n,f);return n==10&&(h<0&&(p=lr(p,-h)),f<0&&(m=lr(m,-f))),r||n==2?(t=p*i,e=m*s):(t=lU(t,p),e=TS(e,m)),[t,e]}function zE(t,e,n,r){let i=_S(t,e,n,r);return t==0&&(i[0]=0),e==0&&(i[1]=0),i}const qE=.1,Y9={mode:3,pad:qE},zg={pad:0,soft:null,mode:0},Exe={min:zg,max:zg};function Ow(t,e,n,r){return CS(n)?X9(t,e,n):(zg.pad=n,zg.soft=r?0:null,zg.mode=r?3:0,X9(t,e,Exe))}function On(t,e){return t??e}function Axe(t,e,n){for(e=On(e,0),n=On(n,t.length-1);e<=n;){if(t[e]!=null)return!0;e++}return!1}function X9(t,e,n){let r=n.min,i=n.max,s=On(r.pad,0),o=On(i.pad,0),l=On(r.hard,-or),u=On(i.hard,or),h=On(r.soft,or),f=On(i.soft,-or),p=On(r.mode,0),m=On(i.mode,0),v=e-t,b=Yc(v),x=Vs(Ti(t),Ti(e)),w=Yc(x),S=Ti(w-b);(v<1e-24||S>10)&&(v=0,(t==0||e==0)&&(v=1e-24,p==2&&h!=or&&(s=0),m==2&&f!=-or&&(o=0)));let _=v||x||1e3,T=Yc(_),C=Mm(10,za(T)),j=_*(v==0?t==0?.1:1:s),A=lr(lU(t-j,C/10),24),E=t>=h&&(p==1||p==3&&A<=h||p==2&&A>=h)?h:or,R=Vs(l,A<E&&t>=E?E:el(E,A)),N=_*(v==0?e==0?.1:1:o),$=lr(TS(e+N,C/10),24),D=e<=f&&(m==1||m==3&&$>=f||m==2&&$<=f)?f:-or,F=el(u,$>D&&e<=D?D:Vs(D,$));return R==F&&R==0&&(F=100),[R,F]}const Mxe=new Intl.NumberFormat(e0?Txe.language:"en-US"),FE=t=>Mxe.format(t),Ua=Math,hx=Ua.PI,Ti=Ua.abs,za=Ua.floor,_i=Ua.round,uo=Ua.ceil,el=Ua.min,Vs=Ua.max,Mm=Ua.pow,G9=Ua.sign,Yc=Ua.log10,iU=Ua.log2,Rxe=(t,e=1)=>Ua.sinh(t)*e,zT=(t,e=1)=>Ua.asinh(t/e),or=1/0;function K9(t){return(Yc((t^t>>31)-(t>>31))|0)+1}function h6(t,e,n){return el(Vs(t,e),n)}function sU(t){return typeof t=="function"}function mn(t){return sU(t)?t:()=>t}const Dxe=()=>{},aU=t=>t,oU=(t,e)=>e,Nxe=t=>null,Z9=t=>!0,J9=(t,e)=>t==e,Pxe=/\.\d*?(?=9{6,}|0{6,})/gm,xf=t=>{if(uU(t)||qh.has(t))return t;const e=`${t}`,n=e.match(Pxe);if(n==null)return t;let r=n[0].length-1;if(e.indexOf("e-")!=-1){let[i,s]=e.split("e");return+`${xf(i)}e${s}`}return lr(t,r)};function Ed(t,e){return xf(lr(xf(t/e))*e)}function TS(t,e){return xf(uo(xf(t/e))*e)}function lU(t,e){return xf(za(xf(t/e))*e)}function lr(t,e=0){if(uU(t))return t;let n=10**e,r=t*n*(1+Number.EPSILON);return _i(r)/n}const qh=new Map;function cU(t){return((""+t).split(".")[1]||"").length}function Tv(t,e,n,r){let i=[],s=r.map(cU);for(let o=e;o<n;o++){let l=Ti(o),u=lr(Mm(t,o),l);for(let h=0;h<r.length;h++){let f=t==10?+`${r[h]}e${o}`:r[h]*u,p=(o>=0?0:l)+(o>=s[h]?0:s[h]),m=t==10?f:lr(f,p);i.push(m),qh.set(m,p)}}return i}const qg={},HE=[],Rm=[null,null],ih=Array.isArray,uU=Number.isInteger,Lxe=t=>t===void 0;function eL(t){return typeof t=="string"}function CS(t){let e=!1;if(t!=null){let n=t.constructor;e=n==null||n==Object}return e}function $xe(t){return t!=null&&typeof t=="object"}const Ixe=Object.getPrototypeOf(Uint8Array),hU="__proto__";function Dm(t,e=CS){let n;if(ih(t)){let r=t.find(i=>i!=null);if(ih(r)||e(r)){n=Array(t.length);for(let i=0;i<t.length;i++)n[i]=Dm(t[i],e)}else n=t.slice()}else if(t instanceof Ixe)n=t.slice();else if(e(t)){n={};for(let r in t)r!=hU&&(n[r]=Dm(t[r],e))}else n=t;return n}function mi(t){let e=arguments;for(let n=1;n<e.length;n++){let r=e[n];for(let i in r)i!=hU&&(CS(t[i])?mi(t[i],Dm(r[i])):t[i]=Dm(r[i]))}return t}const Bxe=0,zxe=1,qxe=2;function Fxe(t,e,n){for(let r=0,i,s=-1;r<e.length;r++){let o=e[r];if(o>s){for(i=o-1;i>=0&&t[i]==null;)t[i--]=null;for(i=o+1;i<n&&t[i]==null;)t[s=i++]=null}}}function Hxe(t,e){if(Qxe(t)){let o=t[0].slice();for(let l=1;l<t.length;l++)o.push(...t[l].slice(1));return Wxe(o[0])||(o=Uxe(o)),o}let n=new Set;for(let o=0;o<t.length;o++){let u=t[o][0],h=u.length;for(let f=0;f<h;f++)n.add(u[f])}let r=[Array.from(n).sort((o,l)=>o-l)],i=r[0].length,s=new Map;for(let o=0;o<i;o++)s.set(r[0][o],o);for(let o=0;o<t.length;o++){let l=t[o],u=l[0];for(let h=1;h<l.length;h++){let f=l[h],p=Array(i).fill(void 0),m=e?e[o][h]:zxe,v=[];for(let b=0;b<f.length;b++){let x=f[b],w=s.get(u[b]);x===null?m!=Bxe&&(p[w]=x,m==qxe&&v.push(w)):p[w]=x}Fxe(p,v,i),r.push(p)}}return r}const Vxe=typeof queueMicrotask>"u"?t=>Promise.resolve().then(t):queueMicrotask;function Uxe(t){let e=t[0],n=e.length,r=Array(n);for(let s=0;s<r.length;s++)r[s]=s;r.sort((s,o)=>e[s]-e[o]);let i=[];for(let s=0;s<t.length;s++){let o=t[s],l=Array(n);for(let u=0;u<n;u++)l[u]=o[r[u]];i.push(l)}return i}function Qxe(t){let e=t[0][0],n=e.length;for(let r=1;r<t.length;r++){let i=t[r][0];if(i.length!=n)return!1;if(i!=e){for(let s=0;s<n;s++)if(i[s]!=e[s])return!1}}return!0}function Wxe(t,e=100){const n=t.length;if(n<=1)return!0;let r=0,i=n-1;for(;r<=i&&t[r]==null;)r++;for(;i>=r&&t[i]==null;)i--;if(i<=r)return!0;const s=Vs(1,za((i-r+1)/e));for(let o=t[r],l=r+s;l<=i;l+=s){const u=t[l];if(u!=null){if(u<=o)return!1;o=u}}return!0}const dU=["January","February","March","April","May","June","July","August","September","October","November","December"],fU=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function pU(t){return t.slice(0,3)}const Yxe=fU.map(pU),Xxe=dU.map(pU),Gxe={MMMM:dU,MMM:Xxe,WWWW:fU,WWW:Yxe};function cg(t){return(t<10?"0":"")+t}function Kxe(t){return(t<10?"00":t<100?"0":"")+t}const Zxe={YYYY:t=>t.getFullYear(),YY:t=>(t.getFullYear()+"").slice(2),MMMM:(t,e)=>e.MMMM[t.getMonth()],MMM:(t,e)=>e.MMM[t.getMonth()],MM:t=>cg(t.getMonth()+1),M:t=>t.getMonth()+1,DD:t=>cg(t.getDate()),D:t=>t.getDate(),WWWW:(t,e)=>e.WWWW[t.getDay()],WWW:(t,e)=>e.WWW[t.getDay()],HH:t=>cg(t.getHours()),H:t=>t.getHours(),h:t=>{let e=t.getHours();return e==0?12:e>12?e-12:e},AA:t=>t.getHours()>=12?"PM":"AM",aa:t=>t.getHours()>=12?"pm":"am",a:t=>t.getHours()>=12?"p":"a",mm:t=>cg(t.getMinutes()),m:t=>t.getMinutes(),ss:t=>cg(t.getSeconds()),s:t=>t.getSeconds(),fff:t=>Kxe(t.getMilliseconds())};function VE(t,e){e=e||Gxe;let n=[],r=/\{([a-z]+)\}|[^{]+/gi,i;for(;i=r.exec(t);)n.push(i[0][0]=="{"?Zxe[i[1]]:i[0]);return s=>{let o="";for(let l=0;l<n.length;l++)o+=typeof n[l]=="string"?n[l]:n[l](s,e);return o}}const Jxe=new Intl.DateTimeFormat().resolvedOptions().timeZone;function ewe(t,e){let n;return e=="UTC"||e=="Etc/UTC"?n=new Date(+t+t.getTimezoneOffset()*6e4):e==Jxe?n=t:(n=new Date(t.toLocaleString("en-US",{timeZone:e})),n.setMilliseconds(t.getMilliseconds())),n}const mU=t=>t%1==0,Ew=[1,2,2.5,5],twe=Tv(10,-32,0,Ew),gU=Tv(10,0,32,Ew),nwe=gU.filter(mU),Ad=twe.concat(gU),UE=`
`,vU="{YYYY}",tL=UE+vU,bU="{M}/{D}",kg=UE+bU,_1=kg+"/{YY}",yU="{aa}",rwe="{h}:{mm}",Sp=rwe+yU,nL=UE+Sp,rL=":{ss}",In=null;function xU(t){let e=t*1e3,n=e*60,r=n*60,i=r*24,s=i*30,o=i*365,u=(t==1?Tv(10,0,3,Ew).filter(mU):Tv(10,-3,0,Ew)).concat([e,e*5,e*10,e*15,e*30,n,n*5,n*10,n*15,n*30,r,r*2,r*3,r*4,r*6,r*8,r*12,i,i*2,i*3,i*4,i*5,i*6,i*7,i*8,i*9,i*10,i*15,s,s*2,s*3,s*4,s*6,o,o*2,o*5,o*10,o*25,o*50,o*100]);const h=[[o,vU,In,In,In,In,In,In,1],[i*28,"{MMM}",tL,In,In,In,In,In,1],[i,bU,tL,In,In,In,In,In,1],[r,"{h}"+yU,_1,In,kg,In,In,In,1],[n,Sp,_1,In,kg,In,In,In,1],[e,rL,_1+" "+Sp,In,kg+" "+Sp,In,nL,In,1],[t,rL+".{fff}",_1+" "+Sp,In,kg+" "+Sp,In,nL,In,1]];function f(p){return(m,v,b,x,w,S)=>{let _=[],T=w>=o,C=w>=s&&w<o,j=p(b),A=lr(j*t,3),E=qT(j.getFullYear(),T?0:j.getMonth(),C||T?1:j.getDate()),R=lr(E*t,3);if(C||T){let N=C?w/s:0,$=T?w/o:0,D=A==R?A:lr(qT(E.getFullYear()+$,E.getMonth()+N,1)*t,3),F=new Date(_i(D/t)),Q=F.getFullYear(),H=F.getMonth();for(let q=0;D<=x;q++){let P=qT(Q+$*q,H+N*q,1),I=P-p(lr(P*t,3));D=lr((+P+I)*t,3),D<=x&&_.push(D)}}else{let N=w>=i?i:w,$=za(b)-za(A),D=R+$+TS(A-R,N);_.push(D);let F=p(D),Q=F.getHours()+F.getMinutes()/n+F.getSeconds()/r,H=w/r,q=m.axes[v]._space,P=S/q;for(;D=lr(D+w,t==1?0:3),!(D>x);)if(H>1){let I=za(lr(Q+H,6))%24,X=p(D).getHours()-I;X>1&&(X=-1),D-=X*r,Q=(Q+H)%24;let V=_[_.length-1];lr((D-V)/w,3)*P>=.7&&_.push(D)}else _.push(D)}return _}}return[u,h,f]}const[iwe,swe,awe]=xU(1),[owe,lwe,cwe]=xU(.001);Tv(2,-53,53,[1]);function iL(t,e){return t.map(n=>n.map((r,i)=>i==0||i==8||r==null?r:e(i==1||n[8]==0?r:n[1]+r)))}function sL(t,e){return(n,r,i,s,o)=>{let l=e.find(b=>o>=b[0])||e[e.length-1],u,h,f,p,m,v;return r.map(b=>{let x=t(b),w=x.getFullYear(),S=x.getMonth(),_=x.getDate(),T=x.getHours(),C=x.getMinutes(),j=x.getSeconds(),A=w!=u&&l[2]||S!=h&&l[3]||_!=f&&l[4]||T!=p&&l[5]||C!=m&&l[6]||j!=v&&l[7]||l[1];return u=w,h=S,f=_,p=T,m=C,v=j,A(x)})}}function uwe(t,e){let n=VE(e);return(r,i,s,o,l)=>i.map(u=>n(t(u)))}function qT(t,e,n){return new Date(t,e,n)}function aL(t,e){return e(t)}const hwe="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function oL(t,e){return(n,r,i,s)=>s==null?IE:e(t(r))}function dwe(t,e){let n=t.series[e];return n.width?n.stroke(t,e):n.points.width?n.points.stroke(t,e):null}function fwe(t,e){return t.series[e].fill(t,e)}const pwe={show:!0,live:!0,isolate:!1,mount:Dxe,markers:{show:!0,width:2,stroke:dwe,fill:fwe,dash:"solid"},idx:null,idxs:null,values:[]};function mwe(t,e){let n=t.cursor.points,r=so(),i=n.size(t,e);_r(r,Tg,i),_r(r,Cg,i);let s=i/-2;_r(r,"marginLeft",s),_r(r,"marginTop",s);let o=n.width(t,e,i);return o&&_r(r,"borderWidth",o),r}function gwe(t,e){let n=t.series[e].points;return n._fill||n._stroke}function vwe(t,e){let n=t.series[e].points;return n._stroke||n._fill}function bwe(t,e){return t.series[e].points.size}const FT=[0,0];function ywe(t,e,n){return FT[0]=e,FT[1]=n,FT}function T1(t,e,n,r=!0){return i=>{i.button==0&&(!r||i.target==e)&&n(i)}}function HT(t,e,n,r=!0){return i=>{(!r||i.target==e)&&n(i)}}const xwe={show:!0,x:!0,y:!0,lock:!1,move:ywe,points:{one:!1,show:mwe,size:bwe,width:0,stroke:vwe,fill:gwe},bind:{mousedown:T1,mouseup:T1,click:T1,dblclick:T1,mousemove:HT,mouseleave:HT,mouseenter:HT},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(t,e)=>{e.stopPropagation(),e.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(t,e,n,r,i)=>r-i,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},wU={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},QE=mi({},wU,{filter:oU}),SU=mi({},QE,{size:10}),jU=mi({},wU,{show:!1}),WE='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',_U="bold "+WE,TU=1.5,lL={show:!0,scale:"x",stroke:$E,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:_U,side:2,grid:QE,ticks:SU,border:jU,font:WE,lineGap:TU,rotate:0},wwe="Value",Swe="Time",cL={show:!0,scale:"x",auto:!1,sorted:1,min:or,max:-or,idxs:[]};function jwe(t,e,n,r,i){return e.map(s=>s==null?"":FE(s))}function _we(t,e,n,r,i,s,o){let l=[],u=qh.get(i)||0;n=o?n:lr(TS(n,i),u);for(let h=n;h<=r;h=lr(h+i,u))l.push(Object.is(h,-0)?0:h);return l}function d6(t,e,n,r,i,s,o){const l=[],u=t.scales[t.axes[e].scale].log,h=u==10?Yc:iU,f=za(h(n));i=Mm(u,f),u==10&&(i=Ad[Go(i,Ad)]);let p=n,m=i*u;u==10&&(m=Ad[Go(m,Ad)]);do l.push(p),p=p+i,u==10&&!qh.has(p)&&(p=lr(p,qh.get(i))),p>=m&&(i=p,m=i*u,u==10&&(m=Ad[Go(m,Ad)]));while(p<=r);return l}function Twe(t,e,n,r,i,s,o){let u=t.scales[t.axes[e].scale].asinh,h=r>u?d6(t,e,Vs(u,n),r,i):[u],f=r>=0&&n<=0?[0]:[];return(n<-u?d6(t,e,Vs(u,-r),-n,i):[u]).reverse().map(m=>-m).concat(f,h)}const CU=/./,Cwe=/[12357]/,kwe=/[125]/,uL=/1/,f6=(t,e,n,r)=>t.map((i,s)=>e==4&&i==0||s%r==0&&n.test(i.toExponential()[i<0?1:0])?i:null);function Owe(t,e,n,r,i){let s=t.axes[n],o=s.scale,l=t.scales[o],u=t.valToPos,h=s._space,f=u(10,o),p=u(9,o)-f>=h?CU:u(7,o)-f>=h?Cwe:u(5,o)-f>=h?kwe:uL;if(p==uL){let m=Ti(u(1,o)-f);if(m<h)return f6(e.slice().reverse(),l.distr,p,uo(h/m)).reverse()}return f6(e,l.distr,p,1)}function Ewe(t,e,n,r,i){let s=t.axes[n],o=s.scale,l=s._space,u=t.valToPos,h=Ti(u(1,o)-u(2,o));return h<l?f6(e.slice().reverse(),3,CU,uo(l/h)).reverse():e}function Awe(t,e,n,r){return r==null?IE:e==null?"":FE(e)}const hL={show:!0,scale:"y",stroke:$E,space:30,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:_U,side:3,grid:QE,ticks:SU,border:jU,font:WE,lineGap:TU,rotate:0};function Mwe(t,e){let n=3+(t||1)*2;return lr(n*e,3)}function Rwe(t,e){let{scale:n,idxs:r}=t.series[0],i=t._data[0],s=t.valToPos(i[r[0]],n,!0),o=t.valToPos(i[r[1]],n,!0),l=Ti(o-s),u=t.series[e],h=l/(u.points.space*Pn);return r[1]-r[0]<=h}const dL={scale:null,auto:!0,sorted:0,min:or,max:-or},kU=(t,e,n,r,i)=>i,fL={show:!0,auto:!0,sorted:0,gaps:kU,alpha:1,facets:[mi({},dL,{scale:"x"}),mi({},dL,{scale:"y"})]},pL={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:kU,alpha:1,points:{show:Rwe,filter:null},values:null,min:or,max:-or,idxs:[],path:null,clip:null};function Dwe(t,e,n,r,i){return n/10}const OU={time:ixe,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Nwe=mi({},OU,{time:!1,ori:1}),mL={};function EU(t,e){let n=mL[t];return n||(n={key:t,plots:[],sub(r){n.plots.push(r)},unsub(r){n.plots=n.plots.filter(i=>i!=r)},pub(r,i,s,o,l,u,h){for(let f=0;f<n.plots.length;f++)n.plots[f]!=i&&n.plots[f].pub(r,i,s,o,l,u,h)}},t!=null&&(mL[t]=n)),n}const Nm=1,p6=2;function Rf(t,e,n){const r=t.mode,i=t.series[e],s=r==2?t._data[e]:t._data,o=t.scales,l=t.bbox;let u=s[0],h=r==2?s[1]:s[e],f=r==2?o[i.facets[0].scale]:o[t.series[0].scale],p=r==2?o[i.facets[1].scale]:o[i.scale],m=l.left,v=l.top,b=l.width,x=l.height,w=t.valToPosH,S=t.valToPosV;return f.ori==0?n(i,u,h,f,p,w,S,m,v,b,x,OS,t0,AS,MU,DU):n(i,u,h,f,p,S,w,v,m,x,b,ES,n0,GE,RU,NU)}function YE(t,e){let n=0,r=0,i=On(t.bands,HE);for(let s=0;s<i.length;s++){let o=i[s];o.series[0]==e?n=o.dir:o.series[1]==e&&(o.dir==1?r|=1:r|=2)}return[n,r==1?-1:r==2?1:r==3?2:0]}function Pwe(t,e,n,r,i){let s=t.mode,o=t.series[e],l=s==2?o.facets[1].scale:o.scale,u=t.scales[l];return i==-1?u.min:i==1?u.max:u.distr==3?u.dir==1?u.min:u.max:0}function Xc(t,e,n,r,i,s){return Rf(t,e,(o,l,u,h,f,p,m,v,b,x,w)=>{let S=o.pxRound;const _=h.dir*(h.ori==0?1:-1),T=h.ori==0?t0:n0;let C,j;_==1?(C=n,j=r):(C=r,j=n);let A=S(p(l[C],h,x,v)),E=S(m(u[C],f,w,b)),R=S(p(l[j],h,x,v)),N=S(m(s==1?f.max:f.min,f,w,b)),$=new Path2D(i);return T($,R,N),T($,A,N),T($,A,E),$})}function kS(t,e,n,r,i,s){let o=null;if(t.length>0){o=new Path2D;const l=e==0?AS:GE;let u=n;for(let p=0;p<t.length;p++){let m=t[p];if(m[1]>m[0]){let v=m[0]-u;v>0&&l(o,u,r,v,r+s),u=m[1]}}let h=n+i-u,f=10;h>0&&l(o,u,r-f/2,h,r+s+f)}return o}function Lwe(t,e,n){let r=t[t.length-1];r&&r[0]==e?r[1]=n:t.push([e,n])}function XE(t,e,n,r,i,s,o){let l=[],u=t.length;for(let h=i==1?n:r;h>=n&&h<=r;h+=i)if(e[h]===null){let p=h,m=h;if(i==1)for(;++h<=r&&e[h]===null;)m=h;else for(;--h>=n&&e[h]===null;)m=h;let v=s(t[p]),b=m==p?v:s(t[m]),x=p-i;v=o<=0&&x>=0&&x<u?s(t[x]):v;let S=m+i;b=o>=0&&S>=0&&S<u?s(t[S]):b,b>=v&&l.push([v,b])}return l}function gL(t){return t==0?aU:t==1?_i:e=>Ed(e,t)}function AU(t){let e=t==0?OS:ES,n=t==0?(i,s,o,l,u,h)=>{i.arcTo(s,o,l,u,h)}:(i,s,o,l,u,h)=>{i.arcTo(o,s,u,l,h)},r=t==0?(i,s,o,l,u)=>{i.rect(s,o,l,u)}:(i,s,o,l,u)=>{i.rect(o,s,u,l)};return(i,s,o,l,u,h=0,f=0)=>{h==0&&f==0?r(i,s,o,l,u):(h=el(h,l/2,u/2),f=el(f,l/2,u/2),e(i,s+h,o),n(i,s+l,o,s+l,o+u,h),n(i,s+l,o+u,s,o+u,f),n(i,s,o+u,s,o,f),n(i,s,o,s+l,o,h),i.closePath())}}const OS=(t,e,n)=>{t.moveTo(e,n)},ES=(t,e,n)=>{t.moveTo(n,e)},t0=(t,e,n)=>{t.lineTo(e,n)},n0=(t,e,n)=>{t.lineTo(n,e)},AS=AU(0),GE=AU(1),MU=(t,e,n,r,i,s)=>{t.arc(e,n,r,i,s)},RU=(t,e,n,r,i,s)=>{t.arc(n,e,r,i,s)},DU=(t,e,n,r,i,s,o)=>{t.bezierCurveTo(e,n,r,i,s,o)},NU=(t,e,n,r,i,s,o)=>{t.bezierCurveTo(n,e,i,r,o,s)};function PU(t){return(e,n,r,i,s)=>Rf(e,n,(o,l,u,h,f,p,m,v,b,x,w)=>{let{pxRound:S,points:_}=o,T,C;h.ori==0?(T=OS,C=MU):(T=ES,C=RU);const j=lr(_.width*Pn,3);let A=(_.size-_.width)/2*Pn,E=lr(A*2,3),R=new Path2D,N=new Path2D,{left:$,top:D,width:F,height:Q}=e.bbox;AS(N,$-E,D-E,F+E*2,Q+E*2);const H=q=>{if(u[q]!=null){let P=S(p(l[q],h,x,v)),I=S(m(u[q],f,w,b));T(R,P+A,I),C(R,P,I,A,0,hx*2)}};if(s)s.forEach(H);else for(let q=r;q<=i;q++)H(q);return{stroke:j>0?R:null,fill:R,clip:N,flags:Nm|p6}})}function LU(t){return(e,n,r,i,s,o)=>{r!=i&&(s!=r&&o!=r&&t(e,n,r),s!=i&&o!=i&&t(e,n,i),t(e,n,o))}}const $we=LU(t0),Iwe=LU(n0);function $U(t){const e=On(t==null?void 0:t.alignGaps,0);return(n,r,i,s)=>Rf(n,r,(o,l,u,h,f,p,m,v,b,x,w)=>{[i,s]=jS(u,i,s);let S=o.pxRound,_=Q=>S(p(Q,h,x,v)),T=Q=>S(m(Q,f,w,b)),C,j;h.ori==0?(C=t0,j=$we):(C=n0,j=Iwe);const A=h.dir*(h.ori==0?1:-1),E={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Nm},R=E.stroke;let N=!1;if(s-i>=x*4){let Q=W=>n.posToVal(W,h.key,!0),H=null,q=null,P,I,U,Z=_(l[A==1?i:s]),X=_(l[i]),V=_(l[s]),G=Q(A==1?X+1:V-1);for(let W=A==1?i:s;W>=i&&W<=s;W+=A){let te=l[W],be=(A==1?te<G:te>G)?Z:_(te),ye=u[W];be==Z?ye!=null?(I=ye,H==null?(C(R,be,T(I)),P=H=q=I):I<H?H=I:I>q&&(q=I)):ye===null&&(N=!0):(H!=null&&j(R,Z,T(H),T(q),T(P),T(I)),ye!=null?(I=ye,C(R,be,T(I)),H=q=P=I):(H=q=null,ye===null&&(N=!0)),Z=be,G=Q(Z+A))}H!=null&&H!=q&&U!=Z&&j(R,Z,T(H),T(q),T(P),T(I))}else for(let Q=A==1?i:s;Q>=i&&Q<=s;Q+=A){let H=u[Q];H===null?N=!0:H!=null&&C(R,_(l[Q]),T(H))}let[D,F]=YE(n,r);if(o.fill!=null||D!=0){let Q=E.fill=new Path2D(R),H=o.fillTo(n,r,o.min,o.max,D),q=T(H),P=_(l[i]),I=_(l[s]);A==-1&&([I,P]=[P,I]),C(Q,I,q),C(Q,P,q)}if(!o.spanGaps){let Q=[];N&&Q.push(...XE(l,u,i,s,A,_,e)),E.gaps=Q=o.gaps(n,r,i,s,Q),E.clip=kS(Q,h.ori,v,b,x,w)}return F!=0&&(E.band=F==2?[Xc(n,r,i,s,R,-1),Xc(n,r,i,s,R,1)]:Xc(n,r,i,s,R,F)),E})}function Bwe(t){const e=On(t.align,1),n=On(t.ascDesc,!1),r=On(t.alignGaps,0),i=On(t.extend,!1);return(s,o,l,u)=>Rf(s,o,(h,f,p,m,v,b,x,w,S,_,T)=>{[l,u]=jS(p,l,u);let C=h.pxRound,{left:j,width:A}=s.bbox,E=X=>C(b(X,m,_,w)),R=X=>C(x(X,v,T,S)),N=m.ori==0?t0:n0;const $={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Nm},D=$.stroke,F=m.dir*(m.ori==0?1:-1);let Q=R(p[F==1?l:u]),H=E(f[F==1?l:u]),q=H,P=H;i&&e==-1&&(P=j,N(D,P,Q)),N(D,H,Q);for(let X=F==1?l:u;X>=l&&X<=u;X+=F){let V=p[X];if(V==null)continue;let G=E(f[X]),W=R(V);e==1?N(D,G,Q):N(D,q,W),N(D,G,W),Q=W,q=G}let I=q;i&&e==1&&(I=j+A,N(D,I,Q));let[U,Z]=YE(s,o);if(h.fill!=null||U!=0){let X=$.fill=new Path2D(D),V=h.fillTo(s,o,h.min,h.max,U),G=R(V);N(X,I,G),N(X,P,G)}if(!h.spanGaps){let X=[];X.push(...XE(f,p,l,u,F,E,r));let V=h.width*Pn/2,G=n||e==1?V:-V,W=n||e==-1?-V:V;X.forEach(te=>{te[0]+=G,te[1]+=W}),$.gaps=X=h.gaps(s,o,l,u,X),$.clip=kS(X,m.ori,w,S,_,T)}return Z!=0&&($.band=Z==2?[Xc(s,o,l,u,D,-1),Xc(s,o,l,u,D,1)]:Xc(s,o,l,u,D,Z)),$})}function vL(t,e,n,r,i,s,o=or){if(t.length>1){let l=null;for(let u=0,h=1/0;u<t.length;u++)if(e[u]!==void 0){if(l!=null){let f=Ti(t[u]-t[l]);f<h&&(h=f,o=Ti(n(t[u],r,i,s)-n(t[l],r,i,s)))}l=u}}return o}function zwe(t){t=t||qg;const e=On(t.size,[.6,or,1]),n=t.align||0,r=t.gap||0;let i=t.radius;i=i==null?[0,0]:typeof i=="number"?[i,0]:i;const s=mn(i),o=1-e[0],l=On(e[1],or),u=On(e[2],1),h=On(t.disp,qg),f=On(t.each,v=>{}),{fill:p,stroke:m}=h;return(v,b,x,w)=>Rf(v,b,(S,_,T,C,j,A,E,R,N,$,D)=>{let F=S.pxRound,Q=n,H=r*Pn,q=l*Pn,P=u*Pn,I,U;C.ori==0?[I,U]=s(v,b):[U,I]=s(v,b);const Z=C.dir*(C.ori==0?1:-1);let X=C.ori==0?AS:GE,V=C.ori==0?f:(Le,Ce,ge,Kt,qn,Ft,xn)=>{f(Le,Ce,ge,qn,Kt,xn,Ft)},G=On(v.bands,HE).find(Le=>Le.series[0]==b),W=G!=null?G.dir:0,te=S.fillTo(v,b,S.min,S.max,W),oe=F(E(te,j,D,N)),be,ye,Ke,Fe=$,Pe=F(S.width*Pn),ae=!1,Te=null,fe=null,Ee=null,gt=null;p!=null&&(Pe==0||m!=null)&&(ae=!0,Te=p.values(v,b,x,w),fe=new Map,new Set(Te).forEach(Le=>{Le!=null&&fe.set(Le,new Path2D)}),Pe>0&&(Ee=m.values(v,b,x,w),gt=new Map,new Set(Ee).forEach(Le=>{Le!=null&&gt.set(Le,new Path2D)})));let{x0:We,size:Be}=h;if(We!=null&&Be!=null){Q=1,_=We.values(v,b,x,w),We.unit==2&&(_=_.map(ge=>v.posToVal(R+ge*$,C.key,!0)));let Le=Be.values(v,b,x,w);Be.unit==2?ye=Le[0]*$:ye=A(Le[0],C,$,R)-A(0,C,$,R),Fe=vL(_,T,A,C,$,R,Fe),Ke=Fe-ye+H}else Fe=vL(_,T,A,C,$,R,Fe),Ke=Fe*o+H,ye=Fe-Ke;Ke<1&&(Ke=0),Pe>=ye/2&&(Pe=0),Ke<5&&(F=aU);let ze=Ke>0,De=Fe-Ke-(ze?Pe:0);ye=F(h6(De,P,q)),be=(Q==0?ye/2:Q==Z?0:ye)-Q*Z*((Q==0?H/2:0)+(ze?Pe/2:0));const Ye={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},$t=ae?null:new Path2D;let tt=null;if(G!=null)tt=v.data[G.series[1]];else{let{y0:Le,y1:Ce}=h;Le!=null&&Ce!=null&&(T=Ce.values(v,b,x,w),tt=Le.values(v,b,x,w))}let et=I*ye,Ve=U*ye;for(let Le=Z==1?x:w;Le>=x&&Le<=w;Le+=Z){let Ce=T[Le];if(Ce==null)continue;if(tt!=null){let nn=tt[Le]??0;if(Ce-nn==0)continue;oe=E(nn,j,D,N)}let ge=C.distr!=2||h!=null?_[Le]:Le,Kt=A(ge,C,$,R),qn=E(On(Ce,te),j,D,N),Ft=F(Kt-be),xn=F(Vs(qn,oe)),Zt=F(el(qn,oe)),ln=xn-Zt;if(Ce!=null){let nn=Ce<0?Ve:et,Pt=Ce<0?et:Ve;ae?(Pe>0&&Ee[Le]!=null&&X(gt.get(Ee[Le]),Ft,Zt+za(Pe/2),ye,Vs(0,ln-Pe),nn,Pt),Te[Le]!=null&&X(fe.get(Te[Le]),Ft,Zt+za(Pe/2),ye,Vs(0,ln-Pe),nn,Pt)):X($t,Ft,Zt+za(Pe/2),ye,Vs(0,ln-Pe),nn,Pt),V(v,b,Le,Ft-Pe/2,Zt,ye+Pe,ln)}}return Pe>0?Ye.stroke=ae?gt:$t:ae||(Ye._fill=S.width==0?S._fill:S._stroke??S._fill,Ye.width=0),Ye.fill=ae?fe:$t,Ye})}function qwe(t,e){const n=On(e==null?void 0:e.alignGaps,0);return(r,i,s,o)=>Rf(r,i,(l,u,h,f,p,m,v,b,x,w,S)=>{[s,o]=jS(h,s,o);let _=l.pxRound,T=I=>_(m(I,f,w,b)),C=I=>_(v(I,p,S,x)),j,A,E;f.ori==0?(j=OS,E=t0,A=DU):(j=ES,E=n0,A=NU);const R=f.dir*(f.ori==0?1:-1);let N=T(u[R==1?s:o]),$=N,D=[],F=[];for(let I=R==1?s:o;I>=s&&I<=o;I+=R)if(h[I]!=null){let Z=u[I],X=T(Z);D.push($=X),F.push(C(h[I]))}const Q={stroke:t(D,F,j,E,A,_),fill:null,clip:null,band:null,gaps:null,flags:Nm},H=Q.stroke;let[q,P]=YE(r,i);if(l.fill!=null||q!=0){let I=Q.fill=new Path2D(H),U=l.fillTo(r,i,l.min,l.max,q),Z=C(U);E(I,$,Z),E(I,N,Z)}if(!l.spanGaps){let I=[];I.push(...XE(u,h,s,o,R,T,n)),Q.gaps=I=l.gaps(r,i,s,o,I),Q.clip=kS(I,f.ori,b,x,w,S)}return P!=0&&(Q.band=P==2?[Xc(r,i,s,o,H,-1),Xc(r,i,s,o,H,1)]:Xc(r,i,s,o,H,P)),Q})}function Fwe(t){return qwe(Hwe,t)}function Hwe(t,e,n,r,i,s){const o=t.length;if(o<2)return null;const l=new Path2D;if(n(l,t[0],e[0]),o==2)r(l,t[1],e[1]);else{let u=Array(o),h=Array(o-1),f=Array(o-1),p=Array(o-1);for(let m=0;m<o-1;m++)f[m]=e[m+1]-e[m],p[m]=t[m+1]-t[m],h[m]=f[m]/p[m];u[0]=h[0];for(let m=1;m<o-1;m++)h[m]===0||h[m-1]===0||h[m-1]>0!=h[m]>0?u[m]=0:(u[m]=3*(p[m-1]+p[m])/((2*p[m]+p[m-1])/h[m-1]+(p[m]+2*p[m-1])/h[m]),isFinite(u[m])||(u[m]=0));u[o-1]=h[o-2];for(let m=0;m<o-1;m++)i(l,t[m]+p[m]/3,e[m]+u[m]*p[m]/3,t[m+1]-p[m]/3,e[m+1]-u[m+1]*p[m]/3,t[m+1],e[m+1])}return l}const m6=new Set;function bL(){for(let t of m6)t.syncRect(!0)}e0&&(cf(jxe,Wp,bL),cf(_xe,Wp,bL,!0),cf(kw,Wp,()=>{Oi.pxRatio=Pn}));const Vwe=$U(),Uwe=PU();function yL(t,e,n,r){return(r?[t[0],t[1]].concat(t.slice(2)):[t[0]].concat(t.slice(1))).map((s,o)=>g6(s,o,e,n))}function Qwe(t,e){return t.map((n,r)=>r==0?{}:mi({},e,n))}function g6(t,e,n,r){return mi({},e==0?n:r,t)}function IU(t,e,n){return e==null?Rm:[e,n]}const Wwe=IU;function Ywe(t,e,n){return e==null?Rm:Ow(e,n,qE,!0)}function BU(t,e,n,r){return e==null?Rm:_S(e,n,t.scales[r].log,!1)}const Xwe=BU;function zU(t,e,n,r){return e==null?Rm:zE(e,n,t.scales[r].log,!1)}const Gwe=zU;function Kwe(t,e,n,r,i){let s=Vs(K9(t),K9(e)),o=e-t,l=Go(i/r*o,n);do{let u=n[l],h=r*u/o;if(h>=i&&s+(u<5?qh.get(u):0)<=17)return[u,h]}while(++l<n.length);return[0,0]}function xL(t){let e,n;return t=t.replace(/(\d+)px/,(r,i)=>(e=_i((n=+i)*Pn))+"px"),[t,e,n]}function Zwe(t){t.show&&[t.font,t.labelFont].forEach(e=>{let n=lr(e[2]*Pn,1);e[0]=e[0].replace(/[0-9.]+px/,n+"px"),e[1]=n})}function Oi(t,e,n){const r={mode:On(t.mode,1)},i=r.mode;function s(z,Y,J,ee){let ce=Y.valToPct(z);return ee+J*(Y.dir==-1?1-ce:ce)}function o(z,Y,J,ee){let ce=Y.valToPct(z);return ee+J*(Y.dir==-1?ce:1-ce)}function l(z,Y,J,ee){return Y.ori==0?s(z,Y,J,ee):o(z,Y,J,ee)}r.valToPosH=s,r.valToPosV=o;let u=!1;r.status=0;const h=r.root=so(sxe);if(t.id!=null&&(h.id=t.id),Oa(h,t.class),t.title){let z=so(lxe,h);z.textContent=t.title}const f=Io("canvas"),p=r.ctx=f.getContext("2d"),m=so(cxe,h);cf("click",m,z=>{z.target===b&&(Ln!=Rs||Vn!=bl)&&Tn.click(r,z)},!0);const v=r.under=so(uxe,m);m.appendChild(f);const b=r.over=so(hxe,m);t=Dm(t);const x=+On(t.pxAlign,1),w=gL(x);(t.plugins||[]).forEach(z=>{z.opts&&(t=z.opts(r,t)||t)});const S=t.ms||.001,_=r.series=i==1?yL(t.series||[],cL,pL,!1):Qwe(t.series||[null],fL),T=r.axes=yL(t.axes||[],lL,hL,!0),C=r.scales={},j=r.bands=t.bands||[];j.forEach(z=>{z.fill=mn(z.fill||null),z.dir=On(z.dir,-1)});const A=i==2?_[1].facets[0].scale:_[0].scale,E={axes:gl,series:i0},R=(t.drawOrder||["axes","series"]).map(z=>E[z]);function N(z){const Y=z.distr==3?J=>Yc(J>0?J:z.clamp(r,J,z.min,z.max,z.key)):z.distr==4?J=>zT(J,z.asinh):z.distr==100?J=>z.fwd(J):J=>J;return J=>{let ee=Y(J),{_min:ce,_max:me}=z,Re=me-ce;return(ee-ce)/Re}}function $(z){let Y=C[z];if(Y==null){let J=(t.scales||qg)[z]||qg;if(J.from!=null){$(J.from);let ee=mi({},C[J.from],J,{key:z});ee.valToPct=N(ee),C[z]=ee}else{Y=C[z]=mi({},z==A?OU:Nwe,J),Y.key=z;let ee=Y.time,ce=Y.range,me=ih(ce);if((z!=A||i==2&&!ee)&&(me&&(ce[0]==null||ce[1]==null)&&(ce={min:ce[0]==null?Y9:{mode:1,hard:ce[0],soft:ce[0]},max:ce[1]==null?Y9:{mode:1,hard:ce[1],soft:ce[1]}},me=!1),!me&&CS(ce))){let Re=ce;ce=(He,Xe,ct)=>Xe==null?Rm:Ow(Xe,ct,Re)}Y.range=mn(ce||(ee?Wwe:z==A?Y.distr==3?Xwe:Y.distr==4?Gwe:IU:Y.distr==3?BU:Y.distr==4?zU:Ywe)),Y.auto=mn(me?!1:Y.auto),Y.clamp=mn(Y.clamp||Dwe),Y._min=Y._max=null,Y.valToPct=N(Y)}}}$("x"),$("y"),i==1&&_.forEach(z=>{$(z.scale)}),T.forEach(z=>{$(z.scale)});for(let z in t.scales)$(z);const D=C[A],F=D.distr;let Q,H;D.ori==0?(Oa(h,axe),Q=s,H=o):(Oa(h,oxe),Q=o,H=s);const q={};for(let z in C){let Y=C[z];(Y.min!=null||Y.max!=null)&&(q[z]={min:Y.min,max:Y.max},Y.min=Y.max=null)}const P=t.tzDate||(z=>new Date(_i(z/S))),I=t.fmtDate||VE,U=S==1?awe(P):cwe(P),Z=sL(P,iL(S==1?swe:lwe,I)),X=oL(P,aL(hwe,I)),V=[],G=r.legend=mi({},pwe,t.legend),W=r.cursor=mi({},xwe,{drag:{y:i==2}},t.cursor),te=G.show,oe=W.show,be=G.markers;G.idxs=V,be.width=mn(be.width),be.dash=mn(be.dash),be.stroke=mn(be.stroke),be.fill=mn(be.fill);let ye,Ke,Fe,Pe=[],ae=[],Te,fe=!1,Ee={};if(G.live){const z=_[1]?_[1].values:null;fe=z!=null,Te=fe?z(r,1,0):{_:0};for(let Y in Te)Ee[Y]=IE}if(te)if(ye=Io("table",vxe,h),Fe=Io("tbody",null,ye),G.mount(r,ye),fe){Ke=Io("thead",null,ye,Fe);let z=Io("tr",null,Ke);Io("th",null,z);for(var gt in Te)Io("th",P9,z).textContent=gt}else Oa(ye,yxe),G.live&&Oa(ye,bxe);const We={show:!0},Be={show:!1};function ze(z,Y){if(Y==0&&(fe||!G.live||i==2))return Rm;let J=[],ee=Io("tr",xxe,Fe,Fe.childNodes[Y]);Oa(ee,z.class),z.show||Oa(ee,Pd);let ce=Io("th",null,ee);if(be.show){let He=so(wxe,ce);if(Y>0){let Xe=be.width(r,Y);Xe&&(He.style.border=Xe+"px "+be.dash(r,Y)+" "+be.stroke(r,Y)),He.style.background=be.fill(r,Y)}}let me=so(P9,ce);z.label instanceof HTMLElement?me.appendChild(z.label):me.textContent=z.label,Y>0&&(be.show||(me.style.color=z.width>0?be.stroke(r,Y):be.fill(r,Y)),Ye("click",ce,He=>{if(W._lock)return;rn(He);let Xe=_.indexOf(z);if((He.ctrlKey||He.metaKey)!=G.isolate){let ct=_.some((dt,vt)=>vt>0&&vt!=Xe&&dt.show);_.forEach((dt,vt)=>{vt>0&&Ds(vt,ct?vt==Xe?We:Be:We,!0,Hr.setSeries)})}else Ds(Xe,{show:!z.show},!0,Hr.setSeries)},!1),Ze&&Ye(B9,ce,He=>{W._lock||(rn(He),Ds(_.indexOf(z),xu,!0,Hr.setSeries))},!1));for(var Re in Te){let He=Io("td",Sxe,ee);He.textContent="--",J.push(He)}return[ee,J]}const De=new Map;function Ye(z,Y,J,ee=!0){const ce=De.get(Y)||{},me=W.bind[z](r,Y,J,ee);me&&(cf(z,Y,ce[z]=me),De.set(Y,ce))}function $t(z,Y,J){const ee=De.get(Y)||{};for(let ce in ee)(z==null||ce==z)&&(u6(ce,Y,ee[ce]),delete ee[ce]);z==null&&De.delete(Y)}let tt=0,et=0,Ve=0,Le=0,Ce=0,ge=0,Kt=Ce,qn=ge,Ft=Ve,xn=Le,Zt=0,ln=0,nn=0,Pt=0;r.bbox={};let Wt=!1,Ri=!1,yt=!1,kt=!1,ir=!1,It=!1;function dr(z,Y,J){(J||z!=r.width||Y!=r.height)&&An(z,Y),gs(!1),yt=!0,Ri=!0,Dt()}function An(z,Y){r.width=tt=Ve=z,r.height=et=Le=Y,Ce=ge=0,Et(),Mn();let J=r.bbox;Zt=J.left=Ed(Ce*Pn,.5),ln=J.top=Ed(ge*Pn,.5),nn=J.width=Ed(Ve*Pn,.5),Pt=J.height=Ed(Le*Pn,.5)}const ie=3;function Oe(){let z=!1,Y=0;for(;!z;){Y++;let J=Fr(Y),ee=Rn(Y);z=Y==ie||J&&ee,z||(An(r.width,r.height),Ri=!0)}}function nt({width:z,height:Y}){dr(z,Y)}r.setSize=nt;function Et(){let z=!1,Y=!1,J=!1,ee=!1;T.forEach((ce,me)=>{if(ce.show&&ce._show){let{side:Re,_size:He}=ce,Xe=Re%2,ct=ce.label!=null?ce.labelSize:0,dt=He+ct;dt>0&&(Xe?(Ve-=dt,Re==3?(Ce+=dt,ee=!0):J=!0):(Le-=dt,Re==0?(ge+=dt,z=!0):Y=!0))}}),fs[0]=z,fs[1]=J,fs[2]=Y,fs[3]=ee,Ve-=va[1]+va[3],Ce+=va[3],Le-=va[2]+va[0],ge+=va[0]}function Mn(){let z=Ce+Ve,Y=ge+Le,J=Ce,ee=ge;function ce(me,Re){switch(me){case 1:return z+=Re,z-Re;case 2:return Y+=Re,Y-Re;case 3:return J-=Re,J+Re;case 0:return ee-=Re,ee+Re}}T.forEach((me,Re)=>{if(me.show&&me._show){let He=me.side;me._pos=ce(He,me._size),me.label!=null&&(me._lpos=ce(He,me.labelSize))}})}if(W.dataIdx==null){let z=W.hover,Y=z.skip=new Set(z.skip??[]);Y.add(void 0);let J=z.prox=mn(z.prox),ee=z.bias??(z.bias=0);W.dataIdx=(ce,me,Re,He)=>{if(me==0)return Re;let Xe=Re,ct=J(ce,me,Re,He)??or,dt=ct>=0&&ct<or,vt=D.ori==0?Ve:Le,Lt=W.left,Sn=e[0],Bt=e[me];if(Y.has(Bt[Re])){Xe=null;let Qt=null,Mt=null,Tt;if(ee==0||ee==-1)for(Tt=Re;Qt==null&&Tt-- >0;)Y.has(Bt[Tt])||(Qt=Tt);if(ee==0||ee==1)for(Tt=Re;Mt==null&&Tt++<Bt.length;)Y.has(Bt[Tt])||(Mt=Tt);if(Qt!=null||Mt!=null)if(dt){let Jn=Qt==null?-1/0:Q(Sn[Qt],D,vt,0),yr=Mt==null?1/0:Q(Sn[Mt],D,vt,0),Vr=Lt-Jn,$n=yr-Lt;Vr<=$n?Vr<=ct&&(Xe=Qt):$n<=ct&&(Xe=Mt)}else Xe=Mt==null?Qt:Qt==null?Mt:Re-Qt<=Mt-Re?Qt:Mt}else dt&&Ti(Lt-Q(Sn[Re],D,vt,0))>ct&&(Xe=null);return Xe}}const rn=z=>{W.event=z};W.idxs=V,W._lock=!1;let rt=W.points;rt.show=mn(rt.show),rt.size=mn(rt.size),rt.stroke=mn(rt.stroke),rt.width=mn(rt.width),rt.fill=mn(rt.fill);const st=r.focus=mi({},t.focus||{alpha:.3},W.focus),Ze=st.prox>=0,Ht=Ze&&rt.one;let Yt=[],xi=[],ds=[];function oc(z,Y){let J=rt.show(r,Y);if(J instanceof HTMLElement)return Oa(J,gxe),Oa(J,z.class),Ol(J,-10,-10,Ve,Le),b.insertBefore(J,Yt[Y]),J}function ga(z,Y){if(i==1||Y>0){let J=i==1&&C[z.scale].time,ee=z.value;z.value=J?eL(ee)?oL(P,aL(ee,I)):ee||X:ee||Awe,z.label=z.label||(J?Swe:wwe)}if(Ht||Y>0){z.width=z.width==null?1:z.width,z.paths=z.paths||Vwe||Nxe,z.fillTo=mn(z.fillTo||Pwe),z.pxAlign=+On(z.pxAlign,x),z.pxRound=gL(z.pxAlign),z.stroke=mn(z.stroke||null),z.fill=mn(z.fill||null),z._stroke=z._fill=z._paths=z._focus=null;let J=Mwe(Vs(1,z.width),1),ee=z.points=mi({},{size:J,width:Vs(1,J*.2),stroke:z.stroke,space:J*2,paths:Uwe,_stroke:null,_fill:null},z.points);ee.show=mn(ee.show),ee.filter=mn(ee.filter),ee.fill=mn(ee.fill),ee.stroke=mn(ee.stroke),ee.paths=mn(ee.paths),ee.pxAlign=z.pxAlign}if(te){let J=ze(z,Y);Pe.splice(Y,0,J[0]),ae.splice(Y,0,J[1]),G.values.push(null)}if(oe){V.splice(Y,0,null);let J=null;Ht?Y==0&&(J=oc(z,Y)):Y>0&&(J=oc(z,Y)),Yt.splice(Y,0,J),xi.splice(Y,0,0),ds.splice(Y,0,0)}ei("addSeries",Y)}function $r(z,Y){Y=Y??_.length,z=i==1?g6(z,Y,cL,pL):g6(z,Y,{},fL),_.splice(Y,0,z),ga(_[Y],Y)}r.addSeries=$r;function Di(z){if(_.splice(z,1),te){G.values.splice(z,1),ae.splice(z,1);let Y=Pe.splice(z,1)[0];$t(null,Y.firstChild),Y.remove()}oe&&(V.splice(z,1),Yt.splice(z,1)[0].remove(),xi.splice(z,1),ds.splice(z,1)),ei("delSeries",z)}r.delSeries=Di;const fs=[!1,!1,!1,!1];function ed(z,Y){if(z._show=z.show,z.show){let J=z.side%2,ee=C[z.scale];ee==null&&(z.scale=J?_[1].scale:A,ee=C[z.scale]);let ce=ee.time;z.size=mn(z.size),z.space=mn(z.space),z.rotate=mn(z.rotate),ih(z.incrs)&&z.incrs.forEach(Re=>{!qh.has(Re)&&qh.set(Re,cU(Re))}),z.incrs=mn(z.incrs||(ee.distr==2?nwe:ce?S==1?iwe:owe:Ad)),z.splits=mn(z.splits||(ce&&ee.distr==1?U:ee.distr==3?d6:ee.distr==4?Twe:_we)),z.stroke=mn(z.stroke),z.grid.stroke=mn(z.grid.stroke),z.ticks.stroke=mn(z.ticks.stroke),z.border.stroke=mn(z.border.stroke);let me=z.values;z.values=ih(me)&&!ih(me[0])?mn(me):ce?ih(me)?sL(P,iL(me,I)):eL(me)?uwe(P,me):me||Z:me||jwe,z.filter=mn(z.filter||(ee.distr>=3&&ee.log==10?Owe:ee.distr==3&&ee.log==2?Ewe:oU)),z.font=xL(z.font),z.labelFont=xL(z.labelFont),z._size=z.size(r,null,Y,0),z._space=z._rotate=z._incrs=z._found=z._splits=z._values=null,z._size>0&&(fs[Y]=!0,z._el=so(dxe,m))}}function ml(z,Y,J,ee){let[ce,me,Re,He]=J,Xe=Y%2,ct=0;return Xe==0&&(He||me)&&(ct=Y==0&&!ce||Y==2&&!Re?_i(lL.size/3):0),Xe==1&&(ce||Re)&&(ct=Y==1&&!me||Y==3&&!He?_i(hL.size/2):0),ct}const lc=r.padding=(t.padding||[ml,ml,ml,ml]).map(z=>mn(On(z,ml))),va=r._padding=lc.map((z,Y)=>z(r,Y,fs,0));let vr,Er=null,yn=null;const Ys=i==1?_[0].idxs:null;let oi=null,Xs=!1;function Ir(z,Y){if(e=z??[],r.data=r._data=e,i==2){vr=0;for(let J=1;J<_.length;J++)vr+=e[J][0].length}else{e.length==0&&(r.data=r._data=e=[[]]),oi=e[0],vr=oi.length;let J=e;if(F==2){J=e.slice();let ee=J[0]=Array(vr);for(let ce=0;ce<vr;ce++)ee[ce]=ce}r._data=e=J}if(gs(!0),ei("setData"),F==2&&(yt=!0),Y!==!1){let J=D;J.auto(r,Xs)?hu():Gs(A,J.min,J.max),kt=kt||W.left>=0,It=!0,Dt()}}r.setData=Ir;function hu(){Xs=!0;let z,Y;i==1&&(vr>0?(Er=Ys[0]=0,yn=Ys[1]=vr-1,z=e[0][Er],Y=e[0][yn],F==2?(z=Er,Y=yn):z==Y&&(F==3?[z,Y]=_S(z,z,D.log,!1):F==4?[z,Y]=zE(z,z,D.log,!1):D.time?Y=z+_i(86400/S):[z,Y]=Ow(z,Y,qE,!0))):(Er=Ys[0]=z=null,yn=Ys[1]=Y=null)),Gs(A,z,Y)}let Qa,ps,Qe,_t,Xt,wn,br,li,Gi,Fn;function Hn(z,Y,J,ee,ce,me){z??(z=$9),J??(J=HE),ee??(ee="butt"),ce??(ce=$9),me??(me="round"),z!=Qa&&(p.strokeStyle=Qa=z),ce!=ps&&(p.fillStyle=ps=ce),Y!=Qe&&(p.lineWidth=Qe=Y),me!=Xt&&(p.lineJoin=Xt=me),ee!=wn&&(p.lineCap=wn=ee),J!=_t&&p.setLineDash(_t=J)}function ms(z,Y,J,ee){Y!=ps&&(p.fillStyle=ps=Y),z!=br&&(p.font=br=z),J!=li&&(p.textAlign=li=J),ee!=Gi&&(p.textBaseline=Gi=ee)}function du(z,Y,J,ee,ce=0){if(ee.length>0&&z.auto(r,Xs)&&(Y==null||Y.min==null)){let me=On(Er,0),Re=On(yn,ee.length-1),He=J.min==null?Oxe(ee,me,Re,ce,z.distr==3):[J.min,J.max];z.min=el(z.min,J.min=He[0]),z.max=Vs(z.max,J.max=He[1])}}const cc={min:null,max:null};function td(){for(let ee in C){let ce=C[ee];q[ee]==null&&(ce.min==null||q[A]!=null&&ce.auto(r,Xs))&&(q[ee]=cc)}for(let ee in C){let ce=C[ee];q[ee]==null&&ce.from!=null&&q[ce.from]!=null&&(q[ee]=cc)}q[A]!=null&&gs(!0);let z={};for(let ee in q){let ce=q[ee];if(ce!=null){let me=z[ee]=Dm(C[ee],$xe);if(ce.min!=null)mi(me,ce);else if(ee!=A||i==2)if(vr==0&&me.from==null){let Re=me.range(r,null,null,ee);me.min=Re[0],me.max=Re[1]}else me.min=or,me.max=-or}}if(vr>0){_.forEach((ee,ce)=>{if(i==1){let me=ee.scale,Re=q[me];if(Re==null)return;let He=z[me];if(ce==0){let Xe=He.range(r,He.min,He.max,me);He.min=Xe[0],He.max=Xe[1],Er=Go(He.min,e[0]),yn=Go(He.max,e[0]),yn-Er>1&&(e[0][Er]<He.min&&Er++,e[0][yn]>He.max&&yn--),ee.min=oi[Er],ee.max=oi[yn]}else ee.show&&ee.auto&&du(He,Re,ee,e[ce],ee.sorted);ee.idxs[0]=Er,ee.idxs[1]=yn}else if(ce>0&&ee.show&&ee.auto){let[me,Re]=ee.facets,He=me.scale,Xe=Re.scale,[ct,dt]=e[ce],vt=z[He],Lt=z[Xe];vt!=null&&du(vt,q[He],me,ct,me.sorted),Lt!=null&&du(Lt,q[Xe],Re,dt,Re.sorted),ee.min=Re.min,ee.max=Re.max}});for(let ee in z){let ce=z[ee],me=q[ee];if(ce.from==null&&(me==null||me.min==null)){let Re=ce.range(r,ce.min==or?null:ce.min,ce.max==-or?null:ce.max,ee);ce.min=Re[0],ce.max=Re[1]}}}for(let ee in z){let ce=z[ee];if(ce.from!=null){let me=z[ce.from];if(me.min==null)ce.min=ce.max=null;else{let Re=ce.range(r,me.min,me.max,ee);ce.min=Re[0],ce.max=Re[1]}}}let Y={},J=!1;for(let ee in z){let ce=z[ee],me=C[ee];if(me.min!=ce.min||me.max!=ce.max){me.min=ce.min,me.max=ce.max;let Re=me.distr;me._min=Re==3?Yc(me.min):Re==4?zT(me.min,me.asinh):Re==100?me.fwd(me.min):me.min,me._max=Re==3?Yc(me.max):Re==4?zT(me.max,me.asinh):Re==100?me.fwd(me.max):me.max,Y[ee]=J=!0}}if(J){_.forEach((ee,ce)=>{i==2?ce>0&&Y.y&&(ee._paths=null):Y[ee.scale]&&(ee._paths=null)});for(let ee in Y)yt=!0,ei("setScale",ee);oe&&W.left>=0&&(kt=It=!0)}for(let ee in q)q[ee]=null}function fu(z){let Y=h6(Er-1,0,vr-1),J=h6(yn+1,0,vr-1);for(;z[Y]==null&&Y>0;)Y--;for(;z[J]==null&&J<vr-1;)J++;return[Y,J]}function i0(){if(vr>0){let z=_.some(Y=>Y._focus)&&Fn!=st.alpha;z&&(p.globalAlpha=Fn=st.alpha),_.forEach((Y,J)=>{if(J>0&&Y.show&&(Ki(J,!1),Ki(J,!0),Y._paths==null)){let ee=Fn;Fn!=Y.alpha&&(p.globalAlpha=Fn=Y.alpha);let ce=i==2?[0,e[J][0].length-1]:fu(e[J]);Y._paths=Y.paths(r,J,ce[0],ce[1]),Fn!=ee&&(p.globalAlpha=Fn=ee)}}),_.forEach((Y,J)=>{if(J>0&&Y.show){let ee=Fn;Fn!=Y.alpha&&(p.globalAlpha=Fn=Y.alpha),Y._paths!=null&&pu(J,!1);{let ce=Y._paths!=null?Y._paths.gaps:null,me=Y.points.show(r,J,Er,yn,ce),Re=Y.points.filter(r,J,me,ce);(me||Re)&&(Y.points._paths=Y.points.paths(r,J,Er,yn,Re),pu(J,!0))}Fn!=ee&&(p.globalAlpha=Fn=ee),ei("drawSeries",J)}}),z&&(p.globalAlpha=Fn=1)}}function Ki(z,Y){let J=Y?_[z].points:_[z];J._stroke=J.stroke(r,z),J._fill=J.fill(r,z)}function pu(z,Y){let J=Y?_[z].points:_[z],{stroke:ee,fill:ce,clip:me,flags:Re,_stroke:He=J._stroke,_fill:Xe=J._fill,_width:ct=J.width}=J._paths;ct=lr(ct*Pn,3);let dt=null,vt=ct%2/2;Y&&Xe==null&&(Xe=ct>0?"#fff":He);let Lt=J.pxAlign==1&&vt>0;if(Lt&&p.translate(vt,vt),!Y){let Sn=Zt-ct/2,Bt=ln-ct/2,Qt=nn+ct,Mt=Pt+ct;dt=new Path2D,dt.rect(Sn,Bt,Qt,Mt)}Y?Jr(He,ct,J.dash,J.cap,Xe,ee,ce,Re,me):uc(z,He,ct,J.dash,J.cap,Xe,ee,ce,Re,dt,me),Lt&&p.translate(-vt,-vt)}function uc(z,Y,J,ee,ce,me,Re,He,Xe,ct,dt){let vt=!1;Xe!=0&&j.forEach((Lt,Sn)=>{if(Lt.series[0]==z){let Bt=_[Lt.series[1]],Qt=e[Lt.series[1]],Mt=(Bt._paths||qg).band;ih(Mt)&&(Mt=Lt.dir==1?Mt[0]:Mt[1]);let Tt,Jn=null;Bt.show&&Mt&&Axe(Qt,Er,yn)?(Jn=Lt.fill(r,Sn)||me,Tt=Bt._paths.clip):Mt=null,Jr(Y,J,ee,ce,Jn,Re,He,Xe,ct,dt,Tt,Mt),vt=!0}}),vt||Jr(Y,J,ee,ce,me,Re,He,Xe,ct,dt)}const hc=Nm|p6;function Jr(z,Y,J,ee,ce,me,Re,He,Xe,ct,dt,vt){Hn(z,Y,J,ee,ce),(Xe||ct||vt)&&(p.save(),Xe&&p.clip(Xe),ct&&p.clip(ct)),vt?(He&hc)==hc?(p.clip(vt),dt&&p.clip(dt),Eo(ce,Re),dc(z,me,Y)):He&p6?(Eo(ce,Re),p.clip(vt),dc(z,me,Y)):He&Nm&&(p.save(),p.clip(vt),dt&&p.clip(dt),Eo(ce,Re),p.restore(),dc(z,me,Y)):(Eo(ce,Re),dc(z,me,Y)),(Xe||ct||vt)&&p.restore()}function dc(z,Y,J){J>0&&(Y instanceof Map?Y.forEach((ee,ce)=>{p.strokeStyle=Qa=ce,p.stroke(ee)}):Y!=null&&z&&p.stroke(Y))}function Eo(z,Y){Y instanceof Map?Y.forEach((J,ee)=>{p.fillStyle=ps=ee,p.fill(J)}):Y!=null&&z&&p.fill(Y)}function At(z,Y,J,ee){let ce=T[z],me;if(ee<=0)me=[0,0];else{let Re=ce._space=ce.space(r,z,Y,J,ee),He=ce._incrs=ce.incrs(r,z,Y,J,ee,Re);me=Kwe(Y,J,He,ee,Re)}return ce._found=me}function mu(z,Y,J,ee,ce,me,Re,He,Xe,ct){let dt=Re%2/2;x==1&&p.translate(dt,dt),Hn(He,Re,Xe,ct,He),p.beginPath();let vt,Lt,Sn,Bt,Qt=ce+(ee==0||ee==3?-me:me);J==0?(Lt=ce,Bt=Qt):(vt=ce,Sn=Qt);for(let Mt=0;Mt<z.length;Mt++)Y[Mt]!=null&&(J==0?vt=Sn=z[Mt]:Lt=Bt=z[Mt],p.moveTo(vt,Lt),p.lineTo(Sn,Bt));p.stroke(),x==1&&p.translate(-dt,-dt)}function Fr(z){let Y=!0;return T.forEach((J,ee)=>{if(!J.show)return;let ce=C[J.scale];if(ce.min==null){J._show&&(Y=!1,J._show=!1,gs(!1));return}else J._show||(Y=!1,J._show=!0,gs(!1));let me=J.side,Re=me%2,{min:He,max:Xe}=ce,[ct,dt]=At(ee,He,Xe,Re==0?Ve:Le);if(dt==0)return;let vt=ce.distr==2,Lt=J._splits=J.splits(r,ee,He,Xe,ct,dt,vt),Sn=ce.distr==2?Lt.map(Tt=>oi[Tt]):Lt,Bt=ce.distr==2?oi[Lt[1]]-oi[Lt[0]]:ct,Qt=J._values=J.values(r,J.filter(r,Sn,ee,dt,Bt),ee,dt,Bt);J._rotate=me==2?J.rotate(r,Qt,ee,dt):0;let Mt=J._size;J._size=uo(J.size(r,Qt,ee,z)),Mt!=null&&J._size!=Mt&&(Y=!1)}),Y}function Rn(z){let Y=!0;return lc.forEach((J,ee)=>{let ce=J(r,ee,fs,z);ce!=va[ee]&&(Y=!1),va[ee]=ce}),Y}function gl(){for(let z=0;z<T.length;z++){let Y=T[z];if(!Y.show||!Y._show)continue;let J=Y.side,ee=J%2,ce,me,Re=Y.stroke(r,z),He=J==0||J==3?-1:1,[Xe,ct]=Y._found;if(Y.label!=null){let Li=Y.labelGap*He,ws=_i((Y._lpos+Li)*Pn);ms(Y.labelFont[0],Re,"center",J==2?lg:L9),p.save(),ee==1?(ce=me=0,p.translate(ws,_i(ln+Pt/2)),p.rotate((J==3?-hx:hx)/2)):(ce=_i(Zt+nn/2),me=ws);let xl=sU(Y.label)?Y.label(r,z,Xe,ct):Y.label;p.fillText(xl,ce,me),p.restore()}if(ct==0)continue;let dt=C[Y.scale],vt=ee==0?nn:Pt,Lt=ee==0?Zt:ln,Sn=Y._splits,Bt=dt.distr==2?Sn.map(Li=>oi[Li]):Sn,Qt=dt.distr==2?oi[Sn[1]]-oi[Sn[0]]:Xe,Mt=Y.ticks,Tt=Y.border,Jn=Mt.show?Mt.size:0,yr=_i(Jn*Pn),Vr=_i((Y.alignTo==2?Y._size-Jn-Y.gap:Y.gap)*Pn),$n=Y._rotate*-hx/180,Un=w(Y._pos*Pn),Zi=(yr+Vr)*He,ti=Un+Zi;me=ee==0?ti:0,ce=ee==1?ti:0;let ys=Y.font[0],Ks=Y.align==1?mp:Y.align==2?$T:$n>0?mp:$n<0?$T:ee==0?"center":J==3?$T:mp,Ni=$n||ee==1?"middle":J==2?lg:L9;ms(ys,Re,Ks,Ni);let ci=Y.font[1]*Y.lineGap,xs=Sn.map(Li=>w(l(Li,dt,vt,Lt))),Zs=Y._values;for(let Li=0;Li<Zs.length;Li++){let ws=Zs[Li];if(ws!=null){ee==0?ce=xs[Li]:me=xs[Li],ws=""+ws;let xl=ws.indexOf(`
`)==-1?[ws]:ws.split(/\n/gm);for(let Ji=0;Ji<xl.length;Ji++){let Eb=xl[Ji];$n?(p.save(),p.translate(ce,me+Ji*ci),p.rotate($n),p.fillText(Eb,0,0),p.restore()):p.fillText(Eb,ce,me+Ji*ci)}}}Mt.show&&mu(xs,Mt.filter(r,Bt,z,ct,Qt),ee,J,Un,yr,lr(Mt.width*Pn,3),Mt.stroke(r,z),Mt.dash,Mt.cap);let Pi=Y.grid;Pi.show&&mu(xs,Pi.filter(r,Bt,z,ct,Qt),ee,ee==0?2:1,ee==0?ln:Zt,ee==0?Pt:nn,lr(Pi.width*Pn,3),Pi.stroke(r,z),Pi.dash,Pi.cap),Tt.show&&mu([Un],[1],ee==0?1:0,ee==0?1:2,ee==1?ln:Zt,ee==1?Pt:nn,lr(Tt.width*Pn,3),Tt.stroke(r,z),Tt.dash,Tt.cap)}ei("drawAxes")}function gs(z){_.forEach((Y,J)=>{J>0&&(Y._paths=null,z&&(i==1?(Y.min=null,Y.max=null):Y.facets.forEach(ee=>{ee.min=null,ee.max=null})))})}let vl=!1,Wa=!1,Ge=[];function wt(){Wa=!1;for(let z=0;z<Ge.length;z++)ei(...Ge[z]);Ge.length=0}function Dt(){vl||(Vxe(fr),vl=!0)}function sn(z,Y=!1){vl=!0,Wa=Y,z(r),fr(),Y&&Ge.length>0&&queueMicrotask(wt)}r.batch=sn;function fr(){if(Wt&&(td(),Wt=!1),yt&&(Oe(),yt=!1),Ri){if(_r(v,mp,Ce),_r(v,lg,ge),_r(v,Tg,Ve),_r(v,Cg,Le),_r(b,mp,Ce),_r(b,lg,ge),_r(b,Tg,Ve),_r(b,Cg,Le),_r(m,Tg,tt),_r(m,Cg,et),f.width=_i(tt*Pn),f.height=_i(et*Pn),T.forEach(({_el:z,_show:Y,_size:J,_pos:ee,side:ce})=>{if(z!=null)if(Y){let me=ce===3||ce===0?J:0,Re=ce%2==1;_r(z,Re?"left":"top",ee-me),_r(z,Re?"width":"height",J),_r(z,Re?"top":"left",Re?ge:Ce),_r(z,Re?"height":"width",Re?Le:Ve),c6(z,Pd)}else Oa(z,Pd)}),Qa=ps=Qe=Xt=wn=br=li=Gi=_t=null,Fn=1,sd(!0),Ce!=Kt||ge!=qn||Ve!=Ft||Le!=xn){gs(!1);let z=Ve/Ft,Y=Le/xn;if(oe&&!kt&&W.left>=0){W.left*=z,W.top*=Y,Ya&&Ol(Ya,_i(W.left),0,Ve,Le),bs&&Ol(bs,0,_i(W.top),Ve,Le);for(let J=0;J<Yt.length;J++){let ee=Yt[J];ee!=null&&(xi[J]*=z,ds[J]*=Y,Ol(ee,uo(xi[J]),uo(ds[J]),Ve,Le))}}if(Dn.show&&!ir&&Dn.left>=0&&Dn.width>0){Dn.left*=z,Dn.width*=z,Dn.top*=Y,Dn.height*=Y;for(let J in u0)_r(bu,J,Dn[J])}Kt=Ce,qn=ge,Ft=Ve,xn=Le}ei("setSize"),Ri=!1}tt>0&&et>0&&(p.clearRect(0,0,f.width,f.height),ei("drawClear"),R.forEach(z=>z()),ei("draw")),Dn.show&&ir&&(yu(Dn),ir=!1),oe&&kt&&(mc(null,!0,!1),kt=!1),G.show&&G.live&&It&&(l0(),It=!1),u||(u=!0,r.status=1,ei("ready")),Xs=!1,vl=!1}r.redraw=(z,Y)=>{yt=Y||!1,z!==!1?Gs(A,D.min,D.max):Dt()};function vs(z,Y){let J=C[z];if(J.from==null){if(vr==0){let ee=J.range(r,Y.min,Y.max,z);Y.min=ee[0],Y.max=ee[1]}if(Y.min>Y.max){let ee=Y.min;Y.min=Y.max,Y.max=ee}if(vr>1&&Y.min!=null&&Y.max!=null&&Y.max-Y.min<1e-16)return;z==A&&J.distr==2&&vr>0&&(Y.min=Go(Y.min,e[0]),Y.max=Go(Y.max,e[0]),Y.min==Y.max&&Y.max++),q[z]=Y,Wt=!0,Dt()}}r.setScale=vs;let fc,gu,Ya,bs,Df,vu,Rs,bl,nd,s0,Ln,Vn,Ao=!1;const Tn=W.drag;let pr=Tn.x,Br=Tn.y;oe&&(W.x&&(fc=so(pxe,b)),W.y&&(gu=so(mxe,b)),D.ori==0?(Ya=fc,bs=gu):(Ya=gu,bs=fc),Ln=W.left,Vn=W.top);const Dn=r.select=mi({show:!0,over:!0,left:0,width:0,top:0,height:0},t.select),bu=Dn.show?so(fxe,Dn.over?b:v):null;function yu(z,Y){if(Dn.show){for(let J in z)Dn[J]=z[J],J in u0&&_r(bu,J,z[J]);Y!==!1&&ei("setSelect")}}r.setSelect=yu;function a0(z){if(_[z].show)te&&c6(Pe[z],Pd);else if(te&&Oa(Pe[z],Pd),oe){let J=Ht?Yt[0]:Yt[z];J!=null&&Ol(J,-10,-10,Ve,Le)}}function Gs(z,Y,J){vs(z,{min:Y,max:J})}function Ds(z,Y,J,ee){Y.focus!=null&&zS(z),Y.show!=null&&_.forEach((ce,me)=>{me>0&&(z==me||z==null)&&(ce.show=Y.show,a0(me),i==2?(Gs(ce.facets[0].scale,null,null),Gs(ce.facets[1].scale,null,null)):Gs(ce.scale,null,null),Dt())}),J!==!1&&ei("setSeries",z,Y),ee&&Su("setSeries",r,z,Y)}r.setSeries=Ds;function bb(z,Y){mi(j[z],Y)}function $S(z,Y){z.fill=mn(z.fill||null),z.dir=On(z.dir,-1),Y=Y??j.length,j.splice(Y,0,z)}function IS(z){z==null?j.length=0:j.splice(z,1)}r.addBand=$S,r.setBand=bb,r.delBand=IS;function BS(z,Y){_[z].alpha=Y,oe&&Yt[z]!=null&&(Yt[z].style.opacity=Y),te&&Pe[z]&&(Pe[z].style.opacity=Y)}let ba,yl,pc;const xu={focus:!0};function zS(z){if(z!=pc){let Y=z==null,J=st.alpha!=1;_.forEach((ee,ce)=>{if(i==1||ce>0){let me=Y||ce==0||ce==z;ee._focus=Y?null:me,J&&BS(ce,me?1:st.alpha)}}),pc=z,J&&Dt()}}te&&Ze&&Ye(z9,ye,z=>{W._lock||(rn(z),pc!=null&&Ds(null,xu,!0,Hr.setSeries))});function Xa(z,Y,J){let ee=C[Y];J&&(z=z/Pn-(ee.ori==1?ge:Ce));let ce=Ve;ee.ori==1&&(ce=Le,z=ce-z),ee.dir==-1&&(z=ce-z);let me=ee._min,Re=ee._max,He=z/ce,Xe=me+(Re-me)*He,ct=ee.distr;return ct==3?Mm(10,Xe):ct==4?Rxe(Xe,ee.asinh):ct==100?ee.bwd(Xe):Xe}function yb(z,Y){let J=Xa(z,A,Y);return Go(J,e[0],Er,yn)}r.valToIdx=z=>Go(z,e[0]),r.posToIdx=yb,r.posToVal=Xa,r.valToPos=(z,Y,J)=>C[Y].ori==0?s(z,C[Y],J?nn:Ve,J?Zt:0):o(z,C[Y],J?Pt:Le,J?ln:0),r.setCursor=(z,Y,J)=>{Ln=z.left,Vn=z.top,mc(null,Y,J)};function xb(z,Y){_r(bu,mp,Dn.left=z),_r(bu,Tg,Dn.width=Y)}function wb(z,Y){_r(bu,lg,Dn.top=z),_r(bu,Cg,Dn.height=Y)}let rd=D.ori==0?xb:wb,id=D.ori==1?xb:wb;function o0(){if(te&&G.live)for(let z=i==2?1:0;z<_.length;z++){if(z==0&&fe)continue;let Y=G.values[z],J=0;for(let ee in Y)ae[z][J++].firstChild.nodeValue=Y[ee]}}function l0(z,Y){if(z!=null&&(z.idxs?z.idxs.forEach((J,ee)=>{V[ee]=J}):Lxe(z.idx)||V.fill(z.idx),G.idx=V[0]),te&&G.live){for(let J=0;J<_.length;J++)(J>0||i==1&&!fe)&&qS(J,V[J]);o0()}It=!1,Y!==!1&&ei("setLegend")}r.setLegend=l0;function qS(z,Y){let J=_[z],ee=z==0&&F==2?oi:e[z],ce;fe?ce=J.values(r,z,Y)??Ee:(ce=J.value(r,Y==null?null:ee[Y],z,Y),ce=ce==null?Ee:{_:ce}),G.values[z]=ce}function mc(z,Y,J){nd=Ln,s0=Vn,[Ln,Vn]=W.move(r,Ln,Vn),W.left=Ln,W.top=Vn,oe&&(Ya&&Ol(Ya,_i(Ln),0,Ve,Le),bs&&Ol(bs,0,_i(Vn),Ve,Le));let ee,ce=Er>yn;ba=or,yl=null;let me=D.ori==0?Ve:Le,Re=D.ori==1?Ve:Le;if(Ln<0||vr==0||ce){ee=W.idx=null;for(let He=0;He<_.length;He++){let Xe=Yt[He];Xe!=null&&Ol(Xe,-10,-10,Ve,Le)}Ze&&Ds(null,xu,!0,z==null&&Hr.setSeries),G.live&&(V.fill(ee),It=!0)}else{let He,Xe,ct;i==1&&(He=D.ori==0?Ln:Vn,Xe=Xa(He,A),ee=W.idx=Go(Xe,e[0],Er,yn),ct=Q(e[0][ee],D,me,0));let dt=-10,vt=-10,Lt=0,Sn=0,Bt=!0,Qt="",Mt="";for(let Tt=i==2?1:0;Tt<_.length;Tt++){let Jn=_[Tt],yr=V[Tt],Vr=yr==null?null:i==1?e[Tt][yr]:e[Tt][1][yr],$n=W.dataIdx(r,Tt,ee,Xe),Un=$n==null?null:i==1?e[Tt][$n]:e[Tt][1][$n];if(It=It||Un!=Vr||$n!=yr,V[Tt]=$n,Tt>0&&Jn.show){let Zi=$n==null?-10:$n==ee?ct:Q(i==1?e[0][$n]:e[Tt][0][$n],D,me,0),ti=Un==null?-10:H(Un,i==1?C[Jn.scale]:C[Jn.facets[1].scale],Re,0);if(Ze&&Un!=null){let ys=D.ori==1?Ln:Vn,Ks=Ti(st.dist(r,Tt,$n,ti,ys));if(Ks<ba){let Ni=st.bias;if(Ni!=0){let ci=Xa(ys,Jn.scale),xs=Un>=0?1:-1,Zs=ci>=0?1:-1;Zs==xs&&(Zs==1?Ni==1?Un>=ci:Un<=ci:Ni==1?Un<=ci:Un>=ci)&&(ba=Ks,yl=Tt)}else ba=Ks,yl=Tt}}if(It||Ht){let ys,Ks;D.ori==0?(ys=Zi,Ks=ti):(ys=ti,Ks=Zi);let Ni,ci,xs,Zs,Pi,Li,ws=!0,xl=rt.bbox;if(xl!=null){ws=!1;let Ji=xl(r,Tt);xs=Ji.left,Zs=Ji.top,Ni=Ji.width,ci=Ji.height}else xs=ys,Zs=Ks,Ni=ci=rt.size(r,Tt);if(Li=rt.fill(r,Tt),Pi=rt.stroke(r,Tt),Ht)Tt==yl&&ba<=st.prox&&(dt=xs,vt=Zs,Lt=Ni,Sn=ci,Bt=ws,Qt=Li,Mt=Pi);else{let Ji=Yt[Tt];Ji!=null&&(xi[Tt]=xs,ds[Tt]=Zs,W9(Ji,Ni,ci,ws),U9(Ji,Li,Pi),Ol(Ji,uo(xs),uo(Zs),Ve,Le))}}}}if(Ht){let Tt=st.prox,Jn=pc==null?ba<=Tt:ba>Tt||yl!=pc;if(It||Jn){let yr=Yt[0];yr!=null&&(xi[0]=dt,ds[0]=vt,W9(yr,Lt,Sn,Bt),U9(yr,Qt,Mt),Ol(yr,uo(dt),uo(vt),Ve,Le))}}}if(Dn.show&&Ao)if(z!=null){let[He,Xe]=Hr.scales,[ct,dt]=Hr.match,[vt,Lt]=z.cursor.sync.scales,Sn=z.cursor.drag;if(pr=Sn._x,Br=Sn._y,pr||Br){let{left:Bt,top:Qt,width:Mt,height:Tt}=z.select,Jn=z.scales[vt].ori,yr=z.posToVal,Vr,$n,Un,Zi,ti,ys=He!=null&&ct(He,vt),Ks=Xe!=null&&dt(Xe,Lt);ys&&pr?(Jn==0?(Vr=Bt,$n=Mt):(Vr=Qt,$n=Tt),Un=C[He],Zi=Q(yr(Vr,vt),Un,me,0),ti=Q(yr(Vr+$n,vt),Un,me,0),rd(el(Zi,ti),Ti(ti-Zi))):rd(0,me),Ks&&Br?(Jn==1?(Vr=Bt,$n=Mt):(Vr=Qt,$n=Tt),Un=C[Xe],Zi=H(yr(Vr,Lt),Un,Re,0),ti=H(yr(Vr+$n,Lt),Un,Re,0),id(el(Zi,ti),Ti(ti-Zi))):id(0,Re)}else h0()}else{let He=Ti(nd-Df),Xe=Ti(s0-vu);if(D.ori==1){let Lt=He;He=Xe,Xe=Lt}pr=Tn.x&&He>=Tn.dist,Br=Tn.y&&Xe>=Tn.dist;let ct=Tn.uni;ct!=null?pr&&Br&&(pr=He>=ct,Br=Xe>=ct,!pr&&!Br&&(Xe>He?Br=!0:pr=!0)):Tn.x&&Tn.y&&(pr||Br)&&(pr=Br=!0);let dt,vt;pr&&(D.ori==0?(dt=Rs,vt=Ln):(dt=bl,vt=Vn),rd(el(dt,vt),Ti(vt-dt)),Br||id(0,Re)),Br&&(D.ori==1?(dt=Rs,vt=Ln):(dt=bl,vt=Vn),id(el(dt,vt),Ti(vt-dt)),pr||rd(0,me)),!pr&&!Br&&(rd(0,0),id(0,0))}if(Tn._x=pr,Tn._y=Br,z==null){if(J){if(kb!=null){let[He,Xe]=Hr.scales;Hr.values[0]=He!=null?Xa(D.ori==0?Ln:Vn,He):null,Hr.values[1]=Xe!=null?Xa(D.ori==1?Ln:Vn,Xe):null}Su(IT,r,Ln,Vn,Ve,Le,ee)}if(Ze){let He=J&&Hr.setSeries,Xe=st.prox;pc==null?ba<=Xe&&Ds(yl,xu,!0,He):ba>Xe?Ds(null,xu,!0,He):yl!=pc&&Ds(yl,xu,!0,He)}}It&&(G.idx=ee,l0()),Y!==!1&&ei("setCursor")}let Mo=null;Object.defineProperty(r,"rect",{get(){return Mo==null&&sd(!1),Mo}});function sd(z=!1){z?Mo=null:(Mo=b.getBoundingClientRect(),ei("syncRect",Mo))}function Sb(z,Y,J,ee,ce,me,Re){W._lock||Ao&&z!=null&&z.movementX==0&&z.movementY==0||(c0(z,Y,J,ee,ce,me,Re,!1,z!=null),z!=null?mc(null,!0,!0):mc(Y,!0,!1))}function c0(z,Y,J,ee,ce,me,Re,He,Xe){if(Mo==null&&sd(!1),rn(z),z!=null)J=z.clientX-Mo.left,ee=z.clientY-Mo.top;else{if(J<0||ee<0){Ln=-10,Vn=-10;return}let[ct,dt]=Hr.scales,vt=Y.cursor.sync,[Lt,Sn]=vt.values,[Bt,Qt]=vt.scales,[Mt,Tt]=Hr.match,Jn=Y.axes[0].side%2==1,yr=D.ori==0?Ve:Le,Vr=D.ori==1?Ve:Le,$n=Jn?me:ce,Un=Jn?ce:me,Zi=Jn?ee:J,ti=Jn?J:ee;if(Bt!=null?J=Mt(ct,Bt)?l(Lt,C[ct],yr,0):-10:J=yr*(Zi/$n),Qt!=null?ee=Tt(dt,Qt)?l(Sn,C[dt],Vr,0):-10:ee=Vr*(ti/Un),D.ori==1){let ys=J;J=ee,ee=ys}}Xe&&(Y==null||Y.cursor.event.type==IT)&&((J<=1||J>=Ve-1)&&(J=Ed(J,Ve)),(ee<=1||ee>=Le-1)&&(ee=Ed(ee,Le))),He?(Df=J,vu=ee,[Rs,bl]=W.move(r,J,ee)):(Ln=J,Vn=ee)}const u0={width:0,height:0,left:0,top:0};function h0(){yu(u0,!1)}let jb,_b,Tb,Cb;function Nf(z,Y,J,ee,ce,me,Re){Ao=!0,pr=Br=Tn._x=Tn._y=!1,c0(z,Y,J,ee,ce,me,Re,!0,!1),z!=null&&(Ye(BT,o6,wu,!1),Su(I9,r,Rs,bl,Ve,Le,null));let{left:He,top:Xe,width:ct,height:dt}=Dn;jb=He,_b=Xe,Tb=ct,Cb=dt}function wu(z,Y,J,ee,ce,me,Re){Ao=Tn._x=Tn._y=!1,c0(z,Y,J,ee,ce,me,Re,!1,!0);let{left:He,top:Xe,width:ct,height:dt}=Dn,vt=ct>0||dt>0,Lt=jb!=He||_b!=Xe||Tb!=ct||Cb!=dt;if(vt&&Lt&&yu(Dn),Tn.setScale&&vt&&Lt){let Sn=He,Bt=ct,Qt=Xe,Mt=dt;if(D.ori==1&&(Sn=Xe,Bt=dt,Qt=He,Mt=ct),pr&&Gs(A,Xa(Sn,A),Xa(Sn+Bt,A)),Br)for(let Tt in C){let Jn=C[Tt];Tt!=A&&Jn.from==null&&Jn.min!=or&&Gs(Tt,Xa(Qt+Mt,Tt),Xa(Qt,Tt))}h0()}else W.lock&&(W._lock=!W._lock,mc(Y,!0,z!=null));z!=null&&($t(BT,o6),Su(BT,r,Ln,Vn,Ve,Le,null))}function FS(z,Y,J,ee,ce,me,Re){if(W._lock)return;rn(z);let He=Ao;if(Ao){let Xe=!0,ct=!0,dt=10,vt,Lt;D.ori==0?(vt=pr,Lt=Br):(vt=Br,Lt=pr),vt&&Lt&&(Xe=Ln<=dt||Ln>=Ve-dt,ct=Vn<=dt||Vn>=Le-dt),vt&&Xe&&(Ln=Ln<Rs?0:Ve),Lt&&ct&&(Vn=Vn<bl?0:Le),mc(null,!0,!0),Ao=!1}Ln=-10,Vn=-10,V.fill(null),mc(null,!0,!0),He&&(Ao=He)}function d0(z,Y,J,ee,ce,me,Re){W._lock||(rn(z),hu(),h0(),z!=null&&Su(q9,r,Ln,Vn,Ve,Le,null))}function f0(){T.forEach(Zwe),dr(r.width,r.height,!0)}cf(kw,Wp,f0);const gc={};gc.mousedown=Nf,gc.mousemove=Sb,gc.mouseup=wu,gc.dblclick=d0,gc.setSeries=(z,Y,J,ee)=>{let ce=Hr.match[2];J=ce(r,Y,J),J!=-1&&Ds(J,ee,!0,!1)},oe&&(Ye(I9,b,Nf),Ye(IT,b,Sb),Ye(B9,b,z=>{rn(z),sd(!1)}),Ye(z9,b,FS),Ye(q9,b,d0),m6.add(r),r.syncRect=sd);const ad=r.hooks=t.hooks||{};function ei(z,Y,J){Wa?Ge.push([z,Y,J]):z in ad&&ad[z].forEach(ee=>{ee.call(null,r,Y,J)})}(t.plugins||[]).forEach(z=>{for(let Y in z.hooks)ad[Y]=(ad[Y]||[]).concat(z.hooks[Y])});const vc=(z,Y,J)=>J,Hr=mi({key:null,setSeries:!1,filters:{pub:Z9,sub:Z9},scales:[A,_[1]?_[1].scale:null],match:[J9,J9,vc],values:[null,null]},W.sync);Hr.match.length==2&&Hr.match.push(vc),W.sync=Hr;const kb=Hr.key,p0=EU(kb);function Su(z,Y,J,ee,ce,me,Re){Hr.filters.pub(z,Y,J,ee,ce,me,Re)&&p0.pub(z,Y,J,ee,ce,me,Re)}p0.sub(r);function Ob(z,Y,J,ee,ce,me,Re){Hr.filters.sub(z,Y,J,ee,ce,me,Re)&&gc[z](null,Y,J,ee,ce,me,Re)}r.pub=Ob;function od(){p0.unsub(r),m6.delete(r),De.clear(),u6(kw,Wp,f0),h.remove(),ye==null||ye.remove(),ei("destroy")}r.destroy=od;function bc(){ei("init",t,e),Ir(e||t.data,!1),q[A]?vs(A,q[A]):hu(),ir=Dn.show&&(Dn.width>0||Dn.height>0),kt=It=!0,dr(t.width,t.height)}return _.forEach(ga),T.forEach(ed),n?n instanceof HTMLElement?(n.appendChild(h),bc()):n(r,bc):bc(),r}Oi.assign=mi;Oi.fmtNum=FE;Oi.rangeNum=Ow;Oi.rangeLog=_S;Oi.rangeAsinh=zE;Oi.orient=Rf;Oi.pxRatio=Pn;Oi.join=Hxe;Oi.fmtDate=VE,Oi.tzDate=ewe;Oi.sync=EU;{Oi.addGap=Lwe,Oi.clipGaps=kS;let t=Oi.paths={points:PU};t.linear=$U,t.stepped=Bwe,t.bars=zwe,t.spline=Fwe}const Jwe=Object.freeze(Object.defineProperty({__proto__:null,default:Oi},Symbol.toStringTag,{value:"Module"})),e2e=f7(Jwe);var t2e=ux.exports,wL;function n2e(){return wL||(wL=1,function(t,e){(function(r,i){t.exports=i(Nv(),e2e)})(t2e,(n,r)=>(()=>{var i={"./common/index.ts":(u,h,f)=>{f.r(h),f.d(h,{dataMatch:()=>v,optionsUpdateState:()=>m});var p=function(b,x){var w={};for(var S in b)Object.prototype.hasOwnProperty.call(b,S)&&x.indexOf(S)<0&&(w[S]=b[S]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var _=0,S=Object.getOwnPropertySymbols(b);_<S.length;_++)x.indexOf(S[_])<0&&Object.prototype.propertyIsEnumerable.call(b,S[_])&&(w[S[_]]=b[S[_]]);return w};Object.is||Object.defineProperty(Object,"is",{value:function(x,w){return x===w&&(x!==0||1/x===1/w)||x!==x&&w!==w}});var m=function(x,w){var S=x.width,_=x.height,T=p(x,["width","height"]),C=w.width,j=w.height,A=p(w,["width","height"]),E="keep";if((_!==j||S!==C)&&(E="update"),Object.keys(T).length!==Object.keys(A).length)return"create";for(var R=0,N=Object.keys(T);R<N.length;R++){var $=N[R];if(!Object.is(T[$],A[$])){E="create";break}}return E},v=function(x,w){return x.length!==w.length?!1:x.every(function(S,_){var T=w[_];return S.length!==T.length?!1:S.every(function(C,j){return C===T[j]})})}},react:u=>{u.exports=n},uplot:u=>{u.exports=r}},s={};function o(u){var h=s[u];if(h!==void 0)return h.exports;var f=s[u]={exports:{}};return i[u](f,f.exports,o),f.exports}o.n=u=>{var h=u&&u.__esModule?()=>u.default:()=>u;return o.d(h,{a:h}),h},o.d=(u,h)=>{for(var f in h)o.o(h,f)&&!o.o(u,f)&&Object.defineProperty(u,f,{enumerable:!0,get:h[f]})},o.o=(u,h)=>Object.prototype.hasOwnProperty.call(u,h),o.r=u=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var l={};return(()=>{/*!*******************************!*\
  !*** ./react/uplot-react.tsx ***!
  \*******************************/o.r(l),o.d(l,{default:()=>v});var u=o("react"),h=o.n(u),f=o("uplot"),p=o.n(f),m=o("./common/index.ts");function v(b){var x=b.options,w=b.data,S=b.target,_=b.onDelete,T=b.onCreate,C=b.resetScales,j=C===void 0?!0:C,A=b.className,E=(0,u.useRef)(null),R=(0,u.useRef)(null),N=(0,u.useRef)(x),$=(0,u.useRef)(S),D=(0,u.useRef)(w),F=(0,u.useRef)(T),Q=(0,u.useRef)(_);(0,u.useEffect)(function(){F.current=T,Q.current=_});var H=(0,u.useCallback)(function(P){var I;P&&((I=Q.current)===null||I===void 0||I.call(Q,P),P.destroy(),E.current=null)},[]),q=(0,u.useCallback)(function(){var P,I=new(p())(N.current,D.current,$.current||R.current);E.current=I,(P=F.current)===null||P===void 0||P.call(F,I)},[]);return(0,u.useEffect)(function(){return q(),function(){H(E.current)}},[q,H]),(0,u.useEffect)(function(){if(N.current!==x){var P=(0,m.optionsUpdateState)(N.current,x);N.current=x,!E.current||P==="create"?(H(E.current),q()):P==="update"&&E.current.setSize({width:x.width,height:x.height})}},[x,q,H]),(0,u.useEffect)(function(){D.current!==w&&(E.current?(0,m.dataMatch)(D.current,w)||(j?E.current.setData(w,!0):(E.current.setData(w,!1),E.current.redraw())):(D.current=w,q()),D.current=w)},[w,j,q]),(0,u.useEffect)(function(){return $.current!==S&&($.current=S,q()),function(){return H(E.current)}},[S,q,H]),S?null:h().createElement("div",{ref:R,className:A})}})(),l=l.default,l})())}(ux)),ux.exports}var r2e=n2e();const i2e=dl(r2e),qU=t=>t===null?"scalar":SS(t.__name__||"")?`{"${Oh(t.__name__)}",${Object.entries(t).filter(([e])=>e!=="__name__").map(([e,n])=>`${zh(e)}="${Oh(n)}"`).join(", ")}}`:`${t.__name__||""}{${Object.entries(t).filter(([e])=>e!=="__name__").map(([e,n])=>`${zh(e)}="${Oh(n)}"`).join(", ")}}`,SL=(t,e)=>{const n=jL[t%jL.length];return e?n:z7(n,.4)},jL=["#008000","#008080","#800000","#800080","#808000","#808080","#0000c0","#008040","#0080c0","#800040","#8000c0","#808040","#8080c0","#00c000","#00c080","#804000","#804080","#80c000","#80c080","#0040c0","#00c040","#00c0c0","#804040","#8040c0","#80c040","#80c0c0","#408000","#408080","#c00000","#c00080","#c08000","#c08080","#4000c0","#408040","#4080c0","#c00040","#c000c0","#c08040","#c080c0","#404000","#404080","#40c000","#40c080","#c04000","#c04080","#c0c000","#c0c080","#404040","#4040c0","#40c040","#40c0c0","#c04040","#c040c0","#c0c040","#0000a0","#008020","#0080a0","#800020","#8000a0","#808020","#8080a0","#0000e0","#008060","#0080e0","#800060","#8000e0","#808060","#8080e0","#0040a0","#00c020","#00c0a0","#804020","#8040a0","#80c020","#80c0a0","#0040e0","#00c060","#00c0e0","#804060","#8040e0","#80c060","#80c0e0","#4000a0","#408020","#4080a0","#c00020","#c000a0","#c08020","#c080a0","#4000e0","#408060","#4080e0","#c00060","#c000e0","#c08060","#c080e0","#404020","#4040a0","#40c020","#40c0a0","#c04020","#c040a0","#c0c020","#c0c0a0","#404060","#4040e0","#40c060","#40c0e0","#c04060","#c040e0","#c0c060","#00a000","#00a080","#802000","#802080","#80a000","#80a080","#0020c0","#00a040","#00a0c0","#802040","#8020c0","#80a040","#80a0c0","#006000","#006080","#00e000","#00e080","#806000","#806080","#80e000","#80e080","#006040","#0060c0","#00e040","#00e0c0","#806040","#8060c0","#80e040","#80e0c0","#40a000","#40a080","#c02000","#c02080","#c0a000","#c0a080","#4020c0","#40a040","#40a0c0","#c02040","#c020c0","#c0a040","#c0a0c0","#406000","#406080","#40e000","#40e080","#c06000","#c06080","#c0e000","#c0e080","#406040","#4060c0","#40e040","#40e0c0","#c06040","#c060c0","#c0e040","#c0e0c0","#0020a0","#00a020","#00a0a0","#802020","#8020a0","#80a020","#80a0a0","#0020e0","#00a060","#00a0e0","#802060","#8020e0","#80a060","#80a0e0","#006020","#0060a0","#00e020","#00e0a0","#806020","#8060a0","#80e020","#80e0a0","#006060","#0060e0","#00e060","#00e0e0","#806060","#8060e0","#80e060","#80e0e0","#4020a0","#40a020","#40a0a0","#c02020","#c020a0","#c0a020","#c0a0a0","#4020e0","#40a060","#40a0e0","#c02060","#c020e0","#c0a060","#c0a0e0","#406020","#4060a0","#40e020","#40e0a0","#c06020","#c060a0","#c0e020","#c0e0a0","#406060","#4060e0","#40e060","#40e0e0","#c06060","#c060e0","#c0e060","#208000","#208080","#a00000","#a00080","#a08000","#a08080","#208040","#2080c0","#a00040","#a000c0","#a08040","#a080c0","#204080","#20c000","#20c080","#a04000","#a04080","#a0c000","#a0c080","#2040c0","#20c040","#20c0c0","#a04040","#a040c0","#a0c040","#a0c0c0","#608000","#608080","#e00000","#e00080","#e08000","#e08080","#6000c0","#608040","#6080c0","#e00040","#e000c0","#e08040","#e080c0","#604080","#60c000","#60c080","#e04000","#e04080","#e0c000","#e0c080","#604040","#6040c0","#60c040","#60c0c0","#e04040","#e040c0","#e0c040","#e0c0c0","#208020","#2080a0","#a00020","#a000a0","#a08020","#a080a0","#2000e0","#208060","#2080e0","#a00060","#a000e0","#a08060","#a080e0","#2040a0","#20c020","#20c0a0","#a04020","#a040a0","#a0c020","#2040e0","#20c060","#20c0e0","#a04060","#a040e0","#a0c060","#a0c0e0","#6000a0","#608020","#6080a0","#e00020","#e000a0","#e08020","#e080a0","#6000e0","#608060","#6080e0","#e00060","#e000e0","#e08060","#e080e0","#604020","#6040a0","#60c020","#60c0a0","#e04020","#e040a0","#e0c020","#e0c0a0","#604060","#6040e0","#60c060","#60c0e0","#e04060","#e040e0","#e0c060","#e0c0e0","#20a000","#20a080","#a02000","#a02080","#a0a000","#a0a080","#2020c0","#20a040","#20a0c0","#a02040","#a020c0","#a0a040","#a0a0c0","#206000","#206080","#20e000","#20e080","#a06000","#a06080","#a0e000","#a0e080","#206040","#2060c0","#20e040","#20e0c0","#a06040","#a060c0","#a0e040","#a0e0c0","#602080","#60a000","#60a080","#e02000","#e02080","#e0a000","#e0a080","#6020c0","#60a040","#60a0c0","#e02040","#e020c0","#e0a040","#e0a0c0","#606000","#606080","#60e000","#60e080","#e06000","#e06080","#e0e000","#e0e080","#606040","#6060c0","#60e040","#60e0c0","#e06040","#e060c0","#e0e040","#e0e0c0","#20a020","#20a0a0","#a02020","#a020a0","#a0a020","#a0a0a0","#2020e0","#20a060","#20a0e0","#a02060","#a020e0","#a0a060","#a0a0e0","#206020","#2060a0","#20e020","#20e0a0","#a06020","#a060a0","#a0e020","#a0e0a0","#206060","#2060e0","#20e060","#20e0e0","#a06060","#a060e0","#a0e060","#a0e0e0","#6020a0","#60a020","#60a0a0","#e02020","#e020a0","#e0a020","#e0a0a0","#602060","#6020e0","#60a060","#60a0e0","#e02060","#e020e0","#e0a060","#e0a0e0","#606020","#6060a0","#60e020","#60e0a0","#e06020","#e060a0","#e0e020","#e0e0a0","#606060","#6060e0","#60e060","#60e0e0","#e06060","#e060e0","#e0e060","#008010","#008090","#800010","#800090","#808010","#808090","#0000d0","#008050","#0080d0","#800050","#8000d0","#808050","#8080d0","#004010","#004090","#00c010","#00c090","#804010","#804090","#80c010","#80c090","#004050","#0040d0","#00c050","#00c0d0","#804050","#8040d0","#80c050","#80c0d0","#400090","#408010","#408090","#c00010","#c00090","#c08010","#c08090","#4000d0","#408050","#4080d0","#c00050","#c000d0","#c08050","#c080d0","#404010","#404090","#40c010","#40c090","#c04010","#c04090","#c0c010","#c0c090","#404050","#4040d0","#40c050","#40c0d0","#c04050","#c040d0","#c0c050","#0000b0","#008030","#0080b0","#800030","#8000b0","#808030","#8080b0","#0000f0","#008070","#0080f0","#800070","#8000f0","#808070","#8080f0","#004030","#0040b0","#00c030","#00c0b0","#804030","#8040b0","#80c030","#80c0b0","#004070","#0040f0","#00c070","#00c0f0","#804070","#8040f0","#80c070","#80c0f0","#4000b0","#408030","#4080b0","#c00030","#c000b0","#c08030","#c080b0","#400070","#4000f0","#408070","#4080f0","#c00070","#c000f0","#c08070","#c080f0","#404030","#4040b0","#40c030","#40c0b0","#c04030","#c040b0","#c0c030","#c0c0b0","#404070","#4040f0","#40c070","#40c0f0","#c04070","#c040f0","#c0c070","#c0c0f0","#002090","#00a010","#00a090","#802010","#802090","#80a010","#80a090","#0020d0","#00a050","#00a0d0","#802050","#8020d0","#80a050","#80a0d0","#006010","#006090","#00e010","#00e090","#806010","#806090","#80e010","#80e090","#006050","#0060d0","#00e050","#00e0d0","#806050","#8060d0","#80e050","#80e0d0","#402090","#40a010","#40a090","#c02010","#c02090","#c0a010","#c0a090","#402050","#4020d0","#40a050","#40a0d0","#c02050","#c020d0","#c0a050","#c0a0d0","#406010","#406090","#40e010","#40e090","#c06010","#c06090","#c0e010","#c0e090","#406050","#4060d0","#40e050","#40e0d0","#c06050","#c060d0","#c0e050","#c0e0d0","#0020b0","#00a030","#00a0b0","#802030","#8020b0","#80a030","#80a0b0","#0020f0","#00a070","#00a0f0","#802070","#8020f0","#80a070","#80a0f0","#006030","#0060b0","#00e030","#00e0b0","#806030","#8060b0","#80e030","#80e0b0","#006070","#0060f0","#00e070","#00e0f0","#806070","#8060f0","#80e070","#80e0f0","#4020b0","#40a030","#40a0b0","#c02030","#c020b0","#c0a030","#c0a0b0","#4020f0","#40a070","#40a0f0","#c02070","#c020f0","#c0a070","#c0a0f0","#406030","#4060b0","#40e030","#40e0b0","#c06030","#c060b0","#c0e030","#c0e0b0","#406070","#4060f0","#40e070","#40e0f0","#c06070","#c060f0","#c0e070","#208010","#208090","#a00010","#a00090","#a08010","#a08090","#2000d0","#208050","#2080d0","#a00050","#a000d0","#a08050","#a080d0","#204010","#204090","#20c010","#20c090","#a04010","#a04090","#a0c010","#a0c090","#204050","#2040d0","#20c050","#20c0d0","#a04050","#a040d0","#a0c050","#a0c0d0","#600090","#608010","#608090","#e00010","#e00090","#e08010","#e08090","#600050","#6000d0","#608050","#6080d0","#e00050","#e000d0","#e08050","#e080d0","#604010","#604090","#60c010","#60c090","#e04010","#e04090","#e0c010","#e0c090","#604050","#6040d0","#60c050","#60c0d0","#e04050","#e040d0","#e0c050","#e0c0d0","#2000b0","#208030","#2080b0","#a00030","#a000b0","#a08030","#a080b0","#2000f0","#208070","#2080f0","#a00070","#a000f0","#a08070","#a080f0","#204030","#2040b0","#20c030","#20c0b0","#a04030","#a040b0","#a0c030","#a0c0b0","#204070","#2040f0","#20c070","#20c0f0","#a04070","#a040f0","#a0c070","#a0c0f0","#6000b0","#608030","#6080b0","#e00030","#e000b0","#e08030","#e080b0","#600070","#6000f0","#608070","#e00070","#e000f0","#e08070","#e080f0","#604030","#6040b0","#60c030","#60c0b0","#e04030","#e040b0","#e0c030","#e0c0b0","#604070","#6040f0","#60c070","#60c0f0","#e04070","#e040f0","#e0c070","#e0c0f0","#20a010","#20a090","#a02010","#a02090","#a0a010","#a0a090","#2020d0","#20a050","#20a0d0","#a02050","#a020d0","#a0a050","#a0a0d0","#206010","#206090","#20e010","#20e090","#a06010","#a06090","#a0e010","#a0e090","#206050","#2060d0","#20e050","#20e0d0","#a06050","#a060d0","#a0e050","#a0e0d0","#602090","#60a010","#60a090","#e02010","#e02090","#e0a010","#e0a090","#602050","#6020d0","#60a050","#60a0d0","#e02050","#e020d0","#e0a050","#e0a0d0","#606010","#606090","#60e010","#60e090","#e06010","#e06090","#e0e010","#e0e090","#606050","#6060d0","#60e050","#60e0d0","#e06050","#e060d0","#e0e050","#2020b0","#20a030","#20a0b0","#a02030","#a020b0","#a0a030","#a0a0b0","#2020f0","#20a070","#20a0f0","#a02070","#a020f0","#a0a070","#a0a0f0","#206030","#2060b0","#20e030","#20e0b0","#a06030","#a060b0","#a0e030","#a0e0b0","#206070","#2060f0","#20e070","#20e0f0","#a06070","#a060f0","#a0e070","#a0e0f0","#6020b0","#60a030","#60a0b0","#e02030","#e020b0","#e0a030","#e0a0b0","#6020f0","#60a070","#60a0f0","#e02070","#e020f0","#e0a070","#e0a0f0","#606030","#6060b0","#60e030","#60e0b0","#e06030","#e060b0","#e0e030","#e0e0b0","#606070","#6060f0","#60e070","#60e0f0","#e06070","#e060f0","#e0e070"],s2e=t=>{if(t===null)return"null";const e=Math.abs(t);if(e>=1e24)return(t/1e24).toFixed(2)+"Y";if(e>=1e21)return(t/1e21).toFixed(2)+"Z";if(e>=1e18)return(t/1e18).toFixed(2)+"E";if(e>=1e15)return(t/1e15).toFixed(2)+"P";if(e>=1e12)return(t/1e12).toFixed(2)+"T";if(e>=1e9)return(t/1e9).toFixed(2)+"G";if(e>=1e6)return(t/1e6).toFixed(2)+"M";if(e>=1e3)return(t/1e3).toFixed(2)+"k";if(e>=1)return t.toFixed(2);if(e===0)return t.toFixed(2);if(e<1e-23)return(t/1e-24).toFixed(2)+"y";if(e<1e-20)return(t/1e-21).toFixed(2)+"z";if(e<1e-17)return(t/1e-18).toFixed(2)+"a";if(e<1e-14)return(t/1e-15).toFixed(2)+"f";if(e<1e-11)return(t/1e-12).toFixed(2)+"p";if(e<1e-8)return(t/1e-9).toFixed(2)+"n";if(e<1e-5)return(t/1e-6).toFixed(2)+"µ";if(e<.01)return(t/.001).toFixed(2)+"m";if(e<=1)return t.toFixed(2);throw Error("couldn't format a value, this is a bug")},VT=t=>{const e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};return String(t).replace(/[&<>"'/]/g,function(n){return e[n]})},a2e=t=>`
            <div class="labels">
              ${Object.keys(t).length===0?'<div class="no-labels">no labels</div>':""}
              ${t.__name__?`<div><strong>${VT(t.__name__)}</strong></div>`:""}
              ${Object.keys(t).filter(e=>e!=="__name__").map(e=>`<div><strong>${VT(e)}</strong>: ${VT(t[e])}</div>`).join("")}
            </div>`,o2e=(t,e)=>{let n,r,i,s=null;const o=document.createElement("div");return o.className="u-tooltip",o.style.display="none",{hooks:{init:l=>{n=l.over,n.addEventListener("mouseenter",()=>{o.style.display="block"}),n.addEventListener("mouseleave",()=>{o.style.display="none"}),document.body.appendChild(o)},destroy:()=>{o.remove()},setSize:()=>{const l=n.getBoundingClientRect();r=l.left,i=l.top},setSeries:(l,u,h)=>{s=u},setCursor:l=>{const{left:u,top:h,idx:f}=l.cursor;if(f==null||u===null||u===void 0||h===null||h===void 0||s===null)return;const p=l.data[0][f],m=e[s][f],v=l.series[s],b=v.labels;if(typeof v.stroke!="function")throw new Error("series.stroke is not a function");const x=v.stroke(l,s),w=u+r,S=h+i;o.innerHTML=`
            <div class="date">${sf(p,t)}</div>
            <div class="series-value">
              <span class="detail-swatch" style="background-color: ${x}"></span>
              <span>${b.__name__?b.__name__+": ":" "}<strong>${m}</strong></span>
            </div>
            ${a2e(b)}
          `.trimEnd(),o$({getBoundingClientRect(){return{width:0,height:0,x:w,y:S,left:w,right:w,top:S,bottom:S}}},o,{placement:"right-start",middleware:[i$(5),a$(),s$()]}).then(({x:T,y:C})=>{Object.assign(o.style,{top:`${C}px`,left:`${T}px`})})}}}},l2e=(t,e,n,r)=>{const i=t.axes[n];if(r>1)return i._size;let s=i.ticks.size+i.gap;const o=(e??[]).reduce((l,u)=>u.length>l.length?u:l,"");return o!=""&&(t.ctx.font=i.font[0],s+=t.ctx.measureText(o).width/devicePixelRatio),Math.ceil(s)},c2e=(t,e,n,r)=>{const i=[],s=t.series[e];if(!n&&r&&r.length){const[o,l]=s.idxs,u=t.data[0],h=t.data[e],f=Math.round(t.valToPos(u[o],"x",!0)),p=Math.round(t.valToPos(u[l],"x",!0));r[0][0]===f&&i.push(o);for(let m=0;m<r.length;m++){const v=r[m],b=r[m+1];if(b&&v[1]===b[0]){let x=t.posToIdx(v[1],!0);if(h[x]==null)for(let w=1;w<100;w++){if(h[x+w]!=null){x+=w;break}if(h[x-w]!=null){x-=w;break}}i.push(x)}}r[r.length-1][1]===p&&i.push(l)}return i.length?i:null},u2e=(t,e,n,r,i,s,o)=>({width:e-30,height:550,cursor:{focus:{prox:1e3},drag:{x:!0,setScale:!1}},tzDate:r?void 0:l=>Oi.tzDate(new Date(l*1e3),"Etc/UTC"),plugins:[o2e(r,t)],legend:{show:!0,live:!1,isolate:!0,markers:{fill:(l,u)=>SL(u-1,s)}},drawOrder:["series","axes"],focus:{alpha:1},scales:i!==null?{y:{range:(l,u,h)=>{const f=Oi.rangeNum(i,h,.1,!0);return[i,f[1]]}}}:void 0,axes:[{space:80,labelSize:20,stroke:s?"#333":"#eee",ticks:{stroke:s?"#00000010":"#ffffff20"},grid:{show:!0,stroke:s?"#00000010":"#ffffff20",width:2,dash:[]},values:[[3600*24*365,"{YYYY}",null,null,null,null,null,null,1],[3600*24*28,"{MMM}",`
{YYYY}`,null,null,null,null,null,1],[3600*24,"{MMM} {D}",`
{YYYY}`,null,null,null,null,null,1],[3600,"{HH}:{mm}",`
{MMM} {D} '{YY}`,null,`
{MMM} {D}`,null,null,null,1],[60,"{HH}:{mm}",`
{MMM} {D} '{YY}`,null,`
{MMM} {D}`,null,null,null,1],[1,"{HH}:{mm}:{ss}",`
{MMM} {D} '{YY}`,null,`
{MMM} {D}`,null,null,null,1],[.001,"{HH}:{mm}:{ss}.{fff}",`
{MMM} {D} '{YY}`,null,`
{MMM} {D}`,null,null,null,1]]},{values:(l,u)=>u.map(s2e),ticks:{stroke:s?"#00000010":"#ffffff20"},grid:{show:!0,stroke:s?"#00000010":"#ffffff20",width:2,dash:[]},labelGap:8,labelSize:28,stroke:s?"#333":"#eee",size:l2e}],series:[{},...n.map((l,u)=>({points:{filter:c2e},label:qU(l.metric),width:1.5,labels:l.metric,stroke:SL(u,s)}))],hooks:{setSelect:[l=>{const u=l.posToVal(l.select.left,"x"),h=Math.max(l.posToVal(l.select.left+l.select.width,"x"),u+1);o(u,h)}]}}),_L=t=>{const e=parseFloat(t);return isNaN(e)?null:e},h2e=(t,e,n,r)=>{const i=[];for(let o=e;o<=n;o+=r)i.push(o);const s=t.map(({values:o,histograms:l})=>{const u=[];let h=0,f=0;for(let p=e;p<=n;p+=r){const m=o&&o[h],v=l&&l[f];m&&o.length>h&&m[0]<p+r/100?(u.push(_L(m[1])),h++):v&&l.length>f&&v[0]<p+r/100?(u.push(_L(v[1].sum)),f++):u.push(null)}return u});return[i,...s]};function TL(t,e){const n=[];let r=[];const i=t[0].length,s=Array(i);for(let o=0;o<i;o++)s[o]=0;for(let o=1;o<t.length;o++)n.push(e(o)?t[o]:t[o].map((l,u)=>s[u]+=+(l||0)));for(let o=1;o<t.length;o++)e(o)||r.push({series:[t.findIndex((l,u)=>u>o&&!e(u)),o]});return r=r.filter(o=>o.series[1]>-1),{data:[t[0]].concat(n),bands:r}}function d2e(t,e){const n=TL(e,r=>!1);return t.bands=n.bands,t.cursor=t.cursor||{},t.cursor.dataIdx=(r,i,s,o)=>e[i][s]==null?null:s,t.series.forEach(r=>{r.points=r.points||{},r.stroke&&(r.fill=z7(r.stroke,.6)),r.points.filter=(i,s,o,l)=>{if(o){const u=[];return e[s].forEach((h,f)=>{h!=null&&u.push(f)}),u}return null}}),t.scales=t.scales||{},t.scales.y={range:(r,i,s)=>[0,Oi.rangeNum(0,s,.1,!0)[1]]},t.hooks=t.hooks||{},t.hooks.setSeries=t.hooks.setSeries||[],t.hooks.setSeries.push((r,i)=>{const s=TL(e,o=>!r.series[o].show);r.delBand(null),s.bands.forEach(o=>r.addBand(o)),r.setData(s.data)}),{opts:t,data:n.data}}const f2e=({data:t,range:{startTime:e,endTime:n,resolution:r},width:i,displayMode:s,yAxisMin:o,onSelectRange:l})=>{const[u,h]=M.useState(null),[f,p]=M.useState(null),{useLocalTime:m}=ai(),v=Fw();if(M.useEffect(()=>{if(i===0)return;const b=h2e(t,e,n,r),x=u2e(b,i,t,m,o,v==="light",l);s===ym.Stacked?p(d2e(x,b).data):p(b),h(x)},[i,t,s,e,n,r,m,v,l,o]),!(u===null||f===null))return a.jsxs(a.Fragment,{children:[a.jsx(i2e,{options:u,data:f,className:eU.uplotChart}),a.jsxs(ut,{fz:"xs",c:"dimmed",ml:40,mt:-25,mb:"lg",children:["Click: show single series,"," ",navigator.userAgent.includes("Mac")?"⌘":"Ctrl"," + click: hide single series"]})]})},p2e=({expr:t,node:e,endTime:n,range:r,resolution:i,showExemplars:s,displayMode:o,yAxisMin:l,retriggerIdx:u,onSelectRange:h})=>{const{ref:f,width:p}=uX(),[m,v]=M.useState(!0),{showQueryWarnings:b,showQueryInfoNotices:x}=ai(),w=e===null?t:as(e.type===mt.matrixSelector?{type:mt.vectorSelector,name:e.name,matchers:e.matchers,offset:e.offset,timestamp:e.timestamp,startOrEnd:e.startOrEnd,anchored:e.anchored,smoothed:e.smoothed}:e),S=(n!==null?n:Date.now())/1e3,_=S-r/1e3,T=Q1(i,r)/1e3,{data:C,error:j,isFetching:A,isLoading:E,refetch:R}=Ih({key:[M.useId()],path:"/query_range",params:{query:w,step:T.toString(),start:_.toString(),end:S.toString()},enabled:w!==""}),[N,$]=M.useState(null),D=(Q,H)=>a.jsxs(a.Fragment,{children:[b&&(Q==null?void 0:Q.map((q,P)=>a.jsx(Nt,{color:"red",title:"Query warning",icon:a.jsx(Ui,{}),children:q},P))),x&&(H==null?void 0:H.map((q,P)=>a.jsx(Nt,{color:"yellow",title:"Query notice",icon:a.jsx(Gn,{}),children:q},P)))]});if(M.useEffect(()=>{C!==void 0&&$({data:C,range:{startTime:_,endTime:S,resolution:T}})},[C]),M.useEffect(()=>{w!==""&&R()},[u,R,w,n,r,i]),M.useEffect(()=>{N!==null&&m&&v(!1)},[N,m,v]),E)return a.jsx(ve,{children:Array.from(Array(5),(Q,H)=>a.jsx(xo,{height:30,mb:15},H))});if(j)return a.jsx(Nt,{color:"red",title:"Error executing query",icon:a.jsx(Ui,{}),children:j.message});if(N===null)return a.jsx(Nt,{variant:"transparent",children:"No data queried yet"});const{result:F}=N.data.data;return F.length===0?a.jsxs(En,{children:[a.jsx(Nt,{title:"Empty query result",icon:a.jsx(Gn,{}),children:"This query returned no data."}),D(N.data.warnings)]}):a.jsxs(En,{children:[e!==null&&e.type===mt.matrixSelector&&a.jsxs(Nt,{color:"orange",title:"Graphing modified expression",icon:a.jsx(Ui,{}),children:[a.jsx("strong",{children:"Note:"})," Range vector selectors can't be graphed, so graphing the equivalent instant vector selector instead."]}),D(N.data.warnings,N.data.infos),a.jsxs(ve,{pos:"relative",ref:f,className:eU.chartWrapper,children:[a.jsx(RO,{visible:A,zIndex:1e3,h:570,overlayProps:{radius:"sm",blur:.5},loaderProps:{type:"dots",color:"gray.6"}}),a.jsx(f2e,{data:N.data.data.result,range:N.range,width:p,showExemplars:s,displayMode:o,yAxisMin:l,onSelectRange:h})]})]})},m2e=({resolution:t,range:e,onChangeResolution:n})=>{const[r,i]=M.useState(Bn(Q1(t,e))),s=o=>{const l=_4(o);t.type==="custom"&&l===t.step||(l===null?i(Bn(Q1(t,e))):n({type:"custom",step:l}))};return a.jsxs(a.Fragment,{children:[a.jsx(Qm,{title:"Resolution",placeholder:"Resolution",maxDropdownHeight:500,data:[{group:"Automatic resolution",items:[{label:"Low res.",value:"low"},{label:"Medium res.",value:"medium"},{label:"High res.",value:"high"}]},{group:"Fixed resolution",items:[{label:"10s",value:"10000"},{label:"30s",value:"30000"},{label:"1m",value:"60000"},{label:"5m",value:"300000"},{label:"15m",value:"900000"},{label:"1h",value:"3600000"}]},{group:"Custom resolution",items:[{label:"Enter value...",value:"custom"}]}],w:160,value:t.type==="auto"?t.density:t.type==="fixed"?t.step.toString():"custom",onChange:(o,l)=>{if(["low","medium","high"].includes(l.value)){n({type:"auto",density:l.value});return}if(l.value==="custom"){const h=Q1(t,e);n({type:"custom",step:h}),i(Bn(h));return}const u=parseInt(l.value);if(!isNaN(u))n({type:"fixed",step:u});else throw new Error("Invalid resolution value")}}),t.type==="custom"&&a.jsx(ec,{placeholder:"Resolution",value:r,onChange:o=>i(o.currentTarget.value),onBlur:()=>s(r),onKeyDown:o=>o.key==="Enter"&&s(r),"aria-label":"Range",style:{width:`calc(44px + ${r.length+3}ch)`}})]})};var dx={exports:{}},g2e=dx.exports,CL;function v2e(){return CL||(CL=1,function(t,e){(function(n,r){t.exports=r()})(g2e,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(i,s,o){var l,u=function(m,v,b){b===void 0&&(b={});var x=new Date(m),w=function(S,_){_===void 0&&(_={});var T=_.timeZoneName||"short",C=S+"|"+T,j=r[C];return j||(j=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:T}),r[C]=j),j}(v,b);return w.formatToParts(x)},h=function(m,v){for(var b=u(m,v),x=[],w=0;w<b.length;w+=1){var S=b[w],_=S.type,T=S.value,C=n[_];C>=0&&(x[C]=parseInt(T,10))}var j=x[3],A=j===24?0:j,E=x[0]+"-"+x[1]+"-"+x[2]+" "+A+":"+x[4]+":"+x[5]+":000",R=+m;return(o.utc(E).valueOf()-(R-=R%1e3))/6e4},f=s.prototype;f.tz=function(m,v){m===void 0&&(m=l);var b,x=this.utcOffset(),w=this.toDate(),S=w.toLocaleString("en-US",{timeZone:m}),_=Math.round((w-new Date(S))/1e3/60),T=15*-Math.round(w.getTimezoneOffset()/15)-_;if(!Number(T))b=this.utcOffset(0,v);else if(b=o(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(T,!0),v){var C=b.utcOffset();b=b.add(x-C,"minute")}return b.$x.$timezone=m,b},f.offsetName=function(m){var v=this.$x.$timezone||o.tz.guess(),b=u(this.valueOf(),v,{timeZoneName:m}).find(function(x){return x.type.toLowerCase()==="timezonename"});return b&&b.value};var p=f.startOf;f.startOf=function(m,v){if(!this.$x||!this.$x.$timezone)return p.call(this,m,v);var b=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return p.call(b,m,v).tz(this.$x.$timezone,!0)},o.tz=function(m,v,b){var x=b&&v,w=b||v||l,S=h(+o(),w);if(typeof m!="string")return o(m).tz(w);var _=function(A,E,R){var N=A-60*E*1e3,$=h(N,R);if(E===$)return[N,E];var D=h(N-=60*($-E)*1e3,R);return $===D?[N,$]:[A-60*Math.min($,D)*1e3,Math.max($,D)]}(o.utc(m,x).valueOf(),S,w),T=_[0],C=_[1],j=o(T).utcOffset(C);return j.$x.$timezone=w,j},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(m){l=m}}})}(dx)),dx.exports}var b2e=v2e();const FU=dl(b2e),y2e="_metricName_13uqi_1",x2e="_labelPair_13uqi_4",w2e="_labelName_13uqi_14",S2e="_labelValue_13uqi_18",ug={metricName:y2e,labelPair:x2e,labelName:w2e,labelValue:S2e},j2e=t=>{"clipboard"in navigator?navigator.clipboard.writeText(t).then(()=>al.show({title:"Copied matcher!",message:`Label matcher ${t} copied to clipboard`})).catch(()=>al.show({color:"red",title:"Failed to copy matcher!",message:"Label matcher could not be copied to clipboard."})):al.show({color:"red",title:"Failed to copy matcher!",message:"Clipboard API is not supported in this context (most likely due to non-HTTPS origin)."})},Yp=({labels:t,format:e})=>{const n=()=>{const r=t&&SS(t.__name__||""),i=[];let s=!0;r&&(i.push(a.jsx("span",{children:a.jsxs("span",{className:ug.labelValue,children:['"',Oh(t.__name__),'"']})},"__name__")),s=!1);for(const o in t)o!=="__name__"&&(i.push(a.jsxs("span",{children:[!s&&", ",a.jsxs("span",{className:ug.labelPair,onDoubleClick:l=>j2e(l.currentTarget.innerText),title:"Double click to copy label matcher",children:[a.jsx("span",{className:ug.labelName,children:zh(o)}),"=",a.jsxs("span",{className:ug.labelValue,children:['"',Oh(t[o]),'"']})]})]},o)),s&&(s=!1));return a.jsxs("span",{children:[!r&&a.jsx("span",{className:ug.metricName,children:t?t.__name__:""}),"{",i,"}"]})};return t===null?a.jsx(a.Fragment,{children:"scalar"}):e?n():a.jsx(a.Fragment,{children:qU(t)})},_2e="_tableWrapper_n77eh_1",T2e="_numberCell_n77eh_7",C1={tableWrapper:_2e,numberCell:T2e};function C2e(t,e){if(parseFloat(t[2])===0||parseFloat(t[1])===0){if(e.length>1)return Math.abs(Math.log(Math.abs(parseFloat(e[e.length-2][2])))-Math.log(Math.abs(parseFloat(e[e.length-2][1]))));throw new Error("Only one bucket in histogram ([-0, 0]). Cannot calculate defaultExpBucketWidth.")}else return Math.abs(Math.log(Math.abs(parseFloat(t[2])))-Math.log(Math.abs(parseFloat(t[1]))))}function k2e(t){if(!t||t.length===0)return 0;for(let e=0;e<t.length;e++){const n=parseFloat(t[e][2]),r=parseFloat(t[e][1]);if(r>0)return r;if(r<0&&n>0||e===t.length-1&&n>0)return n}return 0}function O2e(t){if(!t||t.length===0)return 0;for(let e=0;e<t.length;e++){const n=parseFloat(t[e][2]),r=parseFloat(t[e][1]),i=e>0?parseFloat(t[e-1][2]):0;if(n>=0)return e===0?r<0?r:0:i}return console.log("findmaxneg returning: ",t[t.length-1][2]),parseFloat(t[t.length-1][2])}function E2e(t,e,n,r,i,s,o,l,u){return t==="linear"?(0-e)/(n-e)*100+"%":i===0?"0%":r===0?"100%":s===-1?o/l*100+"%":(o+.5*u)/l>0?(o+.5*u)/l*100+"%":"0%"}function A2e(t){const e=parseFloat(t.slice(0,-1));return 5<e&&e<95}function M2e(t){for(let e=0;e<t.length;e++){const n=parseFloat(t[e][1]),r=parseFloat(t[e][2]);if(n<=0&&r>=0)return e}return-1}const R2e=t=>t===3||t===1?"[":"(",D2e=t=>t===3||t===0?"]":")",HU=([t,e,n,r])=>`${R2e(t)}${e} -> ${n}${D2e(t)}`,N2e="_histogramYWrapper_4ql1n_1",P2e="_histogramYLabels_4ql1n_10",L2e="_histogramYLabel_4ql1n_10",$2e="_histogramXWrapper_4ql1n_22",I2e="_histogramXLabels_4ql1n_29",B2e="_histogramXLabel_4ql1n_29",z2e="_histogramContainer_4ql1n_40",q2e="_histogramAxes_4ql1n_46",F2e="_histogramYGrid_4ql1n_55",H2e="_histogramYTick_4ql1n_61",V2e="_histogramXGrid_4ql1n_69",U2e="_histogramXTick_4ql1n_76",Q2e="_histogramBucketSlot_4ql1n_84",W2e="_histogramBucket_4ql1n_84",Ii={histogramYWrapper:N2e,histogramYLabels:P2e,histogramYLabel:L2e,histogramXWrapper:$2e,histogramXLabels:I2e,histogramXLabel:B2e,histogramContainer:z2e,histogramAxes:q2e,histogramYGrid:F2e,histogramYTick:H2e,histogramXGrid:V2e,histogramXTick:U2e,histogramBucketSlot:Q2e,histogramBucket:W2e},Y2e=({index:t,histogram:e,scale:n})=>{const{buckets:r}=e;if(!r||r.length===0)return a.jsx("div",{children:"No data"});const i=Intl.NumberFormat("en",{notation:"compact"}),s=[];for(const D of r){const F=parseFloat(D[1]),Q=parseFloat(D[2]),H=parseFloat(D[3]),q=Q-F;if(q===0){s.push(0);continue}s.push(H/q)}const o=Math.max(...s),l=r[0],u=r[r.length-1],h=parseFloat(u[2]),f=parseFloat(l[1]),p=Math.max(...r.map(D=>parseFloat(D[3]))),m=C2e(u,r),v=h>0?h:0,b=k2e(r),x=O2e(r),w=parseFloat(l[1])<0?parseFloat(l[1]):0,S=w!==0?-Math.log(Math.abs(w)):0,_=x!==0?-Math.log(Math.abs(x)):0,T=b!==0?Math.log(b):0,C=v!==0?Math.log(v):0,j=_-S,A=C-T,E=j+m+A,R=M2e(r),N=E2e(n,f,h,b,x,R,j,E,m),$=A2e(N);return a.jsxs("div",{className:Ii.histogramYWrapper,children:[a.jsxs("div",{className:Ii.histogramYLabels,children:[[1,.75,.5,.25].map(D=>a.jsx("div",{className:Ii.histogramYLabel,children:n==="linear"?"":i.format(p*D)},D)),a.jsx("div",{className:Ii.histogramYLabel,style:{height:0},children:"0"},0)]}),a.jsxs("div",{className:Ii.histogramXWrapper,children:[a.jsxs("div",{className:Ii.histogramContainer,children:[[0,.25,.5,.75,1].map(D=>a.jsxs(_n.Fragment,{children:[a.jsx("div",{className:Ii.histogramYGrid,style:{bottom:D*100+"%"}}),a.jsx("div",{className:Ii.histogramYTick,style:{bottom:D*100+"%"}}),a.jsx("div",{className:Ii.histogramXGrid,style:{left:D*100+"%"}})]},D)),a.jsx("div",{className:Ii.histogramXTick,style:{left:"0%"}}),a.jsx("div",{className:Ii.histogramXTick,style:{left:N}}),a.jsx("div",{className:Ii.histogramXGrid,style:{left:N}}),a.jsx("div",{className:Ii.histogramXTick,style:{left:"100%"}}),a.jsx(X2e,{buckets:r,scale:n,rangeMin:f,rangeMax:h,index:t,fds:s,fdMax:o,countMax:p,defaultExpBucketWidth:m,minPositive:b,maxNegative:x,startPositive:T,startNegative:S,xWidthNegative:j,xWidthTotal:E}),a.jsx("div",{className:Ii.histogramAxes})]}),a.jsx("div",{className:Ii.histogramXLabels,children:a.jsx("div",{className:Ii.histogramXLabel,children:a.jsxs(_n.Fragment,{children:[a.jsx("div",{style:{position:"absolute",left:0},children:i.format(f)}),f<0&&$&&a.jsx("div",{style:{position:"absolute",left:N},children:"0"}),a.jsx("div",{style:{position:"absolute",right:0},children:i.format(h)})]})})})]})]})},X2e=({buckets:t,scale:e,rangeMin:n,rangeMax:r,index:i,fds:s,fdMax:o,countMax:l,defaultExpBucketWidth:u,minPositive:h,maxNegative:f,startPositive:p,startNegative:m,xWidthNegative:v,xWidthTotal:b})=>a.jsx(_n.Fragment,{children:t.map((x,w)=>{const S=parseFloat(x[1]),_=parseFloat(x[2]),T=parseFloat(x[3]),C=`bucket-${i}-${w}-${Math.ceil(parseFloat(x[3])*100)}`,j=Math.abs(Math.log(Math.abs(_))-Math.log(Math.abs(S))),A=j===0?u:j;let E="",R="",N="";switch(e){case"linear":{E=(_-S)/(r-n)*100+"%",R=(S-n)/(r-n)*100+"%",S===0&&_===0&&(R="0%",E="0%"),N=s[w]/o*100+"%";break}case"exponential":{let $=0;(h===0||f===0)&&($=u),E=A/(b-$)*100+"%",S<0?R=-(Math.log(Math.abs(S))+m)/(b-$)*100+"%":R=(Math.log(S)-p+u+v-$)/(b-$)*100+"%",S<0&&_>0&&(R=v/b*100+"%"),S===0&&_===0&&(R="0%",E="0%"),N=T/l*100+"%";break}default:throw new Error("Invalid scale")}return a.jsx(Xr,{label:`range: ${HU(x)}`,children:a.jsx("div",{id:C,className:Ii.histogramBucketSlot,style:{left:R,width:E},children:a.jsx("div",{id:C,className:Ii.histogramBucket,style:{height:N}})})},w)})});qe.extend(FU);const kL=1e3,Aw=1e4,OL=(t,e)=>e&&t.length>Aw?t.slice(0,Aw):t,G2e=({data:t,limitResults:e,setLimitResults:n})=>{const[r,i]=M.useState("exponential"),{useLocalTime:s}=ai(),{result:o,resultType:l}=t,u=o.length<=kL;return a.jsxs(En,{gap:"lg",mt:0,children:[e&&["vector","matrix"].includes(l)&&o.length>Aw&&a.jsxs(Nt,{color:"orange",icon:a.jsx(Ui,{}),title:"Showing limited results",children:["Fetched ",t.result.length," metrics, only displaying first"," ",Aw," for performance reasons.",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>n(!1),children:"Show all results"})]}),!u&&a.jsxs(Nt,{title:"Formatting turned off",icon:a.jsx(Gn,{}),children:["Showing more than ",kL," series, turning off label formatting to improve rendering performance."]}),a.jsx(ve,{pos:"relative",className:C1.tableWrapper,children:a.jsx(re,{fz:"xs",children:a.jsx(re.Tbody,{children:l==="vector"?OL(o,e).map((h,f)=>a.jsxs(re.Tr,{children:[a.jsx(re.Td,{children:a.jsx(Yp,{labels:h.metric,format:u})}),a.jsxs(re.Td,{className:C1.numberCell,children:[h.value&&h.value[1],h.histogram&&a.jsxs(En,{children:[a.jsx(Y2e,{histogram:h.histogram[1],index:f,scale:r}),a.jsxs(ht,{justify:"space-between",align:"center",p:10,children:[a.jsxs(ht,{align:"center",gap:"1rem",children:[a.jsxs("span",{children:[a.jsx("strong",{children:"Count:"})," ",h.histogram[1].count]}),a.jsxs("span",{children:[a.jsx("strong",{children:"Sum:"})," ",h.histogram[1].sum]})]}),a.jsxs(ht,{align:"center",gap:"1rem",children:[a.jsx("span",{children:"x-axis scale:"}),a.jsx(Xv,{size:"xs",value:r,onChange:i,data:["exponential","linear"]})]})]}),K2e(h.histogram[1])]})]})]},f)):l==="matrix"?OL(o,e).map((h,f)=>a.jsxs(re.Tr,{children:[a.jsx(re.Td,{children:a.jsx(Yp,{labels:h.metric,format:u})}),a.jsx(re.Td,{className:C1.numberCell,children:h.values&&h.values.map((p,m)=>a.jsxs("div",{children:[p[1]," ",a.jsxs(ut,{span:!0,c:"gray.7",size:"1em",title:sf(p[0],s),children:["@ ",p[0]]})]},m))})]},f)):l==="scalar"?a.jsxs(re.Tr,{children:[a.jsx(re.Td,{children:"Scalar value"}),a.jsx(re.Td,{className:C1.numberCell,children:o[1]})]}):l==="string"?a.jsxs(re.Tr,{children:[a.jsx(re.Td,{children:"String value"}),a.jsx(re.Td,{children:o[1]})]}):a.jsx(Nt,{color:"red",title:"Invalid query response",icon:a.jsx(Ui,{}),children:"Invalid result value type"})})})})]})},K2e=t=>{var e;return a.jsx(re,{withTableBorder:!0,fz:"xs",children:a.jsxs(re.Tbody,{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[a.jsxs(re.Tr,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[a.jsx(re.Th,{children:"Bucket range"}),a.jsx(re.Th,{children:"Count"})]}),a.jsx(Fa,{w:"100%",h:265,children:(e=t.buckets)==null?void 0:e.map((n,r)=>a.jsxs(re.Tr,{children:[a.jsx(re.Td,{style:{textAlign:"left"},children:HU(n)}),a.jsx(re.Td,{children:n[3]})]},r))})]})})},EL=t=>a.jsx(re,{withRowBorders:!1,children:a.jsx(re.Tbody,{children:Object.entries(t).map(([e,n])=>a.jsxs(re.Tr,{children:[a.jsx(re.Td,{pl:0,py:3,c:"dimmed",children:e}),a.jsx(re.Td,{pr:0,py:3,ta:"right",children:n})]},e))})}),Z2e=({numResults:t,responseTime:e,stats:n})=>a.jsx(Xr,{label:a.jsxs(ve,{p:"xs",children:[a.jsx(ut,{mb:"xs",children:"Timing stats (s):"}),EL(n.timings),a.jsx(ut,{mt:"sm",mb:"xs",children:"Sample stats:"}),EL(n.samples)]}),children:a.jsxs(ut,{size:"xs",c:"gray",children:["Load time: ",e,"ms   Result series: ",t]})});qe.extend(FU);const J2e=({panelIdx:t,retriggerIdx:e,expr:n})=>{var S,_;const[r,i]=M.useState(0),[s,o]=M.useState(!0),{visualizer:l}=rc(T=>T.queryPage.panels[t]),u=ou(),{showQueryWarnings:h,showQueryInfoNotices:f}=ai(),{endTime:p,range:m}=l,{data:v,error:b,isFetching:x,refetch:w}=Ih({key:[M.useId()],path:"/query",params:{query:n,time:`${(p!==null?p:Date.now())/1e3}`,stats:"true"},enabled:n!=="",recordResponseTime:i});return M.useEffect(()=>{n!==""&&w()},[e,w,n,p]),M.useLayoutEffect(()=>{o(!0)},[v,x]),a.jsxs(En,{gap:"lg",mt:"sm",children:[a.jsxs(ht,{justify:"space-between",children:[a.jsx(eq,{time:p,range:m,description:"Evaluation time",onChangeTime:T=>u(Gu({idx:t,visualizer:{...l,endTime:T}}))}),!x&&v!==void 0&&a.jsx(Z2e,{numResults:v.data.result.length,responseTime:r,stats:v.data.stats})]}),x?a.jsx(ve,{children:Array.from(Array(5),(T,C)=>a.jsx(xo,{height:30,mb:15},C))}):b!==null?a.jsx(Nt,{color:"red",title:"Error executing query",icon:a.jsx(Ui,{}),children:b.message}):v===void 0?a.jsx(Nt,{variant:"transparent",children:"No data queried yet"}):a.jsxs(a.Fragment,{children:[v.data.result.length===0&&a.jsx(Nt,{title:"Empty query result",icon:a.jsx(Gn,{}),children:"This query returned no data."}),h&&((S=v.warnings)==null?void 0:S.map((T,C)=>a.jsx(Nt,{color:"red",title:"Query warning",icon:a.jsx(Ui,{}),children:T},C))),f&&((_=v.infos)==null?void 0:_.map((T,C)=>a.jsx(Nt,{color:"yellow",title:"Query notice",icon:a.jsx(Gn,{}),children:T},C))),a.jsx(G2e,{data:v.data,limitResults:s,setLimitResults:o})]})]})},eSe="_nodeText_1076s_1",tSe="_nodeTextSelected_1076s_10",nSe="_nodeTextError_1076s_27",rSe="_errorText_1076s_34",k1={nodeText:eSe,nodeTextSelected:tSe,nodeTextError:nSe,errorText:rSe},iSe={abs:{argTypes:[le.vector],returnType:le.vector},absent:{argTypes:[le.vector],returnType:le.vector},absent_over_time:{argTypes:[le.matrix],returnType:le.vector},acos:{argTypes:[le.vector],returnType:le.vector},acosh:{argTypes:[le.vector],returnType:le.vector},asin:{argTypes:[le.vector],returnType:le.vector},asinh:{argTypes:[le.vector],returnType:le.vector},atan:{argTypes:[le.vector],returnType:le.vector},atanh:{argTypes:[le.vector],returnType:le.vector},avg_over_time:{argTypes:[le.matrix],returnType:le.vector},ceil:{argTypes:[le.vector],returnType:le.vector},changes:{argTypes:[le.matrix],returnType:le.vector},clamp:{argTypes:[le.vector,le.scalar,le.scalar],returnType:le.vector},clamp_max:{argTypes:[le.vector,le.scalar],returnType:le.vector},clamp_min:{argTypes:[le.vector,le.scalar],returnType:le.vector},cos:{argTypes:[le.vector],returnType:le.vector},cosh:{argTypes:[le.vector],returnType:le.vector},count_over_time:{argTypes:[le.matrix],returnType:le.vector},day_of_month:{argTypes:[le.vector],returnType:le.vector},day_of_week:{argTypes:[le.vector],returnType:le.vector},day_of_year:{argTypes:[le.vector],returnType:le.vector},days_in_month:{argTypes:[le.vector],returnType:le.vector},deg:{argTypes:[le.vector],returnType:le.vector},delta:{argTypes:[le.matrix],returnType:le.vector},deriv:{argTypes:[le.matrix],returnType:le.vector},double_exponential_smoothing:{argTypes:[le.matrix,le.scalar,le.scalar],returnType:le.vector},exp:{argTypes:[le.vector],returnType:le.vector},first_over_time:{argTypes:[le.matrix],returnType:le.vector},floor:{argTypes:[le.vector],returnType:le.vector},histogram_avg:{argTypes:[le.vector],returnType:le.vector},histogram_count:{argTypes:[le.vector],returnType:le.vector},histogram_fraction:{argTypes:[le.scalar,le.scalar,le.vector],returnType:le.vector},histogram_quantile:{argTypes:[le.scalar,le.vector],returnType:le.vector},histogram_stddev:{argTypes:[le.vector],returnType:le.vector},histogram_stdvar:{argTypes:[le.vector],returnType:le.vector},histogram_sum:{argTypes:[le.vector],returnType:le.vector},hour:{argTypes:[le.vector],returnType:le.vector},idelta:{argTypes:[le.matrix],returnType:le.vector},increase:{argTypes:[le.matrix],returnType:le.vector},info:{argTypes:[le.vector,le.vector],returnType:le.vector},irate:{argTypes:[le.matrix],returnType:le.vector},label_join:{argTypes:[le.vector,le.string,le.string,le.string],returnType:le.vector},label_replace:{argTypes:[le.vector,le.string,le.string,le.string,le.string],returnType:le.vector},last_over_time:{name:"last_over_time",argTypes:[le.matrix],variadic:0,returnType:le.vector},ln:{argTypes:[le.vector],returnType:le.vector},log10:{argTypes:[le.vector],returnType:le.vector},log2:{argTypes:[le.vector],returnType:le.vector},mad_over_time:{argTypes:[le.matrix],returnType:le.vector},max_over_time:{argTypes:[le.matrix],returnType:le.vector},min_over_time:{argTypes:[le.matrix],returnType:le.vector},minute:{argTypes:[le.vector],returnType:le.vector},month:{argTypes:[le.vector],returnType:le.vector},pi:{returnType:le.scalar},predict_linear:{argTypes:[le.matrix,le.scalar],returnType:le.vector},present_over_time:{argTypes:[le.matrix],returnType:le.vector},quantile_over_time:{argTypes:[le.scalar,le.matrix],returnType:le.vector},rad:{argTypes:[le.vector],returnType:le.vector},rate:{argTypes:[le.matrix],returnType:le.vector},resets:{argTypes:[le.matrix],returnType:le.vector},round:{argTypes:[le.vector,le.scalar],returnType:le.vector},scalar:{argTypes:[le.vector],returnType:le.scalar},sgn:{argTypes:[le.vector],returnType:le.vector},sin:{argTypes:[le.vector],returnType:le.vector},sinh:{argTypes:[le.vector],returnType:le.vector},sort:{argTypes:[le.vector],returnType:le.vector},sort_by_label:{argTypes:[le.vector,le.string],returnType:le.vector},sort_by_label_desc:{argTypes:[le.vector,le.string],returnType:le.vector},sort_desc:{argTypes:[le.vector],returnType:le.vector},sqrt:{argTypes:[le.vector],returnType:le.vector},stddev_over_time:{argTypes:[le.matrix],returnType:le.vector},stdvar_over_time:{argTypes:[le.matrix],returnType:le.vector},sum_over_time:{argTypes:[le.matrix],returnType:le.vector},tan:{argTypes:[le.vector],returnType:le.vector},tanh:{argTypes:[le.vector],returnType:le.vector},time:{returnType:le.scalar},timestamp:{argTypes:[le.vector],returnType:le.vector},ts_of_first_over_time:{argTypes:[le.matrix],returnType:le.vector},ts_of_last_over_time:{argTypes:[le.matrix],returnType:le.vector},ts_of_max_over_time:{argTypes:[le.matrix],returnType:le.vector},ts_of_min_over_time:{argTypes:[le.matrix],returnType:le.vector},vector:{argTypes:[le.scalar],returnType:le.vector},year:{argTypes:[le.vector],returnType:le.vector}},O1=20,UT=10,AL=10,QT={width:de(18),height:de(18)},sSe=t=>t.includes("error")?"error":t.includes("waiting")?"waiting":t.includes("running")?"running":"success",fx=({node:t,selectedNode:e,setSelectedNode:n,parentEl:r,reportNodeState:i,reverse:s,childIdx:o})=>{const l=Ei(),[u,h]=M.useState(null),f=M.useCallback(D=>h(D),[]),[p,m]=M.useState({borderColor:"light-dark(var(--mantine-color-gray-4), var(--mantine-color-dark-3))",borderLeftStyle:"solid",borderLeftWidth:2,width:O1-7,left:-13}),[v,b]=M.useState(0),[x,w]=M.useState({numSeries:0,labelExamples:{},sortedLabelCards:[]});M.useEffect(()=>{r===void 0&&n({id:l,node:t})},[r,n,l,t]),M.useEffect(()=>()=>{n(null)},[n]);const S=N1e(t),[_,T]=M.useState(S.map(()=>"waiting")),C=M.useMemo(()=>sSe(_),[_]);let j=t;if(j.type===mt.matrixSelector){const D={...j};D.anchored=!1,D.smoothed=!1,j={type:mt.call,func:iSe.last_over_time,args:[D]}}const{data:A,error:E,isFetching:R}=Ih({key:[Ei()],path:"/query",params:{query:as(j)},recordResponseTime:b,enabled:C==="success"});M.useEffect(()=>{C==="error"&&i&&i(o,"error")},[C,i,o]),M.useEffect(()=>{E&&i&&i(o,"error")},[E,i,o]),M.useEffect(()=>{R&&i&&i(o,"running")},[R,i,o]);const N=M.useCallback((D,F)=>{T(Q=>{const H=[...Q];return H[D]=F,H})},[T]);M.useLayoutEffect(()=>{if(r===void 0||r===null||u===null)return;const D=r.getBoundingClientRect(),F=u.getBoundingClientRect();m(s?Q=>({...Q,top:"calc(50% - 1px)",bottom:F.bottom-D.top,borderTopLeftRadius:3,borderTopStyle:"solid",borderBottomLeftRadius:void 0}):Q=>({...Q,top:D.bottom-F.top,bottom:"calc(50% - 1px)",borderBottomLeftRadius:3,borderBottomStyle:"solid",borderTopLeftRadius:void 0}))},[r,u,s,f,m]),M.useEffect(()=>{if(!A)return;i&&i(o,"success");let D=0;const F={},{resultType:Q,result:H}=A.data;Q==="scalar"||Q==="string"?D=1:H&&H.length>0&&(D=H.length,H.forEach(I=>{Object.entries(I.metric).forEach(([U,Z])=>{U!=="__name__"&&(F[U]||(F[U]={}),F[U][Z]=(F[U][Z]||0)+1)})}));const q={},P={};Object.entries(F).forEach(([I,U])=>{q[I]=Object.keys(U).length,P[I]=Object.entries(U).sort(([,Z],[,X])=>X-Z).slice(0,AL).map(([Z,X])=>({value:Z,count:X}))}),w({numSeries:D,sortedLabelCards:Object.entries(q).sort((I,U)=>U[1]-I[1]),labelExamples:P})},[A,i,o]);const $=a.jsxs(ht,{w:"fit-content",gap:"lg",my:"sm",wrap:"nowrap",pos:"relative",align:"center",children:[r!==void 0&&a.jsx(ve,{pos:"absolute",display:"inline-block",style:p}),a.jsx(ve,{ref:f,w:"fit-content",px:10,py:4,style:{borderRadius:4,flexShrink:0},className:Lr(k1.nodeText,{[k1.nodeTextError]:E,[k1.nodeTextSelected]:(e==null?void 0:e.id)===l}),onClick:()=>{(e==null?void 0:e.id)===l?n(null):n({id:l,node:t})},children:Bo(t,!1,1)}),C==="waiting"?a.jsx(ht,{c:"gray",children:a.jsx(s3,{style:QT})}):C==="running"?a.jsx(Kl,{size:14,color:"gray",type:"dots"}):C==="error"?a.jsxs(ht,{c:"orange.7",gap:5,fz:"xs",wrap:"nowrap",children:[a.jsx(s3,{style:QT})," Blocked on child query error"]}):R?a.jsx(Kl,{size:14,color:"gray"}):E?a.jsxs(ht,{gap:5,wrap:"nowrap",style:{flexShrink:0},className:k1.errorText,children:[a.jsx(s3,{style:QT}),a.jsxs(ut,{fz:"xs",children:[a.jsx("strong",{children:"Error executing query:"})," ",E.message]})]}):a.jsxs(ht,{gap:0,wrap:"nowrap",children:[a.jsxs(ut,{c:"dimmed",fz:"xs",style:{whiteSpace:"nowrap"},children:[x.numSeries," result",x.numSeries!==1&&"s","  –  ",v,"ms",x.sortedLabelCards.length>0&&a.jsx(a.Fragment,{children:"  –  "})]}),a.jsxs(ht,{gap:"xs",wrap:"nowrap",children:[x.sortedLabelCards.slice(0,UT).map(([D,F])=>a.jsx(Xr,{position:"bottom",withArrow:!0,color:"dark.6",label:a.jsx(ve,{p:"xs",children:a.jsxs(rr,{fz:"xs",children:[x.labelExamples[D].map(({value:Q,count:H})=>a.jsxs(rr.Item,{py:1,children:[a.jsx(CO,{c:"red.3",bg:"gray.8",children:os(Q)})," ","(",H,"x)"]},Q)),F>AL&&a.jsx("li",{children:"..."})]})}),children:a.jsxs("span",{style:{cursor:"pointer",whiteSpace:"nowrap"},children:[a.jsx(ut,{component:"span",fz:"xs",className:"promql-code promql-label-name",c:"light-dark(var(--mantine-color-green-9), var(--mantine-color-green-6))",children:D}),a.jsxs(ut,{component:"span",fz:"xs",c:"dimmed",children:[": ",F]})]})},D)),x.sortedLabelCards.length>UT?a.jsxs(ut,{component:"span",c:"dimmed",fz:"xs",style:{whiteSpace:"nowrap"},children:["...",x.sortedLabelCards.length-UT," more..."]}):null]})]})]});return t.type===mt.binaryExpr?a.jsxs("div",{children:[a.jsx(ve,{ml:O1,children:a.jsx(fx,{node:S[0],selectedNode:e,setSelectedNode:n,parentEl:u,reverse:!0,childIdx:0,reportNodeState:N})}),$,a.jsx(ve,{ml:O1,children:a.jsx(fx,{node:S[1],selectedNode:e,setSelectedNode:n,parentEl:u,reverse:!1,childIdx:1,reportNodeState:N})})]}):a.jsxs("div",{children:[$,S.map((D,F)=>a.jsx(ve,{ml:O1,children:a.jsx(fx,{node:D,selectedNode:e,setSelectedNode:n,parentEl:u,reverse:!1,childIdx:F,reportNodeState:N})},F))]})},aSe=({panelIdx:t,selectedNode:e,setSelectedNode:n,closeTreeView:r})=>{const{expr:i}=rc(o=>o.queryPage.panels[t]),{data:s}=bi({path:"/parse_query",params:{query:i}});return a.jsxs(Gr,{withBorder:!0,fz:"sm",style:{overflowX:"auto"},pl:"sm",children:[a.jsx(Jl,{"aria-label":"Close tree view",title:"Close tree view",pos:"absolute",top:7,size:"sm",right:7,onClick:r}),a.jsx(fx,{childIdx:0,node:s.data,selectedNode:e,setSelectedNode:n,reverse:!1})]})},oSe={abs:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"abs(v instant-vector)"})," returns a vector containing all float samples in the input vector converted to their absolute value. Histogram samples in the input vector are ignored silently."]})}),absent:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"absent(v instant-vector)"})," returns an empty vector if the vector passed to it has any elements (float samples or histogram samples) and a 1-element vector with the value 1 if the vector passed to it has no elements."]}),a.jsx("p",{children:"This is useful for alerting on when no time series exist for a given metric name and label combination."}),a.jsx("pre",{children:a.jsxs("code",{children:["absent(nonexistent","{",'job="myjob"',"}",") # => ","{",'job="myjob"',"}","absent(nonexistent","{",'job="myjob",instance=~".*"',"}",") # => ","{",'job="myjob"',"}","absent(sum(nonexistent","{",'job="myjob"',"}",")) # => ","{","}"]})}),a.jsxs("p",{children:["In the first two examples, ",a.jsx("code",{children:"absent()"})," tries to be smart about deriving labels of the 1-element output vector from the input vector."]})]}),absent_over_time:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"absent_over_time(v range-vector)"})," returns an empty vector if the range vector passed to it has any elements (float samples or histogram samples) and a 1-element vector with the value 1 if the range vector passed to it has no elements."]}),a.jsx("p",{children:"This is useful for alerting on when no time series exist for a given metric name and label combination for a certain amount of time."}),a.jsx("pre",{children:a.jsxs("code",{children:["absent_over_time(nonexistent","{",'job="myjob"',"}","[1h]) # => ","{",'job="myjob"',"}","absent_over_time(nonexistent","{",'job="myjob",instance=~".*"',"}","[1h]) # => ","{",'job="myjob"',"}","absent_over_time(sum(nonexistent","{",'job="myjob"',"}",")[1h:]) # => ","{","}"]})}),a.jsxs("p",{children:["In the first two examples, ",a.jsx("code",{children:"absent_over_time()"})," tries to be smart about deriving labels of the 1-element output vector from the input vector."]})]}),acos:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),acosh:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),asin:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),asinh:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),atan:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),atanh:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),avg_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),ceil:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"ceil(v instant-vector)"})," returns a vector containing all float samples in the input vector rounded up to the nearest integer value greater than or equal to their original value. Histogram samples in the input vector are ignored silently."]}),a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx("code",{children:"ceil(+Inf) = +Inf"})}),a.jsx("li",{children:a.jsx("code",{children:"ceil(±0) = ±0"})}),a.jsx("li",{children:a.jsx("code",{children:"ceil(1.49) = 2.0"})}),a.jsx("li",{children:a.jsx("code",{children:"ceil(1.78) = 2.0"})})]})]}),changes:a.jsx(a.Fragment,{children:a.jsxs("p",{children:["For each input time series, ",a.jsx("code",{children:"changes(v range-vector)"})," returns the number of times its value has changed within the provided time range as an instant vector. A float sample followed by a histogram sample, or vice versa, counts as a change. A counter histogram sample followed by a gauge histogram sample with otherwise exactly the same values, or vice versa, does not count as a change."]})}),clamp:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"clamp(v instant-vector, min scalar, max scalar)"})," clamps the values of all float samples in"," ",a.jsx("code",{children:"v"})," to have a lower limit of ",a.jsx("code",{children:"min"})," and an upper limit of",a.jsx("code",{children:"max"}),". Histogram samples in the input vector are ignored silently."]}),a.jsx("p",{children:"Special cases:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:["Return an empty vector if ",a.jsx("code",{children:"min > max"})]}),a.jsxs("li",{children:["Float samples are clamped to ",a.jsx("code",{children:"NaN"})," if ",a.jsx("code",{children:"min"})," or ",a.jsx("code",{children:"max"})," is ",a.jsx("code",{children:"NaN"})]})]})]}),clamp_max:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"clamp_max(v instant-vector, max scalar)"})," clamps the values of all float samples in ",a.jsx("code",{children:"v"})," to have an upper limit of ",a.jsx("code",{children:"max"}),". Histogram samples in the input vector are ignored silently."]})}),clamp_min:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"clamp_min(v instant-vector, min scalar)"})," clamps the values of all float samples in ",a.jsx("code",{children:"v"})," to have a lower limit of ",a.jsx("code",{children:"min"}),". Histogram samples in the input vector are ignored silently."]})}),cos:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),cosh:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),count_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),day_of_month:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"day_of_month(v=vector(time()) instant-vector)"})," interprets float samples in",a.jsx("code",{children:"v"})," as timestamps (number of seconds since January 1, 1970 UTC) and returns the day of the month (in UTC) for each of those timestamps. Returned values are from 1 to 31. Histogram samples in the input vector are ignored silently."]})}),day_of_week:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"day_of_week(v=vector(time()) instant-vector)"})," interprets float samples in ",a.jsx("code",{children:"v"}),"as timestamps (number of seconds since January 1, 1970 UTC) and returns the day of the week (in UTC) for each of those timestamps. Returned values are from 0 to 6, where 0 means Sunday etc. Histogram samples in the input vector are ignored silently."]})}),day_of_year:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"day_of_year(v=vector(time()) instant-vector)"})," interprets float samples in ",a.jsx("code",{children:"v"}),"as timestamps (number of seconds since January 1, 1970 UTC) and returns the day of the year (in UTC) for each of those timestamps. Returned values are from 1 to 365 for non-leap years, and 1 to 366 in leap years. Histogram samples in the input vector are ignored silently."]})}),days_in_month:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"days_in_month(v=vector(time()) instant-vector)"})," interprets float samples in",a.jsx("code",{children:"v"})," as timestamps (number of seconds since January 1, 1970 UTC) and returns the number of days in the month of each of those timestamps (in UTC). Returned values are from 28 to 31. Histogram samples in the input vector are ignored silently."]})}),deg:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),delta:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"delta(v range-vector)"})," calculates the difference between the first and last value of each time series element in a range vector ",a.jsx("code",{children:"v"}),", returning an instant vector with the given deltas and equivalent labels. The delta is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if the sample values are all integers."]}),a.jsx("p",{children:"The following example expression returns the difference in CPU temperature between now and 2 hours ago:"}),a.jsx("pre",{children:a.jsxs("code",{children:["delta(cpu_temp_celsius","{",'host="zeus"',"}","[2h])"]})}),a.jsxs("p",{children:[a.jsx("code",{children:"delta"})," acts on histogram samples by calculating a new histogram where each component (sum and count of observations, buckets) is the difference between the respective component in the first and last native histogram in ",a.jsx("code",{children:"v"}),". However, each element in ",a.jsx("code",{children:"v"})," that contains a mix of float samples and histogram samples within the range will be omitted from the result vector, flagged by a warn-level annotation."]}),a.jsxs("p",{children:[a.jsx("code",{children:"delta"})," should only be used with gauges (for both floats and histograms)."]})]}),deriv:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"deriv(v range-vector)"})," calculates the per-second derivative of each float time series in the range vector ",a.jsx("code",{children:"v"}),", using"," ",a.jsx("a",{href:"https://en.wikipedia.org/wiki/Simple_linear_regression",children:"simple linear regression"}),". The range vector must have at least two float samples in order to perform the calculation. When ",a.jsx("code",{children:"+Inf"})," or"," ",a.jsx("code",{children:"-Inf"})," are found in the range vector, the slope and offset value calculated will be ",a.jsx("code",{children:"NaN"}),"."]}),a.jsxs("p",{children:[a.jsx("code",{children:"deriv"})," should only be used with gauges and only works for float samples. Elements in the range vector that contain only histogram samples are ignored entirely. For elements that contain a mix of float and histogram samples, only the float samples are used as input, which is flagged by an info-level annotation."]})]}),double_exponential_smoothing:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:a.jsxs("strong",{children:["This function has to be enabled via the"," ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),a.jsxs("p",{children:[a.jsx("code",{children:"double_exponential_smoothing(v range-vector, sf scalar, tf scalar)"})," produces a smoothed value for each float time series in the range in ",a.jsx("code",{children:"v"}),". The lower the smoothing factor ",a.jsx("code",{children:"sf"}),", the more importance is given to old data. The higher the trend factor ",a.jsx("code",{children:"tf"}),", the more trends in the data is considered. Both ",a.jsx("code",{children:"sf"})," and",a.jsx("code",{children:"tf"})," must be between 0 and 1. For additional details, refer to"," ",a.jsx("a",{href:"https://www.itl.nist.gov/div898/handbook/pmc/section4/pmc433.htm",children:"NIST Engineering Statistics Handbook"}),". In Prometheus V2 this function was called ",a.jsx("code",{children:"holt_winters"}),". This caused confusion since the Holt-Winters method usually refers to triple exponential smoothing. Double exponential smoothing as implemented here is also referred to as “Holt Linear”."]}),a.jsxs("p",{children:[a.jsx("code",{children:"double_exponential_smoothing"})," should only be used with gauges and only works for float samples. Elements in the range vector that contain only histogram samples are ignored entirely. For elements that contain a mix of float and histogram samples, only the float samples are used as input, which is flagged by an info-level annotation."]})]}),exp:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"exp(v instant-vector)"})," calculates the exponential function for all float samples in ",a.jsx("code",{children:"v"}),". Histogram samples are ignored silently. Special cases are:"]}),a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx("code",{children:"Exp(+Inf) = +Inf"})}),a.jsx("li",{children:a.jsx("code",{children:"Exp(NaN) = NaN"})})]})]}),first_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),floor:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"floor(v instant-vector)"})," returns a vector containing all float samples in the input vector rounded down to the nearest integer value smaller than or equal to their original value. Histogram samples in the input vector are ignored silently."]}),a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx("code",{children:"floor(+Inf) = +Inf"})}),a.jsx("li",{children:a.jsx("code",{children:"floor(±0) = ±0"})}),a.jsx("li",{children:a.jsx("code",{children:"floor(1.49) = 1.0"})}),a.jsx("li",{children:a.jsx("code",{children:"floor(1.78) = 1.0"})})]})]}),histogram_avg:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"histogram_avg(v instant-vector)"})," returns the arithmetic average of observed values stored in each histogram sample in ",a.jsx("code",{children:"v"}),". Float samples are ignored and do not show up in the returned vector."]}),a.jsxs("p",{children:["Use ",a.jsx("code",{children:"histogram_avg"})," as demonstrated below to compute the average request duration over a 5-minute window from a native histogram:"]}),a.jsx("pre",{children:a.jsx("code",{children:"histogram_avg(rate(http_request_duration_seconds[5m]))"})}),a.jsx("p",{children:"Which is equivalent to the following query:"}),a.jsx("pre",{children:a.jsxs("code",{children:[" ","histogram_sum(rate(http_request_duration_seconds[5m])) / histogram_count(rate(http_request_duration_seconds[5m]))"]})})]}),histogram_count:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"histogram_count(v instant-vector)"})," returns the count of observations stored in each histogram sample in ",a.jsx("code",{children:"v"}),". Float samples are ignored and do not show up in the returned vector."]}),a.jsxs("p",{children:["Similarly, ",a.jsx("code",{children:"histogram_sum(v instant-vector)"})," returns the sum of observations stored in each histogram sample."]}),a.jsxs("p",{children:["Use ",a.jsx("code",{children:"histogram_count"})," in the following way to calculate a rate of observations (in this case corresponding to “requests per second”) from a series of histogram samples:"]}),a.jsx("pre",{children:a.jsx("code",{children:"histogram_count(rate(http_request_duration_seconds[10m]))"})})]}),histogram_fraction:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"histogram_fraction(lower scalar, upper scalar, b instant-vector)"})," returns the estimated fraction of observations between the provided lower and upper values for each classic or native histogram contained in"," ",a.jsx("code",{children:"b"}),". Float samples in ",a.jsx("code",{children:"b"})," are considered the counts of observations in each bucket of one or more classic histograms, while native histogram samples in ",a.jsx("code",{children:"b"})," are treated each individually as a separate histogram. This works in the same way as for ",a.jsx("code",{children:"histogram_quantile()"}),". (See there for more details.)"]}),a.jsxs("p",{children:["If the provided lower and upper values do not coincide with bucket boundaries, the calculated fraction is an estimate, using the same interpolation method as for",a.jsx("code",{children:"histogram_quantile()"}),". (See there for more details.) Especially with classic histograms, it is easy to accidentally pick lower or upper values that are very far away from any bucket boundary, leading to large margins of error. Rather than using ",a.jsx("code",{children:"histogram_fraction()"})," with classic histograms, it is often a more robust approach to directly act on the bucket series when calculating fractions. See the",a.jsx("a",{href:"https://prometheus.io/docs/practices/histograms/#apdex-score",children:"calculation of the Apdex score"}),"as a typical example."]}),a.jsx("p",{children:"For example, the following expression calculates the fraction of HTTP requests over the last hour that took 200ms or less:"}),a.jsx("pre",{children:a.jsx("code",{children:"histogram_fraction(0, 0.2, rate(http_request_duration_seconds[1h]))"})}),a.jsx("p",{children:"The error of the estimation depends on the resolution of the underlying native histogram and how closely the provided boundaries are aligned with the bucket boundaries in the histogram."}),a.jsxs("p",{children:[a.jsx("code",{children:"+Inf"})," and ",a.jsx("code",{children:"-Inf"})," are valid boundary values. For example, if the histogram in the expression above included negative observations (which shouldn’t be the case for request durations), the appropriate lower boundary to include all observations less than or equal 0.2 would be ",a.jsx("code",{children:"-Inf"})," rather than ",a.jsx("code",{children:"0"}),"."]}),a.jsx("p",{children:"Whether the provided boundaries are inclusive or exclusive is only relevant if the provided boundaries are precisely aligned with bucket boundaries in the underlying native histogram. In this case, the behavior depends on the schema definition of the histogram. (The usual standard exponential schemas all feature inclusive upper boundaries and exclusive lower boundaries for positive values, and vice versa for negative values.) Without a precise alignment of boundaries, the function uses interpolation to estimate the fraction. With the resulting uncertainty, it becomes irrelevant if the boundaries are inclusive or exclusive."}),a.jsxs("p",{children:["Special case for native histograms with standard exponential buckets:",a.jsx("code",{children:"NaN"})," observations are considered outside of any buckets in this case.",a.jsx("code",{children:"histogram_fraction(-Inf, +Inf, b)"})," effectively returns the fraction of non-",a.jsx("code",{children:"NaN"})," ","observations and may therefore be less than 1."]})]}),histogram_quantile:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"histogram_quantile(φ scalar, b instant-vector)"})," calculates the φ-quantile (0 ≤ φ ≤ 1) from a"," ",a.jsx("a",{href:"https://prometheus.io/docs/concepts/metric_types/#histogram",children:"classic histogram"})," or from a native histogram. (See ",a.jsx("a",{href:"https://prometheus.io/docs/practices/histograms",children:"histograms and summaries"})," for a detailed explanation of φ-quantiles and the usage of the (classic) histogram metric type in general.)"]}),a.jsxs("p",{children:["The float samples in ",a.jsx("code",{children:"b"})," are considered the counts of observations in each bucket of one or more classic histograms. Each float sample must have a label",a.jsx("code",{children:"le"})," where the label value denotes the inclusive upper bound of the bucket. (Float samples without such a label are silently ignored.) The other labels and the metric name are used to identify the buckets belonging to each classic histogram. The"," ",a.jsx("a",{href:"https://prometheus.io/docs/concepts/metric_types/#histogram",children:"histogram metric type"}),"automatically provides time series with the ",a.jsx("code",{children:"_bucket"})," suffix and the appropriate labels."]}),a.jsxs("p",{children:["The (native) histogram samples in ",a.jsx("code",{children:"b"})," are treated each individually as a separate histogram to calculate the quantile from."]}),a.jsxs("p",{children:["As long as no naming collisions arise, ",a.jsx("code",{children:"b"})," may contain a mix of classic and native histograms."]}),a.jsxs("p",{children:["Use the ",a.jsx("code",{children:"rate()"})," function to specify the time window for the quantile calculation."]}),a.jsxs("p",{children:["Example: A histogram metric is called ",a.jsx("code",{children:"http_request_duration_seconds"})," (and therefore the metric name for the buckets of a classic histogram is",a.jsx("code",{children:"http_request_duration_seconds_bucket"}),"). To calculate the 90th percentile of request durations over the last 10m, use the following expression in case",a.jsx("code",{children:"http_request_duration_seconds"})," is a classic histogram:"]}),a.jsx("pre",{children:a.jsx("code",{children:"histogram_quantile(0.9, rate(http_request_duration_seconds_bucket[10m]))"})}),a.jsx("p",{children:"For a native histogram, use the following expression instead:"}),a.jsx("pre",{children:a.jsx("code",{children:"histogram_quantile(0.9, rate(http_request_duration_seconds[10m]))"})}),a.jsxs("p",{children:["The quantile is calculated for each label combination in",a.jsx("code",{children:"http_request_duration_seconds"}),". To aggregate, use the ",a.jsx("code",{children:"sum()"})," aggregator around the"," ",a.jsx("code",{children:"rate()"})," function. Since the ",a.jsx("code",{children:"le"})," label is required by",a.jsx("code",{children:"histogram_quantile()"})," to deal with classic histograms, it has to be included in the ",a.jsx("code",{children:"by"})," ","clause. The following expression aggregates the 90th percentile by ",a.jsx("code",{children:"job"})," for classic histograms:"]}),a.jsx("pre",{children:a.jsx("code",{children:"histogram_quantile(0.9, sum by (job, le) (rate(http_request_duration_seconds_bucket[10m])))"})}),a.jsx("p",{children:"When aggregating native histograms, the expression simplifies to:"}),a.jsx("pre",{children:a.jsx("code",{children:"histogram_quantile(0.9, sum by (job) (rate(http_request_duration_seconds[10m])))"})}),a.jsxs("p",{children:["To aggregate all classic histograms, specify only the ",a.jsx("code",{children:"le"})," label:"]}),a.jsx("pre",{children:a.jsx("code",{children:"histogram_quantile(0.9, sum by (le) (rate(http_request_duration_seconds_bucket[10m])))"})}),a.jsxs("p",{children:["With native histograms, aggregating everything works as usual without any ",a.jsx("code",{children:"by"})," clause:"]}),a.jsx("pre",{children:a.jsx("code",{children:"histogram_quantile(0.9, sum(rate(http_request_duration_seconds[10m])))"})}),a.jsxs("p",{children:["In the (common) case that a quantile value does not coincide with a bucket boundary, the"," ",a.jsx("code",{children:"histogram_quantile()"})," function interpolates the quantile value within the bucket the quantile value falls into. For classic histograms, for native histograms with custom bucket boundaries, and for the zero bucket of other native histograms, it assumes a uniform distribution of observations within the bucket (also called"," ",a.jsx("em",{children:"linear interpolation"}),"). For the non-zero-buckets of native histograms with a standard exponential bucketing schema, the interpolation is done under the assumption that the samples within the bucket are distributed in a way that they would uniformly populate the buckets in a hypothetical histogram with higher resolution. (This is also called ",a.jsx("em",{children:"exponential interpolation"}),". See the"," ",a.jsx("a",{href:"https://prometheus.io/docs/specs/native_histograms/#interpolation-within-a-bucket",children:"native histogram specification"}),"for more details.)"]}),a.jsxs("p",{children:["If ",a.jsx("code",{children:"b"})," has 0 observations, ",a.jsx("code",{children:"NaN"})," is returned. For φ < 0, ",a.jsx("code",{children:"-Inf"})," is returned. For φ > 1, ",a.jsx("code",{children:"+Inf"})," is returned. For φ = ",a.jsx("code",{children:"NaN"}),", ",a.jsx("code",{children:"NaN"})," is returned."]}),a.jsx("p",{children:"Special cases for classic histograms:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:["If ",a.jsx("code",{children:"b"})," contains fewer than two buckets, ",a.jsx("code",{children:"NaN"})," is returned."]}),a.jsxs("li",{children:["The highest bucket must have an upper bound of ",a.jsx("code",{children:"+Inf"}),". (Otherwise, ",a.jsx("code",{children:"NaN"})," is returned.)"]}),a.jsx("li",{children:"If a quantile is located in the highest bucket, the upper bound of the second highest bucket is returned."}),a.jsx("li",{children:"The lower limit of the lowest bucket is assumed to be 0 if the upper bound of that bucket is greater than 0. In that case, the usual linear interpolation is applied within that bucket. Otherwise, the upper bound of the lowest bucket is returned for quantiles located in the lowest bucket."})]}),a.jsx("p",{children:"Special cases for native histograms:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:["If a native histogram with standard exponential buckets has ",a.jsx("code",{children:"NaN"}),"observations and the quantile falls into one of the existing exponential buckets, the result is skewed towards higher values due to ",a.jsx("code",{children:"NaN"}),"observations treated as ",a.jsx("code",{children:"+Inf"}),". This is flagged with an info level annotation."]}),a.jsxs("li",{children:["If a native histogram with standard exponential buckets has ",a.jsx("code",{children:"NaN"}),"observations and the quantile falls above all of the existing exponential buckets, ",a.jsx("code",{children:"NaN"})," is returned. This is flagged with an info level annotation."]}),a.jsx("li",{children:"A zero bucket with finite width is assumed to contain no negative observations if the histogram has observations in positive buckets, but none in negative buckets."}),a.jsx("li",{children:"A zero bucket with finite width is assumed to contain no positive observations if the histogram has observations in negative buckets, but none in positive buckets."})]}),a.jsxs("p",{children:["You can use ",a.jsx("code",{children:"histogram_quantile(0, v instant-vector)"})," to get the estimated minimum value stored in a histogram."]}),a.jsxs("p",{children:["You can use ",a.jsx("code",{children:"histogram_quantile(1, v instant-vector)"})," to get the estimated maximum value stored in a histogram."]}),a.jsx("p",{children:"Buckets of classic histograms are cumulative. Therefore, the following should always be the case:"}),a.jsxs("ul",{children:[a.jsx("li",{children:"The counts in the buckets are monotonically increasing (strictly non-decreasing)."}),a.jsx("li",{children:"A lack of observations between the upper limits of two consecutive buckets results in equal counts in those two buckets."})]}),a.jsxs("p",{children:["However, floating point precision issues (e.g. small discrepancies introduced by computing of buckets with"," ",a.jsx("code",{children:"sum(rate(...))"}),") or invalid data might violate these assumptions. In that case,"," ",a.jsx("code",{children:"histogram_quantile"})," would be unable to return meaningful results. To mitigate the issue,"," ",a.jsx("code",{children:"histogram_quantile"})," assumes that tiny relative differences between consecutive buckets are happening because of floating point precision errors and ignores them. (The threshold to ignore a difference between two buckets is a trillionth (1e-12) of the sum of both buckets.) Furthermore, if there are non-monotonic bucket counts even after this adjustment, they are increased to the value of the previous buckets to enforce monotonicity. The latter is evidence for an actual issue with the input data and is therefore flagged by an info-level annotation reading ",a.jsx("code",{children:"input to histogram_quantile needed to be fixed for monotonicity"}),". If you encounter this annotation, you should find and remove the source of the invalid data."]})]}),histogram_stddev:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"histogram_stddev(v instant-vector)"})," returns the estimated standard deviation of observations for each histogram sample in ",a.jsx("code",{children:"v"}),". For this estimation, all observations in a bucket are assumed to have the value of the mean of the bucket boundaries. For the zero bucket and for buckets with custom boundaries, the arithmetic mean is used. For the usual exponential buckets, the geometric mean is used. Float samples are ignored and do not show up in the returned vector."]}),a.jsxs("p",{children:["Similarly, ",a.jsx("code",{children:"histogram_stdvar(v instant-vector)"})," returns the estimated standard variance of observations for each histogram sample in ",a.jsx("code",{children:"v"}),"."]})]}),histogram_stdvar:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"histogram_stddev(v instant-vector)"})," returns the estimated standard deviation of observations for each histogram sample in ",a.jsx("code",{children:"v"}),". For this estimation, all observations in a bucket are assumed to have the value of the mean of the bucket boundaries. For the zero bucket and for buckets with custom boundaries, the arithmetic mean is used. For the usual exponential buckets, the geometric mean is used. Float samples are ignored and do not show up in the returned vector."]}),a.jsxs("p",{children:["Similarly, ",a.jsx("code",{children:"histogram_stdvar(v instant-vector)"})," returns the estimated standard variance of observations for each histogram sample in ",a.jsx("code",{children:"v"}),"."]})]}),histogram_sum:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"histogram_count(v instant-vector)"})," returns the count of observations stored in each histogram sample in ",a.jsx("code",{children:"v"}),". Float samples are ignored and do not show up in the returned vector."]}),a.jsxs("p",{children:["Similarly, ",a.jsx("code",{children:"histogram_sum(v instant-vector)"})," returns the sum of observations stored in each histogram sample."]}),a.jsxs("p",{children:["Use ",a.jsx("code",{children:"histogram_count"})," in the following way to calculate a rate of observations (in this case corresponding to “requests per second”) from a series of histogram samples:"]}),a.jsx("pre",{children:a.jsx("code",{children:"histogram_count(rate(http_request_duration_seconds[10m]))"})})]}),hour:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"hour(v=vector(time()) instant-vector)"})," interprets float samples in ",a.jsx("code",{children:"v"})," as timestamps (number of seconds since January 1, 1970 UTC) and returns the hour of the day (in UTC) for each of those timestamps. Returned values are from 0 to 23. Histogram samples in the input vector are ignored silently."]})}),idelta:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"idelta(v range-vector)"})," calculates the difference between the last two samples in the range vector"," ",a.jsx("code",{children:"v"}),", returning an instant vector with the given deltas and equivalent labels. Both samples must be either float samples or histogram samples. Elements in ",a.jsx("code",{children:"v"})," where one of the last two samples is a float sample and the other is a histogram sample will be omitted from the result vector, flagged by a warn-level annotation."]}),a.jsxs("p",{children:[a.jsx("code",{children:"idelta"})," should only be used with gauges (for both floats and histograms)."]})]}),increase:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"increase(v range-vector)"})," calculates the increase in the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. The increase is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if a counter increases only by integer increments."]}),a.jsx("p",{children:"The following example expression returns the number of HTTP requests as measured over the last 5 minutes, per time series in the range vector:"}),a.jsx("pre",{children:a.jsxs("code",{children:["increase(http_requests_total","{",'job="api-server"',"}","[5m])"]})}),a.jsxs("p",{children:[a.jsx("code",{children:"increase"})," acts on histogram samples by calculating a new histogram where each component (sum and count of observations, buckets) is the increase between the respective component in the first and last native histogram in ",a.jsx("code",{children:"v"}),". However, each element in ",a.jsx("code",{children:"v"})," that contains a mix of float samples and histogram samples within the range, will be omitted from the result vector, flagged by a warn-level annotation."]}),a.jsxs("p",{children:[a.jsx("code",{children:"increase"})," should only be used with counters (for both floats and histograms). It is syntactic sugar for ",a.jsx("code",{children:"rate(v)"})," multiplied by the number of seconds under the specified time range window, and should be used primarily for human readability. Use ",a.jsx("code",{children:"rate"})," in recording rules so that increases are tracked consistently on a per-second basis."]})]}),info:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:["_The ",a.jsx("code",{children:"info"})," function is an experiment to improve UX around including labels from"," ",a.jsx("a",{href:"https://grafana.com/blog/2021/08/04/how-to-use-promql-joins-for-more-effective-queries-of-prometheus-metrics-at-scale/#info-metrics",children:"info metrics"}),". The behavior of this function may change in future versions of Prometheus, including its removal from PromQL."," ",a.jsx("code",{children:"info"})," has to be enabled via the",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"})," ",a.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"._"]}),a.jsxs("p",{children:[a.jsx("code",{children:"info(v instant-vector, [data-label-selector instant-vector])"})," finds, for each time series in"," ",a.jsx("code",{children:"v"}),", all info series with matching ",a.jsx("em",{children:"identifying"})," labels (more on this later), and adds the union of their ",a.jsx("em",{children:"data"})," (i.e., non-identifying) labels to the time series. The second argument"," ",a.jsx("code",{children:"data-label-selector"})," is optional. It is not a real instant vector, but uses a subset of its syntax. It must start and end with curly braces (",a.jsxs("code",{children:["{"," ... ","}"]}),") and may only contain label matchers. The label matchers are used to constrain which info series to consider and which data labels to add to ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("p",{children:["Identifying labels of an info series are the subset of labels that uniquely identify the info series. The remaining labels are considered",a.jsx("em",{children:"data labels"})," (also called non-identifying). (Note that Prometheus’s concept of time series identity always includes ",a.jsx("em",{children:"all"})," the labels. For the sake of the ",a.jsx("code",{children:"info"}),"function, we “logically” define info series identity in a different way than in the conventional Prometheus view.) The identifying labels of an info series are used to join it to regular (non-info) series, i.e. those series that have the same labels as the identifying labels of the info series. The data labels, which are the ones added to the regular series by the ",a.jsx("code",{children:"info"})," function, effectively encode metadata key value pairs. (This implies that a change in the data labels in the conventional Prometheus view constitutes the end of one info series and the beginning of a new info series, while the “logical” view of the ",a.jsx("code",{children:"info"})," function is that the same info series continues to exist, just with different “data”.)"]}),a.jsx("p",{children:"The conventional approach of adding data labels is sometimes called a “join query”, as illustrated by the following example:"}),a.jsx("pre",{children:a.jsxs("code",{children:[" ","rate(http_server_request_duration_seconds_count[2m]) * on (job, instance) group_left (k8s_cluster_name) target_info"]})}),a.jsxs("p",{children:["The core of the query is the expression ",a.jsx("code",{children:"rate(http_server_request_duration_seconds_count[2m])"}),". But to add data labels from an info metric, the user has to use elaborate (and not very obvious) syntax to specify which info metric to use (",a.jsx("code",{children:"target_info"}),"), what the identifying labels are (",a.jsx("code",{children:"on (job, instance)"}),"), and which data labels to add (",a.jsx("code",{children:"group_left (k8s_cluster_name)"}),")."]}),a.jsxs("p",{children:["This query is not only verbose and hard to write, it might also run into an “identity crisis”: If any of the data labels of ",a.jsx("code",{children:"target_info"})," changes, Prometheus sees that as a change of series (as alluded to above, Prometheus just has no native concept of non-identifying labels). If the old ",a.jsx("code",{children:"target_info"})," ","series is not properly marked as stale (which can happen with certain ingestion paths), the query above will fail for up to 5m (the lookback delta) because it will find a conflicting match with both the old and the new version of ",a.jsx("code",{children:"target_info"}),"."]}),a.jsxs("p",{children:["The ",a.jsx("code",{children:"info"})," function not only resolves this conflict in favor of the newer series, it also simplifies the syntax because it knows about the available info series and what their identifying labels are. The example query looks like this with the ",a.jsx("code",{children:"info"})," function:"]}),a.jsx("pre",{children:a.jsxs("code",{children:["info( rate(http_server_request_duration_seconds_count[2m]),","{",'k8s_cluster_name=~".+"',"}",")"]})}),a.jsxs("p",{children:["The common case of adding ",a.jsx("em",{children:"all"})," data labels can be achieved by omitting the 2nd argument of the"," ",a.jsx("code",{children:"info"})," function entirely, simplifying the example even more:"]}),a.jsx("pre",{children:a.jsx("code",{children:"info(rate(http_server_request_duration_seconds_count[2m]))"})}),a.jsxs("p",{children:["While ",a.jsx("code",{children:"info"})," normally automatically finds all matching info series, it’s possible to restrict them by providing a ",a.jsx("code",{children:"__name__"})," label matcher, e.g.",a.jsxs("code",{children:["{",'__name__="target_info"',"}"]}),"."]}),a.jsxs("p",{children:["Note that if there are any time series in ",a.jsx("code",{children:"v"})," that match the ",a.jsx("code",{children:"data-label-selector"})," (or the default ",a.jsx("code",{children:"target_info"})," if that argument is not specified), they will be treated as info series and will be returned unchanged."]}),a.jsx("h3",{children:"Limitations"}),a.jsxs("p",{children:["In its current iteration, ",a.jsx("code",{children:"info"})," defaults to considering only info series with the name"," ",a.jsx("code",{children:"target_info"}),". It also assumes that the identifying info series labels are",a.jsx("code",{children:"instance"})," and ",a.jsx("code",{children:"job"}),". ",a.jsx("code",{children:"info"})," does support other info series names however, through",a.jsx("code",{children:"__name__"})," label matchers. E.g., one can explicitly say to consider both",a.jsx("code",{children:"target_info"})," and ",a.jsx("code",{children:"build_info"})," as follows:",a.jsxs("code",{children:["{",'__name__=~"(target|build)_info"',"}"]}),". However, the identifying labels always have to be ",a.jsx("code",{children:"instance"})," and ",a.jsx("code",{children:"job"}),"."]}),a.jsxs("p",{children:["These limitations are partially defeating the purpose of the ",a.jsx("code",{children:"info"})," function. At the current stage, this is an experiment to find out how useful the approach turns out to be in practice. A final version of the"," ",a.jsx("code",{children:"info"})," function will indeed consider all matching info series and with their appropriate identifying labels."]})]}),irate:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"irate(v range-vector)"})," calculates the per-second instant rate of increase of the time series in the range vector. This is based on the last two data points. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. Both samples must be either float samples or histogram samples. Elements in ",a.jsx("code",{children:"v"})," where one of the last two samples is a float sample and the other is a histogram sample will be omitted from the result vector, flagged by a warn-level annotation."]}),a.jsxs("p",{children:[a.jsx("code",{children:"irate"})," should only be used with counters (for both floats and histograms)."]}),a.jsx("p",{children:"The following example expression returns the per-second rate of HTTP requests looking up to 5 minutes back for the two most recent data points, per time series in the range vector:"}),a.jsx("pre",{children:a.jsxs("code",{children:["irate(http_requests_total","{",'job="api-server"',"}","[5m])"]})}),a.jsxs("p",{children:[a.jsx("code",{children:"irate"})," should only be used when graphing volatile, fast-moving counters. Use ",a.jsx("code",{children:"rate"})," for alerts and slow-moving counters, as brief changes in the rate can reset the ",a.jsx("code",{children:"FOR"})," clause and graphs consisting entirely of rare spikes are hard to read."]}),a.jsxs("p",{children:["Note that when combining ",a.jsx("code",{children:"irate()"})," with an",a.jsx("a",{href:"operators.md#aggregation-operators",children:"aggregation operator"})," (e.g. ",a.jsx("code",{children:"sum()"}),") or a function aggregating over time (any function ending in ",a.jsx("code",{children:"_over_time"}),"), always take an ",a.jsx("code",{children:"irate()"})," ","first, then aggregate. Otherwise ",a.jsx("code",{children:"irate()"})," cannot detect counter resets when your target restarts."]})]}),label_join:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:["For each timeseries in ",a.jsx("code",{children:"v"}),","," ",a.jsx("code",{children:"label_join(v instant-vector, dst_label string, separator string, src_label_1 string, src_label_2 string, ...)"})," ","joins all the values of all the ",a.jsx("code",{children:"src_labels"}),"using ",a.jsx("code",{children:"separator"})," and returns the timeseries with the label ",a.jsx("code",{children:"dst_label"})," containing the joined value. There can be any number of ",a.jsx("code",{children:"src_labels"})," in this function."]}),a.jsxs("p",{children:[a.jsx("code",{children:"label_join"})," acts on float and histogram samples in the same way."]}),a.jsxs("p",{children:["This example will return a vector with each time series having a ",a.jsx("code",{children:"foo"})," label with the value"," ",a.jsx("code",{children:"a,b,c"})," added to it:"]}),a.jsx("pre",{children:a.jsxs("code",{children:["label_join(up","{",'job="api-server",src1="a",src2="b",src3="c"',"}",', "foo", ",", "src1", "src2", "src3")']})})]}),label_replace:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:["For each timeseries in ",a.jsx("code",{children:"v"}),","," ",a.jsx("code",{children:"label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)"}),"matches the ",a.jsx("a",{href:"./basics.md#regular-expressions",children:"regular expression"})," ",a.jsx("code",{children:"regex"})," against the value of the label ",a.jsx("code",{children:"src_label"}),". If it matches, the value of the label ",a.jsx("code",{children:"dst_label"})," in the returned timeseries will be the expansion of ",a.jsx("code",{children:"replacement"}),", together with the original labels in the input. Capturing groups in the regular expression can be referenced with ",a.jsx("code",{children:"$1"}),", ",a.jsx("code",{children:"$2"}),", etc. Named capturing groups in the regular expression can be referenced with ",a.jsx("code",{children:"$name"})," (where"," ",a.jsx("code",{children:"name"})," is the capturing group name). If the regular expression doesn’t match then the timeseries is returned unchanged."]}),a.jsxs("p",{children:[a.jsx("code",{children:"label_replace"})," acts on float and histogram samples in the same way."]}),a.jsxs("p",{children:["This example will return timeseries with the values ",a.jsx("code",{children:"a:c"})," at label ",a.jsx("code",{children:"service"})," and"," ",a.jsx("code",{children:"a"})," at label ",a.jsx("code",{children:"foo"}),":"]}),a.jsx("pre",{children:a.jsxs("code",{children:["label_replace(up","{",'job="api-server",service="a:c"',"}",', "foo", "$1", "service", "(.*):.*")']})}),a.jsx("p",{children:"This second example has the same effect than the first example, and illustrates use of named capturing groups:"}),a.jsx("pre",{children:a.jsxs("code",{children:["label_replace(up","{",'job="api-server",service="a:c"',"}",', "foo", "$name", "service", "(?P<name>.*):(?P<version>.*)")']})})]}),last_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),ln:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"ln(v instant-vector)"})," calculates the natural logarithm for all float samples in ",a.jsx("code",{children:"v"}),". Histogram samples in the input vector are ignored silently. Special cases are:"]}),a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx("code",{children:"ln(+Inf) = +Inf"})}),a.jsx("li",{children:a.jsx("code",{children:"ln(0) = -Inf"})}),a.jsx("li",{children:a.jsx("code",{children:"ln(x < 0) = NaN"})}),a.jsx("li",{children:a.jsx("code",{children:"ln(NaN) = NaN"})})]})]}),log10:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"log10(v instant-vector)"})," calculates the decimal logarithm for all float samples in ",a.jsx("code",{children:"v"}),". Histogram samples in the input vector are ignored silently. The special cases are equivalent to those in"," ",a.jsx("code",{children:"ln"}),"."]})}),log2:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"log2(v instant-vector)"})," calculates the binary logarithm for all float samples in ",a.jsx("code",{children:"v"}),". Histogram samples in the input vector are ignored silently. The special cases are equivalent to those in"," ",a.jsx("code",{children:"ln"}),"."]})}),mad_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),max_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),min_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),minute:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"minute(v=vector(time()) instant-vector)"})," interprets float samples in ",a.jsx("code",{children:"v"})," as timestamps (number of seconds since January 1, 1970 UTC) and returns the minute of the hour (in UTC) for each of those timestamps. Returned values are from 0 to 59. Histogram samples in the input vector are ignored silently."]})}),month:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"month(v=vector(time()) instant-vector)"})," interprets float samples in ",a.jsx("code",{children:"v"})," as timestamps (number of seconds since January 1, 1970 UTC) and returns the month of the year (in UTC) for each of those timestamps. Returned values are from 1 to 12, where 1 means January etc. Histogram samples in the input vector are ignored silently."]})}),pi:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),predict_linear:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"predict_linear(v range-vector, t scalar)"})," predicts the value of time series",a.jsx("code",{children:"t"})," seconds from now, based on the range vector ",a.jsx("code",{children:"v"}),", using"," ",a.jsx("a",{href:"https://en.wikipedia.org/wiki/Simple_linear_regression",children:"simple linear regression"}),". The range vector must have at least two float samples in order to perform the calculation. When ",a.jsx("code",{children:"+Inf"})," or"," ",a.jsx("code",{children:"-Inf"})," are found in the range vector, the predicted value will be ",a.jsx("code",{children:"NaN"}),"."]}),a.jsxs("p",{children:[a.jsx("code",{children:"predict_linear"})," should only be used with gauges and only works for float samples. Elements in the range vector that contain only histogram samples are ignored entirely. For elements that contain a mix of float and histogram samples, only the float samples are used as input, which is flagged by an info-level annotation."]})]}),present_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),quantile_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),rad:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),rate:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"rate(v range-vector)"})," calculates the per-second average rate of increase of the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. Also, the calculation extrapolates to the ends of the time range, allowing for missed scrapes or imperfect alignment of scrape cycles with the range’s time period."]}),a.jsx("p",{children:"The following example expression returns the per-second average rate of HTTP requests over the last 5 minutes, per time series in the range vector:"}),a.jsx("pre",{children:a.jsxs("code",{children:["rate(http_requests_total","{",'job="api-server"',"}","[5m])"]})}),a.jsxs("p",{children:[a.jsx("code",{children:"rate"})," acts on native histograms by calculating a new histogram where each component (sum and count of observations, buckets) is the rate of increase between the respective component in the first and last native histogram in ",a.jsx("code",{children:"v"}),". However, each element in ",a.jsx("code",{children:"v"})," that contains a mix of float and native histogram samples within the range, will be omitted from the result vector, flagged by a warn-level annotation."]}),a.jsxs("p",{children:[a.jsx("code",{children:"rate"})," should only be used with counters (for both floats and histograms). It is best suited for alerting, and for graphing of slow-moving counters."]}),a.jsxs("p",{children:["Note that when combining ",a.jsx("code",{children:"rate()"})," with an aggregation operator (e.g. ",a.jsx("code",{children:"sum()"}),") or a function aggregating over time (any function ending in ",a.jsx("code",{children:"_over_time"}),"), always take a"," ",a.jsx("code",{children:"rate()"})," first, then aggregate. Otherwise ",a.jsx("code",{children:"rate()"})," cannot detect counter resets when your target restarts."]})]}),resets:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:["For each input time series, ",a.jsx("code",{children:"resets(v range-vector)"})," returns the number of counter resets within the provided time range as an instant vector. Any decrease in the value between two consecutive float samples is interpreted as a counter reset. A reset in a native histogram is detected in a more complex way: Any decrease in any bucket, including the zero bucket, or in the count of observation constitutes a counter reset, but also the disappearance of any previously populated bucket, a decrease of the zero-bucket width, or any schema change that is not a compatible decrease of resolution."]}),a.jsxs("p",{children:[a.jsx("code",{children:"resets"})," should only be used with counters (for both floats and histograms)."]}),a.jsxs("p",{children:["A float sample followed by a histogram sample, or vice versa, counts as a reset. A counter histogram sample followed by a gauge histogram sample, or vice versa, also counts as a reset (but note that ",a.jsx("code",{children:"resets"})," ","should not be used on gauges in the first place, see above)."]})]}),round:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"round(v instant-vector, to_nearest=1 scalar)"})," rounds the sample values of all elements in"," ",a.jsx("code",{children:"v"})," to the nearest integer. Ties are resolved by rounding up. The optional ",a.jsx("code",{children:"to_nearest"})," ","argument allows specifying the nearest multiple to which the sample values should be rounded. This multiple may also be a fraction. Histogram samples in the input vector are ignored silently."]})}),scalar:a.jsx(a.Fragment,{children:a.jsxs("p",{children:["Given an input vector that contains only one element with a float sample,",a.jsx("code",{children:"scalar(v instant-vector)"})," returns the sample value of that float sample as a scalar. If the input vector does not have exactly one element with a float sample, ",a.jsx("code",{children:"scalar"})," will return ",a.jsx("code",{children:"NaN"}),". Histogram samples in the input vector are ignored silently."]})}),sgn:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"sgn(v instant-vector)"})," returns a vector with all float sample values converted to their sign, defined as this: 1 if v is positive, -1 if v is negative and 0 if v is equal to zero. Histogram samples in the input vector are ignored silently."]})}),sin:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),sinh:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),sort:a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[a.jsx("code",{children:"sort(v instant-vector)"})," returns vector elements sorted by their float sample values, in ascending order. Histogram samples in the input vector are ignored silently."]}),a.jsxs("p",{children:["Please note that ",a.jsx("code",{children:"sort"})," only affects the results of instant queries, as range query results always have a fixed output ordering."]})]}),sort_by_label:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:a.jsxs("strong",{children:["This function has to be enabled via the"," ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),a.jsxs("p",{children:[a.jsx("code",{children:"sort_by_label(v instant-vector, label string, ...)"})," returns vector elements sorted by the values of the given labels in ascending order. In case these label values are equal, elements are sorted by their full label sets.",a.jsx("code",{children:"sort_by_label"})," acts on float and histogram samples in the same way."]}),a.jsxs("p",{children:["Please note that ",a.jsx("code",{children:"sort_by_label"})," only affects the results of instant queries, as range query results always have a fixed output ordering."]}),a.jsxs("p",{children:[a.jsx("code",{children:"sort_by_label"})," uses"," ",a.jsx("a",{href:"https://en.wikipedia.org/wiki/Natural_sort_order",children:"natural sort order"}),"."]})]}),sort_by_label_desc:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:a.jsxs("strong",{children:["This function has to be enabled via the"," ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),a.jsxs("p",{children:["Same as ",a.jsx("code",{children:"sort_by_label"}),", but sorts in descending order."]})]}),sort_desc:a.jsx(a.Fragment,{children:a.jsxs("p",{children:["Same as ",a.jsx("code",{children:"sort"}),", but sorts in descending order."]})}),sqrt:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"sqrt(v instant-vector)"})," calculates the square root of all float samples in",a.jsx("code",{children:"v"}),". Histogram samples in the input vector are ignored silently."]})}),stddev_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),stdvar_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),sum_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),tan:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),tanh:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",a.jsx("code",{children:"v"})," (",a.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),a.jsxs("li",{children:[a.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",a.jsx("code",{children:"v"})," ","(",a.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),a.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",a.jsx("code",{children:"v"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"pi()"}),": returns pi."]}),a.jsxs("li",{children:[a.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",a.jsx("code",{children:"v"}),"."]})]})]}),time:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"time()"})," returns the number of seconds since January 1, 1970 UTC. Note that this does not actually return the current time, but the time at which the expression is to be evaluated."]})}),timestamp:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"timestamp(v instant-vector)"})," returns the timestamp of each of the samples of the given vector as the number of seconds since January 1, 1970 UTC. It acts on float and histogram samples in the same way."]})}),ts_of_first_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),ts_of_last_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),ts_of_max_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),ts_of_min_over_time:a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"The following functions allow aggregating each series of a given range vector over time and return an instant vector with per-series aggregation results:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population standard variance of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),a.jsxs("p",{children:["If the ",a.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),a.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_min_over_time(range-vector)"}),": the timestamp of the last float sample that has the minimum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_max_over_time(range-vector)"}),": the timestamp of the last float sample that has the maximum value of all float samples in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),a.jsxs("li",{children:[a.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),a.jsx("p",{children:"Note that all values in the specified interval have the same weight in the aggregation even if the values are not equally spaced throughout the interval."}),a.jsx("p",{children:"These functions act on histograms in the following way:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"count_over_time"}),", ",a.jsx("code",{children:"first_over_time"}),", ",a.jsx("code",{children:"last_over_time"}),", and",a.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),a.jsxs("li",{children:[a.jsx("code",{children:"avg_over_time()"})," and ",a.jsx("code",{children:"sum_over_time()"})," act on histogram samples in a way that corresponds to the respective aggregation operators. If a series contains a mix of float samples and histogram samples within the range, the corresponding result is removed entirely from the output vector. Such a removal is flagged by a warn-level annotation."]}),a.jsx("li",{children:"All other functions ignore histogram samples in the following way: Input ranges containing only histogram samples are silently removed from the output. For ranges with a mix of histogram and float samples, only the float samples are processed and the omission of the histogram samples is flagged by an info-level annotation."})]}),a.jsxs("p",{children:[a.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",a.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",a.jsx("code",{children:"m"})," ",a.jsx("em",{children:"within"})," the 1m range, where ",a.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",a.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",a.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries (available when ",a.jsx("code",{children:"--enable-feature=promql-duration-expr"})," is set) to ensure that the sample selected is within the range step."]})]}),vector:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"vector(s scalar)"})," converts the scalar ",a.jsx("code",{children:"s"})," to a float sample and returns it as a single-element instant vector with no labels."]})}),year:a.jsx(a.Fragment,{children:a.jsxs("p",{children:[a.jsx("code",{children:"year(v=vector(time()) instant-vector)"})," returns the year for each of the given times in UTC. Histogram samples in the input vector are ignored silently."]})})},lSe="_funcDoc_mrib5_1",cSe={funcDoc:lSe},uSe=(t,e)=>a.jsxs(rr,{fz:"sm",my:"md",withPadding:!0,children:[t.length>0&&a.jsxs(rr.Item,{children:["The metric name is"," ",a.jsx("span",{className:"promql-code promql-metric-name",children:t}),"."]}),e.filter(n=>n.name!=="__name__").map(n=>{switch(n.type){case vo.equal:return a.jsxs(rr.Item,{children:[a.jsx("span",{className:"promql-code promql-label-name",children:n.name}),a.jsx("span",{className:"promql-code promql-operator",children:n.type}),a.jsxs("span",{className:"promql-code promql-string",children:['"',os(n.value),'"']}),": The label"," ",a.jsx("span",{className:"promql-code promql-label-name",children:n.name})," ","is exactly"," ",a.jsxs("span",{className:"promql-code promql-string",children:['"',os(n.value),'"']}),"."]});case vo.notEqual:return a.jsxs(rr.Item,{children:[a.jsx("span",{className:"promql-code promql-label-name",children:n.name}),a.jsx("span",{className:"promql-code promql-operator",children:n.type}),a.jsxs("span",{className:"promql-code promql-string",children:['"',os(n.value),'"']}),": The label"," ",a.jsx("span",{className:"promql-code promql-label-name",children:n.name})," ","is not"," ",a.jsxs("span",{className:"promql-code promql-string",children:['"',os(n.value),'"']}),"."]});case vo.matchRegexp:return a.jsxs(rr.Item,{children:[a.jsx("span",{className:"promql-code promql-label-name",children:n.name}),a.jsx("span",{className:"promql-code promql-operator",children:n.type}),a.jsxs("span",{className:"promql-code promql-string",children:['"',os(n.value),'"']}),": The label"," ",a.jsx("span",{className:"promql-code promql-label-name",children:n.name})," ","matches the regular expression"," ",a.jsxs("span",{className:"promql-code promql-string",children:['"',os(n.value),'"']}),"."]});case vo.matchNotRegexp:return a.jsxs(rr.Item,{children:[a.jsx("span",{className:"promql-code promql-label-name",children:n.name}),a.jsx("span",{className:"promql-code promql-operator",children:n.type}),a.jsxs("span",{className:"promql-code promql-string",children:['"',os(n.value),'"']}),": The label"," ",a.jsx("span",{className:"promql-code promql-label-name",children:n.name})," ","does not match the regular expression"," ",a.jsxs("span",{className:"promql-code promql-string",children:['"',os(n.value),'"']}),"."]});default:throw new Error("invalid matcher type")}})]}),ML=({node:t})=>{const e=t.name.replace(/(_count|_sum|_bucket|_total)$/,""),{lookbackDelta:n}=ai(),{data:r}=bi({path:"/metadata",params:{metric:t.name}}),{data:i}=bi({path:"/metadata",params:{metric:e}}),s=r.data[t.name]??i.data[e];return a.jsxs(Gr,{withBorder:!0,children:[a.jsxs(ut,{fz:"lg",fw:600,mb:"md",children:[t.type===mt.vectorSelector?"Instant":"Range"," vector selector"]}),a.jsx(ut,{fz:"sm",children:s===void 0||s.length<1?a.jsx(a.Fragment,{children:"No metric metadata found."}):a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"Metric help"}),": ",s[0].help,a.jsx("br",{}),a.jsx("strong",{children:"Metric type"}),": ",s[0].type]})}),a.jsx(Vv,{my:"md"}),a.jsxs(ut,{fz:"sm",children:[t.type===mt.vectorSelector?a.jsxs(a.Fragment,{children:["This node ",t.smoothed?"smooths the value":"selects the latest"," ",t.anchored||t.smoothed?"":"non-stale ",!t.smoothed&&a.jsxs(a.Fragment,{children:["sample value within the last"," ",a.jsx("span",{className:"promql-code promql-duration",children:n})]}),t.smoothed&&a.jsxs(a.Fragment,{children:["using ",a.jsx("code",{children:"smoothed"})," mode (linear interpolation with nearest points within"," ",a.jsx("span",{className:"promql-code promql-duration",children:n})," ","before and after execution timestamp, ignoring staleness markers)"]})]}):a.jsxs(a.Fragment,{children:["This node selects"," ",a.jsx("span",{className:"promql-code promql-duration",children:Bn(t.range)})," ","of data going backward from the evaluation timestamp",t.anchored&&a.jsxs(a.Fragment,{children:[" ","using ",a.jsx("code",{children:"anchored"})," mode (includes first sample before or at start boundary, and last sample of the range at end boundary, ignoring staleness markers)"]}),t.smoothed&&a.jsxs(a.Fragment,{children:[" ","using ",a.jsx("code",{children:"smoothed"})," mode (applies linear interpolation at the boundaries using nearest samples before and after boundaries, ignoring staleness markers)"]})]}),t.timestamp!==null?a.jsxs(a.Fragment,{children:[", evaluated relative to an absolute evaluation timestamp of"," ",a.jsx("span",{className:"promql-number",children:(t.timestamp/1e3).toFixed(3)})]}):t.startOrEnd!==null?a.jsxs(a.Fragment,{children:[", evaluated relative to the ",t.startOrEnd," of the query range"]}):a.jsx(a.Fragment,{}),t.offset===0?a.jsx(a.Fragment,{}):t.offset>0?a.jsxs(a.Fragment,{children:[", time-shifted"," ",a.jsx("span",{className:"promql-code promql-duration",children:Bn(t.offset)})," ","into the past,"]}):a.jsxs(a.Fragment,{children:[", time-shifted"," ",a.jsx("span",{className:"promql-code promql-duration",children:Bn(-t.offset)})," ","into the future,"]})," ","for any series that match all of the following criteria:"]}),uSe(t.name,t.matchers),a.jsxs(ut,{fz:"sm",children:["If a series has no values in the last"," ",a.jsx("span",{className:"promql-code promql-duration",children:t.type===mt.vectorSelector?n:Bn(t.range)}),t.offset>0&&a.jsxs(a.Fragment,{children:[" ","(relative to the time-shifted instant"," ",a.jsx("span",{className:"promql-code promql-duration",children:Bn(t.offset)})," ","in the past)"]}),", the series will not be returned."]})]})},Fh=t=>{switch(t){case"+Inf":return 1/0;case"-Inf":return-1/0;default:return parseFloat(t)}},Fg=t=>{switch(t){case 1/0:return"+Inf";case-1/0:return"-Inf";default:return t.toString()}},hSe=(t,e)=>{switch(t){case"sum":return"sums over the sample values of the input series";case"min":return"takes the minimum of the sample values of the input series";case"max":return"takes the maximum of the sample values of the input series";case"avg":return"calculates the average of the sample values of the input series";case"stddev":return"calculates the population standard deviation of the sample values of the input series";case"stdvar":return"calculates the population standard variation of the sample values of the input series";case"count":return"counts the number of input series";case"group":return"groups the input series by the supplied grouping labels, while setting the sample value to 1";case"count_values":if(e===null)throw new Error("encountered count_values() node without label parameter");if(e.type!=="stringLiteral")throw new Error("encountered count_values() node without string literal label parameter");return a.jsxs(a.Fragment,{children:["outputs one time series for each unique sample value in the input series (each counting the number of occurrences of that value and indicating the original value in the ",ua([e.val])," ","label)"]});case"bottomk":return e===null||e.type!=="numberLiteral"?a.jsxs(a.Fragment,{children:["returns the bottom"," ",a.jsx("span",{className:"promql-code promql-number",children:"K"})," series by value"]}):a.jsxs(a.Fragment,{children:["returns the bottom"," ",a.jsx("span",{className:"promql-code promql-number",children:e.val})," series by value"]});case"topk":return e===null||e.type!=="numberLiteral"?a.jsxs(a.Fragment,{children:["returns the top ",a.jsx("span",{className:"promql-code promql-number",children:"K"})," ","series by value"]}):a.jsxs(a.Fragment,{children:["returns the top"," ",a.jsx("span",{className:"promql-code promql-number",children:e.val})," series by value"]});case"quantile":if(e===null)throw new Error("encountered quantile() node without quantile parameter");return e.type==="numberLiteral"?`calculates the ${e.val}th quantile (${Fh(e.val)*100}th percentile) over the sample values of the input series`:"calculates a quantile over the sample values of the input series";case"limitk":return e===null||e.type!=="numberLiteral"?a.jsxs(a.Fragment,{children:["limits the output to"," ",a.jsx("span",{className:"promql-code promql-number",children:"K"})," series"]}):a.jsxs(a.Fragment,{children:["limits the output to"," ",a.jsx("span",{className:"promql-code promql-number",children:e.val})," series"]});case"limit_ratio":return e===null||e.type!=="numberLiteral"?"limits the output to a ratio of the input series":a.jsxs(a.Fragment,{children:["limits the output to a ratio of"," ",a.jsx("span",{className:"promql-code promql-number",children:e.val})," (",Fh(e.val)*100,"%) of the input series"]});default:throw new Error(`invalid aggregation type ${t}`)}},dSe=(t,e)=>e?a.jsxs(a.Fragment,{children:["aggregating away the [",ua(t),"] label dimensions"]}):t.length===1?a.jsxs(a.Fragment,{children:["grouped by their ",ua(t)," label dimension"]}):t.length>1?a.jsxs(a.Fragment,{children:["grouped by their [",ua(t),"] label dimensions"]}):"aggregating away any label dimensions",fSe=({node:t})=>a.jsxs(Gr,{withBorder:!0,children:[a.jsx(ut,{fz:"lg",fw:600,mb:"md",children:"Aggregation"}),a.jsxs(ut,{fz:"sm",children:["This node ",hSe(t.op,t.param),","," ",dSe(t.grouping,t.without),"."]})]}),VU="filtered";var Og=(t=>(t.multipleMatchesForOneToOneMatching="multipleMatchesForOneToOneMatching",t.multipleMatchesOnBothSides="multipleMatchesOnBothSides",t.multipleMatchesOnOneSide="multipleMatchesOnOneSide",t))(Og||{});const RL=16777619,pSe=2166136261,mSe=55296,DL=t=>{let e=pSe;for(let n=0;n<t.length;n++){if(t[n]!==void 0)for(let r=0;r<t[n].length;r++)e^=t[n].charCodeAt(r),e*=RL;n<t.length-1&&(e^=mSe,e*=RL)}return e.toString()},gSe=(t,e)=>(e.sort(),t?n=>DL(e.map(r=>n[r])):n=>DL(Object.keys(n).filter(r=>!e.includes(r)&&r!=="__name__").map(r=>n[r]))),NL=(t,e,n)=>{const r={};for(const i in t)n.includes(i)===e&&(e||i!=="__name__")&&(r[i]=t[i]);return r},vSe=(t,e,n)=>{const{value:r,keep:i}=Mw(t,e,n);return LE(t)?Number(i):r},Mw=(t,e,n)=>{switch(t){case tn.add:return{value:e+n,keep:!0};case tn.sub:return{value:e-n,keep:!0};case tn.mul:return{value:e*n,keep:!0};case tn.div:return{value:e/n,keep:!0};case tn.pow:return{value:Math.pow(e,n),keep:!0};case tn.mod:return{value:e%n,keep:!0};case tn.eql:return{value:e,keep:e===n};case tn.neq:return{value:e,keep:e!==n};case tn.gtr:return{value:e,keep:e>n};case tn.lss:return{value:e,keep:e<n};case tn.gte:return{value:e,keep:e>=n};case tn.lte:return{value:e,keep:e<=n};case tn.atan2:return{value:Math.atan2(e,n),keep:!0};default:throw new Error("invalid binop")}},bSe=t=>[tn.add,tn.sub,tn.mul,tn.div,tn.pow,tn.mod,tn.atan2].includes(t),ySe=(t,e,n,r)=>{const i={};for(const s in t)i[s]=t[s];if(bSe(n)&&delete i.__name__,r.card===Tr.oneToOne)if(r.on)for(const s in i)r.labels.includes(s)||delete i[s];else for(const s of r.labels)delete i[s];return r.include.forEach(s=>{s in e?i[s]=e[s]:delete i[s]}),i},xSe=(t,e,n,r,i,s)=>{[r,i]=e.card===Tr.oneToMany?[i,r]:[r,i];const o={},l=gSe(e.on,e.labels),u=new Set;return i.forEach(h=>{const f=l(h.metric);if(!(f in o)){if(s!=null&&s.maxGroups&&Object.keys(o).length>=s.maxGroups){u.add(f);return}o[f]={groupLabels:NL(h.metric,e.on,e.labels),lhs:[],lhsCount:0,rhs:[],rhsCount:0,result:[],error:null}}(!(s!=null&&s.maxSeriesPerGroup)||o[f].rhsCount<s.maxSeriesPerGroup)&&o[f].rhs.push(h),o[f].rhsCount++}),r.forEach(h=>{const f=l(h.metric);if(!(f in o)){if(s!=null&&s.maxGroups&&Object.keys(o).length>=s.maxGroups){u.add(f);return}o[f]={groupLabels:NL(h.metric,e.on,e.labels),lhs:[],lhsCount:0,rhs:[],rhsCount:0,result:[],error:null}}(!(s!=null&&s.maxSeriesPerGroup)||o[f].lhsCount<s.maxSeriesPerGroup)&&o[f].lhs.push(h),o[f].lhsCount++}),Object.values(o).forEach(h=>{h.lhs.length===0&&e.fillValues.lhs!==null&&(h.lhs.push({metric:h.groupLabels,value:[0,Fg(e.fillValues.lhs)],filled:!0}),h.lhsCount=1),h.rhs.length===0&&e.fillValues.rhs!==null&&(h.rhs.push({metric:h.groupLabels,value:[0,Fg(e.fillValues.rhs)],filled:!0}),h.rhsCount=1)}),Object.values(o).forEach(h=>{switch(e.card){case Tr.oneToOne:h.lhs.length>1&&h.rhs.length>1?h.error={type:"multipleMatchesOnBothSides"}:(h.lhs.length>1||h.rhs.length>1)&&(h.error={type:"multipleMatchesForOneToOneMatching",dupeSide:h.lhs.length>1?"left":"right"});break;case Tr.oneToMany:case Tr.manyToOne:h.rhs.length>1&&(h.error={type:"multipleMatchesOnOneSide"});break;case Tr.manyToMany:if(!s6(t))throw new Error("unexpected many-to-many matching for non-set operator");break;default:throw new Error("unknown vector matching cardinality")}h.error||(s6(t)?(h.lhs.forEach((f,p)=>{(t===tn.and&&h.rhs.length>0||t===tn.unless&&h.rhs.length===0||t===tn.or)&&h.result.push({sample:{metric:f.metric,value:f.value},manySideIdx:p})}),t===tn.or&&h.rhs.forEach((f,p)=>{h.lhs.length===0&&h.result.push({sample:{metric:f.metric,value:f.value},manySideIdx:p})})):h.rhs.forEach(f=>{h.lhs.forEach((p,m)=>{if(!p.value||!f.value)throw new Error("native histogram support not implemented yet");const[v,b]=e.card!==Tr.oneToMany?[p.value[1],f.value[1]]:[f.value[1],p.value[1]];let{value:x,keep:w}=Mw(t,Fh(v),Fh(b));const S=ySe(p.metric,f.metric,t,e);n&&(x=w?1:0,delete S.__name__),h.result.push({sample:{metric:S,value:[p.value[0],w||n?Fg(x):VU]},manySideIdx:m})})}))}),e.card===Tr.oneToMany&&Object.keys(o).forEach(h=>{[o[h].lhs,o[h].rhs]=[o[h].rhs,o[h].lhs],[o[h].lhsCount,o[h].rhsCount]=[o[h].rhsCount,o[h].lhsCount]}),{groups:o,numGroups:Object.keys(o).length+u.size}},PL=({node:t,scalar:e,vector:n,scalarLeft:r})=>n.length===0?a.jsx(Nt,{children:"One side of the binary operation produces 0 results, no matching information shown."}):a.jsxs(re,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,fz:"xs",children:[a.jsx(re.Thead,{children:a.jsxs(re.Tr,{children:[!r&&a.jsx(re.Th,{children:"Left labels"}),a.jsx(re.Th,{children:"Left value"}),a.jsx(re.Th,{children:"Operator"}),r&&a.jsx(re.Th,{children:"Right labels"}),a.jsx(re.Th,{children:"Right value"}),a.jsx(re.Th,{}),a.jsx(re.Th,{children:"Result"})]})}),a.jsx(re.Tbody,{children:n.map((i,s)=>{if(!i.value)throw new Error("Native histograms are not supported yet");const o=Fh(i.value[1]),l=Fh(e[1]);let{value:u,keep:h}=r?Mw(t.op,l,o):Mw(t.op,o,l);LE(t.op)&&r&&(u=o),t.bool&&(u=Number(h),h=!0);const f=a.jsx(re.Td,{ta:"right",children:e[1]}),p=a.jsxs(a.Fragment,{children:[a.jsx(re.Td,{children:a.jsx(Yp,{labels:i.metric,format:!0})}),a.jsx(re.Td,{ta:"right",children:i.value[1]})]});return a.jsxs(re.Tr,{children:[r?f:p,a.jsxs(re.Td,{ta:"center",children:[t.op,t.bool&&" bool"]}),r?p:f,a.jsx(re.Td,{ta:"center",children:"="}),a.jsx(re.Td,{ta:"right",children:h?Fg(u):a.jsx(ut,{c:"dimmed",children:"dropped"})})]},s)})})]}),Cv=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf","#393b79","#637939","#8c6d31","#843c39","#d6616b","#7b4173","#ce6dbd","#9c9ede","#c5b0d5","#c49c94","#f7b6d2","#c7c7c7","#dbdb8d","#9edae5","#393b79","#637939","#8c6d31","#843c39","#d6616b","#7b4173","#ce6dbd","#9c9ede","#c5b0d5","#c49c94","#f7b6d2","#c7c7c7","#dbdb8d","#9edae5","#17becf","#393b79","#637939","#8c6d31","#843c39","#d6616b","#7b4173","#ce6dbd","#9c9ede","#c5b0d5","#c49c94","#f7b6d2"],LL=Cv.length/2+3,WT=(t,e)=>`${Cv[(t+(e||0))%Cv.length]}80`,YT=t=>a.jsx(ve,{display:"inline-block",w:12,h:12,bg:t,style:{borderRadius:2,flexShrink:0}}),wSe=(t,e,n)=>{const r={};for(const i in t)n.includes(i)===e&&(e||i!=="__name__")||(r[i]=t[i]);return r},SSe=t=>{const e=t.matching,[n,r]=e.card===Tr.oneToMany?["left","right"]:["right","left"];return a.jsxs(a.Fragment,{children:[a.jsx(ut,{size:"sm",children:LE(t.op)?a.jsxs(a.Fragment,{children:['This node filters the series from the left-hand side based on the result of a "',a.jsx("span",{className:"promql-code promql-operator",children:t.op}),'" comparison with matching series from the right-hand side.']}):a.jsxs(a.Fragment,{children:['This node calculates the result of applying the "',a.jsx("span",{className:"promql-code promql-operator",children:t.op}),'" operator between the sample values of matching series from two sets of time series.']})}),a.jsxs(rr,{my:"md",fz:"sm",withPadding:!0,children:[(e.labels.length>0||e.on)&&(e.on?a.jsxs(rr.Item,{children:[a.jsx("span",{className:"promql-code promql-keyword",children:"on"}),"(",ua(e.labels),"):"," ",e.labels.length>0?a.jsxs(a.Fragment,{children:["series on both sides are matched on the labels"," ",ua(e.labels)]}):a.jsx(a.Fragment,{children:"all series from one side are matched to all series on the other side."})]}):a.jsxs(rr.Item,{children:[a.jsx("span",{className:"promql-code promql-keyword",children:"ignoring"}),"(",ua(e.labels),"): series on both sides are matched on all of their labels, except"," ",ua(e.labels),"."]})),e.card===Tr.oneToOne?a.jsx(rr.Item,{children:"One-to-one match. Each series from the left-hand side is allowed to match with at most one series on the right-hand side, and vice versa."}):a.jsxs(rr.Item,{children:[a.jsxs("span",{className:"promql-code promql-keyword",children:["group_",r]}),"(",ua(e.include),") : ",e.card," match. Each series from the ",n,"-hand side is allowed to match with multiple series from the ",r,"-hand side.",e.include.length!==0&&a.jsxs(a.Fragment,{children:[" ","Any ",ua(e.include)," labels found on the"," ",n,"-hand side are propagated into the result, in addition to the match group's labels."]})]}),(e.fillValues.lhs!==null||e.fillValues.rhs!==null)&&(e.fillValues.lhs===e.fillValues.rhs?a.jsxs(rr.Item,{children:[a.jsx("span",{className:"promql-code promql-keyword",children:"fill"}),"(",a.jsx("span",{className:"promql-code promql-number",children:e.fillValues.lhs}),") : For series on either side missing a match, fill in the sample value"," ",a.jsx("span",{className:"promql-code promql-number",children:e.fillValues.lhs}),"."]}):a.jsxs(a.Fragment,{children:[e.fillValues.lhs!==null&&a.jsxs(rr.Item,{children:[a.jsx("span",{className:"promql-code promql-keyword",children:"fill_left"}),"(",a.jsx("span",{className:"promql-code promql-number",children:e.fillValues.lhs}),") : For series on the left-hand side missing a match, fill in the sample value"," ",a.jsx("span",{className:"promql-code promql-number",children:e.fillValues.lhs}),"."]}),e.fillValues.rhs!==null&&a.jsxs(rr.Item,{children:[a.jsx("span",{className:"promql-code promql-keyword",children:"fill_right"}),"(",a.jsx("span",{className:"promql-code promql-number",children:e.fillValues.rhs}),") : For series on the right-hand side missing a match, fill in the sample value"," ",a.jsx("span",{className:"promql-code promql-number",children:e.fillValues.rhs}),"."]})]})),t.bool&&a.jsxs(rr.Item,{children:[a.jsx("span",{className:"promql-code promql-keyword",children:"bool"}),": Instead of filtering series based on the outcome of the comparison for matched series, keep all series, but return the comparison outcome as a boolean ",a.jsx("span",{className:"promql-code promql-number",children:"0"})," or"," ",a.jsx("span",{className:"promql-code promql-number",children:"1"})," sample value."]})]})]})},jSe=(t,e,n)=>{const r=a.jsxs(a.Fragment,{children:[a.jsx(ut,{size:"sm",children:a.jsx("strong",{children:"Possible fixes:"})}),a.jsxs(rr,{withPadding:!0,my:"md",fz:"sm",children:[n.type===Og.multipleMatchesForOneToOneMatching&&a.jsxs(rr.Item,{children:[a.jsxs(ut,{size:"sm",children:[a.jsxs("strong",{children:["Allow ",n.dupeSide==="left"?"many-to-one":"one-to-many"," ","matching"]}),": If you want to allow"," ",n.dupeSide==="left"?"many-to-one":"one-to-many"," ","matching, you need to explicitly request it by adding a"," ",a.jsxs("span",{className:"promql-code promql-keyword",children:["group_",n.dupeSide,"()"]})," ","modifier to the operator:"]}),a.jsx(ut,{size:"sm",ta:"center",my:"md",children:Bo({...t,matching:{...t.matching?t.matching:{labels:[],on:!1,include:[],fillValues:{lhs:null,rhs:null}},card:n.dupeSide==="left"?Tr.manyToOne:Tr.oneToMany}},!0,1)})]}),a.jsxs(rr.Item,{children:[a.jsx("strong",{children:"Update your matching parameters:"})," Consider including more differentiating labels in your matching modifiers (via"," ",a.jsx("span",{className:"promql-code promql-keyword",children:"on()"})," /"," ",a.jsx("span",{className:"promql-code promql-keyword",children:"ignoring()"}),") to split multiple series into distinct match groups."]}),a.jsxs(rr.Item,{children:[a.jsx("strong",{children:"Aggregate the input:"})," Consider aggregating away the extra labels that create multiple series per group before applying the binary operation."]})]})]});switch(n.type){case Og.multipleMatchesForOneToOneMatching:return a.jsxs(a.Fragment,{children:[a.jsxs(ut,{size:"sm",children:["Binary operators only allow ",a.jsx("strong",{children:"one-to-one"})," matching by default, but we found"," ",a.jsxs("strong",{children:["multiple series on the ",n.dupeSide," side"]})," for this match group."]}),r]});case Og.multipleMatchesOnBothSides:return a.jsxs(a.Fragment,{children:[a.jsxs(ut,{size:"sm",children:["We found ",a.jsx("strong",{children:"multiple series on both sides"})," for this match group. Since ",a.jsx("strong",{children:"many-to-many matching"})," is not supported, you need to ensure that at least one of the sides only yields a single series."]}),r]});case Og.multipleMatchesOnOneSide:{const[i,s]=t.matching.card===Tr.oneToMany?["left","right"]:["right","left"];return a.jsxs(a.Fragment,{children:[a.jsxs(ut,{size:"sm",children:["You requested"," ",a.jsxs("strong",{children:[i==="right"?"many-to-one":"one-to-many"," matching"]})," ","via"," ",a.jsxs("span",{className:"promql-code promql-keyword",children:["group_",s,"()"]}),", but we also found"," ",a.jsxs("strong",{children:["multiple series on the ",i," side"]})," of the match group. Make sure that the ",i," side only contains a single series."]}),r]})}default:throw new Error("unknown match error")}},_Se=({node:t,lhs:e,rhs:n})=>{const[r,i]=$v({key:"queryPage.explain.binaryOperators.showSampleValues",defaultValue:!1}),[s,o]=M.useState(100),[l,u]=M.useState(100),{matching:h}=t;if(h===null)throw new Error("missing matching parameters in vector-to-vector binop");const{groups:f,numGroups:p}=xSe(t.op,h,t.bool,e,n,{maxGroups:s,maxSeriesPerGroup:l}),m=Object.values(f).filter(v=>v.error).length;return a.jsxs(a.Fragment,{children:[a.jsx(ut,{size:"sm",children:SSe(t)}),a.jsx(ht,{my:"lg",justify:"flex-end",gap:"xl",children:a.jsx(k2,{label:"Show sample values",checked:r,onChange:v=>i(v.currentTarget.checked)})}),p>Object.keys(f).length&&a.jsxs(Nt,{color:"yellow",mb:"md",icon:a.jsx(Ui,{}),children:["Too many match groups to display, only showing"," ",Object.keys(f).length," out of ",p," groups.",a.jsx("br",{}),a.jsx("br",{}),a.jsx(qr,{fz:"sm",onClick:()=>o(void 0),children:"Show all groups"})]}),m>0&&a.jsxs(Nt,{color:"yellow",mb:"md",icon:a.jsx(Ui,{}),children:["Found matching issues in ",m," match group",m>1?"s":"",". See below for per-group error details."]}),a.jsx(re,{fz:"xs",withRowBorders:!1,children:a.jsx(re.Tbody,{children:Object.values(f).map((v,b)=>{const{groupLabels:x,lhs:w,lhsCount:S,rhs:_,rhsCount:T,result:C,error:j}=v,A=F=>a.jsx(re.Tr,{ta:"center",children:a.jsx(re.Td,{colSpan:2,style:{backgroundColor:`${F}25`},children:a.jsx(Yp,{labels:x,format:!0})})}),E=(F,Q,H,q)=>a.jsx(ve,{style:{borderRadius:3,border:"2px solid",borderColor:Q===0?"light-dark(var(--mantine-color-gray-4), var(--mantine-color-gray-7))":H},children:a.jsx(re,{fz:"xs",withRowBorders:!1,verticalSpacing:5,children:a.jsxs(re.Tbody,{children:[Q===0?a.jsx(re.Tr,{children:a.jsx(re.Td,{ta:"center",c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-5))",py:"md",fw:"bold",children:"no matching series"})}):a.jsxs(a.Fragment,{children:[A(H),F.map((P,I)=>{if(P.value===void 0)throw new Error("Native histograms are not supported yet");return a.jsxs(re.Tr,{children:[a.jsx(re.Td,{children:a.jsxs(ht,{wrap:"nowrap",gap:7,align:"center",children:[YT(WT(I,q)),a.jsx(Yp,{labels:wSe(P.metric,h.on,h.labels),format:!0}),P.filled&&a.jsx(ut,{size:"sm",c:"dimmed",children:"no match, filling in default value"})]})}),r&&a.jsx(re.Td,{ta:"right",children:P.value[1]})]},I)})]}),Q>F.length&&a.jsx(re.Tr,{children:a.jsxs(re.Td,{ta:"center",py:"md",fw:"bold",c:"gray.6",children:[Q-F.length," more series omitted   –  ",a.jsx(qr,{size:"xs",onClick:()=>u(void 0),children:"Show all series"})]})})]})})}),R=Cv[b%Cv.length],N=E(w,S,R),$=E(_,T,R,LL),D=a.jsx(ve,{style:{borderRadius:3,border:"2px solid",borderColor:C.length===0||j!==null?"light-dark(var(--mantine-color-gray-4), var(--mantine-color-gray-7))":R},children:a.jsx(re,{fz:"xs",withRowBorders:!1,verticalSpacing:5,children:a.jsx(re.Tbody,{children:j!==null?a.jsx(re.Tr,{children:a.jsx(re.Td,{ta:"center",c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-5))",py:"md",fw:"bold",children:"error, result omitted"})}):C.length===0?a.jsx(re.Tr,{children:a.jsx(re.Td,{ta:"center",c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-5))",py:"md",fw:"bold",children:"dropped"})}):j!==null?a.jsx(re.Tr,{children:a.jsx(re.Td,{ta:"center",c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-5))",py:"md",fw:"bold",children:"error, result omitted"})}):a.jsx(a.Fragment,{children:C.map(({sample:F,manySideIdx:Q},H)=>{if(F.value===void 0)throw new Error("Native histograms are not supported yet");const q=F.value[1]===VU,[P,I]=h.card===Tr.oneToMany?[0,Q]:[Q,0];return a.jsxs(re.Tr,{children:[a.jsx(re.Td,{style:{opacity:q?.5:1},title:q?"Series has been filtered by comparison operator":void 0,children:a.jsxs(ht,{wrap:"nowrap",gap:"xs",align:"flex-start",children:[a.jsxs(ht,{wrap:"nowrap",gap:0,children:[YT(WT(P)),a.jsx("span",{style:{color:"#aaa"},children:"–"}),YT(WT(I,LL))]}),a.jsx(Yp,{labels:F.metric,format:!0})]})}),r&&a.jsx(re.Td,{ta:"right",children:q?a.jsx("span",{style:{color:"grey"},children:"filtered"}):a.jsx("span",{children:F.value[1]})})]},H)})})})})});return a.jsxs(_n.Fragment,{children:[b!==0&&a.jsx("tr",{style:{height:30}}),a.jsx(re.Tr,{children:a.jsx(re.Td,{colSpan:5,children:j&&a.jsx(Nt,{color:"red",mb:"md",title:"Error in match group below",icon:a.jsx(Ui,{}),children:jSe(t,v,j)})})}),a.jsxs(re.Tr,{children:[a.jsx(re.Td,{valign:"middle",p:0,children:N}),a.jsxs(re.Td,{ta:"center",fw:s6(t.op)?"bold":void 0,children:[t.op,t.bool&&" bool"]}),a.jsx(re.Td,{valign:"middle",p:0,children:$}),a.jsx(re.Td,{ta:"center",children:"="}),a.jsx(re.Td,{valign:"middle",p:0,children:D})]})]},b)})})})]})},TSe=({node:t,lhs:e,rhs:n})=>{const[r,i]=[Fh(e[1]),Fh(n[1])];return a.jsxs(re,{withColumnBorders:!0,withTableBorder:!0,children:[a.jsx(re.Thead,{children:a.jsxs(re.Tr,{children:[a.jsx(re.Th,{children:"Left value"}),a.jsx(re.Th,{children:"Operator"}),a.jsx(re.Th,{children:"Right value"}),a.jsx(re.Th,{}),a.jsx(re.Th,{children:"Result"})]})}),a.jsx(re.Tbody,{children:a.jsxs(re.Tr,{children:[a.jsx(re.Td,{className:"number-cell",children:e[1]}),a.jsxs(re.Td,{className:"op-cell",children:[t.op,t.bool&&" bool"]}),a.jsx(re.Td,{className:"number-cell",children:n[1]}),a.jsx(re.Td,{className:"op-cell",children:"="}),a.jsx(re.Td,{className:"number-cell",children:Fg(vSe(t.op,r,i))})]})})]})},CSe=({node:t})=>{const{data:e}=bi({path:"/query",params:{query:as(t.lhs)}}),{data:n}=bi({path:"/query",params:{query:as(t.rhs)}});if(e.data.resultType!==Ep(t.lhs)||n.data.resultType!==Ep(t.rhs))return null;if(e.data.resultType==="scalar"&&n.data.resultType==="scalar")return a.jsxs(Gr,{withBorder:!0,children:[a.jsx(ut,{fz:"lg",fw:600,mb:"md",children:"Scalar-to-scalar binary operation"}),a.jsx(TSe,{node:t,lhs:e.data.result,rhs:n.data.result})]});if(e.data.resultType==="scalar"&&n.data.resultType==="vector")return a.jsxs(Gr,{withBorder:!0,children:[a.jsx(ut,{fz:"lg",fw:600,mb:"md",children:"Scalar-to-vector binary operation"}),a.jsx(PL,{node:t,vector:n.data.result,scalar:e.data.result,scalarLeft:!0})]});if(e.data.resultType==="vector"&&n.data.resultType==="scalar")return a.jsxs(Gr,{withBorder:!0,children:[a.jsx(ut,{fz:"lg",fw:600,mb:"md",children:"Vector-to-scalar binary operation"}),a.jsx(PL,{node:t,scalar:n.data.result,vector:e.data.result,scalarLeft:!1})]});if(e.data.resultType==="vector"&&n.data.resultType==="vector")return a.jsxs(Gr,{withBorder:!0,children:[a.jsx(ut,{fz:"lg",fw:600,mb:"md",children:"Vector-to-vector binary operation"}),a.jsx(_Se,{node:t,lhs:e.data.result,rhs:n.data.result})]});throw new Error("invalid binary operator argument types")},kSe=({node:t,treeShown:e,showTree:n})=>{if(t===null)return a.jsxs(Nt,{title:"How to use the Explain view",icon:a.jsx(Gn,{}),children:["This tab can help you understand the behavior of individual components of a query.",a.jsx("br",{}),a.jsx("br",{}),"To use the Explain view,"," ",!e&&a.jsxs(a.Fragment,{children:[a.jsx(qr,{fz:"unset",onClick:n,children:"enable the query tree view"})," ","(also available via the expression input menu) and then"]})," ","select a node in the tree above."]});switch(t.type){case mt.aggregation:return a.jsx(fSe,{node:t});case mt.binaryExpr:return a.jsx(CSe,{node:t});case mt.call:return a.jsxs(Gr,{withBorder:!0,children:[a.jsx(ut,{fz:"lg",fw:600,mb:"md",children:"Function call"}),a.jsxs(ut,{fz:"sm",children:["This node calls the"," ",a.jsx(qr,{fz:"inherit",href:`https://prometheus.io/docs/prometheus/latest/querying/functions/#${t.func.name}`,target:"_blank",children:a.jsxs("span",{className:"promql-code promql-keyword",children:[t.func.name,"()"]})})," ","function",t.args.length>0?" on the provided inputs":"","."]}),a.jsx(Vv,{my:"md"}),a.jsx(ut,{fz:"sm",className:cSe.funcDoc,children:oSe[t.func.name]})]});case mt.matrixSelector:return a.jsx(ML,{node:t});case mt.subquery:return a.jsxs(Gr,{withBorder:!0,children:[a.jsx(ut,{fz:"lg",fw:600,mb:"md",children:"Subquery"}),a.jsxs(ut,{fz:"sm",children:["This node evaluates the passed expression as a subquery over the last"," ",a.jsx("span",{className:"promql-code promql-duration",children:Bn(t.range)})," ","at a query resolution"," ",t.step>0?a.jsxs(a.Fragment,{children:["of"," ",a.jsx("span",{className:"promql-code promql-duration",children:Bn(t.step)})]}):"equal to the default rule evaluation interval",t.timestamp!==null?a.jsxs(a.Fragment,{children:[", evaluated relative to an absolute evaluation timestamp of"," ",a.jsx("span",{className:"promql-number",children:(t.timestamp/1e3).toFixed(3)})]}):t.startOrEnd!==null?a.jsxs(a.Fragment,{children:[", evaluated relative to the ",t.startOrEnd," of the query range"]}):a.jsx(a.Fragment,{}),t.offset===0?a.jsx(a.Fragment,{}):t.offset>0?a.jsxs(a.Fragment,{children:[", time-shifted"," ",a.jsx("span",{className:"promql-code promql-duration",children:Bn(t.offset)})," ","into the past"]}):a.jsxs(a.Fragment,{children:[", time-shifted"," ",a.jsx("span",{className:"promql-code promql-duration",children:Bn(-t.offset)})," ","into the future"]}),"."]})]});case mt.numberLiteral:return a.jsxs(Gr,{withBorder:!0,children:[a.jsx(ut,{fz:"lg",fw:600,mb:"md",children:"Number literal"}),a.jsxs(ut,{fz:"sm",children:["A scalar number literal with the value"," ",a.jsx("span",{className:"promql-code promql-number",children:t.val}),"."]})]});case mt.parenExpr:return a.jsxs(Gr,{withBorder:!0,children:[a.jsx(ut,{fz:"lg",fw:600,mb:"md",children:"Parentheses"}),a.jsx(ut,{fz:"sm",children:"Parentheses that contain a sub-expression to be evaluated."})]});case mt.stringLiteral:return a.jsxs(Gr,{withBorder:!0,children:[a.jsx(ut,{fz:"lg",fw:600,mb:"md",children:"String literal"}),a.jsxs(ut,{fz:"sm",children:["A string literal with the value"," ",a.jsxs("span",{className:"promql-code promql-string",children:['"',os(t.val),'"']}),"."]})]});case mt.unaryExpr:return a.jsxs(Gr,{withBorder:!0,children:[a.jsx(ut,{fz:"lg",fw:600,mb:"md",children:"Unary expression"}),a.jsxs(ut,{fz:"sm",children:["A unary expression that"," ",t.op==="+"?"does not affect the expression it is applied to":"changes the sign of the expression it is applied to","."]})]});case mt.vectorSelector:return a.jsx(ML,{node:t});default:throw new Error("invalid node type")}},hg={width:"0.9rem",height:"0.9rem"},OSe=({idx:t,metricNames:e})=>{const[n,r]=M.useState(0),i=rc(f=>f.queryPage.panels[t]),s=ou(),[o,l]=M.useState(null),u=M.useMemo(()=>o!==null?as(o.node):i.expr,[o,i.expr]),h=M.useCallback((f,p)=>s(Gu({idx:t,visualizer:{...i.visualizer,range:(p-f)*1e3,endTime:p*1e3}})),[s,t,i.visualizer]);return a.jsxs(En,{gap:"lg",children:[a.jsx(txe,{initialExpr:i.expr,metricNames:e,executeQuery:f=>{r(p=>p+1),s(Ele({idx:t,expr:f})),!e.includes(f)&&f.trim()!==""&&s(Cz(f))},treeShown:i.showTree,setShowTree:f=>{s(g3({idx:t,showTree:f})),f||l(null)},duplicatePanel:f=>{s(Ole({idx:t,expr:f}))},removePanel:()=>{s(kle(t))}}),i.expr.trim()!==""&&i.showTree&&a.jsx(yf,{title:"Error showing tree view",children:a.jsx(M.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(20),(f,p)=>a.jsx(xo,{height:30,mb:15,width:"100%"},p))}),children:a.jsx(aSe,{panelIdx:t,selectedNode:o,setSelectedNode:l,closeTreeView:()=>{s(g3({idx:t,showTree:!1})),l(null)}})})},n),a.jsxs(Pa,{value:i.visualizer.activeTab,onChange:f=>s(Gu({idx:t,visualizer:{...i.visualizer,activeTab:f}})),keepMounted:!1,children:[a.jsxs(Pa.List,{children:[a.jsx(Pa.Tab,{value:"table",leftSection:a.jsx(bB,{style:hg}),children:"Table"}),a.jsx(Pa.Tab,{value:"graph",leftSection:a.jsx(Are,{style:hg}),children:"Graph"}),a.jsx(Pa.Tab,{value:"explain",leftSection:a.jsx(Gn,{style:hg}),children:"Explain"})]}),a.jsx(Pa.Panel,{pt:"sm",value:"table",children:a.jsx(J2e,{expr:u,panelIdx:t,retriggerIdx:n})}),a.jsxs(Pa.Panel,{pt:"sm",value:"graph",children:[a.jsxs(ht,{mt:"xs",justify:"space-between",children:[a.jsxs(ht,{children:[a.jsx(Wce,{range:i.visualizer.range,onChangeRange:f=>s(Gu({idx:t,visualizer:{...i.visualizer,range:f}}))}),a.jsx(eq,{time:i.visualizer.endTime,range:i.visualizer.range,description:"End time",onChangeTime:f=>s(Gu({idx:t,visualizer:{...i.visualizer,endTime:f}}))}),a.jsx(m2e,{resolution:i.visualizer.resolution,range:i.visualizer.range,onChangeResolution:f=>{s(Gu({idx:t,visualizer:{...i.visualizer,resolution:f}}))}})]}),a.jsxs(ht,{gap:"lg",children:[a.jsx(Xv,{onChange:f=>s(Gu({idx:t,visualizer:{...i.visualizer,displayMode:f}})),value:i.visualizer.displayMode,data:[{value:ym.Lines,label:a.jsxs(Wg,{children:[a.jsx(nre,{style:hg}),a.jsx(ve,{ml:10,children:"Unstacked"})]})},{value:ym.Stacked,label:a.jsxs(Wg,{children:[a.jsx(kie,{style:hg}),a.jsx(ve,{ml:10,children:"Stacked"})]})}]}),a.jsxs(Kn,{position:"bottom",withArrow:!0,shadow:"md",children:[a.jsx(Kn.Target,{children:a.jsx(Nr,{variant:"light",color:"gray",size:32,title:"Graph settings",children:a.jsx(Bne,{style:nu,stroke:1.5})})}),a.jsx(Kn.Dropdown,{p:"lg",children:a.jsx(aa,{size:"xs",checked:i.visualizer.yAxisMin!==null,label:"Start Y axis at 0",onChange:f=>s(Gu({idx:t,visualizer:{...i.visualizer,yAxisMin:f.currentTarget.checked?0:null}}))})})]})]})]}),a.jsx(eB,{h:"lg"}),a.jsx(p2e,{expr:u,node:(o==null?void 0:o.node)??null,endTime:i.visualizer.endTime,range:i.visualizer.range,resolution:i.visualizer.resolution,showExemplars:i.visualizer.showExemplars,displayMode:i.visualizer.displayMode,yAxisMin:i.visualizer.yAxisMin,retriggerIdx:n,onSelectRange:h})]}),a.jsx(Pa.Panel,{pt:"sm",value:"explain",children:a.jsx(yf,{title:"Error showing explain view",children:a.jsx(M.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(20),(f,p)=>a.jsx(xo,{height:30,mb:15,width:"100%"},p))}),children:a.jsx(kSe,{node:(o==null?void 0:o.node)??null,treeShown:i.showTree,showTree:()=>{s(g3({idx:t,showTree:!0}))}})})},o==null?void 0:o.id)})]})]})};function UU(){const t=rc(u=>u.queryPage.panels),e=ou(),[n,r]=M.useState(0);M.useEffect(()=>{const u=()=>{const h=jle(window.location.search);h.length>0&&e(oD(h))};return u(),window.addEventListener("popstate",u),()=>{window.removeEventListener("popstate",u)}},[e]),M.useEffect(()=>()=>{e(oD([z2()]))},[e]);const{data:i,error:s}=Ih({path:"/label/__name__/values"}),{data:o,error:l}=Ih({path:"/query",params:{query:"time()"}});return M.useEffect(()=>{if(!o)return;if(o.data.resultType!=="scalar")throw new Error("Unexpected result type from time query");const u=new Date().getTime()/1e3,h=o.data.result[0];r(Math.abs(u-h))},[o]),a.jsxs(ve,{mt:"xs",children:[s&&a.jsxs(Nt,{mb:"sm",icon:a.jsx(Ui,{}),color:"red",title:"Error fetching metrics list",children:["Unable to fetch list of metric names: ",s.message]}),l&&a.jsx(Nt,{mb:"sm",icon:a.jsx(Ui,{}),color:"red",title:"Error fetching server time",children:l.message}),n>30&&a.jsxs(Nt,{mb:"sm",title:"Server time is out of sync",color:"red",icon:a.jsx(qne,{}),onClose:()=>r(0),children:["Detected a time difference of"," ",a.jsx("strong",{children:Pp(n*1e3)})," between your browser and the server. You may see unexpected time-shifted query results due to the time drift."]}),a.jsx(En,{gap:"xl",children:t.map((u,h)=>a.jsx(OSe,{idx:h,metricNames:(i==null?void 0:i.data)||[]},u.id))}),a.jsx(ks,{variant:"light",mt:"xl",leftSection:a.jsx(mB,{style:_g}),onClick:()=>e(Cle()),children:"Add query"})]})}const ESe="_statsBadge_w76va_1",ASe="_labelBadge_w76va_9",MSe="_healthOk_w76va_35",RSe="_healthErr_w76va_43",DSe="_healthWarn_w76va_51",NSe="_healthInfo_w76va_62",PSe="_healthUnknown_w76va_70",hn={statsBadge:ESe,labelBadge:ASe,healthOk:MSe,healthErr:RSe,healthWarn:DSe,healthInfo:NSe,healthUnknown:PSe},LSe="_panelHealthOk_p1xoy_1",$Se="_panelHealthErr_p1xoy_6",ISe="_panelHealthWarn_p1xoy_11",BSe="_panelHealthUnknown_p1xoy_16",wh={panelHealthOk:LSe,panelHealthErr:$Se,panelHealthWarn:ISe,panelHealthUnknown:BSe},zSe="_codebox_b9wnp_1",qSe="_queryButton_b9wnp_8",$L={codebox:zSe,queryButton:qSe},Pm=({labels:t,wrapper:e=ht,style:n})=>a.jsx(e,{gap:"xs",children:Object.entries(t).map(([r,i])=>a.jsxs("span",{className:hn.labelBadge,style:n,children:[zh(r),'="',Oh(i),'"']},r))}),FSe=new LH,QU=({rule:t})=>{const e=Fw(),{pathPrefix:n}=ai();return a.jsxs(a.Fragment,{children:[a.jsxs(Gr,{p:"xs",className:$L.codebox,fz:"sm",shadow:"none",children:[a.jsx(kE,{basicSetup:!1,value:t.query,editable:!1,extensions:[EV,AV,hS(e==="light"?MV:RV),FSe.asExtension(),it.lineWrapping]}),a.jsx(Xr,{label:"Query rule expression",withArrow:!0,position:"top",children:a.jsx(Nr,{pos:"absolute",top:7,right:7,variant:"light",onClick:()=>{window.open(`${n}/query?g0.expr=${encodeURIComponent(t.query)}&g0.tab=1`,"_blank")},className:$L.queryButton,children:a.jsx(Xh,{style:nu})})})]}),t.type==="alerting"&&a.jsxs(ht,{mt:"lg",gap:"xs",children:[t.duration&&a.jsxs(zr,{variant:"light",styles:{label:{textTransform:"none"}},leftSection:a.jsx(pre,{style:Jo}),children:["for: ",Bn(t.duration*1e3)]}),t.keepFiringFor&&a.jsxs(zr,{variant:"light",styles:{label:{textTransform:"none"}},leftSection:a.jsx(gre,{style:Jo}),children:["keep_firing_for: ",Bn(t.keepFiringFor*1e3)]})]}),t.labels&&Object.keys(t.labels).length>0&&a.jsx(ve,{mt:"lg",children:a.jsx(Pm,{labels:t.labels})}),t.type==="alerting"&&Object.keys(t.annotations).length>0&&a.jsx(re,{mt:"lg",fz:"sm",children:a.jsx(re.Tbody,{children:Object.entries(t.annotations).map(([r,i])=>a.jsxs(re.Tr,{children:[a.jsx(re.Th,{c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-4))",children:r}),a.jsx(re.Td,{children:i})]},r))})})]})};function IL({value:t,onRemove:e,...n}){return a.jsx(Hc,{fw:600,style:{textTransform:"uppercase",fontWeight:600},onRemove:e,...n,withRemoveButton:!!e,children:t})}const MS=({options:t,optionClass:e,optionCount:n,placeholder:r,values:i,onChange:s})=>{const o=s2({onDropdownClose:()=>o.resetSelectedOption(),onDropdownOpen:()=>o.updateSelectedOptionIndex("active")}),l=f=>s(i.includes(f)?i.filter(p=>p!==f):[...i,f]),u=f=>s(i.filter(p=>p!==f)),h=i.map(f=>a.jsx(IL,{value:n?`${f} (${n(f)})`:f,className:e(f),onRemove:()=>u(f)},f));return a.jsxs(an,{store:o,onOptionSubmit:l,withinPortal:!1,children:[a.jsx(an.DropdownTarget,{children:a.jsx(Ag,{pointer:!0,onClick:()=>o.toggleDropdown(),miw:200,leftSection:a.jsx(dB,{style:Mf}),rightSection:i.length>0?a.jsx(oO,{onClear:()=>s([])}):a.jsx(i2,{}),children:a.jsxs(Hc.Group,{children:[h.length>0?h:a.jsx(Ag.Field,{placeholder:r,mt:1}),a.jsx(an.EventsTarget,{children:a.jsx(Ag.Field,{type:"hidden",onBlur:()=>o.closeDropdown(),onKeyDown:f=>{f.key==="Backspace"&&(f.preventDefault(),u(i[i.length-1]))}})})]})})}),a.jsx(an.Dropdown,{children:a.jsx(an.Options,{children:t.map(f=>a.jsx(an.Option,{value:f,active:i.includes(f),children:a.jsxs(ht,{gap:"sm",children:[i.includes(f)?a.jsx(a2,{size:12,color:"gray"}):null,a.jsx(IL,{value:n?`${f} (${n(f)})`:f,className:e(f)})]})},f))})})]})};function Wl(t,e,n=!0){return{...t,default:e,decode:(...i)=>{const s=t.decode(...i);return s===void 0||n&&s===null?e:s}}}function WU(t,e){if(t==null)return t;if(t.length===0&&(!e||e&&t!==""))return null;const n=t instanceof Array?t[0]:t;return n==null?n:!e&&n===""?null:n}function HSe(t){return t==null||t instanceof Array?t:t===""?[]:[t]}function VSe(t){return t==null?t:String(t)}function USe(t){const e=WU(t);return e==null?e:e===""?null:+e}function QSe(t){return t==null?t:String(t)}function WSe(t){const e=WU(t,!0);return e==null?e:String(e)}function YSe(t){return t==null,t}function XSe(t){const e=HSe(t);return e==null,e}const Hh={encode:QSe,decode:WSe},YU={encode:VSe,decode:USe},RS={encode:YSe,decode:XSe};function GSe(t){const e=new URLSearchParams,n=Object.entries(t);for(const[r,i]of n)if(i!==void 0&&i!==null)if(Array.isArray(i))for(const s of i)e.append(r,s??"");else e.append(r,i);return e.toString()}'{}[],":'.split("").map(t=>[t,encodeURIComponent(t)]);function KSe(t,e){const n={},r=Object.keys(e);for(const i of r){const s=e[i];t[i]?n[i]=t[i].encode(e[i]):n[i]=s==null?s:String(s)}return n}function ZSe(t){const e=new URLSearchParams(t),n={};for(let[r,i]of e)Object.prototype.hasOwnProperty.call(n,r)?Array.isArray(n[r])?n[r].push(i):n[r]=[n[r],i]:n[r]=i;return n}class JSe{constructor(){this.paramsMap=new Map,this.registeredParams=new Map}set(e,n,r,i){this.paramsMap.set(e,{stringified:n,decoded:r,decode:i})}has(e,n,r){if(!this.paramsMap.has(e))return!1;const i=this.paramsMap.get(e);return i?i.stringified===n&&(r==null||i.decode===r):!1}get(e){var n;if(this.paramsMap.has(e))return(n=this.paramsMap.get(e))==null?void 0:n.decoded}registerParams(e){for(const n of e){const r=this.registeredParams.get(n)||0;this.registeredParams.set(n,r+1)}}unregisterParams(e){for(const n of e){const r=(this.registeredParams.get(n)||0)-1;r<=0?(this.registeredParams.delete(n),this.paramsMap.has(n)&&this.paramsMap.delete(n)):this.registeredParams.set(n,r)}}clear(){this.paramsMap.clear(),this.registeredParams.clear()}}const px=new JSe;function eje(t,e){var n,r,i;const s={};let o=!1;const l=Object.keys(t);let u=l;if(e.includeKnownParams||e.includeKnownParams!==!1&&l.length===0){const f=Object.keys((n=e.params)!=null?n:{});u.push(...f)}for(const f of u){const p=t[f];if(p!=null&&typeof p=="object"){s[f]=p;continue}o=!0,s[f]=(i=(r=e.params)==null?void 0:r[f])!=null?i:Hh}return o?s:t}function XU(t,e,n,r){var i;if(!n||!e.length)return t;let s={...t},o=!1;for(const l of e)Object.prototype.hasOwnProperty.call(s,l)||(s[l]=(i=n[l])!=null?i:r,o=!0);return o?s:t}const tje=Object.prototype.hasOwnProperty;function BL(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function GU(t,e,n){var r,i;if(BL(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;const s=Object.keys(t),o=Object.keys(e);if(s.length!==o.length)return!1;for(let l=0;l<s.length;l++){const u=(i=(r=void 0)==null?void 0:r.equals)!=null?i:BL;if(!tje.call(e,s[l])||!u(t[s[l]],e[s[l]]))return!1}return!0}function KU(t,e,n){const r={},i=Object.keys(e);for(const s of i){const o=e[s],l=t[s];let u;if(n.has(s,l,o.decode))u=n.get(s);else{if(u=o.decode(l),o.equals&&n.has(s,l)){const h=n.get(s);o.equals(u,h)&&(u=h)}u!==void 0&&n.set(s,l,u,o.decode)}u===void 0&&o.default!==void 0&&(u=o.default),r[s]=u}return r}function nje(){let t;function e(n,r,i){const s=KU(n,r,i);return t!=null&&GU(t,s)?t:(t=s,s)}return e}function rje(t){let e;for(const n in t)if(t[n].urlName){const i=`${t[n].urlName}\0${n}`;e?e.push(i):e=[i]}return e?e.join(`
`):void 0}function ije(t){if(t)return Object.fromEntries(t.split(`
`).map(e=>e.split("\0")))}function sje(t,e){var n;let r={};for(const i in t)((n=e[i])==null?void 0:n.urlName)!=null?r[e[i].urlName]=t[i]:r[i]=t[i];return r}let zL,qL,FL,XT={};const ZU=(t,e,n)=>{if(zL===e&&FL===t&&qL===n)return XT;zL=e,FL=t;const r=t(e??"");qL=n;const i=ije(n);for(let[s,o]of Object.entries(r)){i!=null&&i[s]&&(delete r[s],s=i[s],r[s]=o);const l=XT[s];GU(o,l)&&(r[s]=l)}return XT=r,r},aje={searchStringToObject:ZSe,objectToSearchString:GSe,updateType:"pushIn",includeKnownParams:void 0,includeAllParams:!1,removeDefaultsFromUrl:!1,enableBatching:!1,skipUpdateWhenNoChange:!0};function JU(t,e){e==null&&(e={});const n={...t,...e};return e.params&&t.params&&(n.params={...t.params,...e.params}),n}const eQ={adapter:{},options:aje},v6=M.createContext(eQ);function oje(){const t=M.useContext(v6);if(t===void 0||t===eQ)throw new Error("useQueryParams must be used within a QueryParamProvider");return t}function HL({children:t,adapter:e,options:n}){const{adapter:r,options:i}=M.useContext(v6),s=M.useMemo(()=>({adapter:e??r,options:JU(i,n)}),[e,n,r,i]);return M.createElement(v6.Provider,{value:s},t)}function lje({children:t,adapter:e,options:n}){const r=e;return r?M.createElement(r,null,i=>M.createElement(HL,{adapter:i,options:n},t)):M.createElement(HL,{options:n},t)}function cje(t,e){var n;for(const r in t)((n=e[r])==null?void 0:n.default)!==void 0&&t[r]!==void 0&&e[r].encode(e[r].default)===t[r]&&(t[r]=void 0)}function uje({changes:t,updateType:e,currentSearchString:n,paramConfigMap:r,options:i}){const{searchStringToObject:s,objectToSearchString:o}=i;e==null&&(e=i.updateType);let l;const u=ZU(s,n),h=XU(r,Object.keys(t),i.params);let f;if(typeof t=="function"){const m=KU(u,h,px);f=t(m)}else f=t;l=KSe(h,f),i.removeDefaultsFromUrl&&cje(l,h),l=sje(l,h);let p;return e==="push"||e==="replace"?p=o(l):p=o({...u,...l}),p!=null&&p.length&&p[0]!=="?"&&(p=`?${p}`),p??""}function hje({searchString:t,adapter:e,navigate:n,updateType:r}){const s={...e.location,search:t};typeof r=="string"&&r.startsWith("replace")?e.replace(s):e.push(s)}const dje=t=>t(),fje=t=>setTimeout(()=>t(),0),E1=[];function pje(t,{immediate:e}={}){E1.push(t);let n=e?dje:fje;E1.length===1&&n(()=>{const r=E1.slice();E1.length=0;const i=r[0].currentSearchString;let s;for(let o=0;o<r.length;++o){const l=o===0?r[o]:{...r[o],currentSearchString:s};s=uje(l)}t.options.skipUpdateWhenNoChange&&s===i||hje({searchString:s??"",adapter:r[r.length-1].adapter,navigate:!0,updateType:r[r.length-1].updateType})})}function mje(t,e){const{adapter:n,options:r}=oje(),[i]=M.useState(nje),{paramConfigMap:s,options:o}=vje(t,e),l=M.useMemo(()=>JU(r,o),[r,o]);let u=eje(s,l);const h=ZU(l.searchStringToObject,n.location.search,rje(u));l.includeAllParams&&(u=XU(u,Object.keys(h),l.params,Hh));const f=i(h,u,px),p=Object.keys(u).join("\0");M.useEffect(()=>{const x=p.split("\0");return px.registerParams(x),()=>{px.unregisterParams(x)}},[p]);const m={adapter:n,paramConfigMap:u,options:l},v=M.useRef(m);v.current==null&&(v.current=m),M.useEffect(()=>{v.current.adapter=n,v.current.paramConfigMap=u,v.current.options=l},[n,u,l]);const[b]=M.useState(()=>(w,S)=>{const{adapter:_,paramConfigMap:T,options:C}=v.current;S==null&&(S=C.updateType),pje({changes:w,updateType:S,currentSearchString:_.location.search,paramConfigMap:T,options:C,adapter:_},{immediate:!C.enableBatching})});return[f,b]}var gje=mje;function vje(t,e){let n,r;return t===void 0?(n={},r=e):Array.isArray(t)?(n=Object.fromEntries(t.map(i=>[i,"inherit"])),r=e):(n=t,r=e),{paramConfigMap:n,options:r}}const bo=(t,e,n)=>{const r=M.useMemo(()=>({[t]:e??"inherit"}),[t,e]),[i,s]=gje(r,n),o=i[t],l=M.useCallback((u,h)=>s(typeof u=="function"?f=>{const p=u(f[t]);return{[t]:p}}:{[t]:u},h),[t,s]);return[o,l]};function bje(t,e,n,r){let i=[];for(const s of e){const o=KE(t,s,n,r.concat([]));o!==null&&(Array.isArray(o)?i=i.concat(o):i.push(o))}return i.length===0?null:i.length===1?i[0]:i}function KE(t,e,n=0,r=[]){let i=e;for(let s=n;s<t.length;s++){if(i==null||typeof i!="object")return null;if(Array.isArray(i))return bje(t,i,s,r);const o=t[s];if(typeof o=="string")if(i[o]!==void 0)r.push(o),i=i[o];else return null;else{let l=[];for(const u of Object.keys(i))if(o.test(u)){const h=KE(t,i[u],s+1,r.concat([u]));h!==null&&(Array.isArray(h)?l=l.concat(h):l.push(h))}return l}}return{path:r,value:i}}function yje(t){return t.right!==void 0}function xje(t){return t.keyPath!==void 0}function Rw(t,e){const n={original:t.original,rendered:t.rendered,score:t.score+e.score,index:t.index};let r;return t.matched&&e.matched?r=t.matched.concat(e.matched):t.matched?r=t.matched:e.matched&&(r=e.matched),r&&(n.matched=r),n}function wje(t,e){const n=t;for(const[r,i]of Object.entries(e)){const s=r;n[s]!==void 0?n[s]=Rw(n[s],i):n[s]=i}}function Sje(t,e){const n={};for(const[r,i]of Object.entries(e)){const s=r;t[s]!==void 0&&(n[s]=Rw(t[s],i))}return n}function jje(t,e,n){return r0(t,e,(r,i)=>r===i,n)}function _je(t,e,n){return r0(t,e,(r,i)=>r!==i,n)}function Tje(t,e,n){return r0(t,e,(r,i)=>r>i,n)}function Cje(t,e,n){return r0(t,e,(r,i)=>r>=i,n)}function kje(t,e,n){return r0(t,e,(r,i)=>r<i,n)}function Oje(t,e,n){return r0(t,e,(r,i)=>r<=i,n)}function r0(t,e,n,r){let i=t,s=e;return!r&&typeof i=="string"&&typeof s=="string"&&(i=i.toLocaleLowerCase(),s=s.toLocaleLowerCase()),n(s,i)}function VL(t,e){const n={match:"fuzzy",pattern:t,keyPath:[]};return Array.isArray(e)?n.keyPath=n.keyPath.concat(e):n.keyPath=[e],n}class mb{constructor(e){this.conf={caseSensitive:(e==null?void 0:e.caseSensitive)===void 0?!1:e.caseSensitive,excludedChars:(e==null?void 0:e.excludedChars)===void 0?[]:e.excludedChars,includeMatches:(e==null?void 0:e.includeMatches)===void 0?!1:e.includeMatches,shouldSort:(e==null?void 0:e.shouldSort)===void 0?!1:e.shouldSort,shouldRender:(e==null?void 0:e.shouldRender)===void 0?!0:e.shouldRender,escapeHTML:(e==null?void 0:e.escapeHTML)===void 0?!1:e.escapeHTML,findAllMatches:(e==null?void 0:e.findAllMatches)==null?!1:e.findAllMatches,pre:e==null?void 0:e.pre,post:e==null?void 0:e.post,indexedKeys:e==null?void 0:e.indexedKeys}}filter(e,n,r){const i=r!=null&&r.indexedKeys?r.indexedKeys:this.conf.indexedKeys;if(i===void 0)return[];const s=i.length,o=VL(e,i[0]);if(s===1)return this.filterWithQuery(o,n,r);const l={operator:"or",left:o,right:o};let u=l;for(let h=1;h<s;h++){const f=VL(e,i[h]);if(h+1<s){const p={operator:"or",left:f,right:f};u.right=p,u=p}else u.right=f}return this.filterWithQuery(l,n,r)}filterWithQuery(e,n,r){const i=(r==null?void 0:r.shouldSort)!==void 0?r.shouldSort:this.conf.shouldSort,s=(r==null?void 0:r.shouldRender)!==void 0?r.shouldRender:this.conf.shouldRender,o=(r==null?void 0:r.includeMatches)!==void 0?r.includeMatches:this.conf.includeMatches,l=(r==null?void 0:r.findAllMatches)!==void 0?r.findAllMatches:this.conf.findAllMatches,u=[{current:e,depth:0}],h=[];for(;u.length>0;){const p=u.shift();if(!p)break;const m=p.current;if(yje(m)){u.unshift({current:m.left,parent:m.operator,depth:p.depth+1},{current:m.right,parent:m.operator,depth:p.depth+1},{current:m.operator,parent:p.parent,depth:p.depth});continue}if(xje(m)){let x;!l&&h.length>1&&h[h.length-1].depth===p.depth&&p.parent!==void 0&&(x={result:h[h.length-1].result,parent:p.parent}),h.push({result:this.executeQuery(m,n,x,r),depth:p.depth});continue}const v=h.pop(),b=h.pop();if(!v||!b)break;m==="or"?(wje(v.result,b.result),h.push({result:v.result,depth:p.depth})):h.push({result:Sje(v.result,b.result),depth:p.depth})}let f=Object.values(h[0].result);for(let p=0;p<f.length;p++)f[p].rendered=s?this.render(f[p].original,f[p].matched,r):f[p].original,o||(f[p].matched=void 0);return i&&(f=f.sort((p,m)=>m.score-p.score)),f||[]}match(e,n,r){const i=(r==null?void 0:r.includeMatches)!==void 0?r.includeMatches:this.conf.includeMatches,s=(r==null?void 0:r.shouldRender)!==void 0?r.shouldRender:this.conf.shouldRender,o=this.internalMatch(e,n,r);return o!==null&&(o.original=n,o.rendered=s?this.render(n,o.matched,r):n,i||(o.matched=void 0)),o}render(e,n,r){const i=r!=null&&r.pre?r.pre:this.conf.pre,s=r!=null&&r.post?r.post:this.conf.post;if(i===void 0&&s===void 0||n===void 0)return e;const o=JSON.parse(JSON.stringify(e)),l={};for(const u of n)this.renderingWalk(u,o,l,r);return o}renderingWalk(e,n,r,i){let s=n,o=0;const l=e.path;for(;o<l.length-1;)s[l[o]]!==void 0?s=s[l[o]]:s=s[r[l.slice(0,o).toString()]],o++;const u={pre:i!=null&&i.pre?i.pre:this.conf.pre,post:i!=null&&i.post?i.post:this.conf.post,escapeHTML:i!=null&&i.escapeHTML?i.escapeHTML:this.conf.escapeHTML};let h=l[o];if(typeof s[h]=="object"&&typeof e.value=="string"){s=s[h];const f=xP(e.value,e.intervals,u);s[f]=s[e.value],r[l.concat(e.value).toString()]=f,delete s[e.value]}else s[h]===void 0&&(h=r[l.toString()]),s[h]=xP(s[h],e.intervals,u)}executeQuery(e,n,r,i){const s={};for(let o=0;o<n.length;o++){const l=n[o];if(r){if(r.parent==="or"){if(r.result[o])continue}else if(!r.result[o])continue}const u=this.internalMatch(e,l,i);u!==null&&(u.index=o,u.original=l,s[o]=u)}return s}internalMatch(e,n,r){const i=KE(e.keyPath,n);return this.processWalkingPath(i,e,r)}processWalkingPath(e,n,r){let i=null;if(e===null)return null;if(Array.isArray(e))for(const s of e){const o=this.recursiveMatch(s.value,s.path,n,r);o!==null&&(i!=null?i=Rw(o,i):i=o)}else i=this.recursiveMatch(e.value,e.path,n,r);return i}recursiveMatch(e,n,r,i){let s=null;if(typeof e=="string"||typeof e=="number")s=this.matchSingleStringOrNumber(e,n,r,i);else if(Array.isArray(e))for(const o of e){const l=this.recursiveMatch(o,n,r,i);l!==null&&(s!=null?s=Rw(l,s):s=l)}else for(const o of Object.keys(e))if(s=this.matchSingleStringOrNumber(o,n,r,i),s!==null)break;return s}matchSingleStringOrNumber(e,n,r,i){const s=(i==null?void 0:i.caseSensitive)!==void 0?i.caseSensitive:this.conf.caseSensitive;let o=[];switch((i==null?void 0:i.excludedChars)!==void 0?o=i.excludedChars:this.conf.excludedChars!==void 0&&(o=this.conf.excludedChars),r.match){case"exact":return jje(r.pattern,e,s)?{score:1/0,matched:[{path:n,value:e,intervals:typeof e=="string"?[{from:0,to:e.length-1}]:[]}]}:null;case"negative":return _je(r.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null;case"fuzzy":{if(typeof r.pattern!="string"||typeof e!="string")return null;const l=n1e(r.pattern,e,{includeMatches:!0,caseSensitive:s,excludedChars:o});return l===null?null:{score:l.score,matched:[{path:n,value:e,intervals:l.intervals?l.intervals:[]}]}}case"greater":return Tje(r.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null;case"greaterEqual":return Cje(r.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null;case"less":return kje(r.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null;case"lessEqual":return Oje(r.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null}}}const Eje="_item_11v54_1",Aje={item:Eje},[Mje,ZE]=Wi("Accordion component was not found in the tree");function JE({style:t,size:e=16,...n}){return a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:de(e),height:de(e),display:"block"},...n,children:a.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}JE.displayName="@mantine/core/AccordionChevron";const[Rje,tQ]=Wi("Accordion.Item component was not found in the tree"),Dje="_root_1yehb_30",Nje="_panel_1yehb_34",Pje="_content_1yehb_38",Lje="_itemTitle_1yehb_43",$je="_control_1yehb_48",Ije="_label_1yehb_85",Bje="_chevron_1yehb_95",zje="_icon_1yehb_114",qje="_item_1yehb_43",gb={root:Dje,panel:Nje,content:Pje,itemTitle:Lje,control:$je,"control--default":"_control--default_1yehb_70","control--contained":"_control--contained_1yehb_71",label:Ije,chevron:Bje,icon:zje,item:qje,"item--default":"_item--default_1yehb_138","item--contained":"_item--contained_1yehb_142","item--filled":"_item--filled_1yehb_175","item--separated":"_item--separated_1yehb_183"},eA=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,chevron:l,icon:u,onClick:h,onKeyDown:f,children:p,disabled:m,mod:v,...b}=Se("AccordionControl",null,t),{value:x}=tQ(),w=ZE(),S=w.isItemActive(x),_=typeof w.order=="number",T=`h${w.order}`,C=a.jsxs(Dr,{...b,...w.getStyles("control",{className:r,classNames:n,style:i,styles:s,variant:w.variant}),unstyled:w.unstyled,mod:["accordion-control",{active:S,"chevron-position":w.chevronPosition,disabled:m},v],ref:e,onClick:j=>{h==null||h(j),w.onChange(x)},type:"button",disabled:m,"aria-expanded":S,"aria-controls":w.getRegionId(x),id:w.getControlId(x),onKeyDown:Nw({siblingSelector:"[data-accordion-control]",parentSelector:"[data-accordion]",activateOnFocus:!1,loop:w.loop,orientation:"vertical",onKeyDown:f}),children:[a.jsx(ve,{component:"span",mod:{rotate:!w.disableChevronRotation&&S,position:w.chevronPosition},...w.getStyles("chevron",{classNames:n,styles:s}),children:l||w.chevron}),a.jsx("span",{...w.getStyles("label",{classNames:n,styles:s}),children:p}),u&&a.jsx(ve,{component:"span",mod:{"chevron-position":w.chevronPosition},...w.getStyles("icon",{classNames:n,styles:s}),children:u})]});return _?a.jsx(T,{...w.getStyles("itemTitle",{classNames:n,styles:s}),children:C}):C});eA.displayName="@mantine/core/AccordionControl";eA.classes=gb;const tA=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,value:l,mod:u,...h}=Se("AccordionItem",null,t),f=ZE();return a.jsx(Rje,{value:{value:l},children:a.jsx(ve,{ref:e,mod:[{active:f.isItemActive(l)},u],...f.getStyles("item",{className:r,classNames:n,styles:s,style:i,variant:f.variant}),...h})})});tA.displayName="@mantine/core/AccordionItem";tA.classes=gb;const nA=Ae((t,e)=>{const{classNames:n,className:r,style:i,styles:s,vars:o,children:l,...u}=Se("AccordionPanel",null,t),{value:h}=tQ(),f=ZE(),p=f.isItemActive(h),[m,v]=M.useState(p);return M.useEffect(()=>{let b;return p?v(!0):b=setTimeout(()=>v(!1),200),()=>clearTimeout(b)},[p]),a.jsx(Uw,{ref:e,...f.getStyles("panel",{className:r,classNames:n,style:i,styles:s}),...u,in:p,transitionDuration:f.transitionDuration??200,role:"region",id:f.getRegionId(h),"aria-labelledby":f.getControlId(h),children:a.jsx("div",{...f.getStyles("content",{classNames:n,styles:s}),children:m&&l})})});nA.displayName="@mantine/core/AccordionPanel";nA.classes=gb;const Fje={multiple:!1,disableChevronRotation:!1,chevronPosition:"right",variant:"default",chevronSize:"auto",chevronIconSize:16},Hje=(t,{transitionDuration:e,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":e===void 0?void 0:`${e}ms`,"--accordion-chevron-size":n===void 0?void 0:de(n),"--accordion-radius":r===void 0?void 0:Zn(r)}});function kr(t){const e=Se("Accordion",Fje,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,children:u,multiple:h,value:f,defaultValue:p,onChange:m,id:v,loop:b,transitionDuration:x,disableChevronRotation:w,chevronPosition:S,chevronSize:_,order:T,chevron:C,variant:j,radius:A,chevronIconSize:E,attributes:R,...N}=e,$=Ei(v),[D,F]=Qi({value:f,defaultValue:p,finalValue:h?[]:null,onChange:m}),Q=P=>Array.isArray(D)?D.includes(P):P===D,H=P=>{const I=Array.isArray(D)?D.includes(P)?D.filter(U=>U!==P):[...D,P]:P===D?null:P;F(I)},q=lt({name:"Accordion",classes:gb,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:R,vars:l,varsResolver:Hje});return a.jsx(Mje,{value:{isItemActive:Q,onChange:H,getControlId:mx(`${$}-control`,"Accordion.Item component was rendered with invalid value or without value"),getRegionId:mx(`${$}-panel`,"Accordion.Item component was rendered with invalid value or without value"),chevron:C===null?null:C||a.jsx(JE,{size:E}),transitionDuration:x,disableChevronRotation:w,chevronPosition:S,order:T,loop:b,getStyles:q,variant:j,unstyled:o},children:a.jsx(ve,{...q("root"),id:$,...N,variant:j,"data-accordion":!0,children:u})})}const Vje=t=>t;kr.extend=Vje;kr.withProps=W7(kr);kr.classes=gb;kr.displayName="@mantine/core/Accordion";kr.Item=tA;kr.Panel=nA;kr.Control=eA;kr.Chevron=JE;const Uje=new mb({shouldSort:!0,indexedKeys:["name","labels",["labels",/.*/]]}),Qje=(t,e,n)=>{const r={globalCounts:{inactive:0,pending:0,firing:0,unknown:0},groups:[]};for(const i of t.groups){const s={total:0,inactive:0,pending:0,firing:0,unknown:0};for(const l of i.rules)switch(s.total++,l.state){case"inactive":r.globalCounts.inactive++,s.inactive++;break;case"firing":r.globalCounts.firing++,s.firing++;break;case"pending":r.globalCounts.pending++,s.pending++;break;case"unknown":r.globalCounts.unknown++,s.unknown++;break;default:throw new Error(`Unknown rule state: ${l.state}`)}const o=(e===""?i.rules:Uje.filter(e,i.rules).map(l=>l.original)).filter(l=>n.length===0||n.includes(l.state));r.groups.push({name:i.name,file:i.file,counts:s,rules:o.map(l=>({rule:l,counts:{firing:l.alerts.filter(u=>u.state==="firing").length,pending:l.alerts.filter(u=>u.state==="pending").length}}))})}return r},Wje=[];function nQ(){const{data:t}=bi({path:"/rules",params:{type:"alert"}}),{showAnnotations:e}=ai(),[n,r]=bo("state",Wl(RS,Wje)),[i,s]=bo("search",Wl(Hh,"")),[o]=Lv(i.trim(),250),[l,u]=$v({key:"alertsPage.showEmptyGroups",defaultValue:!1}),{alertGroupsPerPage:h}=ai(),[f,p]=bo("page",Wl(YU,1)),m=M.useMemo(()=>Qje(t.data,o,n),[t,n,o]),v=M.useMemo(()=>l?m.groups:m.groups.filter(_=>_.rules.length>0),[m.groups,l]),b=Math.ceil(v.length/h),x=Math.max(1,Math.min(f,b));M.useEffect(()=>{x!==f&&p(x)},[x,f,p]);const w=M.useMemo(()=>v.slice((x-1)*h,x*h),[v,x,h]),S=M.useMemo(()=>w.map(_=>a.jsxs(Gr,{shadow:"xs",withBorder:!0,p:"md",children:[a.jsxs(ht,{mb:"sm",justify:"space-between",children:[a.jsxs(ht,{align:"baseline",children:[a.jsx(ut,{fz:"xl",fw:600,c:"var(--mantine-primary-color-filled)",children:_.name}),a.jsx(ut,{fz:"sm",c:"gray.6",children:_.file})]}),a.jsxs(ht,{children:[_.counts.firing>0&&a.jsxs(zr,{className:hn.healthErr,children:["firing (",_.counts.firing,")"]}),_.counts.pending>0&&a.jsxs(zr,{className:hn.healthWarn,children:["pending (",_.counts.pending,")"]}),_.counts.unknown>0&&a.jsxs(zr,{className:hn.healthUnknown,children:["unknown (",_.counts.unknown,")"]}),_.counts.inactive>0&&a.jsxs(zr,{className:hn.healthOk,children:["inactive (",_.counts.inactive,")"]})]})]}),_.counts.total===0?a.jsxs(Nt,{title:"No rules",icon:a.jsx(Gn,{}),children:["No rules in this group.",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>u(!1),children:"Hide empty groups"})]}):_.rules.length===0?a.jsxs(Nt,{title:"No matching rules",icon:a.jsx(Gn,{}),children:["No rules in this group match your filter criteria (omitted"," ",_.counts.total," filtered rules).",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>u(!1),children:"Hide empty groups"})]}):a.jsx(Am,{allItems:_.rules,child:({items:T})=>a.jsx(kr,{multiple:!0,variant:"separated",classNames:Aje,children:T.map((C,j)=>a.jsxs(kr.Item,{mt:de(5),value:j.toString(),className:C.counts.firing>0?wh.panelHealthErr:C.counts.pending>0?wh.panelHealthWarn:C.rule.state==="unknown"?wh.panelHealthUnknown:wh.panelHealthOk,children:[a.jsx(kr.Control,{styles:{label:{paddingBlock:de(10)}},children:a.jsxs(ht,{wrap:"nowrap",justify:"space-between",mr:"lg",children:[a.jsx(ut,{children:C.rule.name}),a.jsxs(ht,{gap:"xs",children:[C.counts.firing>0&&a.jsxs(zr,{className:hn.healthErr,children:["firing (",C.counts.firing,")"]}),C.counts.pending>0&&a.jsxs(zr,{className:hn.healthWarn,children:["pending (",C.counts.pending,")"]})]})]})}),a.jsxs(kr.Panel,{children:[a.jsx(QU,{rule:C.rule}),C.rule.alerts.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Vv,{my:"md"}),a.jsx(Am,{allItems:C.rule.alerts,child:({items:A})=>a.jsxs(re,{mt:"lg",children:[a.jsx(re.Thead,{children:a.jsxs(re.Tr,{style:{whiteSpace:"nowrap"},children:[a.jsx(re.Th,{children:"Alert labels"}),a.jsx(re.Th,{children:"State"}),a.jsx(re.Th,{children:"Active Since"}),a.jsx(re.Th,{children:"Value"})]})}),a.jsx(re.Tbody,{children:A.map((E,R)=>a.jsxs(M.Fragment,{children:[a.jsxs(re.Tr,{children:[a.jsx(re.Td,{children:a.jsx(Pm,{labels:E.labels})}),a.jsx(re.Td,{children:a.jsx(zr,{className:E.state==="firing"?hn.healthErr:hn.healthWarn,children:E.state})}),a.jsx(re.Td,{style:{whiteSpace:"nowrap"},children:a.jsx(Xr,{label:E.activeAt,children:a.jsx(ve,{children:Fx(E.activeAt,qx(),"")})})}),a.jsx(re.Td,{style:{whiteSpace:"nowrap"},children:isNaN(Number(E.value))?E.value:Number(E.value)})]}),e&&a.jsx(re.Tr,{children:a.jsx(re.Td,{colSpan:4,children:a.jsx(re,{mt:"md",mb:"xl",children:a.jsx(re.Tbody,{children:Object.entries(E.annotations).map(([N,$])=>a.jsxs(re.Tr,{children:[a.jsx(re.Th,{c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-4))",children:N}),a.jsx(re.Td,{children:$})]},N))})})})})]},R))})]})})]})]})]},j))})})]},`${_.file}-${_.name}`)),[w,e,u]);return a.jsxs(En,{mt:"xs",children:[a.jsxs(ht,{children:[a.jsx(MS,{options:["inactive","pending","firing","unknown"],optionClass:_=>_==="inactive"?hn.healthOk:_==="pending"?hn.healthWarn:_==="firing"?hn.healthErr:hn.healthUnknown,optionCount:_=>m.globalCounts[_],placeholder:"Filter by rule group state",values:(n==null?void 0:n.filter(_=>_!==null))||[],onChange:_=>r(_)}),a.jsx(ec,{flex:1,leftSection:a.jsx(Xh,{style:Mf}),placeholder:"Filter by rule name or labels",value:i||"",onChange:_=>s(_.currentTarget.value||null)})]}),m.groups.length===0?a.jsx(Nt,{title:"No rules found",icon:a.jsx(Gn,{}),children:"No rules found."}):!l&&m.groups.length!==v.length&&a.jsxs(Nt,{title:"Hiding groups with no matching rules",icon:a.jsx(Gn,{}),children:["Hiding ",m.groups.length-v.length," empty groups due to filters or no rules.",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>u(!0),children:"Show empty groups"})]}),a.jsx(ko,{total:b,value:x,onChange:p,hideWithOnePage:!0}),S]})}const Yje="_item_11v54_1",Xje={item:Yje},Gje=new mb({shouldSort:!0,indexedKeys:["name","labels",["labels",/.*/]]}),Kje=(t,e,n)=>({groups:t.groups.map(i=>({...i,prefilterRulesCount:i.rules.length,rules:(e===""?i.rules:Gje.filter(e,i.rules).map(s=>s.original)).filter(s=>n.length===0||n.includes(s.health))}))}),Zje=t=>{switch(t){case"ok":return hn.healthOk;case"err":return hn.healthErr;case"unknown":return hn.healthUnknown;default:throw new Error("Unknown rule health state")}},Jje=[];function e_e(){const{data:t}=bi({path:"/rules"}),[e,n]=bo("health",Wl(RS,Jje)),[r,i]=bo("search",Wl(Hh,"")),[s]=Lv(r.trim(),250),[o,l]=$v({key:"alertsPage.showEmptyGroups",defaultValue:!1}),{ruleGroupsPerPage:u}=ai(),[h,f]=bo("page",Wl(YU,1)),p=M.useMemo(()=>Kje(t.data,s,e),[t,e,s]),m=M.useMemo(()=>o?p.groups:p.groups.filter(S=>S.rules.length>0),[p.groups,o]),v=Math.ceil(m.length/u),b=Math.max(1,Math.min(h,v));M.useEffect(()=>{b!==h&&f(b)},[b,h,f]);const x=M.useMemo(()=>m.slice((b-1)*u,b*u),[m,b,u]),w=M.useMemo(()=>x.map(S=>a.jsxs(Gr,{shadow:"xs",withBorder:!0,p:"md",children:[a.jsxs(ht,{mb:"sm",justify:"space-between",children:[a.jsxs(ht,{align:"baseline",children:[a.jsx(ut,{fz:"xl",fw:600,c:"var(--mantine-primary-color-filled)",children:S.name}),a.jsx(ut,{fz:"sm",c:"gray.6",children:S.file})]}),a.jsxs(ht,{children:[a.jsx(Xr,{label:"Last group evaluation",withArrow:!0,children:a.jsxs(zr,{variant:"light",className:hn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(vC,{style:Jo}),children:["last run ",Fx(S.lastEvaluation,qx())]})}),a.jsx(Xr,{label:"Duration of last group evaluation",withArrow:!0,children:a.jsxs(zr,{variant:"light",className:hn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(gC,{style:Jo}),children:["took ",Pp(parseFloat(S.evaluationTime)*1e3)]})}),a.jsx(Xr,{label:"Group evaluation interval",withArrow:!0,children:a.jsxs(zr,{variant:"transparent",className:hn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(gB,{style:Jo}),children:["every ",Pp(parseFloat(S.interval)*1e3)," "]})})]})]}),S.prefilterRulesCount===0?a.jsxs(Nt,{title:"No rules",icon:a.jsx(Gn,{}),children:["No rules in this group.",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty groups"})]}):S.rules.length===0?a.jsxs(Nt,{title:"No matching rules",icon:a.jsx(Gn,{}),children:["No rules in this group match your filter criteria (omitted"," ",S.prefilterRulesCount," filtered rules).",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty groups"})]}):a.jsx(Am,{allItems:S.rules,child:({items:_})=>a.jsx(kr,{multiple:!0,variant:"separated",classNames:Xje,children:_.map((T,C)=>a.jsxs(kr.Item,{mt:de(5),value:C.toString(),style:{borderLeft:T.health==="err"?"5px solid var(--mantine-color-red-4)":T.health==="unknown"?"5px solid var(--mantine-color-gray-5)":"5px solid var(--mantine-color-green-4)"},children:[a.jsx(kr.Control,{styles:{label:{paddingBlock:de(10)}},children:a.jsxs(ht,{justify:"space-between",mr:"lg",children:[a.jsxs(ht,{gap:"xs",wrap:"nowrap",children:[T.type==="alerting"?a.jsx(Xr,{label:"Alerting rule",withArrow:!0,children:a.jsx(t4,{style:{width:de(15),height:de(15)}})}):a.jsx(Xr,{label:"Recording rule",withArrow:!0,children:a.jsx(fie,{style:{width:de(15),height:de(15)}})}),a.jsx(ut,{children:T.name})]}),a.jsxs(ht,{gap:"xs",children:[a.jsxs(ht,{gap:"xs",wrap:"wrap",children:[a.jsx(Xr,{label:"Last rule evaluation",withArrow:!0,children:a.jsx(zr,{variant:"light",className:hn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(vC,{style:Jo}),children:Fx(T.lastEvaluation,qx())})}),a.jsx(Xr,{label:"Duration of last rule evaluation",withArrow:!0,children:a.jsx(zr,{variant:"light",className:hn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(gC,{style:Jo}),children:Pp(parseFloat(T.evaluationTime)*1e3)})})]}),a.jsx(zr,{className:Zje(T.health),children:T.health})]})]})}),a.jsxs(kr.Panel,{children:[a.jsx(QU,{rule:T}),T.lastError&&a.jsxs(Nt,{color:"red",mt:"sm",title:"Rule failed to evaluate",icon:a.jsx(Ui,{}),children:[a.jsx("strong",{children:"Error:"})," ",T.lastError]})]})]},C))})})]},`${S.file}-${S.name}`)),[x,l]);return a.jsxs(En,{mt:"xs",children:[a.jsxs(ht,{children:[a.jsx(MS,{options:["ok","unknown","err"],optionClass:S=>S==="ok"?hn.healthOk:S==="unknown"?hn.healthWarn:hn.healthErr,placeholder:"Filter by rule health",values:(e==null?void 0:e.filter(S=>S!==null))||[],onChange:S=>n(S)}),a.jsx(ec,{flex:1,leftSection:a.jsx(Xh,{style:Mf}),placeholder:"Filter by rule name or labels",value:r||"",onChange:S=>i(S.currentTarget.value||null)})]}),p.groups.length===0?a.jsx(Nt,{title:"No rules found",icon:a.jsx(Gn,{}),children:"No rules found."}):!o&&p.groups.length!==m.length&&a.jsxs(Nt,{title:"Hiding groups with no matching rules",icon:a.jsx(Gn,{}),children:["Hiding ",p.groups.length-m.length," empty groups due to filters or no rules.",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>l(!0),children:"Show empty groups"})]}),a.jsx(ko,{total:v,value:b,onChange:f,hideWithOnePage:!0}),w]})}const rQ="targetsPage.collapsedPools",t_e={collapsedPools:Ea(rQ,[]),showLimitAlert:!1},iQ=$2({name:"targetsPage",initialState:t_e,reducers:{setCollapsedPools:(t,{payload:e})=>{t.collapsedPools=e},setShowLimitAlert:(t,{payload:e})=>{t.showLimitAlert=e}}}),{setCollapsedPools:rA,setShowLimitAlert:b6}=iQ.actions,n_e=iQ.reducer,y6=({endpoint:t,globalUrl:e})=>{let n,r="",i=!1;try{n=new URL(t)}catch{i=!0,t.indexOf("?")>-1&&(r=t.substring(t.indexOf("?"))),n=new URL("http://0.0.0.0"+r)}const{host:s,pathname:o,protocol:l,searchParams:u}=n,h=Array.from(u.entries()),f=i?t.replace(r,""):`${l}//${s}${o}`;return a.jsxs(En,{gap:0,children:[a.jsx(qr,{size:"sm",href:e,target:"_blank",children:f}),h.length>0&&a.jsx(ht,{gap:"xs",mt:"md",children:h.map(([p,m])=>a.jsx(zr,{size:"sm",variant:"light",color:"gray",style:{textTransform:"none"},children:`${p}="${m}"`},`${p}/${m}`))})]})},r_e=({discoveredLabels:t,labels:e})=>{const[n,{toggle:r}]=Iv(!1);return a.jsxs(En,{children:[a.jsxs(ht,{wrap:"nowrap",align:"flex-start",children:[a.jsx(Pm,{labels:e}),a.jsx(Nr,{size:"xs",color:"gray",variant:"light",onClick:r,title:`${n?"Hide":"Show"} discovered (pre-relabeling) labels`,children:n?a.jsx(n4,{style:nu}):a.jsx(Gg,{style:nu})})]}),a.jsx(Uw,{in:n,children:n&&a.jsxs(a.Fragment,{children:[a.jsx(ut,{fw:700,size:"1em",my:"lg",c:"gray.7",children:"Discovered labels:"}),a.jsx(Pm,{labels:t,style:{color:"var(--mantine-color-blue-light-color)",backgroundColor:"var(--mantine-color-blue-light)"}})]})})]})},i_e=({target:t})=>{const[e,{toggle:n}]=Iv(!1);return a.jsxs(En,{gap:"xs",children:[a.jsxs(ht,{wrap:"nowrap",align:"flex-start",children:[a.jsxs(ht,{gap:"xs",wrap:"wrap",children:[a.jsx(Xr,{label:"Last target scrape",withArrow:!0,children:a.jsx(zr,{variant:"light",className:hn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(vC,{style:Jo}),children:Fx(t.lastScrape,qx())})}),a.jsx(Xr,{label:"Duration of last target scrape",withArrow:!0,children:a.jsx(zr,{variant:"light",className:hn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(gC,{style:Jo}),children:Pp(t.lastScrapeDuration*1e3)})})]}),a.jsx(Nr,{size:"xs",color:"gray",variant:"light",onClick:n,title:`${e?"Hide":"Show"} additional timing info`,children:e?a.jsx(n4,{style:nu}):a.jsx(Gg,{style:nu})})]}),a.jsx(Uw,{in:e,children:e&&a.jsxs(ht,{gap:"xs",wrap:"wrap",children:[a.jsx(Xr,{label:"Scrape interval",withArrow:!0,children:a.jsxs(zr,{variant:"light",className:hn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(gB,{style:Jo}),children:["every ",t.scrapeInterval]})}),a.jsx(Xr,{label:"Scrape timeout",withArrow:!0,children:a.jsxs(zr,{variant:"light",className:hn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(Hre,{style:Jo}),children:["after ",t.scrapeTimeout]})})]})})]})},s_e=t=>t.count>0&&t.downCount===t.count?wh.panelHealthErr:t.downCount>=1?wh.panelHealthWarn:t.unknownCount===t.count?wh.panelHealthUnknown:wh.panelHealthOk,a_e=t=>{switch(t.toLowerCase()){case"up":return hn.healthOk;case"down":return hn.healthErr;case"unknown":return hn.healthUnknown;default:return hn.healthWarn}},o_e=new mb({shouldSort:!0,indexedKeys:["labels","scrapePool",["labels",/.*/]]}),l_e=(t,e,n,r)=>{const i={};for(const o of t)i[o]={targets:[],count:0,upCount:0,downCount:0,unknownCount:0};for(const o of e){if(!i[o.scrapePool])throw new Error("Received target information for an unknown scrape pool, likely the list of scrape pools has changed. Please reload the page.");switch(i[o.scrapePool].count++,o.health.toLowerCase()){case"up":i[o.scrapePool].upCount++;break;case"down":i[o.scrapePool].downCount++;break;case"unknown":i[o.scrapePool].unknownCount++;break}}const s=(n===""?e:o_e.filter(n,e).map(o=>o.original)).filter(o=>r.length===0||r.includes(o.health));for(const o of s)i[o.scrapePool].targets.push(o);return i},c_e=M.memo(({poolNames:t,selectedPool:e,healthFilter:n,searchFilter:r})=>{const{data:{data:{activeTargets:i}}}=bi({path:"/targets",params:{state:"active",scrapePool:e===null?"":e}}),s=ou(),[o,l]=$v({key:"targetsPage.showEmptyPools",defaultValue:!1}),{collapsedPools:u,showLimitAlert:h}=rc(v=>v.targetsPage),f=M.useMemo(()=>l_e(e?[e]:t,i,r,n),[e,t,i,r,n]),p=Object.keys(f),m=o?p:p.filter(v=>f[v].targets.length!==0);return a.jsxs(En,{children:[p.length===0?a.jsx(Nt,{title:"No scrape pools found",icon:a.jsx(Gn,{}),children:"No scrape pools found."}):!o&&p.length!==m.length&&a.jsxs(Nt,{title:"Hiding pools with no matching targets",icon:a.jsx(Gn,{}),children:["Hiding ",p.length-m.length," empty pools due to filters or no targets.",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>l(!0),children:"Show empty pools"})]}),h&&a.jsxs(Nt,{title:"Found many pools, showing only one",icon:a.jsx(Gn,{}),withCloseButton:!0,onClose:()=>s(b6(!1)),children:["There are more than ",sQ," scrape pools. Showing only the first one. Use the dropdown to select a different pool."]}),a.jsx(kr,{multiple:!0,variant:"separated",value:p.filter(v=>!u.includes(v)),onChange:v=>s(rA(p.filter(b=>!v.includes(b)))),children:m.map(v=>{const b=f[v];return a.jsxs(kr.Item,{value:v,className:s_e(b),children:[a.jsx(kr.Control,{children:a.jsxs(ht,{wrap:"nowrap",justify:"space-between",mr:"lg",children:[a.jsx(ut,{children:v}),a.jsxs(ht,{gap:"xs",children:[a.jsxs(ut,{c:"gray.6",children:[b.upCount," / ",b.count," up"]}),a.jsx(T2,{size:25,thickness:5,sections:b.count===0?[]:[{value:b.upCount/b.count*100,color:"green.4"},{value:b.unknownCount/b.count*100,color:"gray.4"},{value:b.downCount/b.count*100,color:"red.5"}]})]})]})}),a.jsx(kr.Panel,{children:b.count===0?a.jsxs(Nt,{title:"No targets",icon:a.jsx(Gn,{}),children:["No active targets in this scrape pool.",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty pools"})]}):b.targets.length===0?a.jsxs(Nt,{title:"No matching targets",icon:a.jsx(Gn,{}),children:["No targets in this pool match your filter criteria (omitted ",b.count," filtered targets).",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty pools"})]}):a.jsx(Am,{allItems:b.targets,child:({items:x})=>a.jsxs(re,{children:[a.jsx(re.Thead,{children:a.jsxs(re.Tr,{children:[a.jsx(re.Th,{w:"25%",children:"Endpoint"}),a.jsx(re.Th,{children:"Labels"}),a.jsx(re.Th,{w:230,children:"Last scrape"}),a.jsx(re.Th,{w:100,children:"State"})]})}),a.jsx(re.Tbody,{children:x.map((w,S)=>a.jsxs(_n.Fragment,{children:[a.jsxs(re.Tr,{style:{borderBottom:w.lastError?"none":void 0},children:[a.jsx(re.Td,{valign:"top",children:a.jsx(y6,{endpoint:w.scrapeUrl,globalUrl:w.globalUrl})}),a.jsx(re.Td,{valign:"top",children:a.jsx(r_e,{labels:w.labels,discoveredLabels:w.discoveredLabels})}),a.jsx(re.Td,{valign:"top",children:a.jsx(i_e,{target:w})}),a.jsx(re.Td,{valign:"top",children:a.jsx(zr,{className:a_e(w.health),children:w.health})})]}),w.lastError&&a.jsx(re.Tr,{children:a.jsx(re.Td,{colSpan:5,valign:"top",children:a.jsxs(Nt,{color:"red",mb:"sm",icon:a.jsx(Ui,{}),children:[a.jsx("strong",{children:"Error scraping target:"})," ",w.lastError]})})})]},S))})]})})})]},v)})})]})}),sQ=20,u_e=[];function h_e(){const{data:{data:{scrapePools:t}}}=bi({path:"/scrape_pools"}),e=ou(),n="Select scrape pool",[r,i]=bo("pool",Hh),[s,o]=M.useState(n),[l,u]=M.useState(!1),[h,f]=bo("health",Wl(RS,u_e)),[p,m]=bo("search",Wl(Hh,"")),[v]=Lv(p.trim(),250),{collapsedPools:b,showLimitAlert:x}=rc(S=>S.targetsPage),w=t.length>sQ&&r===void 0;return w&&(i(t[0]),e(b6(!0))),a.jsxs(a.Fragment,{children:[a.jsxs(ht,{mb:"md",mt:"xs",children:[a.jsx(Qm,{placeholder:s,data:[{label:"All pools",value:""},...t],value:l?null:w&&t[0]||r||null,onChange:S=>{i(S),x&&e(b6(!1))},onDropdownOpen:()=>{o(r||n),u(!0)},onDropdownClose:()=>{o(n),u(!1)},searchable:!0}),a.jsx(MS,{options:["unknown","up","down"],optionClass:S=>S==="unknown"?hn.healthUnknown:S==="up"?hn.healthOk:hn.healthErr,placeholder:"Filter by target health",values:(h==null?void 0:h.filter(S=>S!==null))||[],onChange:S=>f(S)}),a.jsx(ec,{flex:1,leftSection:a.jsx(Xh,{style:Mf}),placeholder:"Filter by endpoint or labels",value:p||"",onChange:S=>m(S.currentTarget.value||null)}),a.jsx(Nr,{size:"input-sm",title:b.length>0?"Expand all pools":"Collapse all pools",variant:"light",onClick:()=>e(rA(b.length>0?[]:t)),children:b.length>0?a.jsx(pB,{style:Cw}):a.jsx(fB,{style:Cw})})]}),a.jsx(yf,{title:"Error showing target pools",children:a.jsx(M.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(10),(S,_)=>a.jsx(xo,{height:40,mb:15,width:1e3,mx:"auto"},_))}),children:a.jsx(c_e,{poolNames:t,selectedPool:w&&t[0]||r||null,healthFilter:h,searchFilter:v})})},location.pathname)]})}const wf=({children:t,title:e,icon:n})=>a.jsxs(Gr,{shadow:"xs",withBorder:!0,p:"md",children:[e&&a.jsxs(ht,{wrap:"nowrap",align:"center",ml:"xs",mb:"sm",gap:"xs",fz:"xl",fw:600,children:[n&&a.jsx(n,{style:F1e}),e]}),t]}),vb=({children:t})=>a.jsx(En,{gap:"lg",maw:1e3,mx:"auto",mt:"xs",children:t});function d_e(){const{data:t}=bi({path:"/status/buildinfo"}),{data:e}=bi({path:"/status/runtimeinfo"}),{useLocalTime:n}=ai(),r={startTime:{title:"Start time",formatValue:i=>sf(new Date(i).valueOf()/1e3,n)},CWD:{title:"Working directory"},hostname:{title:"Hostname"},serverTime:{title:"Server Time",formatValue:i=>sf(new Date(i).valueOf()/1e3,n)},reloadConfigSuccess:{title:"Configuration reload",formatValue:i=>i?"Successful":"Unsuccessful"},lastConfigTime:{title:"Last successful configuration reload",formatValue:i=>sf(new Date(i).valueOf()/1e3,n)},corruptionCount:{title:"WAL corruptions"},goroutineCount:{title:"Goroutines"},storageRetention:{title:"Storage retention"}};return a.jsxs(vb,{children:[a.jsx(wf,{title:"Build information",icon:vie,children:a.jsx(re,{layout:"fixed",children:a.jsx(re.Tbody,{children:Object.entries(t.data).map(([i,s])=>a.jsxs(re.Tr,{children:[a.jsx(re.Th,{style:{textTransform:"capitalize"},children:i}),a.jsx(re.Td,{children:s})]},i))})})}),a.jsx(wf,{title:"Runtime information",icon:Xre,children:a.jsx(re,{layout:"fixed",children:a.jsx(re.Tbody,{children:Object.entries(e.data).map(([i,s])=>{const{title:o=i,formatValue:l=u=>u}=r[i]||{};return a.jsxs(re.Tr,{children:[a.jsx(re.Th,{style:{textTransform:"capitalize"},children:o}),a.jsx(re.Td,{children:l(s)})]},i)})})})})]})}function f_e(){const{data:{data:{headStats:t,labelValueCountByLabelName:e,seriesCountByMetricName:n,memoryInBytesByLabelName:r,seriesCountByLabelValuePair:i}}}=bi({path:"/status/tsdb"}),{useLocalTime:s}=ai(),o=v=>{const b=sf(v,s);return b==="Invalid Date"?u===0?"No datapoints yet":`Error parsing time (${v})`:b},{chunkCount:l,numSeries:u,numLabelPairs:h,minTime:f,maxTime:p}=t,m=[{name:"Number of Series",value:u},{name:"Number of Chunks",value:l},{name:"Number of Label Pairs",value:h},{name:"Current Min Time",value:`${o(f/1e3)}`},{name:"Current Max Time",value:`${o(p/1e3)}`}];return a.jsx(vb,{children:[{title:"TSDB Head Status",stats:m,formatAsCode:!1},{title:"Top 10 label names with value count",stats:e,formatAsCode:!0},{title:"Top 10 series count by metric names",stats:n,formatAsCode:!0},{title:"Top 10 label names with high memory usage",unit:"Bytes",stats:r,formatAsCode:!0},{title:"Top 10 series count by label value pairs",stats:i,formatAsCode:!0}].map(({title:v,unit:b="Count",stats:x,formatAsCode:w})=>a.jsx(wf,{title:v,children:a.jsxs(re,{layout:"fixed",children:[a.jsx(re.Thead,{children:a.jsxs(re.Tr,{children:[a.jsx(re.Th,{children:"Name"}),a.jsx(re.Th,{children:b})]})}),a.jsx(re.Tbody,{children:x.map(({name:S,value:_})=>a.jsxs(re.Tr,{children:[a.jsx(re.Td,{style:{wordBreak:"break-all"},children:w?a.jsx("code",{children:S}):S}),a.jsx(re.Td,{children:_})]},S))})]})}))})}const p_e="_th_1w9xk_1",m_e="_control_1w9xk_5",g_e="_icon_1w9xk_17",GT={th:p_e,control:m_e,icon:g_e};function UL({children:t,reversed:e,sorted:n,onSort:r}){const i=n?e?n4:Gg:Zre;return a.jsx(re.Th,{className:GT.th,children:a.jsx(Dr,{onClick:r,className:GT.control,children:a.jsxs(ht,{justify:"space-between",children:[a.jsx(ut,{fw:600,fz:"sm",children:t}),a.jsx(Wg,{className:GT.icon,children:a.jsx(i,{style:{width:de(16),height:de(16)},stroke:1.5})})]})})})}function QL(t,e){const n=e.toLowerCase().trim();return t.filter(r=>Kr(t[0]).some(i=>r[i].toLowerCase().includes(n)))}function WL(t,e){const{sortBy:n}=e;return QL(n?[...t].sort((r,i)=>e.reversed?i[n].localeCompare(r[n]):r[n].localeCompare(i[n])):t,e.search)}function v_e(){const{data:t}=bi({path:"/status/flags"}),e=Object.entries(t.data).map(([v,b])=>({flag:v,value:b})),[n,r]=M.useState(""),[i,s]=M.useState(e),[o,l]=M.useState(null),[u,h]=M.useState(!1),f=v=>{const b=v===o?!u:!1;h(b),l(v),s(WL(e,{sortBy:v,reversed:b,search:n}))},p=v=>{const{value:b}=v.currentTarget;r(b),s(WL(e,{sortBy:o,reversed:u,search:b}))},m=i.map(v=>a.jsxs(re.Tr,{children:[a.jsx(re.Td,{children:a.jsxs("code",{children:["--",v.flag]})}),a.jsx(re.Td,{children:a.jsx("code",{children:v.value})})]},v.flag));return a.jsx(vb,{children:a.jsxs(wf,{children:[a.jsx(ec,{placeholder:"Filter by flag name or value",mb:"md",autoFocus:!0,leftSection:a.jsx(Xh,{style:Mf}),value:n,onChange:p}),a.jsxs(re,{horizontalSpacing:"md",verticalSpacing:"xs",miw:700,layout:"fixed",children:[a.jsx(re.Tbody,{children:a.jsxs(re.Tr,{children:[a.jsx(UL,{sorted:o==="flag",reversed:u,onSort:()=>f("flag"),children:"Flag"}),a.jsx(UL,{sorted:o==="value",reversed:u,onSort:()=>f("value"),children:"Value"})]})}),a.jsx(re.Tbody,{children:m.length>0?m:a.jsx(re.Tr,{children:a.jsx(re.Td,{colSpan:2,children:a.jsx(ut,{fw:500,ta:"center",children:"Nothing found"})})})})]})]})})}var aQ={root:"m_5cb1b9c8",codeHighlight:"m_e597c321",inlineCodeHighlight:"m_dfe9c588",pre:"m_2c47c4fd",code:"m_5caae6d3",controls:"m_be7e9c9c",control:"m_d498bab7",controlTooltip:"m_4c3d814c",scrollarea:"m_f744fd40",showCodeButton:"m_c9378bc2",file:"m_5cac2e62",fileIcon:"m_b46cddfb",filesScrollarea:"m_7b14120b",files:"m_38d99e51"};const x6={getHighlighter:()=>({code:t})=>({highlightedCode:t,isHighlighted:!1})},[b_e,y_e]=Vh({adapter:x6,highlight:x6.getHighlighter(null)});function x_e({adapter:t,children:e}){const[n,r]=M.useState(null),i=M.useMemo(()=>t.getHighlighter(n),[t,n]);return M.useEffect(()=>{t.loadContext&&t.loadContext().then(r)},[t]),a.jsx(b_e,{value:{adapter:t,highlight:i},children:e})}function w_e(){const t=y_e();return(t==null?void 0:t.highlight)||x6.getHighlighter(null)}const[S_e,j_e]=Wi("CodeHighlightProvider was not found in the component tree"),DS=Yi((t,e)=>{const n=Se("CodeHighlightControl",null,t),{children:r,vars:i,tooltipLabel:s,...o}=n,l=j_e(),u=l.getStyles("controlTooltip"),h=a.jsx(Nr,{ref:e,...l.getStyles("control"),...o,variant:"none","data-code-color-scheme":l.codeColorScheme,children:r});return s?a.jsx(Xr,{label:s,fz:"sm",position:"bottom",classNames:{tooltip:u.className},styles:{tooltip:u.style},"data-code-color-scheme":l.codeColorScheme,transitionProps:{duration:0},children:h}):h});DS.displayName="@mantine/code-highlight/CodeHighlightControl";function oQ({copied:t,...e}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",...e,children:t?a.jsxs(a.Fragment,{children:[a.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),a.jsx("path",{d:"M5 12l5 5l10 -10"})]}):a.jsxs(a.Fragment,{children:[a.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),a.jsx("path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"}),a.jsx("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]})})}oQ.displayName="@mantine/code-highlight/CopyIcon";function lQ({code:t,copyLabel:e="Copy",copiedLabel:n="Copied"}){const r=C7();return a.jsx(DS,{onClick:()=>r.copy(t.trim()),variant:"none",tooltipLabel:r.copied?n:e,"aria-label":r.copied?n:`${e} code`,children:a.jsx(oQ,{copied:r.copied})})}lQ.displayName="@mantine/code-highlight/CopyCodeButton";function cQ({expanded:t,style:e,...n}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",...n,children:t?a.jsxs(a.Fragment,{children:[a.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),a.jsx("path",{d:"M12 13v-8l-3 3m6 0l-3 -3"}),a.jsx("path",{d:"M9 17l1 0"}),a.jsx("path",{d:"M14 17l1 0"}),a.jsx("path",{d:"M19 17l1 0"}),a.jsx("path",{d:"M4 17l1 0"})]}):a.jsxs(a.Fragment,{children:[a.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),a.jsx("path",{d:"M12 11v8l3 -3m-6 0l3 3"}),a.jsx("path",{d:"M9 7l1 0"}),a.jsx("path",{d:"M14 7l1 0"}),a.jsx("path",{d:"M19 7l1 0"}),a.jsx("path",{d:"M4 7l1 0"})]})})}cQ.displayName="@mantine/code-highlight/ExpandIcon";function uQ({expanded:t,onExpand:e,expandCodeLabel:n="Expand code",collapseCodeLabel:r="Collapse code"}){return a.jsx(DS,{onClick:()=>e(!t),tooltipLabel:t?r:n,children:a.jsx(cQ,{expanded:t})})}uQ.displayName="@mantine/code-highlight/ExpandCodeButton";const __e={withCopyButton:!0,expandCodeLabel:"Expand code"},T_e=(t,{maxCollapsedHeight:e,background:n,radius:r})=>({codeHighlight:{"--ch-max-height":de(e),"--ch-background":n?hr(n,t):void 0,"--ch-radius":typeof r<"u"?Zn(r):void 0}}),NS=Ae((t,e)=>{var W,te,oe,be;const n=Se("CodeHighlight",__e,t),{classNames:r,className:i,style:s,styles:o,unstyled:l,vars:u,code:h,copiedLabel:f,copyLabel:p,defaultExpanded:m,expanded:v,onExpandedChange:b,maxCollapsedHeight:x,withCopyButton:w,withExpandButton:S,expandCodeLabel:_,collapseCodeLabel:T,radius:C,background:j,withBorder:A,controls:E,language:R,codeColorScheme:N,__withOffset:$,__inline:D,__staticSelector:F,attributes:Q,...H}=n,q=lt({name:F||"CodeHighlight",classes:aQ,props:n,className:i,style:s,classNames:r,styles:o,unstyled:l,attributes:Q,vars:u,varsResolver:T_e,rootSelector:"codeHighlight"}),[P,I]=Qi({value:v,defaultValue:m,finalValue:!0,onChange:b}),U=E&&E.length>0||S||w,Z=Fw(),V=w_e()({code:h.trim(),language:R,colorScheme:N??Z}),G=V.isHighlighted?{dangerouslySetInnerHTML:{__html:V.highlightedCode}}:{children:h.trim()};return D?a.jsx(ve,{component:"code",ref:e,...H,...V.codeElementProps,...q("codeHighlight",{className:Lr((W=V.codeElementProps)==null?void 0:W.className,i),style:[{...(te=V.codeElementProps)==null?void 0:te.style},s]}),"data-with-border":A||void 0,...G}):a.jsx(S_e,{value:{getStyles:q,codeColorScheme:N},children:a.jsxs(ve,{ref:e,...q("codeHighlight"),...H,dir:"ltr","data-code-color-scheme":N,"data-with-border":A||void 0,children:[U&&a.jsxs("div",{...q("controls"),"data-with-offset":$||void 0,children:[E,S&&a.jsx(uQ,{expanded:P,onExpand:I,expandCodeLabel:_,collapseCodeLabel:T}),w&&a.jsx(lQ,{code:h,copiedLabel:f,copyLabel:p})]}),a.jsx(Fa,{type:"hover",scrollbarSize:4,dir:"ltr",offsetScrollbars:!1,"data-collapsed":!P||void 0,styles:{viewport:{overscrollBehaviorInline:"none"}},...q("scrollarea"),children:a.jsx("pre",{...q("pre"),"data-with-offset":$||void 0,children:a.jsx("code",{...V.codeElementProps,...q("code",{className:(oe=V.codeElementProps)==null?void 0:oe.className,style:(be=V.codeElementProps)==null?void 0:be.style}),...G})})}),a.jsx(Dr,{...q("showCodeButton"),mod:{hidden:P},onClick:()=>I(!0),"data-code-color-scheme":N,children:_})]})})});NS.displayName="@mantine/code-highlight/CodeHighlight";NS.classes=aQ;NS.Control=DS;function C_e(t){return{getHighlighter:()=>({code:e,language:n})=>{const r=t.getLanguage(n)?n:"plaintext";return{highlightedCode:t.highlight(e.trim(),{language:r}).value,isHighlighted:!0,codeElementProps:{className:`hljs ${r}`}}}}}function k_e(){const{data:{data:{yaml:t}}}=bi({path:"/status/config"});return a.jsx(NS,{code:t,language:"yaml",miw:"50vw",w:"fit-content",maw:"calc(100vw - 75px)",mx:"auto",mt:"xs"})}const O_e=()=>a.jsx(vb,{children:a.jsxs(wf,{title:"Prometheus Agent",icon:aie,children:[a.jsxs(ut,{p:"md",children:["This Prometheus instance is running in ",a.jsx("strong",{children:"agent mode"}),". In this mode, Prometheus is only used to scrape discovered targets and forward the scraped metrics to remote write endpoints."]}),a.jsx(ut,{p:"md",children:"Some features are not available in this mode, such as querying and alerting."})]})}),E_e=()=>{const{colorScheme:t,setColorScheme:e}=q7(),n={style:{width:de(20),height:de(20),display:"block"},stroke:1.5};return a.jsx(Nr,{color:"gray",title:`Switch to ${t==="light"?"dark":t==="dark"?"browser-preferred":"light"} theme`,"aria-label":`Switch to ${t==="light"?"dark":t==="dark"?"browser-preferred":"light"} theme`,size:32,onClick:()=>e(t==="light"?"dark":t==="dark"?"auto":"light"),children:t==="light"?a.jsx(Rie,{...n}):t==="dark"?a.jsx(Eie,{...n}):a.jsx(Tie,{...n})})},A_e=()=>{const{useLocalTime:t,enableQueryHistory:e,enableAutocomplete:n,enableSyntaxHighlighting:r,enableLinter:i,showAnnotations:s,showQueryWarnings:o,showQueryInfoNotices:l,ruleGroupsPerPage:u,alertGroupsPerPage:h}=ai(),f=ou();return a.jsxs(Kn,{position:"bottom",withArrow:!0,shadow:"md",children:[a.jsx(Kn.Target,{children:a.jsx(Nr,{color:"gray",title:"Settings","aria-label":"Settings",size:32,children:a.jsx(iie,{style:nu})})}),a.jsx(Kn.Dropdown,{children:a.jsxs(ht,{align:"flex-start",children:[a.jsxs(En,{children:[a.jsx(jp,{p:"md",legend:"Global settings",children:a.jsx(aa,{checked:t,label:"Use local time",onChange:p=>f(ao({useLocalTime:p.currentTarget.checked}))})}),a.jsx(jp,{p:"md",legend:"Query page settings",children:a.jsxs(En,{children:[a.jsx(aa,{checked:e,label:"Enable query history",onChange:p=>f(ao({enableQueryHistory:p.currentTarget.checked}))}),a.jsx(aa,{checked:n,label:"Enable autocomplete",onChange:p=>f(ao({enableAutocomplete:p.currentTarget.checked}))}),a.jsx(aa,{checked:r,label:"Enable syntax highlighting",onChange:p=>f(ao({enableSyntaxHighlighting:p.currentTarget.checked}))}),a.jsx(aa,{checked:i,label:"Enable linter",onChange:p=>f(ao({enableLinter:p.currentTarget.checked}))}),a.jsx(aa,{checked:o,label:"Show query warnings",onChange:p=>f(ao({showQueryWarnings:p.currentTarget.checked}))}),a.jsx(aa,{checked:l,label:"Show query info notices",onChange:p=>f(ao({showQueryInfoNotices:p.currentTarget.checked}))})]})})]}),a.jsxs(En,{children:[a.jsx(jp,{p:"md",legend:"Alerts page settings",children:a.jsxs(En,{children:[a.jsx(aa,{checked:s,label:"Show expanded annotations",onChange:p=>f(ao({showAnnotations:p.currentTarget.checked}))}),a.jsx(Ox,{min:1,allowDecimal:!1,label:"Alert groups per page",value:h,onChange:p=>{typeof p=="number"&&f(ao({alertGroupsPerPage:p}))}})]})}),a.jsx(jp,{p:"md",legend:"Rules page settings",children:a.jsx(Ox,{min:1,allowDecimal:!1,label:"Rule groups per page",value:u,onChange:p=>{typeof p=="number"&&f(ao({ruleGroupsPerPage:p}))}})})]})]})})]})},YL="is starting up...",M_e="is shutting down...",R_e="is not ready...",D_e=()=>{const{pathPrefix:t,agentMode:e}=ai(),n=ou(),[r,i]=M.useState(0),[s,o]=M.useState(""),{data:l}=XB({queryKey:["ready",r],retry:!1,refetchOnWindowFocus:!1,gcTime:0,queryFn:async({signal:p})=>{try{const m=await fetch(`${t}/-/ready`,{cache:"no-store",credentials:"same-origin",signal:p});switch(m.status){case 200:return o(""),!0;case 503:return m.headers.get("X-Prometheus-Stopping")==="true"?o(M_e):o(YL),!1;default:throw new Error(m.statusText)}}catch{throw new Error("Unexpected error while fetching ready status")}}}),u=s===YL,{data:h,isSuccess:f}=bi({path:"/status/walreplay",key:["walreplay",r]});return M.useEffect(()=>{l&&n(ao({ready:l}))},[l,n]),M.useEffect(()=>{const p=setInterval(()=>i(m=>m+1),1e3);return()=>clearInterval(p)},[]),a.jsx(Nt,{color:"yellow",title:"Prometheus "+(e&&"Agent "||"")+(s||R_e),icon:a.jsx(Ui,{}),maw:500,mx:"auto",mt:"lg",children:u&&f&&h&&a.jsxs(En,{children:[a.jsxs("strong",{children:["Replaying WAL (",h.data.current,"/",h.data.max,")"]}),a.jsx(Um,{size:"xl",animated:!0,color:"yellow",value:(h.data.current-h.data.min+1)/(h.data.max-h.data.min+1)*100})]})})},A1=({children:t})=>{const{ready:e}=ai();return e?a.jsx(a.Fragment,{children:t}):a.jsx(D_e,{})},N_e={notifications:[],isConnectionError:!1},hQ=M.createContext(N_e),P_e=()=>M.useContext(hQ);async function L_e(t,e){const n=t.getReader();let r;for(;!(r=await n.read()).done;)e(r.value)}function $_e(t){let e,n,r,i=!1;return function(o){e===void 0?(e=o,n=0,r=-1):e=B_e(e,o);const l=e.length;let u=0;for(;n<l;){i&&(e[n]===10&&(u=++n),i=!1);let h=-1;for(;n<l&&h===-1;++n)switch(e[n]){case 58:r===-1&&(r=n-u);break;case 13:i=!0;case 10:h=n;break}if(h===-1)break;t(e.subarray(u,h),r),u=n,r=-1}u===l?e=void 0:u!==0&&(e=e.subarray(u),n-=u)}}function I_e(t,e,n){let r=XL();const i=new TextDecoder;return function(o,l){if(o.length===0)n==null||n(r),r=XL();else if(l>0){const u=i.decode(o.subarray(0,l)),h=l+(o[l+1]===32?2:1),f=i.decode(o.subarray(h));switch(u){case"data":r.data=r.data?r.data+`
`+f:f;break;case"event":r.event=f;break;case"id":t(r.id=f);break;case"retry":const p=parseInt(f,10);isNaN(p)||e(r.retry=p);break}}}}function B_e(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function XL(){return{data:"",event:"",id:"",retry:void 0}}var z_e=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const w6="text/event-stream",q_e=1e3,GL="last-event-id";function F_e(t,e){var{signal:n,headers:r,onopen:i,onmessage:s,onclose:o,onerror:l,openWhenHidden:u,fetch:h}=e,f=z_e(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((p,m)=>{const v=Object.assign({},r);v.accept||(v.accept=w6);let b;function x(){b.abort(),document.hidden||j()}u||document.addEventListener("visibilitychange",x);let w=q_e,S=0;function _(){document.removeEventListener("visibilitychange",x),window.clearTimeout(S),b.abort()}n==null||n.addEventListener("abort",()=>{_(),p()});const T=h??window.fetch,C=i??H_e;async function j(){var A;b=new AbortController;try{const E=await T(t,Object.assign(Object.assign({},f),{headers:v,signal:b.signal}));await C(E),await L_e(E.body,$_e(I_e(R=>{R?v[GL]=R:delete v[GL]},R=>{w=R},s))),o==null||o(),_(),p()}catch(E){if(!b.signal.aborted)try{const R=(A=l==null?void 0:l(E))!==null&&A!==void 0?A:w;window.clearTimeout(S),S=window.setTimeout(j,R)}catch(R){_(),m(R)}}}j()})}function H_e(t){const e=t.headers.get("content-type");if(!(e!=null&&e.startsWith(w6)))throw new Error(`Expected content-type to be ${w6}, Actual: ${e}`)}const V_e=({children:t})=>{const{pathPrefix:e}=ai(),[n,r]=M.useState([]),[i,s]=M.useState(!1),[o,l]=M.useState(!1),{data:u,isError:h}=Ih({path:"/notifications",enabled:o,refetchInterval:1e4});return M.useEffect(()=>{u&&u.data&&r(u.data),s(h)},[u,h]),M.useEffect(()=>{const f=new AbortController;return F_e(`${e}/api/v1/notifications/live`,{signal:f.signal,async onopen(p){if(p.ok)p.status===200?(r([]),s(!1)):p.status===204&&(f.abort(),l(!0));else throw s(!0),new Error(`Unexpected response: ${p.status} ${p.statusText}`)},onmessage(p){const m=JSON.parse(p.data);r(v=>{const b=[...v.filter(x=>x.text!==m.text)];return m.active&&b.push(m),b})},onclose(){throw new Error("Server closed the connection")},onerror(){return s(!0),5e3}}),()=>{f.abort()}},[e]),a.jsx(hQ.Provider,{value:{notifications:n,isConnectionError:i},children:t})},U_e=()=>{const{notifications:t,isConnectionError:e}=P_e(),{useLocalTime:n}=ai();return t.length===0&&!e?null:a.jsx(OO,{color:"red",size:16,label:e?"!":t.length,children:a.jsxs(Kn,{position:"bottom-end",shadow:"md",withArrow:!0,children:[a.jsx(Kn.Target,{children:a.jsx(Nr,{color:"gray",title:"Notifications","aria-label":"Notifications",size:32,children:a.jsx($re,{style:nu})})}),a.jsx(Kn.Dropdown,{children:a.jsxs(En,{gap:"xs",children:[a.jsx(ut,{fw:700,size:"xs",c:"dimmed",ta:"center",children:"Notifications"}),a.jsx(Fa.Autosize,{mah:200,children:e?a.jsx(Gr,{p:"xs",color:"red",children:a.jsxs(ht,{wrap:"nowrap",children:[a.jsx(qre,{color:"red",style:{width:de(20),height:de(20)}}),a.jsxs(En,{gap:"0",children:[a.jsx(ut,{size:"sm",fw:500,children:"Real-time notifications interrupted."}),a.jsx(ut,{size:"xs",c:"dimmed",children:"Please refresh the page or check your connection."})]})]})}):t.length===0?a.jsx(ut,{ta:"center",c:"dimmed",children:"No notifications"}):t.map((r,i)=>a.jsx(Gr,{p:"xs",children:a.jsxs(ht,{wrap:"nowrap",align:"flex-start",children:[a.jsx(Ui,{color:"red",style:{width:de(20),height:de(20),marginTop:de(3)}}),a.jsxs(En,{maw:250,gap:5,children:[a.jsx(ut,{size:"sm",fw:500,children:r.text}),a.jsx(ut,{size:"xs",c:"dimmed",children:sf(new Date(r.date).valueOf()/1e3,n)})]})]})},i))})]})})]})})},Q_e=({children:t})=>{var e;const{navigator:n}=M.useContext(ma),r=o4(),i=(e=M.useContext(Cf))==null?void 0:e.router,s=nc();return t({replace(l){r(l.search||"?",{replace:!0,state:l.state})},push(l){r(l.search||"?",{replace:!1,state:l.state})},get location(){var l,u,h;return(h=(u=(l=i==null?void 0:i.state)==null?void 0:l.location)!=null?u:n==null?void 0:n.location)!=null?h:s}})},dQ="serviceDiscovery.collapsedPools",W_e={collapsedPools:Ea(dQ,[]),showLimitAlert:!1},fQ=$2({name:"serviceDiscoveryPage",initialState:W_e,reducers:{setCollapsedPools:(t,{payload:e})=>{t.collapsedPools=e},setShowLimitAlert:(t,{payload:e})=>{t.showLimitAlert=e}}}),{setCollapsedPools:iA,setShowLimitAlert:S6}=fQ.actions,Y_e=fQ.reducer,Hd={width:As(18),height:As(18),verticalAlign:"middle"},X_e=(t,e)=>a.jsxs(re,{w:"60%",withTableBorder:!0,withColumnBorders:!0,bg:"light-dark(var(--mantine-color-gray-0), var(--mantine-color-gray-8))",children:[a.jsx(re.Thead,{children:a.jsx(re.Tr,{bg:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-gray-7))",children:a.jsx(re.Th,{colSpan:2,children:a.jsxs(ht,{gap:"xs",children:[a.jsx(vB,{style:Hd})," Rule ",e+1]})})})}),a.jsx(re.Tbody,{children:Object.entries(t).sort(([n],[r])=>{const i=["action","source_labels","regex","modulus","replacement","target_label"],s=i.indexOf(n),o=i.indexOf(r);return s===-1&&o===-1?n.localeCompare(r):s===-1?1:o===-1?-1:s-o}).map(([n,r])=>a.jsxs(re.Tr,{children:[a.jsx(re.Th,{children:a.jsx("code",{children:n})}),a.jsx(re.Td,{children:a.jsx("code",{children:typeof r=="object"?JSON.stringify(r):String(r)})})]},n))})]}),KL=(t,e)=>t===null?a.jsx(ut,{c:"dimmed",children:"dropped"}):a.jsxs(re,{w:"50%",withTableBorder:!0,children:[a.jsx(re.Thead,{children:a.jsx(re.Tr,{bg:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-gray-7))",children:a.jsx(re.Th,{colSpan:3,children:a.jsxs(ht,{gap:"xs",children:[a.jsx(cie,{style:Hd})," Labels"]})})})}),a.jsx(re.Tbody,{children:Object.entries(t).concat(e?Object.entries(e).filter(([n])=>t[n]===void 0):[]).sort(([n],[r])=>n.localeCompare(r)).map(([n,r])=>{const i=e!==null&&e[n]===void 0,s=e!==null&&!i&&e[n]!==r,o=e!==null&&!s&&e[n]!==void 0&&t[n]===void 0;return a.jsxs(re.Tr,{bg:i?"light-dark(var(--mantine-color-green-1), var(--mantine-color-green-8))":s?"light-dark(var(--mantine-color-blue-1), var(--mantine-color-blue-8))":o?"light-dark(var(--mantine-color-red-1), var(--mantine-color-red-8))":void 0,children:[a.jsx(re.Td,{w:40,children:i?a.jsx(dre,{style:Hd}):s?a.jsx(vB,{style:Hd}):o?a.jsx(ure,{style:Hd}):null}),a.jsx(re.Th,{children:a.jsx("code",{children:n})}),a.jsx(re.Td,{children:a.jsx("code",{children:r})})]},n)})})]}),G_e=({labels:t,pool:e})=>{const{data:n}=bi({path:"/targets/relabel_steps",params:{labels:JSON.stringify(t),scrapePool:e}});return a.jsxs(En,{align:"center",children:[KL(t,null),n.data.steps.map((r,i)=>a.jsxs(_n.Fragment,{children:[a.jsx(yR,{style:Hd}),X_e(r.rule,i),a.jsx(yR,{style:Hd}),r.keep?KL(r.output,i===0?t:n.data.steps[i-1].output):a.jsx(ut,{c:"dimmed",children:"dropped"})]},i))]})},K_e=new mb({shouldSort:!0,indexedKeys:["labels","discoveredLabels",["discoveredLabels",/.*/],["labels",/.*/]]}),Z_e=new mb({shouldSort:!0,indexedKeys:["discoveredLabels",["discoveredLabels",/.*/]]}),J_e=(t,e,n,r)=>{const{activeTargets:i,droppedTargets:s,droppedTargetCounts:o}=e,l={};for(const f of t)l[f]={targets:[],active:0,total:0,serverTotal:o[f]||0};for(const f of i){const p=l[f.scrapePool];if(!p)throw new Error("Received target information for an unknown scrape pool, likely the list of scrape pools has changed. Please reload the page.");p.active++,p.total++,p.serverTotal++}const u=r.length!==0&&!r.includes("active")?[]:n===""?i:K_e.filter(n,i).map(f=>f.original);for(const f of u)l[f.scrapePool].targets.push({discoveredLabels:f.discoveredLabels,labels:f.labels,isDropped:!1});for(const f of s){const p=l[f.scrapePool];if(!p)throw new Error("Received target information for an unknown scrape pool, likely the list of scrape pools has changed. Please reload the page.");p.total++}const h=r.length!==0&&!r.includes("dropped")?[]:n===""?s:Z_e.filter(n,s).map(f=>f.original);for(const f of h)l[f.scrapePool].targets.push({discoveredLabels:f.discoveredLabels,isDropped:!0,labels:{}});return l},e3e=({poolNames:t,selectedPool:e,stateFilter:n,searchFilter:r})=>{const i=ou(),[s,o]=$v({key:"serviceDiscoveryPage.showEmptyPools",defaultValue:!1}),[l,u]=M.useState(null),{data:{data:h}}=bi({path:"/targets",params:{scrapePool:e===null?"":e}}),{collapsedPools:f,showLimitAlert:p}=rc(w=>w.serviceDiscoveryPage),[m]=Lv(r,250),v=M.useMemo(()=>J_e(e?[e]:t,h,m,n),[e,t,h,m,n]),b=Object.keys(v),x=s?b:b.filter(w=>v[w].targets.length!==0);return a.jsxs(En,{children:[b.length===0?a.jsx(Nt,{title:"No scrape pools found",icon:a.jsx(Gn,{}),children:"No scrape pools found."}):!s&&b.length!==x.length&&a.jsxs(Nt,{title:"Hiding pools with no matching targets",icon:a.jsx(Gn,{}),children:["Hiding ",b.length-x.length," empty pools due to filters or no targets.",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>o(!0),children:"Show empty pools"})]}),p&&a.jsxs(Nt,{title:"Found many pools, showing only one",icon:a.jsx(Gn,{}),withCloseButton:!0,onClose:()=>i(S6(!1)),children:["There are more than ",pQ," scrape pools. Showing only the first one. Use the dropdown to select a different pool."]}),a.jsx(kr,{multiple:!0,variant:"separated",value:b.filter(w=>!f.includes(w)),onChange:w=>i(iA(b.filter(S=>!w.includes(S)))),children:x.map(w=>{const S=v[w];return a.jsxs(kr.Item,{value:w,children:[a.jsx(kr.Control,{children:a.jsxs(ht,{wrap:"nowrap",justify:"space-between",mr:"lg",children:[a.jsx(ut,{children:w}),a.jsxs(ht,{gap:"xs",children:[a.jsxs(ut,{c:"gray.6",children:[S.active," / ",S.serverTotal]}),a.jsx(T2,{size:25,thickness:5,sections:S.serverTotal===0?[]:[{value:S.active/S.serverTotal*100,color:"green.4"},{value:(S.serverTotal-S.active)/S.serverTotal*100,color:"blue.6"}]})]})]})}),a.jsxs(kr.Panel,{children:[S.total!==S.serverTotal&&a.jsxs(Nt,{title:"Only showing partial dropped targets",icon:a.jsx(Gn,{}),color:"yellow",mb:"sm",children:[S.serverTotal-S.total," further dropped targets are not shown here because the server only kept details on a maximum of ",S.total-S.active," dropped targets (",a.jsx("code",{children:"keep_dropped_targets"})," configuration setting)."]}),S.total===0?a.jsxs(Nt,{title:"No targets",icon:a.jsx(Gn,{}),children:["No targets in this scrape pool.",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>o(!1),children:"Hide empty pools"})]}):S.targets.length===0?a.jsxs(Nt,{title:"No matching targets",icon:a.jsx(Gn,{}),children:["No targets in this pool match your filter criteria (omitted"," ",S.total," filtered targets).",a.jsx(qr,{ml:"md",fz:"1em",onClick:()=>o(!1),children:"Hide empty pools"})]}):a.jsx(Am,{allItems:S.targets,child:({items:_})=>a.jsxs(re,{children:[a.jsx(re.Thead,{children:a.jsxs(re.Tr,{children:[a.jsx(re.Th,{w:"50%",children:"Discovered labels"}),a.jsx(re.Th,{w:"50%",children:"Target labels"})]})}),a.jsx(re.Tbody,{children:_.map((T,C)=>a.jsxs(re.Tr,{children:[a.jsx(re.Td,{py:"lg",valign:"top",children:a.jsx(Pm,{labels:T.discoveredLabels,wrapper:En})}),a.jsx(re.Td,{py:"lg",valign:T.isDropped?"middle":"top",children:a.jsxs(En,{children:[T.isDropped?a.jsx(ut,{c:"dimmed",fw:"bold",children:"dropped"}):a.jsx(Pm,{labels:T.labels,wrapper:En}),a.jsx(qr,{inherit:!0,onClick:()=>{u({labels:T.discoveredLabels,pool:w})},children:"show relabeling"})]})})]},C))})]})})]})]},w)})}),a.jsx(Va,{size:"95%",opened:l!==null,onClose:()=>u(null),title:"Relabeling steps for target",children:a.jsx(yf,{title:"Error showing relabeling steps",children:a.jsx(M.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(20),(w,S)=>a.jsx(xo,{height:30,mb:15,width:"100%"},S))}),children:a.jsx(G_e,{pool:(l==null?void 0:l.pool)||"",labels:(l==null?void 0:l.labels)||{}})})},location.pathname)})]})},pQ=20;function t3e(){const{data:{data:{scrapePools:t}}}=bi({path:"/scrape_pools"}),e=ou(),[n,r]=bo("pool",Hh),[i,s]=bo("state",Wl(RS,[])),[o,l]=bo("search",Wl(Hh,"")),{collapsedPools:u,showLimitAlert:h}=rc(p=>p.serviceDiscoveryPage),f=t.length>pQ&&n===void 0;return f&&(r(t[0]),e(S6(!0))),a.jsxs(a.Fragment,{children:[a.jsxs(ht,{mb:"md",mt:"xs",children:[a.jsx(Qm,{placeholder:"Select scrape pool",data:[{label:"All pools",value:""},...t],value:f&&t[0]||n||null,onChange:p=>{r(p),h&&e(S6(!1))},searchable:!0}),a.jsx(MS,{options:["active","dropped"],optionClass:p=>p==="active"?hn.healthOk:hn.healthInfo,placeholder:"Filter by state",values:(i==null?void 0:i.filter(p=>p!==null))||[],onChange:p=>s(p)}),a.jsx(ec,{flex:1,leftSection:a.jsx(Xh,{style:Mf}),placeholder:"Filter by labels",value:o||"",onChange:p=>l(p.currentTarget.value)}),a.jsx(Nr,{size:"input-sm",title:u.length>0?"Expand all pools":"Collapse all pools",variant:"light",onClick:()=>e(iA(u.length>0?[]:t)),children:u.length>0?a.jsx(pB,{style:Cw}):a.jsx(fB,{style:Cw})})]}),a.jsx(yf,{title:"Error showing target pools",children:a.jsx(M.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(10),(p,m)=>a.jsx(xo,{height:40,mb:15,width:1e3,mx:"auto"},m))}),children:a.jsx(e3e,{poolNames:t,selectedPool:f&&t[0]||n||null,stateFilter:i,searchFilter:o})})},location.pathname)]})}function n3e(){const{data:{data:{activeAlertmanagers:t,droppedAlertmanagers:e}}}=bi({path:"/alertmanagers"});return a.jsxs(vb,{children:[a.jsx(wf,{title:"Active Alertmanagers",icon:t4,children:t.length===0?a.jsx(Nt,{title:"No active alertmanagers",icon:a.jsx(Gn,{}),children:"No active alertmanagers found."}):a.jsx(re,{layout:"fixed",children:a.jsx(re.Tbody,{children:t.map(n=>a.jsx(re.Tr,{children:a.jsx(re.Td,{children:a.jsx(y6,{endpoint:n.url,globalUrl:n.url})})},n.url))})})}),a.jsx(wf,{title:"Dropped Alertmanagers",icon:Xne,children:e.length===0?a.jsx(Nt,{title:"No dropped alertmanagers",icon:a.jsx(Gn,{}),children:"No dropped alertmanagers found."}):a.jsx(re,{layout:"fixed",children:a.jsx(re.Tbody,{children:e.map(n=>a.jsx(re.Tr,{children:a.jsx(re.Td,{children:a.jsx(y6,{endpoint:n.url,globalUrl:n.url})})},n.url))})})})]})}var KT,ZL;function r3e(){if(ZL)return KT;ZL=1;function t(ie){return ie instanceof Map?ie.clear=ie.delete=ie.set=function(){throw new Error("map is read-only")}:ie instanceof Set&&(ie.add=ie.clear=ie.delete=function(){throw new Error("set is read-only")}),Object.freeze(ie),Object.getOwnPropertyNames(ie).forEach(Oe=>{const nt=ie[Oe],Et=typeof nt;(Et==="object"||Et==="function")&&!Object.isFrozen(nt)&&t(nt)}),ie}class e{constructor(Oe){Oe.data===void 0&&(Oe.data={}),this.data=Oe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(ie){return ie.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r(ie,...Oe){const nt=Object.create(null);for(const Et in ie)nt[Et]=ie[Et];return Oe.forEach(function(Et){for(const Mn in Et)nt[Mn]=Et[Mn]}),nt}const i="</span>",s=ie=>!!ie.scope,o=(ie,{prefix:Oe})=>{if(ie.startsWith("language:"))return ie.replace("language:","language-");if(ie.includes(".")){const nt=ie.split(".");return[`${Oe}${nt.shift()}`,...nt.map((Et,Mn)=>`${Et}${"_".repeat(Mn+1)}`)].join(" ")}return`${Oe}${ie}`};class l{constructor(Oe,nt){this.buffer="",this.classPrefix=nt.classPrefix,Oe.walk(this)}addText(Oe){this.buffer+=n(Oe)}openNode(Oe){if(!s(Oe))return;const nt=o(Oe.scope,{prefix:this.classPrefix});this.span(nt)}closeNode(Oe){s(Oe)&&(this.buffer+=i)}value(){return this.buffer}span(Oe){this.buffer+=`<span class="${Oe}">`}}const u=(ie={})=>{const Oe={children:[]};return Object.assign(Oe,ie),Oe};class h{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Oe){this.top.children.push(Oe)}openNode(Oe){const nt=u({scope:Oe});this.add(nt),this.stack.push(nt)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Oe){return this.constructor._walk(Oe,this.rootNode)}static _walk(Oe,nt){return typeof nt=="string"?Oe.addText(nt):nt.children&&(Oe.openNode(nt),nt.children.forEach(Et=>this._walk(Oe,Et)),Oe.closeNode(nt)),Oe}static _collapse(Oe){typeof Oe!="string"&&Oe.children&&(Oe.children.every(nt=>typeof nt=="string")?Oe.children=[Oe.children.join("")]:Oe.children.forEach(nt=>{h._collapse(nt)}))}}class f extends h{constructor(Oe){super(),this.options=Oe}addText(Oe){Oe!==""&&this.add(Oe)}startScope(Oe){this.openNode(Oe)}endScope(){this.closeNode()}__addSublanguage(Oe,nt){const Et=Oe.root;nt&&(Et.scope=`language:${nt}`),this.add(Et)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(ie){return ie?typeof ie=="string"?ie:ie.source:null}function m(ie){return x("(?=",ie,")")}function v(ie){return x("(?:",ie,")*")}function b(ie){return x("(?:",ie,")?")}function x(...ie){return ie.map(nt=>p(nt)).join("")}function w(ie){const Oe=ie[ie.length-1];return typeof Oe=="object"&&Oe.constructor===Object?(ie.splice(ie.length-1,1),Oe):{}}function S(...ie){return"("+(w(ie).capture?"":"?:")+ie.map(Et=>p(Et)).join("|")+")"}function _(ie){return new RegExp(ie.toString()+"|").exec("").length-1}function T(ie,Oe){const nt=ie&&ie.exec(Oe);return nt&&nt.index===0}const C=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function j(ie,{joinWith:Oe}){let nt=0;return ie.map(Et=>{nt+=1;const Mn=nt;let rn=p(Et),rt="";for(;rn.length>0;){const st=C.exec(rn);if(!st){rt+=rn;break}rt+=rn.substring(0,st.index),rn=rn.substring(st.index+st[0].length),st[0][0]==="\\"&&st[1]?rt+="\\"+String(Number(st[1])+Mn):(rt+=st[0],st[0]==="("&&nt++)}return rt}).map(Et=>`(${Et})`).join(Oe)}const A=/\b\B/,E="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",N="\\b\\d+(\\.\\d+)?",$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",D="\\b(0b[01]+)",F="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Q=(ie={})=>{const Oe=/^#![ ]*\//;return ie.binary&&(ie.begin=x(Oe,/.*\b/,ie.binary,/\b.*/)),r({scope:"meta",begin:Oe,end:/$/,relevance:0,"on:begin":(nt,Et)=>{nt.index!==0&&Et.ignoreMatch()}},ie)},H={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[H]},P={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[H]},I={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},U=function(ie,Oe,nt={}){const Et=r({scope:"comment",begin:ie,end:Oe,contains:[]},nt);Et.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Mn=S("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Et.contains.push({begin:x(/[ ]+/,"(",Mn,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Et},Z=U("//","$"),X=U("/\\*","\\*/"),V=U("#","$"),G={scope:"number",begin:N,relevance:0},W={scope:"number",begin:$,relevance:0},te={scope:"number",begin:D,relevance:0},oe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[H,{begin:/\[/,end:/\]/,relevance:0,contains:[H]}]},be={scope:"title",begin:E,relevance:0},ye={scope:"title",begin:R,relevance:0},Ke={begin:"\\.\\s*"+R,relevance:0};var Pe=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:H,BINARY_NUMBER_MODE:te,BINARY_NUMBER_RE:D,COMMENT:U,C_BLOCK_COMMENT_MODE:X,C_LINE_COMMENT_MODE:Z,C_NUMBER_MODE:W,C_NUMBER_RE:$,END_SAME_AS_BEGIN:function(ie){return Object.assign(ie,{"on:begin":(Oe,nt)=>{nt.data._beginMatch=Oe[1]},"on:end":(Oe,nt)=>{nt.data._beginMatch!==Oe[1]&&nt.ignoreMatch()}})},HASH_COMMENT_MODE:V,IDENT_RE:E,MATCH_NOTHING_RE:A,METHOD_GUARD:Ke,NUMBER_MODE:G,NUMBER_RE:N,PHRASAL_WORDS_MODE:I,QUOTE_STRING_MODE:P,REGEXP_MODE:oe,RE_STARTERS_RE:F,SHEBANG:Q,TITLE_MODE:be,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:ye});function ae(ie,Oe){ie.input[ie.index-1]==="."&&Oe.ignoreMatch()}function Te(ie,Oe){ie.className!==void 0&&(ie.scope=ie.className,delete ie.className)}function fe(ie,Oe){Oe&&ie.beginKeywords&&(ie.begin="\\b("+ie.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",ie.__beforeBegin=ae,ie.keywords=ie.keywords||ie.beginKeywords,delete ie.beginKeywords,ie.relevance===void 0&&(ie.relevance=0))}function Ee(ie,Oe){Array.isArray(ie.illegal)&&(ie.illegal=S(...ie.illegal))}function gt(ie,Oe){if(ie.match){if(ie.begin||ie.end)throw new Error("begin & end are not supported with match");ie.begin=ie.match,delete ie.match}}function We(ie,Oe){ie.relevance===void 0&&(ie.relevance=1)}const Be=(ie,Oe)=>{if(!ie.beforeMatch)return;if(ie.starts)throw new Error("beforeMatch cannot be used with starts");const nt=Object.assign({},ie);Object.keys(ie).forEach(Et=>{delete ie[Et]}),ie.keywords=nt.keywords,ie.begin=x(nt.beforeMatch,m(nt.begin)),ie.starts={relevance:0,contains:[Object.assign(nt,{endsParent:!0})]},ie.relevance=0,delete nt.beforeMatch},ze=["of","and","for","in","not","or","if","then","parent","list","value"],De="keyword";function Ye(ie,Oe,nt=De){const Et=Object.create(null);return typeof ie=="string"?Mn(nt,ie.split(" ")):Array.isArray(ie)?Mn(nt,ie):Object.keys(ie).forEach(function(rn){Object.assign(Et,Ye(ie[rn],Oe,rn))}),Et;function Mn(rn,rt){Oe&&(rt=rt.map(st=>st.toLowerCase())),rt.forEach(function(st){const Ze=st.split("|");Et[Ze[0]]=[rn,$t(Ze[0],Ze[1])]})}}function $t(ie,Oe){return Oe?Number(Oe):tt(ie)?0:1}function tt(ie){return ze.includes(ie.toLowerCase())}const et={},Ve=ie=>{console.error(ie)},Le=(ie,...Oe)=>{console.log(`WARN: ${ie}`,...Oe)},Ce=(ie,Oe)=>{et[`${ie}/${Oe}`]||(console.log(`Deprecated as of ${ie}. ${Oe}`),et[`${ie}/${Oe}`]=!0)},ge=new Error;function Kt(ie,Oe,{key:nt}){let Et=0;const Mn=ie[nt],rn={},rt={};for(let st=1;st<=Oe.length;st++)rt[st+Et]=Mn[st],rn[st+Et]=!0,Et+=_(Oe[st-1]);ie[nt]=rt,ie[nt]._emit=rn,ie[nt]._multi=!0}function qn(ie){if(Array.isArray(ie.begin)){if(ie.skip||ie.excludeBegin||ie.returnBegin)throw Ve("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ge;if(typeof ie.beginScope!="object"||ie.beginScope===null)throw Ve("beginScope must be object"),ge;Kt(ie,ie.begin,{key:"beginScope"}),ie.begin=j(ie.begin,{joinWith:""})}}function Ft(ie){if(Array.isArray(ie.end)){if(ie.skip||ie.excludeEnd||ie.returnEnd)throw Ve("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ge;if(typeof ie.endScope!="object"||ie.endScope===null)throw Ve("endScope must be object"),ge;Kt(ie,ie.end,{key:"endScope"}),ie.end=j(ie.end,{joinWith:""})}}function xn(ie){ie.scope&&typeof ie.scope=="object"&&ie.scope!==null&&(ie.beginScope=ie.scope,delete ie.scope)}function Zt(ie){xn(ie),typeof ie.beginScope=="string"&&(ie.beginScope={_wrap:ie.beginScope}),typeof ie.endScope=="string"&&(ie.endScope={_wrap:ie.endScope}),qn(ie),Ft(ie)}function ln(ie){function Oe(rt,st){return new RegExp(p(rt),"m"+(ie.case_insensitive?"i":"")+(ie.unicodeRegex?"u":"")+(st?"g":""))}class nt{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(st,Ze){Ze.position=this.position++,this.matchIndexes[this.matchAt]=Ze,this.regexes.push([Ze,st]),this.matchAt+=_(st)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const st=this.regexes.map(Ze=>Ze[1]);this.matcherRe=Oe(j(st,{joinWith:"|"}),!0),this.lastIndex=0}exec(st){this.matcherRe.lastIndex=this.lastIndex;const Ze=this.matcherRe.exec(st);if(!Ze)return null;const Ht=Ze.findIndex((xi,ds)=>ds>0&&xi!==void 0),Yt=this.matchIndexes[Ht];return Ze.splice(0,Ht),Object.assign(Ze,Yt)}}class Et{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(st){if(this.multiRegexes[st])return this.multiRegexes[st];const Ze=new nt;return this.rules.slice(st).forEach(([Ht,Yt])=>Ze.addRule(Ht,Yt)),Ze.compile(),this.multiRegexes[st]=Ze,Ze}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(st,Ze){this.rules.push([st,Ze]),Ze.type==="begin"&&this.count++}exec(st){const Ze=this.getMatcher(this.regexIndex);Ze.lastIndex=this.lastIndex;let Ht=Ze.exec(st);if(this.resumingScanAtSamePosition()&&!(Ht&&Ht.index===this.lastIndex)){const Yt=this.getMatcher(0);Yt.lastIndex=this.lastIndex+1,Ht=Yt.exec(st)}return Ht&&(this.regexIndex+=Ht.position+1,this.regexIndex===this.count&&this.considerAll()),Ht}}function Mn(rt){const st=new Et;return rt.contains.forEach(Ze=>st.addRule(Ze.begin,{rule:Ze,type:"begin"})),rt.terminatorEnd&&st.addRule(rt.terminatorEnd,{type:"end"}),rt.illegal&&st.addRule(rt.illegal,{type:"illegal"}),st}function rn(rt,st){const Ze=rt;if(rt.isCompiled)return Ze;[Te,gt,Zt,Be].forEach(Yt=>Yt(rt,st)),ie.compilerExtensions.forEach(Yt=>Yt(rt,st)),rt.__beforeBegin=null,[fe,Ee,We].forEach(Yt=>Yt(rt,st)),rt.isCompiled=!0;let Ht=null;return typeof rt.keywords=="object"&&rt.keywords.$pattern&&(rt.keywords=Object.assign({},rt.keywords),Ht=rt.keywords.$pattern,delete rt.keywords.$pattern),Ht=Ht||/\w+/,rt.keywords&&(rt.keywords=Ye(rt.keywords,ie.case_insensitive)),Ze.keywordPatternRe=Oe(Ht,!0),st&&(rt.begin||(rt.begin=/\B|\b/),Ze.beginRe=Oe(Ze.begin),!rt.end&&!rt.endsWithParent&&(rt.end=/\B|\b/),rt.end&&(Ze.endRe=Oe(Ze.end)),Ze.terminatorEnd=p(Ze.end)||"",rt.endsWithParent&&st.terminatorEnd&&(Ze.terminatorEnd+=(rt.end?"|":"")+st.terminatorEnd)),rt.illegal&&(Ze.illegalRe=Oe(rt.illegal)),rt.contains||(rt.contains=[]),rt.contains=[].concat(...rt.contains.map(function(Yt){return Pt(Yt==="self"?rt:Yt)})),rt.contains.forEach(function(Yt){rn(Yt,Ze)}),rt.starts&&rn(rt.starts,st),Ze.matcher=Mn(Ze),Ze}if(ie.compilerExtensions||(ie.compilerExtensions=[]),ie.contains&&ie.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return ie.classNameAliases=r(ie.classNameAliases||{}),rn(ie)}function nn(ie){return ie?ie.endsWithParent||nn(ie.starts):!1}function Pt(ie){return ie.variants&&!ie.cachedVariants&&(ie.cachedVariants=ie.variants.map(function(Oe){return r(ie,{variants:null},Oe)})),ie.cachedVariants?ie.cachedVariants:nn(ie)?r(ie,{starts:ie.starts?r(ie.starts):null}):Object.isFrozen(ie)?r(ie):ie}var Wt="11.11.1";class Ri extends Error{constructor(Oe,nt){super(Oe),this.name="HTMLInjectionError",this.html=nt}}const yt=n,kt=r,ir=Symbol("nomatch"),It=7,dr=function(ie){const Oe=Object.create(null),nt=Object.create(null),Et=[];let Mn=!0;const rn="Could not find the language '{}', did you forget to load/include a language module?",rt={disableAutodetect:!0,name:"Plain text",contains:[]};let st={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function Ze(Qe){return st.noHighlightRe.test(Qe)}function Ht(Qe){let _t=Qe.className+" ";_t+=Qe.parentNode?Qe.parentNode.className:"";const Xt=st.languageDetectRe.exec(_t);if(Xt){const wn=yn(Xt[1]);return wn||(Le(rn.replace("{}",Xt[1])),Le("Falling back to no-highlight mode for this block.",Qe)),wn?Xt[1]:"no-highlight"}return _t.split(/\s+/).find(wn=>Ze(wn)||yn(wn))}function Yt(Qe,_t,Xt){let wn="",br="";typeof _t=="object"?(wn=Qe,Xt=_t.ignoreIllegals,br=_t.language):(Ce("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ce("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),br=Qe,wn=_t),Xt===void 0&&(Xt=!0);const li={code:wn,language:br};Qa("before:highlight",li);const Gi=li.result?li.result:xi(li.language,li.code,Xt);return Gi.code=li.code,Qa("after:highlight",Gi),Gi}function xi(Qe,_t,Xt,wn){const br=Object.create(null);function li(Ge,wt){return Ge.keywords[wt]}function Gi(){if(!At.keywords){Fr.addText(Rn);return}let Ge=0;At.keywordPatternRe.lastIndex=0;let wt=At.keywordPatternRe.exec(Rn),Dt="";for(;wt;){Dt+=Rn.substring(Ge,wt.index);const sn=Jr.case_insensitive?wt[0].toLowerCase():wt[0],fr=li(At,sn);if(fr){const[vs,fc]=fr;if(Fr.addText(Dt),Dt="",br[sn]=(br[sn]||0)+1,br[sn]<=It&&(gl+=fc),vs.startsWith("_"))Dt+=wt[0];else{const gu=Jr.classNameAliases[vs]||vs;ms(wt[0],gu)}}else Dt+=wt[0];Ge=At.keywordPatternRe.lastIndex,wt=At.keywordPatternRe.exec(Rn)}Dt+=Rn.substring(Ge),Fr.addText(Dt)}function Fn(){if(Rn==="")return;let Ge=null;if(typeof At.subLanguage=="string"){if(!Oe[At.subLanguage]){Fr.addText(Rn);return}Ge=xi(At.subLanguage,Rn,!0,mu[At.subLanguage]),mu[At.subLanguage]=Ge._top}else Ge=oc(Rn,At.subLanguage.length?At.subLanguage:null);At.relevance>0&&(gl+=Ge.relevance),Fr.__addSublanguage(Ge._emitter,Ge.language)}function Hn(){At.subLanguage!=null?Fn():Gi(),Rn=""}function ms(Ge,wt){Ge!==""&&(Fr.startScope(wt),Fr.addText(Ge),Fr.endScope())}function du(Ge,wt){let Dt=1;const sn=wt.length-1;for(;Dt<=sn;){if(!Ge._emit[Dt]){Dt++;continue}const fr=Jr.classNameAliases[Ge[Dt]]||Ge[Dt],vs=wt[Dt];fr?ms(vs,fr):(Rn=vs,Gi(),Rn=""),Dt++}}function cc(Ge,wt){return Ge.scope&&typeof Ge.scope=="string"&&Fr.openNode(Jr.classNameAliases[Ge.scope]||Ge.scope),Ge.beginScope&&(Ge.beginScope._wrap?(ms(Rn,Jr.classNameAliases[Ge.beginScope._wrap]||Ge.beginScope._wrap),Rn=""):Ge.beginScope._multi&&(du(Ge.beginScope,wt),Rn="")),At=Object.create(Ge,{parent:{value:At}}),At}function td(Ge,wt,Dt){let sn=T(Ge.endRe,Dt);if(sn){if(Ge["on:end"]){const fr=new e(Ge);Ge["on:end"](wt,fr),fr.isMatchIgnored&&(sn=!1)}if(sn){for(;Ge.endsParent&&Ge.parent;)Ge=Ge.parent;return Ge}}if(Ge.endsWithParent)return td(Ge.parent,wt,Dt)}function fu(Ge){return At.matcher.regexIndex===0?(Rn+=Ge[0],1):(Wa=!0,0)}function i0(Ge){const wt=Ge[0],Dt=Ge.rule,sn=new e(Dt),fr=[Dt.__beforeBegin,Dt["on:begin"]];for(const vs of fr)if(vs&&(vs(Ge,sn),sn.isMatchIgnored))return fu(wt);return Dt.skip?Rn+=wt:(Dt.excludeBegin&&(Rn+=wt),Hn(),!Dt.returnBegin&&!Dt.excludeBegin&&(Rn=wt)),cc(Dt,Ge),Dt.returnBegin?0:wt.length}function Ki(Ge){const wt=Ge[0],Dt=_t.substring(Ge.index),sn=td(At,Ge,Dt);if(!sn)return ir;const fr=At;At.endScope&&At.endScope._wrap?(Hn(),ms(wt,At.endScope._wrap)):At.endScope&&At.endScope._multi?(Hn(),du(At.endScope,Ge)):fr.skip?Rn+=wt:(fr.returnEnd||fr.excludeEnd||(Rn+=wt),Hn(),fr.excludeEnd&&(Rn=wt));do At.scope&&Fr.closeNode(),!At.skip&&!At.subLanguage&&(gl+=At.relevance),At=At.parent;while(At!==sn.parent);return sn.starts&&cc(sn.starts,Ge),fr.returnEnd?0:wt.length}function pu(){const Ge=[];for(let wt=At;wt!==Jr;wt=wt.parent)wt.scope&&Ge.unshift(wt.scope);Ge.forEach(wt=>Fr.openNode(wt))}let uc={};function hc(Ge,wt){const Dt=wt&&wt[0];if(Rn+=Ge,Dt==null)return Hn(),0;if(uc.type==="begin"&&wt.type==="end"&&uc.index===wt.index&&Dt===""){if(Rn+=_t.slice(wt.index,wt.index+1),!Mn){const sn=new Error(`0 width match regex (${Qe})`);throw sn.languageName=Qe,sn.badRule=uc.rule,sn}return 1}if(uc=wt,wt.type==="begin")return i0(wt);if(wt.type==="illegal"&&!Xt){const sn=new Error('Illegal lexeme "'+Dt+'" for mode "'+(At.scope||"<unnamed>")+'"');throw sn.mode=At,sn}else if(wt.type==="end"){const sn=Ki(wt);if(sn!==ir)return sn}if(wt.type==="illegal"&&Dt==="")return Rn+=`
`,1;if(vl>1e5&&vl>wt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Rn+=Dt,Dt.length}const Jr=yn(Qe);if(!Jr)throw Ve(rn.replace("{}",Qe)),new Error('Unknown language: "'+Qe+'"');const dc=ln(Jr);let Eo="",At=wn||dc;const mu={},Fr=new st.__emitter(st);pu();let Rn="",gl=0,gs=0,vl=0,Wa=!1;try{if(Jr.__emitTokens)Jr.__emitTokens(_t,Fr);else{for(At.matcher.considerAll();;){vl++,Wa?Wa=!1:At.matcher.considerAll(),At.matcher.lastIndex=gs;const Ge=At.matcher.exec(_t);if(!Ge)break;const wt=_t.substring(gs,Ge.index),Dt=hc(wt,Ge);gs=Ge.index+Dt}hc(_t.substring(gs))}return Fr.finalize(),Eo=Fr.toHTML(),{language:Qe,value:Eo,relevance:gl,illegal:!1,_emitter:Fr,_top:At}}catch(Ge){if(Ge.message&&Ge.message.includes("Illegal"))return{language:Qe,value:yt(_t),illegal:!0,relevance:0,_illegalBy:{message:Ge.message,index:gs,context:_t.slice(gs-100,gs+100),mode:Ge.mode,resultSoFar:Eo},_emitter:Fr};if(Mn)return{language:Qe,value:yt(_t),illegal:!1,relevance:0,errorRaised:Ge,_emitter:Fr,_top:At};throw Ge}}function ds(Qe){const _t={value:yt(Qe),illegal:!1,relevance:0,_top:rt,_emitter:new st.__emitter(st)};return _t._emitter.addText(Qe),_t}function oc(Qe,_t){_t=_t||st.languages||Object.keys(Oe);const Xt=ds(Qe),wn=_t.filter(yn).filter(oi).map(Hn=>xi(Hn,Qe,!1));wn.unshift(Xt);const br=wn.sort((Hn,ms)=>{if(Hn.relevance!==ms.relevance)return ms.relevance-Hn.relevance;if(Hn.language&&ms.language){if(yn(Hn.language).supersetOf===ms.language)return 1;if(yn(ms.language).supersetOf===Hn.language)return-1}return 0}),[li,Gi]=br,Fn=li;return Fn.secondBest=Gi,Fn}function ga(Qe,_t,Xt){const wn=_t&&nt[_t]||Xt;Qe.classList.add("hljs"),Qe.classList.add(`language-${wn}`)}function $r(Qe){let _t=null;const Xt=Ht(Qe);if(Ze(Xt))return;if(Qa("before:highlightElement",{el:Qe,language:Xt}),Qe.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Qe);return}if(Qe.children.length>0&&(st.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Qe)),st.throwUnescapedHTML))throw new Ri("One of your code blocks includes unescaped HTML.",Qe.innerHTML);_t=Qe;const wn=_t.textContent,br=Xt?Yt(wn,{language:Xt,ignoreIllegals:!0}):oc(wn);Qe.innerHTML=br.value,Qe.dataset.highlighted="yes",ga(Qe,Xt,br.language),Qe.result={language:br.language,re:br.relevance,relevance:br.relevance},br.secondBest&&(Qe.secondBest={language:br.secondBest.language,relevance:br.secondBest.relevance}),Qa("after:highlightElement",{el:Qe,result:br,text:wn})}function Di(Qe){st=kt(st,Qe)}const fs=()=>{lc(),Ce("10.6.0","initHighlighting() deprecated.  Use highlightAll() now.")};function ed(){lc(),Ce("10.6.0","initHighlightingOnLoad() deprecated.  Use highlightAll() now.")}let ml=!1;function lc(){function Qe(){lc()}if(document.readyState==="loading"){ml||window.addEventListener("DOMContentLoaded",Qe,!1),ml=!0;return}document.querySelectorAll(st.cssSelector).forEach($r)}function va(Qe,_t){let Xt=null;try{Xt=_t(ie)}catch(wn){if(Ve("Language definition for '{}' could not be registered.".replace("{}",Qe)),Mn)Ve(wn);else throw wn;Xt=rt}Xt.name||(Xt.name=Qe),Oe[Qe]=Xt,Xt.rawDefinition=_t.bind(null,ie),Xt.aliases&&Ys(Xt.aliases,{languageName:Qe})}function vr(Qe){delete Oe[Qe];for(const _t of Object.keys(nt))nt[_t]===Qe&&delete nt[_t]}function Er(){return Object.keys(Oe)}function yn(Qe){return Qe=(Qe||"").toLowerCase(),Oe[Qe]||Oe[nt[Qe]]}function Ys(Qe,{languageName:_t}){typeof Qe=="string"&&(Qe=[Qe]),Qe.forEach(Xt=>{nt[Xt.toLowerCase()]=_t})}function oi(Qe){const _t=yn(Qe);return _t&&!_t.disableAutodetect}function Xs(Qe){Qe["before:highlightBlock"]&&!Qe["before:highlightElement"]&&(Qe["before:highlightElement"]=_t=>{Qe["before:highlightBlock"](Object.assign({block:_t.el},_t))}),Qe["after:highlightBlock"]&&!Qe["after:highlightElement"]&&(Qe["after:highlightElement"]=_t=>{Qe["after:highlightBlock"](Object.assign({block:_t.el},_t))})}function Ir(Qe){Xs(Qe),Et.push(Qe)}function hu(Qe){const _t=Et.indexOf(Qe);_t!==-1&&Et.splice(_t,1)}function Qa(Qe,_t){const Xt=Qe;Et.forEach(function(wn){wn[Xt]&&wn[Xt](_t)})}function ps(Qe){return Ce("10.7.0","highlightBlock will be removed entirely in v12.0"),Ce("10.7.0","Please use highlightElement now."),$r(Qe)}Object.assign(ie,{highlight:Yt,highlightAuto:oc,highlightAll:lc,highlightElement:$r,highlightBlock:ps,configure:Di,initHighlighting:fs,initHighlightingOnLoad:ed,registerLanguage:va,unregisterLanguage:vr,listLanguages:Er,getLanguage:yn,registerAliases:Ys,autoDetection:oi,inherit:kt,addPlugin:Ir,removePlugin:hu}),ie.debugMode=function(){Mn=!1},ie.safeMode=function(){Mn=!0},ie.versionString=Wt,ie.regex={concat:x,lookahead:m,either:S,optional:b,anyNumberOfTimes:v};for(const Qe in Pe)typeof Pe[Qe]=="object"&&t(Pe[Qe]);return Object.assign(ie,Pe),ie},An=dr({});return An.newInstance=()=>dr({}),KT=An,An.HighlightJS=An,An.default=An,KT}var i3e=r3e();const mQ=dl(i3e);function s3e(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},l=t.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},b={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},x={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},m,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},b,x,s,o],S=[...w];return S.pop(),S.push(l),v.contains=S,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}mQ.registerLanguage("yaml",s3e);const a3e=C_e(mQ),o3e=new Aae,l3e=[{title:"Query",path:"/query",icon:a.jsx(Xh,{style:Fs}),element:a.jsx(UU,{}),inAgentMode:!1},{title:"Alerts",path:"/alerts",icon:a.jsx(jie,{style:Fs}),element:a.jsx(nQ,{}),inAgentMode:!1}],gQ=[{title:"Target health",path:"/targets",icon:a.jsx(dB,{style:Fs}),element:a.jsx(h_e,{}),inAgentMode:!0},{title:"Rule health",path:"/rules",icon:a.jsx(bB,{style:Fs}),element:a.jsx(e_e,{}),inAgentMode:!1},{title:"Service discovery",path:"/service-discovery",icon:a.jsx(bre,{style:Fs}),element:a.jsx(t3e,{}),inAgentMode:!0}],vQ=[{title:"Runtime & build information",path:"/status",icon:a.jsx(Gn,{style:Fs}),element:a.jsx(d_e,{}),inAgentMode:!0},{title:"TSDB status",path:"/tsdb-status",icon:a.jsx(Sre,{style:Fs}),element:a.jsx(f_e,{}),inAgentMode:!1},{title:"Command-line flags",path:"/flags",icon:a.jsx(Ore,{style:Fs}),element:a.jsx(v_e,{}),inAgentMode:!0},{title:"Configuration",path:"/config",icon:a.jsx(eie,{style:Fs}),element:a.jsx(k_e,{}),inAgentMode:!0},{title:"Alertmanager discovery",path:"/alertmanager-discovery",icon:a.jsx(t4,{style:Fs}),element:a.jsx(n3e,{}),inAgentMode:!1}],JL=[...gQ,...vQ],c3e={colors:{"codebox-bg":["#f5f5f5","#e7e7e7","#cdcdcd","#b2b2b2","#9a9a9a","#8b8b8b","#848484","#717171","#656565","#575757"]}},M1="md";function u3e(){const[t,{toggle:e}]=Iv(),{agentMode:n,consolesLink:r,pathPrefix:i}=ai(),s=a.jsxs(a.Fragment,{children:[r&&a.jsx(ks,{component:"a",href:r,className:Ry.link,leftSection:a.jsx(_re,{style:Fs}),px:M1,children:"Consoles"}),l3e.filter(l=>!n||l.inAgentMode).map(l=>a.jsx(ks,{component:fg,to:l.path,className:Ry.link,leftSection:l.icon,px:M1,children:l.title},l.path)),a.jsxs(Xn,{shadow:"md",width:240,children:[a.jsxs(TR,{children:[JL.filter(l=>!n||l.inAgentMode).map(l=>a.jsx(Yu,{path:l.path,element:a.jsx(Xn.Target,{children:a.jsxs(ks,{component:fg,to:l.path,className:Ry.link,leftSection:l.icon,rightSection:a.jsx(Gg,{style:Fs}),px:M1,onClick:u=>u.preventDefault(),children:["Status ",a.jsx(uB,{style:Fs})," ",l.title]})})},l.path)),a.jsx(Yu,{path:"*",element:a.jsx(Xn.Target,{children:a.jsx(ks,{className:Ry.link,leftSection:a.jsx(nie,{style:Fs}),rightSection:a.jsx(Gg,{style:Fs}),px:M1,children:"Status"})})})]}),a.jsxs(Xn.Dropdown,{children:[a.jsx(Xn.Label,{children:"Monitoring status"}),gQ.filter(l=>!n||l.inAgentMode).map(l=>a.jsx(Xn.Item,{component:fg,to:l.path,leftSection:l.icon,children:l.title},l.path)),a.jsx(Xn.Divider,{}),a.jsx(Xn.Label,{children:"Server status"}),vQ.filter(l=>!n||l.inAgentMode).map(l=>a.jsx(Xn.Item,{component:fg,to:l.path,leftSection:l.icon,children:l.title},l.path))]})]})]}),o=a.jsxs(a.Fragment,{children:[a.jsx(E_e,{}),a.jsx(U_e,{}),a.jsx(A_e,{}),a.jsx(Nr,{component:"a",href:"https://prometheus.io/docs/prometheus/latest/getting_started/",target:"_blank",color:"gray",title:"Documentation","aria-label":"Documentation",size:de(32),children:a.jsx(ere,{style:nu})})]});return a.jsx(Jse,{basename:i,children:a.jsx(lje,{adapter:Q_e,children:a.jsx(B7,{defaultColorScheme:"auto",theme:c3e,children:a.jsxs(x_e,{adapter:a3e,children:[a.jsx(uu,{position:"top-right"}),a.jsx(Rae,{client:o3e,children:a.jsxs(fo,{header:{height:56},navbar:{width:300,breakpoint:"sm",collapsed:{desktop:!0,mobile:!t}},padding:"md",children:[a.jsxs(V_e,{children:[a.jsx(fo.Header,{bg:"rgb(65, 73, 81)",c:"#fff",children:a.jsxs(ht,{h:"100%",px:"md",wrap:"nowrap",children:[a.jsxs(ht,{style:{flex:1},justify:"space-between",wrap:"nowrap",children:[a.jsxs(ht,{gap:40,wrap:"nowrap",children:[a.jsx(d4,{to:"/",style:{textDecoration:"none",color:"white"},children:a.jsxs(ht,{gap:10,wrap:"nowrap",children:[a.jsx("img",{src:KW,height:30}),a.jsx(ut,{hiddenFrom:"sm",fz:20,children:"Prometheus"}),a.jsx(ut,{visibleFrom:"md",fz:20,children:"Prometheus"}),a.jsx(ut,{fz:20,children:n&&"Agent"})]})}),a.jsx(ht,{gap:12,visibleFrom:"sm",wrap:"nowrap",children:s})]}),a.jsx(ht,{visibleFrom:"xs",wrap:"nowrap",gap:"xs",children:o})]}),a.jsx(SO,{opened:t,onClick:e,hiddenFrom:"sm",size:"sm",color:"gray.2"})]})}),a.jsxs(fo.Navbar,{py:"md",px:4,bg:"rgb(65, 73, 81)",c:"#fff",children:[s,a.jsx(ht,{mt:"md",hiddenFrom:"xs",justify:"center",children:o})]})]}),a.jsx(fo.Main,{children:a.jsx(yf,{children:a.jsx(M.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(10),(l,u)=>a.jsx(xo,{height:40,mb:15,width:1e3,mx:"auto"},u))}),children:a.jsxs(TR,{children:[a.jsx(Yu,{path:"/",element:a.jsx(Ose,{to:n?"/agent":"/query",replace:!0})}),n?a.jsx(Yu,{path:"/agent",element:a.jsx(A1,{children:a.jsx(O_e,{})})}):a.jsxs(a.Fragment,{children:[a.jsx(Yu,{path:"/query",element:a.jsx(A1,{children:a.jsx(UU,{})})}),a.jsx(Yu,{path:"/alerts",element:a.jsx(A1,{children:a.jsx(nQ,{})})})]}),JL.map(l=>a.jsx(Yu,{path:l.path,element:a.jsx(A1,{children:l.element})},l.path))]})})},location.pathname)})]})})]})})})})}const PS=(t,e)=>{localStorage.setItem(t,JSON.stringify(e))},bQ=ule(),LS=bQ.startListening.withTypes();LS({actionCreator:rA,effect:({payload:t})=>{PS(rQ,t)}});LS({actionCreator:iA,effect:({payload:t})=>{PS(dQ,t)}});LS({actionCreator:Cz,effect:(t,{getState:e})=>{PS(_z,e().queryPage.queryHistory)}});LS({actionCreator:ao,effect:({payload:t})=>{Object.entries(t).forEach(([e,n])=>{switch(e){case"useLocalTime":case"enableQueryHistory":case"enableAutocomplete":case"enableSyntaxHighlighting":case"enableLinter":case"showAnnotations":case"showQueryWarnings":case"showQueryInfoNotices":case"alertGroupsPerPage":case"ruleGroupsPerPage":return PS(`settings.${e}`,n)}})}});const h3e=zoe({reducer:{settings:Qce,queryPage:Ale,targetsPage:n_e,serviceDiscoveryPage:Y_e},middleware:t=>t().prepend(bQ.middleware)});XW.createRoot(document.getElementById("root")).render(a.jsx(_n.StrictMode,{children:a.jsx(soe,{store:h3e,children:a.jsx(u3e,{})})}));
