var MX=Object.defineProperty;var e8=t=>{throw TypeError(t)};var RX=(t,e,n)=>e in t?MX(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var vr=(t,e,n)=>RX(t,typeof e!="symbol"?e+"":e,n),jC=(t,e,n)=>e.has(t)||e8("Cannot "+n);var Q=(t,e,n)=>(jC(t,e,"read from private field"),n?n.call(t):e.get(t)),st=(t,e,n)=>e.has(t)?e8("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Le=(t,e,n,r)=>(jC(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),qe=(t,e,n)=>(jC(t,e,"access private method"),n);var Md=(t,e,n,r)=>({set _(i){Le(t,e,i,n)},get _(){return Q(t,e,r)}});function DX(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 pl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function jP(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 CC={exports:{}},mg={};/**
 * @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 t8;function NX(){if(t8)return mg;t8=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 mg.Fragment=e,mg.jsx=n,mg.jsxs=n,mg}var n8;function IX(){return n8||(n8=1,CC.exports=NX()),CC.exports}var a=IX(),_C={exports:{}},Xt={};/**
 * @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 r8;function LX(){if(r8)return Xt;r8=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"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function v(U){return U===null||typeof U!="object"?null:(U=m&&U[m]||U["@@iterator"],typeof U=="function"?U:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,S={};function w(U,V,G){this.props=U,this.context=V,this.refs=S,this.updater=G||y}w.prototype.isReactComponent={},w.prototype.setState=function(U,V){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,V,"setState")},w.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function A(){}A.prototype=w.prototype;function C(U,V,G){this.props=U,this.context=V,this.refs=S,this.updater=G||y}var j=C.prototype=new A;j.constructor=C,x(j,w.prototype),j.isPureReactComponent=!0;var _=Array.isArray;function k(){}var M={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function N(U,V,G){var J=G.ref;return{$$typeof:t,type:U,key:V,ref:J!==void 0?J:null,props:G}}function I(U,V){return N(U.type,V,U.props)}function D(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function L(U){var V={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(G){return V[G]})}var z=/\/+/g;function P(U,V){return typeof U=="object"&&U!==null&&U.key!=null?L(""+U.key):V.toString(36)}function H(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(k,k):(U.status="pending",U.then(function(V){U.status==="pending"&&(U.status="fulfilled",U.value=V)},function(V){U.status==="pending"&&(U.status="rejected",U.reason=V)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function B(U,V,G,J,ne){var de=typeof U;(de==="undefined"||de==="boolean")&&(U=null);var fe=!1;if(U===null)fe=!0;else switch(de){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(U.$$typeof){case t:case e:fe=!0;break;case f:return fe=U._init,B(fe(U._payload),V,G,J,ne)}}if(fe)return ne=ne(U),fe=J===""?"."+P(U,0):J,_(ne)?(G="",fe!=null&&(G=fe.replace(z,"$&/")+"/"),B(ne,V,G,"",function(Oe){return Oe})):ne!=null&&(D(ne)&&(ne=I(ne,G+(ne.key==null||U&&U.key===ne.key?"":(""+ne.key).replace(z,"$&/")+"/")+fe)),V.push(ne)),1;fe=0;var ke=J===""?".":J+":";if(_(U))for(var Me=0;Me<U.length;Me++)J=U[Me],de=ke+P(J,Me),fe+=B(J,V,G,de,ne);else if(Me=v(U),typeof Me=="function")for(U=Me.call(U),Me=0;!(J=U.next()).done;)J=J.value,de=ke+P(J,Me++),fe+=B(J,V,G,de,ne);else if(de==="object"){if(typeof U.then=="function")return B(H(U),V,G,J,ne);throw V=String(U),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return fe}function F(U,V,G){if(U==null)return U;var J=[],ne=0;return B(U,J,"","",function(de){return V.call(G,de,ne++)}),J}function q(U){if(U._status===-1){var V=U._result;V=V(),V.then(function(G){(U._status===0||U._status===-1)&&(U._status=1,U._result=G)},function(G){(U._status===0||U._status===-1)&&(U._status=2,U._result=G)}),U._status===-1&&(U._status=0,U._result=V)}if(U._status===1)return U._result.default;throw U._result}var X=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},Y={map:F,forEach:function(U,V,G){F(U,function(){V.apply(this,arguments)},G)},count:function(U){var V=0;return F(U,function(){V++}),V},toArray:function(U){return F(U,function(V){return V})||[]},only:function(U){if(!D(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Xt.Activity=p,Xt.Children=Y,Xt.Component=w,Xt.Fragment=n,Xt.Profiler=i,Xt.PureComponent=C,Xt.StrictMode=r,Xt.Suspense=c,Xt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Xt.__COMPILER_RUNTIME={__proto__:null,c:function(U){return M.H.useMemoCache(U)}},Xt.cache=function(U){return function(){return U.apply(null,arguments)}},Xt.cacheSignal=function(){return null},Xt.cloneElement=function(U,V,G){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var J=x({},U.props),ne=U.key;if(V!=null)for(de in V.key!==void 0&&(ne=""+V.key),V)!R.call(V,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&V.ref===void 0||(J[de]=V[de]);var de=arguments.length-2;if(de===1)J.children=G;else if(1<de){for(var fe=Array(de),ke=0;ke<de;ke++)fe[ke]=arguments[ke+2];J.children=fe}return N(U.type,ne,J)},Xt.createContext=function(U){return U={$$typeof:o,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:s,_context:U},U},Xt.createElement=function(U,V,G){var J,ne={},de=null;if(V!=null)for(J in V.key!==void 0&&(de=""+V.key),V)R.call(V,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(ne[J]=V[J]);var fe=arguments.length-2;if(fe===1)ne.children=G;else if(1<fe){for(var ke=Array(fe),Me=0;Me<fe;Me++)ke[Me]=arguments[Me+2];ne.children=ke}if(U&&U.defaultProps)for(J in fe=U.defaultProps,fe)ne[J]===void 0&&(ne[J]=fe[J]);return N(U,de,ne)},Xt.createRef=function(){return{current:null}},Xt.forwardRef=function(U){return{$$typeof:l,render:U}},Xt.isValidElement=D,Xt.lazy=function(U){return{$$typeof:f,_payload:{_status:-1,_result:U},_init:q}},Xt.memo=function(U,V){return{$$typeof:h,type:U,compare:V===void 0?null:V}},Xt.startTransition=function(U){var V=M.T,G={};M.T=G;try{var J=U(),ne=M.S;ne!==null&&ne(G,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(k,X)}catch(de){X(de)}finally{V!==null&&G.types!==null&&(V.types=G.types),M.T=V}},Xt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Xt.use=function(U){return M.H.use(U)},Xt.useActionState=function(U,V,G){return M.H.useActionState(U,V,G)},Xt.useCallback=function(U,V){return M.H.useCallback(U,V)},Xt.useContext=function(U){return M.H.useContext(U)},Xt.useDebugValue=function(){},Xt.useDeferredValue=function(U,V){return M.H.useDeferredValue(U,V)},Xt.useEffect=function(U,V){return M.H.useEffect(U,V)},Xt.useEffectEvent=function(U){return M.H.useEffectEvent(U)},Xt.useId=function(){return M.H.useId()},Xt.useImperativeHandle=function(U,V,G){return M.H.useImperativeHandle(U,V,G)},Xt.useInsertionEffect=function(U,V){return M.H.useInsertionEffect(U,V)},Xt.useLayoutEffect=function(U,V){return M.H.useLayoutEffect(U,V)},Xt.useMemo=function(U,V){return M.H.useMemo(U,V)},Xt.useOptimistic=function(U,V){return M.H.useOptimistic(U,V)},Xt.useReducer=function(U,V,G){return M.H.useReducer(U,V,G)},Xt.useRef=function(U){return M.H.useRef(U)},Xt.useState=function(U){return M.H.useState(U)},Xt.useSyncExternalStore=function(U,V,G){return M.H.useSyncExternalStore(U,V,G)},Xt.useTransition=function(){return M.H.useTransition()},Xt.version="19.2.7",Xt}var i8;function cb(){return i8||(i8=1,_C.exports=LX()),_C.exports}var O=cb();const zn=pl(O),CP=DX({__proto__:null,default:zn},[O]);var TC={exports:{}},gg={},kC={exports:{}},OC={};/**
 * @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 s8;function BX(){return s8||(s8=1,(function(t){function e(B,F){var q=B.length;B.push(F);e:for(;0<q;){var X=q-1>>>1,Y=B[X];if(0<i(Y,F))B[X]=F,B[q]=Y,q=X;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var F=B[0],q=B.pop();if(q!==F){B[0]=q;e:for(var X=0,Y=B.length,U=Y>>>1;X<U;){var V=2*(X+1)-1,G=B[V],J=V+1,ne=B[J];if(0>i(G,q))J<Y&&0>i(ne,G)?(B[X]=ne,B[J]=q,X=J):(B[X]=G,B[V]=q,X=V);else if(J<Y&&0>i(ne,q))B[X]=ne,B[J]=q,X=J;else break e}}return F}function i(B,F){var q=B.sortIndex-F.sortIndex;return q!==0?q:B.id-F.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 c=[],h=[],f=1,p=null,m=3,v=!1,y=!1,x=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function j(B){for(var F=n(h);F!==null;){if(F.callback===null)r(h);else if(F.startTime<=B)r(h),F.sortIndex=F.expirationTime,e(c,F);else break;F=n(h)}}function _(B){if(x=!1,j(B),!y)if(n(c)!==null)y=!0,k||(k=!0,L());else{var F=n(h);F!==null&&H(_,F.startTime-B)}}var k=!1,M=-1,R=5,N=-1;function I(){return S?!0:!(t.unstable_now()-N<R)}function D(){if(S=!1,k){var B=t.unstable_now();N=B;var F=!0;try{e:{y=!1,x&&(x=!1,A(M),M=-1),v=!0;var q=m;try{t:{for(j(B),p=n(c);p!==null&&!(p.expirationTime>B&&I());){var X=p.callback;if(typeof X=="function"){p.callback=null,m=p.priorityLevel;var Y=X(p.expirationTime<=B);if(B=t.unstable_now(),typeof Y=="function"){p.callback=Y,j(B),F=!0;break t}p===n(c)&&r(c),j(B)}else r(c);p=n(c)}if(p!==null)F=!0;else{var U=n(h);U!==null&&H(_,U.startTime-B),F=!1}}break e}finally{p=null,m=q,v=!1}F=void 0}}finally{F?L():k=!1}}}var L;if(typeof C=="function")L=function(){C(D)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,P=z.port2;z.port1.onmessage=D,L=function(){P.postMessage(null)}}else L=function(){w(D,0)};function H(B,F){M=w(function(){B(t.unstable_now())},F)}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(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(B){switch(m){case 1:case 2:case 3:var F=3;break;default:F=m}var q=m;m=F;try{return B()}finally{m=q}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(B,F){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var q=m;m=B;try{return F()}finally{m=q}},t.unstable_scheduleCallback=function(B,F,q){var X=t.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?X+q:X):q=X,B){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=q+Y,B={id:f++,callback:F,priorityLevel:B,startTime:q,expirationTime:Y,sortIndex:-1},q>X?(B.sortIndex=q,e(h,B),n(c)===null&&B===n(h)&&(x?(A(M),M=-1):x=!0,H(_,q-X))):(B.sortIndex=Y,e(c,B),y||v||(y=!0,k||(k=!0,L()))),B},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(B){var F=m;return function(){var q=m;m=F;try{return B.apply(this,arguments)}finally{m=q}}}})(OC)),OC}var a8;function PX(){return a8||(a8=1,kC.exports=BX()),kC.exports}var EC={exports:{}},_s={};/**
 * @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 o8;function FX(){if(o8)return _s;o8=1;var t=cb();function e(c){var h="https://react.dev/errors/"+c;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 #"+c+"; 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(c,h,f){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:c,containerInfo:h,implementation:f}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return _s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,_s.createPortal=function(c,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(c,h,null,f)},_s.flushSync=function(c){var h=o.T,f=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=h,r.p=f,r.d.f()}},_s.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(c,h))},_s.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},_s.preinit=function(c,h){if(typeof c=="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(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:m,fetchPriority:v}):f==="script"&&r.d.X(c,{crossOrigin:p,integrity:m,fetchPriority:v,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},_s.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var f=l(h.as,h.crossOrigin);r.d.M(c,{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(c)},_s.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var f=h.as,p=l(f,h.crossOrigin);r.d.L(c,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})}},_s.preloadModule=function(c,h){if(typeof c=="string")if(h){var f=l(h.as,h.crossOrigin);r.d.m(c,{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(c)},_s.requestFormReset=function(c){r.d.r(c)},_s.unstable_batchedUpdates=function(c,h){return c(h)},_s.useFormState=function(c,h,f){return o.H.useFormState(c,h,f)},_s.useFormStatus=function(){return o.H.useHostTransitionStatus()},_s.version="19.2.7",_s}var l8;function _P(){if(l8)return EC.exports;l8=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(),EC.exports=FX(),EC.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 c8;function $X(){if(c8)return gg;c8=1;var t=PX(),e=cb(),n=_P();function r(u){var d="https://react.dev/errors/"+u;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 #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)}function s(u){var d=u,g=u;if(u.alternate)for(;d.return;)d=d.return;else{u=d;do d=u,(d.flags&4098)!==0&&(g=d.return),u=d.return;while(u)}return d.tag===3?g:null}function o(u){if(u.tag===13){var d=u.memoizedState;if(d===null&&(u=u.alternate,u!==null&&(d=u.memoizedState)),d!==null)return d.dehydrated}return null}function l(u){if(u.tag===31){var d=u.memoizedState;if(d===null&&(u=u.alternate,u!==null&&(d=u.memoizedState)),d!==null)return d.dehydrated}return null}function c(u){if(s(u)!==u)throw Error(r(188))}function h(u){var d=u.alternate;if(!d){if(d=s(u),d===null)throw Error(r(188));return d!==u?null:u}for(var g=u,b=d;;){var T=g.return;if(T===null)break;var E=T.alternate;if(E===null){if(b=T.return,b!==null){g=b;continue}break}if(T.child===E.child){for(E=T.child;E;){if(E===g)return c(T),u;if(E===b)return c(T),d;E=E.sibling}throw Error(r(188))}if(g.return!==b.return)g=T,b=E;else{for(var $=!1,Z=T.child;Z;){if(Z===g){$=!0,g=T,b=E;break}if(Z===b){$=!0,b=T,g=E;break}Z=Z.sibling}if(!$){for(Z=E.child;Z;){if(Z===g){$=!0,g=E,b=T;break}if(Z===b){$=!0,b=E,g=T;break}Z=Z.sibling}if(!$)throw Error(r(189))}}if(g.alternate!==b)throw Error(r(190))}if(g.tag!==3)throw Error(r(188));return g.stateNode.current===g?u:d}function f(u){var d=u.tag;if(d===5||d===26||d===27||d===6)return u;for(u=u.child;u!==null;){if(d=f(u),d!==null)return d;u=u.sibling}return null}var p=Object.assign,m=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),C=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),D=Symbol.iterator;function L(u){return u===null||typeof u!="object"?null:(u=D&&u[D]||u["@@iterator"],typeof u=="function"?u:null)}var z=Symbol.for("react.client.reference");function P(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===z?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case x:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case _:return"Suspense";case k:return"SuspenseList";case N:return"Activity"}if(typeof u=="object")switch(u.$$typeof){case y:return"Portal";case C:return u.displayName||"Context";case A:return(u._context.displayName||"Context")+".Consumer";case j:var d=u.render;return u=u.displayName,u||(u=d.displayName||d.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case M:return d=u.displayName||null,d!==null?d:P(u.type)||"Memo";case R:d=u._payload,u=u._init;try{return P(u(d))}catch{}}return null}var H=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},X=[],Y=-1;function U(u){return{current:u}}function V(u){0>Y||(u.current=X[Y],X[Y]=null,Y--)}function G(u,d){Y++,X[Y]=u.current,u.current=d}var J=U(null),ne=U(null),de=U(null),fe=U(null);function ke(u,d){switch(G(de,d),G(ne,u),G(J,null),d.nodeType){case 9:case 11:u=(u=d.documentElement)&&(u=u.namespaceURI)?SD(u):0;break;default:if(u=d.tagName,d=d.namespaceURI)d=SD(d),u=jD(d,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}V(J),G(J,u)}function Me(){V(J),V(ne),V(de)}function Oe(u){u.memoizedState!==null&&G(fe,u);var d=J.current,g=jD(d,u.type);d!==g&&(G(ne,u),G(J,g))}function Ye(u){ne.current===u&&(V(J),V(ne)),fe.current===u&&(V(fe),hg._currentValue=q)}var ie,Se;function se(u){if(ie===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);ie=d&&d[1]||"",Se=-1<g.stack.indexOf(`
    at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ie+u+Se}var _e=!1;function et(u,d){if(!u||_e)return"";_e=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var b={DetermineComponentFrameRoot:function(){try{if(d){var Qe=function(){throw Error()};if(Object.defineProperty(Qe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Qe,[])}catch(Ee){var je=Ee}Reflect.construct(u,[],Qe)}else{try{Qe.call()}catch(Ee){je=Ee}u.call(Qe.prototype)}}else{try{throw Error()}catch(Ee){je=Ee}(Qe=u())&&typeof Qe.catch=="function"&&Qe.catch(function(){})}}catch(Ee){if(Ee&&je&&typeof Ee.stack=="string")return[Ee.stack,je.stack]}return[null,null]}};b.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var T=Object.getOwnPropertyDescriptor(b.DetermineComponentFrameRoot,"name");T&&T.configurable&&Object.defineProperty(b.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=b.DetermineComponentFrameRoot(),$=E[0],Z=E[1];if($&&Z){var oe=$.split(`
`),we=Z.split(`
`);for(T=b=0;b<oe.length&&!oe[b].includes("DetermineComponentFrameRoot");)b++;for(;T<we.length&&!we[T].includes("DetermineComponentFrameRoot");)T++;if(b===oe.length||T===we.length)for(b=oe.length-1,T=we.length-1;1<=b&&0<=T&&oe[b]!==we[T];)T--;for(;1<=b&&0<=T;b--,T--)if(oe[b]!==we[T]){if(b!==1||T!==1)do if(b--,T--,0>T||oe[b]!==we[T]){var Ne=`
`+oe[b].replace(" at new "," at ");return u.displayName&&Ne.includes("<anonymous>")&&(Ne=Ne.replace("<anonymous>",u.displayName)),Ne}while(1<=b&&0<=T);break}}}finally{_e=!1,Error.prepareStackTrace=g}return(g=u?u.displayName||u.name:"")?se(g):""}function Te(u,d){switch(u.tag){case 26:case 27:case 5:return se(u.type);case 16:return se("Lazy");case 13:return u.child!==d&&d!==null?se("Suspense Fallback"):se("Suspense");case 19:return se("SuspenseList");case 0:case 15:return et(u.type,!1);case 11:return et(u.type.render,!1);case 1:return et(u.type,!0);case 31:return se("Activity");default:return""}}function Xe(u){try{var d="",g=null;do d+=Te(u,g),g=u,u=u.return;while(u);return d}catch(b){return`
Error generating stack: `+b.message+`
`+b.stack}}var at=Object.prototype.hasOwnProperty,Ve=t.unstable_scheduleCallback,Ge=t.unstable_cancelCallback,ut=t.unstable_shouldYield,Ue=t.unstable_requestPaint,De=t.unstable_now,Ce=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,ht=t.unstable_UserBlockingPriority,Rt=t.unstable_NormalPriority,Tn=t.unstable_LowPriority,fn=t.unstable_IdlePriority,Zt=t.log,lt=t.unstable_setDisableYieldValue,tn=null,Bt=null;function Lt(u){if(typeof Zt=="function"&&lt(u),Bt&&typeof Bt.setStrictMode=="function")try{Bt.setStrictMode(tn,u)}catch{}}var Wt=Math.clz32?Math.clz32:cn,jt=Math.log,Ht=Math.LN2;function cn(u){return u>>>=0,u===0?32:31-(jt(u)/Ht|0)|0}var qn=256,bn=262144,un=4194304;function ct(u){var d=u&42;if(d!==0)return d;switch(u&-u){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 u&261888;case 262144:case 524288:case 1048576:case 2097152:return u&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function re(u,d,g){var b=u.pendingLanes;if(b===0)return 0;var T=0,E=u.suspendedLanes,$=u.pingedLanes;u=u.warmLanes;var Z=b&134217727;return Z!==0?(b=Z&~E,b!==0?T=ct(b):($&=Z,$!==0?T=ct($):g||(g=Z&~u,g!==0&&(T=ct(g))))):(Z=b&~E,Z!==0?T=ct(Z):$!==0?T=ct($):g||(g=b&~u,g!==0&&(T=ct(g)))),T===0?0:d!==0&&d!==T&&(d&E)===0&&(E=T&-T,g=d&-d,E>=g||E===32&&(g&4194048)!==0)?d:T}function Re(u,d){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&d)===0}function ye(u,d){switch(u){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 We(){var u=un;return un<<=1,(un&62914560)===0&&(un=4194304),u}function qt(u){for(var d=[],g=0;31>g;g++)d.push(u);return d}function Qt(u,d){u.pendingLanes|=d,d!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function tt(u,d,g,b,T,E){var $=u.pendingLanes;u.pendingLanes=g,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=g,u.entangledLanes&=g,u.errorRecoveryDisabledLanes&=g,u.shellSuspendCounter=0;var Z=u.entanglements,oe=u.expirationTimes,we=u.hiddenUpdates;for(g=$&~g;0<g;){var Ne=31-Wt(g),Qe=1<<Ne;Z[Ne]=0,oe[Ne]=-1;var je=we[Ne];if(je!==null)for(we[Ne]=null,Ne=0;Ne<je.length;Ne++){var Ee=je[Ne];Ee!==null&&(Ee.lane&=-536870913)}g&=~Qe}b!==0&&Pe(u,b,0),E!==0&&T===0&&u.tag!==0&&(u.suspendedLanes|=E&~($&~d))}function Pe(u,d,g){u.pendingLanes|=d,u.suspendedLanes&=~d;var b=31-Wt(d);u.entangledLanes|=d,u.entanglements[b]=u.entanglements[b]|1073741824|g&261930}function nt(u,d){var g=u.entangledLanes|=d;for(u=u.entanglements;g;){var b=31-Wt(g),T=1<<b;T&d|u[b]&d&&(u[b]|=d),g&=~T}}function _t(u,d){var g=d&-d;return g=(g&42)!==0?1:Tt(g),(g&(u.suspendedLanes|d))!==0?0:g}function Tt(u){switch(u){case 2:u=1;break;case 8:u=4;break;case 32:u=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:u=128;break;case 268435456:u=134217728;break;default:u=0}return u}function on(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function Vr(){var u=F.p;return u!==0?u:(u=window.event,u===void 0?32:YD(u.type))}function Gr(u,d){var g=F.p;try{return F.p=u,d()}finally{F.p=g}}var _i=Math.random().toString(36).slice(2),jr="__reactFiber$"+_i,Pi="__reactProps$"+_i,vs="__reactContainer$"+_i,ud="__reactEvents$"+_i,xl="__reactListeners$"+_i,mc="__reactHandles$"+_i,Aa="__reactResources$"+_i,Cr="__reactMarker$"+_i;function Ir(u){delete u[jr],delete u[Pi],delete u[ud],delete u[xl],delete u[mc]}function kn(u){var d=u[jr];if(d)return d;for(var g=u.parentNode;g;){if(d=g[vs]||g[jr]){if(g=d.alternate,d.child!==null||g!==null&&g.child!==null)for(u=MD(u);u!==null;){if(g=u[jr])return g;u=MD(u)}return d}u=g,g=u.parentNode}return null}function Gs(u){if(u=u[jr]||u[vs]){var d=u.tag;if(d===5||d===6||d===13||d===31||d===26||d===27||d===3)return u}return null}function mi(u){var d=u.tag;if(d===5||d===26||d===27||d===6)return u.stateNode;throw Error(r(33))}function Xs(u){var d=u[Aa];return d||(d=u[Aa]={hoistableStyles:new Map,hoistableScripts:new Map}),d}function Hr(u){u[Cr]=!0}var _u=new Set,Za={};function bs(u,d){Je(u,d),Je(u+"Capture",d)}function Je(u,d){for(Za[u]=d,u=0;u<d.length;u++)_u.add(d[u])}var Et=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]*$"),nn={},Mn={};function _r(u){return at.call(Mn,u)?!0:at.call(nn,u)?!1:Et.test(u)?Mn[u]=!0:(nn[u]=!0,!1)}function gi(u,d,g){if(_r(d))if(g===null)u.removeAttribute(d);else{switch(typeof g){case"undefined":case"function":case"symbol":u.removeAttribute(d);return;case"boolean":var b=d.toLowerCase().slice(0,5);if(b!=="data-"&&b!=="aria-"){u.removeAttribute(d);return}}u.setAttribute(d,""+g)}}function Ji(u,d,g){if(g===null)u.removeAttribute(d);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":u.removeAttribute(d);return}u.setAttribute(d,""+g)}}function Gn(u,d,g,b){if(b===null)u.removeAttribute(g);else{switch(typeof b){case"undefined":case"function":case"symbol":case"boolean":u.removeAttribute(g);return}u.setAttributeNS(d,g,""+b)}}function Xn(u){switch(typeof u){case"bigint":case"boolean":case"number":case"string":case"undefined":return u;case"object":return u;default:return""}}function ys(u){var d=u.type;return(u=u.nodeName)&&u.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function Tu(u,d,g){var b=Object.getOwnPropertyDescriptor(u.constructor.prototype,d);if(!u.hasOwnProperty(d)&&typeof b<"u"&&typeof b.get=="function"&&typeof b.set=="function"){var T=b.get,E=b.set;return Object.defineProperty(u,d,{configurable:!0,get:function(){return T.call(this)},set:function($){g=""+$,E.call(this,$)}}),Object.defineProperty(u,d,{enumerable:b.enumerable}),{getValue:function(){return g},setValue:function($){g=""+$},stopTracking:function(){u._valueTracker=null,delete u[d]}}}}function gc(u){if(!u._valueTracker){var d=ys(u)?"checked":"value";u._valueTracker=Tu(u,d,""+u[d])}}function hd(u){if(!u)return!1;var d=u._valueTracker;if(!d)return!0;var g=d.getValue(),b="";return u&&(b=ys(u)?u.checked?"true":"false":u.value),u=b,u!==g?(d.setValue(u),!0):!1}function ku(u){if(u=u||(typeof document<"u"?document:void 0),typeof u>"u")return null;try{return u.activeElement||u.body}catch{return u.body}}var _0=/[\n"\\]/g;function es(u){return u.replace(_0,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function Ou(u,d,g,b,T,E,$,Z){u.name="",$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?u.type=$:u.removeAttribute("type"),d!=null?$==="number"?(d===0&&u.value===""||u.value!=d)&&(u.value=""+Xn(d)):u.value!==""+Xn(d)&&(u.value=""+Xn(d)):$!=="submit"&&$!=="reset"||u.removeAttribute("value"),d!=null?bc(u,$,Xn(d)):g!=null?bc(u,$,Xn(g)):b!=null&&u.removeAttribute("value"),T==null&&E!=null&&(u.defaultChecked=!!E),T!=null&&(u.checked=T&&typeof T!="function"&&typeof T!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?u.name=""+Xn(Z):u.removeAttribute("name")}function vc(u,d,g,b,T,E,$,Z){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(u.type=E),d!=null||g!=null){if(!(E!=="submit"&&E!=="reset"||d!=null)){gc(u);return}g=g!=null?""+Xn(g):"",d=d!=null?""+Xn(d):g,Z||d===u.value||(u.value=d),u.defaultValue=d}b=b??T,b=typeof b!="function"&&typeof b!="symbol"&&!!b,u.checked=Z?u.checked:!!b,u.defaultChecked=!!b,$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"&&(u.name=$),gc(u)}function bc(u,d,g){d==="number"&&ku(u.ownerDocument)===u||u.defaultValue===""+g||(u.defaultValue=""+g)}function ai(u,d,g,b){if(u=u.options,d){d={};for(var T=0;T<g.length;T++)d["$"+g[T]]=!0;for(g=0;g<u.length;g++)T=d.hasOwnProperty("$"+u[g].value),u[g].selected!==T&&(u[g].selected=T),T&&b&&(u[g].defaultSelected=!0)}else{for(g=""+Xn(g),d=null,T=0;T<u.length;T++){if(u[T].value===g){u[T].selected=!0,b&&(u[T].defaultSelected=!0);return}d!==null||u[T].disabled||(d=u[T])}d!==null&&(d.selected=!0)}}function yc(u,d,g){if(d!=null&&(d=""+Xn(d),d!==u.value&&(u.value=d),g==null)){u.defaultValue!==d&&(u.defaultValue=d);return}u.defaultValue=g!=null?""+Xn(g):""}function Eo(u,d,g,b){if(d==null){if(b!=null){if(g!=null)throw Error(r(92));if(H(b)){if(1<b.length)throw Error(r(93));b=b[0]}g=b}g==null&&(g=""),d=g}g=Xn(d),u.defaultValue=g,b=u.textContent,b===g&&b!==""&&b!==null&&(u.value=b),gc(u)}function Pt(u,d){if(d){var g=u.firstChild;if(g&&g===u.lastChild&&g.nodeType===3){g.nodeValue=d;return}}u.textContent=d}var Eu=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 Xr(u,d,g){var b=d.indexOf("--")===0;g==null||typeof g=="boolean"||g===""?b?u.setProperty(d,""):d==="float"?u.cssFloat="":u[d]="":b?u.setProperty(d,g):typeof g!="number"||g===0||Eu.has(d)?d==="float"?u.cssFloat=g:u[d]=(""+g).trim():u[d]=g+"px"}function Pn(u,d,g){if(d!=null&&typeof d!="object")throw Error(r(62));if(u=u.style,g!=null){for(var b in g)!g.hasOwnProperty(b)||d!=null&&d.hasOwnProperty(b)||(b.indexOf("--")===0?u.setProperty(b,""):b==="float"?u.cssFloat="":u[b]="");for(var T in d)b=d[T],d.hasOwnProperty(T)&&g[T]!==b&&Xr(u,T,b)}else for(var E in d)d.hasOwnProperty(E)&&Xr(u,E,d[E])}function Al(u){if(u.indexOf("-")===-1)return!1;switch(u){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 xs=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"]]),wl=/^[\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 Ja(u){return wl.test(""+u)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":u}function it(){}var Ct=null;function zt(u){return u=u.target||u.srcElement||window,u.correspondingUseElement&&(u=u.correspondingUseElement),u.nodeType===3?u.parentNode:u}var hn=null,mr=null;function As(u){var d=Gs(u);if(d&&(u=d.stateNode)){var g=u[Pi]||null;e:switch(u=d.stateNode,d.type){case"input":if(Ou(u,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name),d=g.name,g.type==="radio"&&d!=null){for(g=u;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll('input[name="'+es(""+d)+'"][type="radio"]'),d=0;d<g.length;d++){var b=g[d];if(b!==u&&b.form===u.form){var T=b[Pi]||null;if(!T)throw Error(r(90));Ou(b,T.value,T.defaultValue,T.defaultValue,T.checked,T.defaultChecked,T.type,T.name)}}for(d=0;d<g.length;d++)b=g[d],b.form===u.form&&hd(b)}break e;case"textarea":yc(u,g.value,g.defaultValue);break e;case"select":d=g.value,d!=null&&ai(u,!!g.multiple,d,!1)}}}var xc=!1;function Mu(u,d,g){if(xc)return u(d,g);xc=!0;try{var b=u(d);return b}finally{if(xc=!1,(hn!==null||mr!==null)&&(Ky(),hn&&(d=hn,u=mr,mr=hn=null,As(d),u)))for(d=0;d<u.length;d++)As(u[d])}}function eo(u,d){var g=u.stateNode;if(g===null)return null;var b=g[Pi]||null;if(b===null)return null;g=b[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":(b=!b.disabled)||(u=u.type,b=!(u==="button"||u==="input"||u==="select"||u==="textarea")),u=!b;break e;default:u=!1}if(u)return null;if(g&&typeof g!="function")throw Error(r(231,d,typeof g));return g}var ws=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qf=!1;if(ws)try{var Ru={};Object.defineProperty(Ru,"passive",{get:function(){Qf=!0}}),window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{Qf=!1}var Is=null,Sl=null,dd=null;function T0(){if(dd)return dd;var u,d=Sl,g=d.length,b,T="value"in Is?Is.value:Is.textContent,E=T.length;for(u=0;u<g&&d[u]===T[u];u++);var $=g-u;for(b=1;b<=$&&d[g-b]===T[E-b];b++);return dd=T.slice(u,1<b?1-b:void 0)}function Qn(u){var d=u.keyCode;return"charCode"in u?(u=u.charCode,u===0&&d===13&&(u=13)):u=d,u===10&&(u=13),32<=u||u===13?u:0}function Kn(){return!0}function Mo(){return!1}function Dn(u){function d(g,b,T,E,$){this._reactName=g,this._targetInst=T,this.type=b,this.nativeEvent=E,this.target=$,this.currentTarget=null;for(var Z in u)u.hasOwnProperty(Z)&&(g=u[Z],this[Z]=g?g(E):E[Z]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Kn:Mo,this.isPropagationStopped=Mo,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=Kn)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=Kn)},persist:function(){},isPersistent:Kn}),d}var gr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(u){return u.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zr=Dn(gr),Fn=p({},gr,{view:0,detail:0}),Du=Dn(Fn),Nu,k0,Ks,Ls=p({},Fn,{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(u){return u.relatedTarget===void 0?u.fromElement===u.srcElement?u.toElement:u.fromElement:u.relatedTarget},movementX:function(u){return"movementX"in u?u.movementX:(u!==Ks&&(Ks&&u.type==="mousemove"?(Nu=u.screenX-Ks.screenX,k0=u.screenY-Ks.screenY):k0=Nu=0,Ks=u),Nu)},movementY:function(u){return"movementY"in u?u.movementY:k0}}),sy=Dn(Ls),MS=p({},Ls,{dataTransfer:0}),RS=Dn(MS),DS=p({},Fn,{relatedTarget:0}),wa=Dn(DS),jl=p({},gr,{animationName:0,elapsedTime:0,pseudoElement:0}),Ac=Dn(jl),Iu=p({},gr,{clipboardData:function(u){return"clipboardData"in u?u.clipboardData:window.clipboardData}}),NS=Dn(Iu),to=p({},gr,{data:0}),ay=Dn(to),oy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ly={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"},fd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pd(u){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(u):(u=fd[u])?!!d[u]:!1}function O0(){return pd}var E0=p({},Fn,{key:function(u){if(u.key){var d=oy[u.key]||u.key;if(d!=="Unidentified")return d}return u.type==="keypress"?(u=Qn(u),u===13?"Enter":String.fromCharCode(u)):u.type==="keydown"||u.type==="keyup"?ly[u.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:O0,charCode:function(u){return u.type==="keypress"?Qn(u):0},keyCode:function(u){return u.type==="keydown"||u.type==="keyup"?u.keyCode:0},which:function(u){return u.type==="keypress"?Qn(u):u.type==="keydown"||u.type==="keyup"?u.keyCode:0}}),IS=Dn(E0),wc=p({},Ls,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ro=Dn(wc),md=p({},Fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:O0}),cy=Dn(md),M0=p({},gr,{propertyName:0,elapsedTime:0,pseudoElement:0}),R0=Dn(M0),D0=p({},Ls,{deltaX:function(u){return"deltaX"in u?u.deltaX:"wheelDeltaX"in u?-u.wheelDeltaX:0},deltaY:function(u){return"deltaY"in u?u.deltaY:"wheelDeltaY"in u?-u.wheelDeltaY:"wheelDelta"in u?-u.wheelDelta:0},deltaZ:0,deltaMode:0}),uy=Dn(D0),hy=p({},gr,{newState:0,oldState:0}),dy=Dn(hy),fy=[9,13,27,32],Uf=ws&&"CompositionEvent"in window,Lu=null;ws&&"documentMode"in document&&(Lu=document.documentMode);var LS=ws&&"TextEvent"in window&&!Lu,N0=ws&&(!Uf||Lu&&8<Lu&&11>=Lu),I0=" ",Sc=!1;function gd(u,d){switch(u){case"keyup":return fy.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oi(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var jc=!1;function Kr(u,d){switch(u){case"compositionend":return oi(d);case"keypress":return d.which!==32?null:(Sc=!0,I0);case"textInput":return u=d.data,u===I0&&Sc?null:u;default:return null}}function py(u,d){if(jc)return u==="compositionend"||!Uf&&gd(u,d)?(u=T0(),dd=Sl=Is=null,jc=!1,u):null;switch(u){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 N0&&d.locale!=="ko"?null:d.data;default:return null}}var L0={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 Bu(u){var d=u&&u.nodeName&&u.nodeName.toLowerCase();return d==="input"?!!L0[u.type]:d==="textarea"}function my(u,d,g,b){hn?mr?mr.push(b):mr=[b]:hn=b,d=i1(d,"onChange"),0<d.length&&(g=new zr("onChange","change",null,g,b),u.push({event:g,listeners:d}))}var vd=null,Cc=null;function W(u){vD(u,0)}function K(u){var d=mi(u);if(hd(d))return u}function ee(u,d){if(u==="change")return d}var te=!1;if(ws){var ue;if(ws){var be="oninput"in document;if(!be){var Fe=document.createElement("div");Fe.setAttribute("oninput","return;"),be=typeof Fe.oninput=="function"}ue=be}else ue=!1;te=ue&&(!document.documentMode||9<document.documentMode)}function Ke(){vd&&(vd.detachEvent("onpropertychange",rt),Cc=vd=null)}function rt(u){if(u.propertyName==="value"&&K(Cc)){var d=[];my(d,Cc,u,zt(u)),Mu(W,d)}}function gt(u,d,g){u==="focusin"?(Ke(),vd=d,Cc=g,vd.attachEvent("onpropertychange",rt)):u==="focusout"&&Ke()}function bt(u){if(u==="selectionchange"||u==="keyup"||u==="keydown")return K(Cc)}function At(u,d){if(u==="click")return K(d)}function Ut(u,d){if(u==="input"||u==="change")return K(d)}function Rn(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var Yt=typeof Object.is=="function"?Object.is:Rn;function Jt(u,d){if(Yt(u,d))return!0;if(typeof u!="object"||u===null||typeof d!="object"||d===null)return!1;var g=Object.keys(u),b=Object.keys(d);if(g.length!==b.length)return!1;for(b=0;b<g.length;b++){var T=g[b];if(!at.call(d,T)||!Yt(u[T],d[T]))return!1}return!0}function Ft(u){for(;u&&u.firstChild;)u=u.firstChild;return u}function Mt(u,d){var g=Ft(u);u=0;for(var b;g;){if(g.nodeType===3){if(b=u+g.textContent.length,u<=d&&b>=d)return{node:g,offset:d-u};u=b}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Ft(g)}}function ir(u,d){return u&&d?u===d?!0:u&&u.nodeType===3?!1:d&&d.nodeType===3?ir(u,d.parentNode):"contains"in u?u.contains(d):u.compareDocumentPosition?!!(u.compareDocumentPosition(d)&16):!1:!1}function Tr(u){u=u!=null&&u.ownerDocument!=null&&u.ownerDocument.defaultView!=null?u.ownerDocument.defaultView:window;for(var d=ku(u.document);d instanceof u.HTMLIFrameElement;){try{var g=typeof d.contentWindow.location.href=="string"}catch{g=!1}if(g)u=d.contentWindow;else break;d=ku(u.document)}return d}function Zr(u){var d=u&&u.nodeName&&u.nodeName.toLowerCase();return d&&(d==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||d==="textarea"||u.contentEditable==="true")}var Un=ws&&"documentMode"in document&&11>=document.documentMode,Zn=null,ts=null,li=null,Ss=!1;function Zs(u,d,g){var b=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;Ss||Zn==null||Zn!==ku(b)||(b=Zn,"selectionStart"in b&&Zr(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),li&&Jt(li,b)||(li=b,b=i1(ts,"onSelect"),0<b.length&&(d=new zr("onSelect","select",null,d,g),u.push({event:d,listeners:b}),d.target=Zn)))}function Fi(u,d){var g={};return g[u.toLowerCase()]=d.toLowerCase(),g["Webkit"+u]="webkit"+d,g["Moz"+u]="moz"+d,g}var vi={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionrun:Fi("Transition","TransitionRun"),transitionstart:Fi("Transition","TransitionStart"),transitioncancel:Fi("Transition","TransitionCancel"),transitionend:Fi("Transition","TransitionEnd")},js={},Js={};ws&&(Js=document.createElement("div").style,"AnimationEvent"in window||(delete vi.animationend.animation,delete vi.animationiteration.animation,delete vi.animationstart.animation),"TransitionEvent"in window||delete vi.transitionend.transition);function $i(u){if(js[u])return js[u];if(!vi[u])return u;var d=vi[u],g;for(g in d)if(d.hasOwnProperty(g)&&g in Js)return js[u]=d[g];return u}var Hi=$i("animationend"),Cs=$i("animationiteration"),Cl=$i("animationstart"),ns=$i("transitionrun"),gy=$i("transitionstart"),fG=$i("transitioncancel"),X4=$i("transitionend"),K4=new Map,BS="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(" ");BS.push("scrollEnd");function Do(u,d){K4.set(u,d),bs(d,[u])}var vy=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var d=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(d))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},no=[],Wf=0,PS=0;function by(){for(var u=Wf,d=PS=Wf=0;d<u;){var g=no[d];no[d++]=null;var b=no[d];no[d++]=null;var T=no[d];no[d++]=null;var E=no[d];if(no[d++]=null,b!==null&&T!==null){var $=b.pending;$===null?T.next=T:(T.next=$.next,$.next=T),b.pending=T}E!==0&&Z4(g,T,E)}}function yy(u,d,g,b){no[Wf++]=u,no[Wf++]=d,no[Wf++]=g,no[Wf++]=b,PS|=b,u.lanes|=b,u=u.alternate,u!==null&&(u.lanes|=b)}function FS(u,d,g,b){return yy(u,d,g,b),xy(u)}function bd(u,d){return yy(u,null,null,d),xy(u)}function Z4(u,d,g){u.lanes|=g;var b=u.alternate;b!==null&&(b.lanes|=g);for(var T=!1,E=u.return;E!==null;)E.childLanes|=g,b=E.alternate,b!==null&&(b.childLanes|=g),E.tag===22&&(u=E.stateNode,u===null||u._visibility&1||(T=!0)),u=E,E=E.return;return u.tag===3?(E=u.stateNode,T&&d!==null&&(T=31-Wt(g),u=E.hiddenUpdates,b=u[T],b===null?u[T]=[d]:b.push(d),d.lane=g|536870912),E):null}function xy(u){if(50<ig)throw ig=0,Vj=null,Error(r(185));for(var d=u.return;d!==null;)u=d,d=u.return;return u.tag===3?u.stateNode:null}var Yf={};function pG(u,d,g,b){this.tag=u,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=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sa(u,d,g,b){return new pG(u,d,g,b)}function $S(u){return u=u.prototype,!(!u||!u.isReactComponent)}function _c(u,d){var g=u.alternate;return g===null?(g=Sa(u.tag,d,u.key,u.mode),g.elementType=u.elementType,g.type=u.type,g.stateNode=u.stateNode,g.alternate=u,u.alternate=g):(g.pendingProps=d,g.type=u.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=u.flags&65011712,g.childLanes=u.childLanes,g.lanes=u.lanes,g.child=u.child,g.memoizedProps=u.memoizedProps,g.memoizedState=u.memoizedState,g.updateQueue=u.updateQueue,d=u.dependencies,g.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},g.sibling=u.sibling,g.index=u.index,g.ref=u.ref,g.refCleanup=u.refCleanup,g}function J4(u,d){u.flags&=65011714;var g=u.alternate;return g===null?(u.childLanes=0,u.lanes=d,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=g.childLanes,u.lanes=g.lanes,u.child=g.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=g.memoizedProps,u.memoizedState=g.memoizedState,u.updateQueue=g.updateQueue,u.type=g.type,d=g.dependencies,u.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),u}function Ay(u,d,g,b,T,E){var $=0;if(b=u,typeof u=="function")$S(u)&&($=1);else if(typeof u=="string")$=yX(u,g,J.current)?26:u==="html"||u==="head"||u==="body"?27:5;else e:switch(u){case N:return u=Sa(31,g,d,T),u.elementType=N,u.lanes=E,u;case x:return yd(g.children,T,E,d);case S:$=8,T|=24;break;case w:return u=Sa(12,g,d,T|2),u.elementType=w,u.lanes=E,u;case _:return u=Sa(13,g,d,T),u.elementType=_,u.lanes=E,u;case k:return u=Sa(19,g,d,T),u.elementType=k,u.lanes=E,u;default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case C:$=10;break e;case A:$=9;break e;case j:$=11;break e;case M:$=14;break e;case R:$=16,b=null;break e}$=29,g=Error(r(130,u===null?"null":typeof u,"")),b=null}return d=Sa($,g,d,T),d.elementType=u,d.type=b,d.lanes=E,d}function yd(u,d,g,b){return u=Sa(7,u,b,d),u.lanes=g,u}function HS(u,d,g){return u=Sa(6,u,null,d),u.lanes=g,u}function eM(u){var d=Sa(18,null,null,0);return d.stateNode=u,d}function zS(u,d,g){return d=Sa(4,u.children!==null?u.children:[],u.key,d),d.lanes=g,d.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},d}var tM=new WeakMap;function ro(u,d){if(typeof u=="object"&&u!==null){var g=tM.get(u);return g!==void 0?g:(d={value:u,source:d,stack:Xe(d)},tM.set(u,d),d)}return{value:u,source:d,stack:Xe(d)}}var Vf=[],Gf=0,wy=null,B0=0,io=[],so=0,Pu=null,_l=1,Tl="";function Tc(u,d){Vf[Gf++]=B0,Vf[Gf++]=wy,wy=u,B0=d}function nM(u,d,g){io[so++]=_l,io[so++]=Tl,io[so++]=Pu,Pu=u;var b=_l;u=Tl;var T=32-Wt(b)-1;b&=~(1<<T),g+=1;var E=32-Wt(d)+T;if(30<E){var $=T-T%5;E=(b&(1<<$)-1).toString(32),b>>=$,T-=$,_l=1<<32-Wt(d)+T|g<<T|b,Tl=E+u}else _l=1<<E|g<<T|b,Tl=u}function qS(u){u.return!==null&&(Tc(u,1),nM(u,1,0))}function QS(u){for(;u===wy;)wy=Vf[--Gf],Vf[Gf]=null,B0=Vf[--Gf],Vf[Gf]=null;for(;u===Pu;)Pu=io[--so],io[so]=null,Tl=io[--so],io[so]=null,_l=io[--so],io[so]=null}function rM(u,d){io[so++]=_l,io[so++]=Tl,io[so++]=Pu,_l=d.id,Tl=d.overflow,Pu=u}var rs=null,kr=null,Sn=!1,Fu=null,ao=!1,US=Error(r(519));function $u(u){var d=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw P0(ro(d,u)),US}function iM(u){var d=u.stateNode,g=u.type,b=u.memoizedProps;switch(d[jr]=u,d[Pi]=b,g){case"dialog":mn("cancel",d),mn("close",d);break;case"iframe":case"object":case"embed":mn("load",d);break;case"video":case"audio":for(g=0;g<ag.length;g++)mn(ag[g],d);break;case"source":mn("error",d);break;case"img":case"image":case"link":mn("error",d),mn("load",d);break;case"details":mn("toggle",d);break;case"input":mn("invalid",d),vc(d,b.value,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name,!0);break;case"select":mn("invalid",d);break;case"textarea":mn("invalid",d),Eo(d,b.value,b.defaultValue,b.children)}g=b.children,typeof g!="string"&&typeof g!="number"&&typeof g!="bigint"||d.textContent===""+g||b.suppressHydrationWarning===!0||AD(d.textContent,g)?(b.popover!=null&&(mn("beforetoggle",d),mn("toggle",d)),b.onScroll!=null&&mn("scroll",d),b.onScrollEnd!=null&&mn("scrollend",d),b.onClick!=null&&(d.onclick=it),d=!0):d=!1,d||$u(u,!0)}function sM(u){for(rs=u.return;rs;)switch(rs.tag){case 5:case 31:case 13:ao=!1;return;case 27:case 3:ao=!0;return;default:rs=rs.return}}function Xf(u){if(u!==rs)return!1;if(!Sn)return sM(u),Sn=!0,!1;var d=u.tag,g;if((g=d!==3&&d!==27)&&((g=d===5)&&(g=u.type,g=!(g!=="form"&&g!=="button")||cC(u.type,u.memoizedProps)),g=!g),g&&kr&&$u(u),sM(u),d===13){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));kr=ED(u)}else if(d===31){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));kr=ED(u)}else d===27?(d=kr,eh(u.type)?(u=pC,pC=null,kr=u):kr=d):kr=rs?lo(u.stateNode.nextSibling):null;return!0}function xd(){kr=rs=null,Sn=!1}function WS(){var u=Fu;return u!==null&&(ra===null?ra=u:ra.push.apply(ra,u),Fu=null),u}function P0(u){Fu===null?Fu=[u]:Fu.push(u)}var YS=U(null),Ad=null,kc=null;function Hu(u,d,g){G(YS,d._currentValue),d._currentValue=g}function Oc(u){u._currentValue=YS.current,V(YS)}function VS(u,d,g){for(;u!==null;){var b=u.alternate;if((u.childLanes&d)!==d?(u.childLanes|=d,b!==null&&(b.childLanes|=d)):b!==null&&(b.childLanes&d)!==d&&(b.childLanes|=d),u===g)break;u=u.return}}function GS(u,d,g,b){var T=u.child;for(T!==null&&(T.return=u);T!==null;){var E=T.dependencies;if(E!==null){var $=T.child;E=E.firstContext;e:for(;E!==null;){var Z=E;E=T;for(var oe=0;oe<d.length;oe++)if(Z.context===d[oe]){E.lanes|=g,Z=E.alternate,Z!==null&&(Z.lanes|=g),VS(E.return,g,u),b||($=null);break e}E=Z.next}}else if(T.tag===18){if($=T.return,$===null)throw Error(r(341));$.lanes|=g,E=$.alternate,E!==null&&(E.lanes|=g),VS($,g,u),$=null}else $=T.child;if($!==null)$.return=T;else for($=T;$!==null;){if($===u){$=null;break}if(T=$.sibling,T!==null){T.return=$.return,$=T;break}$=$.return}T=$}}function Kf(u,d,g,b){u=null;for(var T=d,E=!1;T!==null;){if(!E){if((T.flags&524288)!==0)E=!0;else if((T.flags&262144)!==0)break}if(T.tag===10){var $=T.alternate;if($===null)throw Error(r(387));if($=$.memoizedProps,$!==null){var Z=T.type;Yt(T.pendingProps.value,$.value)||(u!==null?u.push(Z):u=[Z])}}else if(T===fe.current){if($=T.alternate,$===null)throw Error(r(387));$.memoizedState.memoizedState!==T.memoizedState.memoizedState&&(u!==null?u.push(hg):u=[hg])}T=T.return}u!==null&&GS(d,u,g,b),d.flags|=262144}function Sy(u){for(u=u.firstContext;u!==null;){if(!Yt(u.context._currentValue,u.memoizedValue))return!0;u=u.next}return!1}function wd(u){Ad=u,kc=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function is(u){return aM(Ad,u)}function jy(u,d){return Ad===null&&wd(u),aM(u,d)}function aM(u,d){var g=d._currentValue;if(d={context:d,memoizedValue:g,next:null},kc===null){if(u===null)throw Error(r(308));kc=d,u.dependencies={lanes:0,firstContext:d},u.flags|=524288}else kc=kc.next=d;return g}var mG=typeof AbortController<"u"?AbortController:function(){var u=[],d=this.signal={aborted:!1,addEventListener:function(g,b){u.push(b)}};this.abort=function(){d.aborted=!0,u.forEach(function(g){return g()})}},gG=t.unstable_scheduleCallback,vG=t.unstable_NormalPriority,bi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function XS(){return{controller:new mG,data:new Map,refCount:0}}function F0(u){u.refCount--,u.refCount===0&&gG(vG,function(){u.controller.abort()})}var $0=null,KS=0,Zf=0,Jf=null;function bG(u,d){if($0===null){var g=$0=[];KS=0,Zf=eC(),Jf={status:"pending",value:void 0,then:function(b){g.push(b)}}}return KS++,d.then(oM,oM),d}function oM(){if(--KS===0&&$0!==null){Jf!==null&&(Jf.status="fulfilled");var u=$0;$0=null,Zf=0,Jf=null;for(var d=0;d<u.length;d++)(0,u[d])()}}function yG(u,d){var g=[],b={status:"pending",value:null,reason:null,then:function(T){g.push(T)}};return u.then(function(){b.status="fulfilled",b.value=d;for(var T=0;T<g.length;T++)(0,g[T])(d)},function(T){for(b.status="rejected",b.reason=T,T=0;T<g.length;T++)(0,g[T])(void 0)}),b}var lM=B.S;B.S=function(u,d){UR=De(),typeof d=="object"&&d!==null&&typeof d.then=="function"&&bG(u,d),lM!==null&&lM(u,d)};var Sd=U(null);function ZS(){var u=Sd.current;return u!==null?u:ur.pooledCache}function Cy(u,d){d===null?G(Sd,Sd.current):G(Sd,d.pool)}function cM(){var u=ZS();return u===null?null:{parent:bi._currentValue,pool:u}}var ep=Error(r(460)),JS=Error(r(474)),_y=Error(r(542)),Ty={then:function(){}};function uM(u){return u=u.status,u==="fulfilled"||u==="rejected"}function hM(u,d,g){switch(g=u[g],g===void 0?u.push(d):g!==d&&(d.then(it,it),d=g),d.status){case"fulfilled":return d.value;case"rejected":throw u=d.reason,fM(u),u;default:if(typeof d.status=="string")d.then(it,it);else{if(u=ur,u!==null&&100<u.shellSuspendCounter)throw Error(r(482));u=d,u.status="pending",u.then(function(b){if(d.status==="pending"){var T=d;T.status="fulfilled",T.value=b}},function(b){if(d.status==="pending"){var T=d;T.status="rejected",T.reason=b}})}switch(d.status){case"fulfilled":return d.value;case"rejected":throw u=d.reason,fM(u),u}throw Cd=d,ep}}function jd(u){try{var d=u._init;return d(u._payload)}catch(g){throw g!==null&&typeof g=="object"&&typeof g.then=="function"?(Cd=g,ep):g}}var Cd=null;function dM(){if(Cd===null)throw Error(r(459));var u=Cd;return Cd=null,u}function fM(u){if(u===ep||u===_y)throw Error(r(483))}var tp=null,H0=0;function ky(u){var d=H0;return H0+=1,tp===null&&(tp=[]),hM(tp,u,d)}function z0(u,d){d=d.props.ref,u.ref=d!==void 0?d:null}function Oy(u,d){throw d.$$typeof===m?Error(r(525)):(u=Object.prototype.toString.call(d),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":u)))}function pM(u){function d(pe,he){if(u){var Ae=pe.deletions;Ae===null?(pe.deletions=[he],pe.flags|=16):Ae.push(he)}}function g(pe,he){if(!u)return null;for(;he!==null;)d(pe,he),he=he.sibling;return null}function b(pe){for(var he=new Map;pe!==null;)pe.key!==null?he.set(pe.key,pe):he.set(pe.index,pe),pe=pe.sibling;return he}function T(pe,he){return pe=_c(pe,he),pe.index=0,pe.sibling=null,pe}function E(pe,he,Ae){return pe.index=Ae,u?(Ae=pe.alternate,Ae!==null?(Ae=Ae.index,Ae<he?(pe.flags|=67108866,he):Ae):(pe.flags|=67108866,he)):(pe.flags|=1048576,he)}function $(pe){return u&&pe.alternate===null&&(pe.flags|=67108866),pe}function Z(pe,he,Ae,He){return he===null||he.tag!==6?(he=HS(Ae,pe.mode,He),he.return=pe,he):(he=T(he,Ae),he.return=pe,he)}function oe(pe,he,Ae,He){var It=Ae.type;return It===x?Ne(pe,he,Ae.props.children,He,Ae.key):he!==null&&(he.elementType===It||typeof It=="object"&&It!==null&&It.$$typeof===R&&jd(It)===he.type)?(he=T(he,Ae.props),z0(he,Ae),he.return=pe,he):(he=Ay(Ae.type,Ae.key,Ae.props,null,pe.mode,He),z0(he,Ae),he.return=pe,he)}function we(pe,he,Ae,He){return he===null||he.tag!==4||he.stateNode.containerInfo!==Ae.containerInfo||he.stateNode.implementation!==Ae.implementation?(he=zS(Ae,pe.mode,He),he.return=pe,he):(he=T(he,Ae.children||[]),he.return=pe,he)}function Ne(pe,he,Ae,He,It){return he===null||he.tag!==7?(he=yd(Ae,pe.mode,He,It),he.return=pe,he):(he=T(he,Ae),he.return=pe,he)}function Qe(pe,he,Ae){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return he=HS(""+he,pe.mode,Ae),he.return=pe,he;if(typeof he=="object"&&he!==null){switch(he.$$typeof){case v:return Ae=Ay(he.type,he.key,he.props,null,pe.mode,Ae),z0(Ae,he),Ae.return=pe,Ae;case y:return he=zS(he,pe.mode,Ae),he.return=pe,he;case R:return he=jd(he),Qe(pe,he,Ae)}if(H(he)||L(he))return he=yd(he,pe.mode,Ae,null),he.return=pe,he;if(typeof he.then=="function")return Qe(pe,ky(he),Ae);if(he.$$typeof===C)return Qe(pe,jy(pe,he),Ae);Oy(pe,he)}return null}function je(pe,he,Ae,He){var It=he!==null?he.key:null;if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return It!==null?null:Z(pe,he,""+Ae,He);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case v:return Ae.key===It?oe(pe,he,Ae,He):null;case y:return Ae.key===It?we(pe,he,Ae,He):null;case R:return Ae=jd(Ae),je(pe,he,Ae,He)}if(H(Ae)||L(Ae))return It!==null?null:Ne(pe,he,Ae,He,null);if(typeof Ae.then=="function")return je(pe,he,ky(Ae),He);if(Ae.$$typeof===C)return je(pe,he,jy(pe,Ae),He);Oy(pe,Ae)}return null}function Ee(pe,he,Ae,He,It){if(typeof He=="string"&&He!==""||typeof He=="number"||typeof He=="bigint")return pe=pe.get(Ae)||null,Z(he,pe,""+He,It);if(typeof He=="object"&&He!==null){switch(He.$$typeof){case v:return pe=pe.get(He.key===null?Ae:He.key)||null,oe(he,pe,He,It);case y:return pe=pe.get(He.key===null?Ae:He.key)||null,we(he,pe,He,It);case R:return He=jd(He),Ee(pe,he,Ae,He,It)}if(H(He)||L(He))return pe=pe.get(Ae)||null,Ne(he,pe,He,It,null);if(typeof He.then=="function")return Ee(pe,he,Ae,ky(He),It);if(He.$$typeof===C)return Ee(pe,he,Ae,jy(he,He),It);Oy(he,He)}return null}function St(pe,he,Ae,He){for(var It=null,Nn=null,Ot=he,sn=he=0,xn=null;Ot!==null&&sn<Ae.length;sn++){Ot.index>sn?(xn=Ot,Ot=null):xn=Ot.sibling;var In=je(pe,Ot,Ae[sn],He);if(In===null){Ot===null&&(Ot=xn);break}u&&Ot&&In.alternate===null&&d(pe,Ot),he=E(In,he,sn),Nn===null?It=In:Nn.sibling=In,Nn=In,Ot=xn}if(sn===Ae.length)return g(pe,Ot),Sn&&Tc(pe,sn),It;if(Ot===null){for(;sn<Ae.length;sn++)Ot=Qe(pe,Ae[sn],He),Ot!==null&&(he=E(Ot,he,sn),Nn===null?It=Ot:Nn.sibling=Ot,Nn=Ot);return Sn&&Tc(pe,sn),It}for(Ot=b(Ot);sn<Ae.length;sn++)xn=Ee(Ot,pe,sn,Ae[sn],He),xn!==null&&(u&&xn.alternate!==null&&Ot.delete(xn.key===null?sn:xn.key),he=E(xn,he,sn),Nn===null?It=xn:Nn.sibling=xn,Nn=xn);return u&&Ot.forEach(function(sh){return d(pe,sh)}),Sn&&Tc(pe,sn),It}function $t(pe,he,Ae,He){if(Ae==null)throw Error(r(151));for(var It=null,Nn=null,Ot=he,sn=he=0,xn=null,In=Ae.next();Ot!==null&&!In.done;sn++,In=Ae.next()){Ot.index>sn?(xn=Ot,Ot=null):xn=Ot.sibling;var sh=je(pe,Ot,In.value,He);if(sh===null){Ot===null&&(Ot=xn);break}u&&Ot&&sh.alternate===null&&d(pe,Ot),he=E(sh,he,sn),Nn===null?It=sh:Nn.sibling=sh,Nn=sh,Ot=xn}if(In.done)return g(pe,Ot),Sn&&Tc(pe,sn),It;if(Ot===null){for(;!In.done;sn++,In=Ae.next())In=Qe(pe,In.value,He),In!==null&&(he=E(In,he,sn),Nn===null?It=In:Nn.sibling=In,Nn=In);return Sn&&Tc(pe,sn),It}for(Ot=b(Ot);!In.done;sn++,In=Ae.next())In=Ee(Ot,pe,sn,In.value,He),In!==null&&(u&&In.alternate!==null&&Ot.delete(In.key===null?sn:In.key),he=E(In,he,sn),Nn===null?It=In:Nn.sibling=In,Nn=In);return u&&Ot.forEach(function(EX){return d(pe,EX)}),Sn&&Tc(pe,sn),It}function or(pe,he,Ae,He){if(typeof Ae=="object"&&Ae!==null&&Ae.type===x&&Ae.key===null&&(Ae=Ae.props.children),typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case v:e:{for(var It=Ae.key;he!==null;){if(he.key===It){if(It=Ae.type,It===x){if(he.tag===7){g(pe,he.sibling),He=T(he,Ae.props.children),He.return=pe,pe=He;break e}}else if(he.elementType===It||typeof It=="object"&&It!==null&&It.$$typeof===R&&jd(It)===he.type){g(pe,he.sibling),He=T(he,Ae.props),z0(He,Ae),He.return=pe,pe=He;break e}g(pe,he);break}else d(pe,he);he=he.sibling}Ae.type===x?(He=yd(Ae.props.children,pe.mode,He,Ae.key),He.return=pe,pe=He):(He=Ay(Ae.type,Ae.key,Ae.props,null,pe.mode,He),z0(He,Ae),He.return=pe,pe=He)}return $(pe);case y:e:{for(It=Ae.key;he!==null;){if(he.key===It)if(he.tag===4&&he.stateNode.containerInfo===Ae.containerInfo&&he.stateNode.implementation===Ae.implementation){g(pe,he.sibling),He=T(he,Ae.children||[]),He.return=pe,pe=He;break e}else{g(pe,he);break}else d(pe,he);he=he.sibling}He=zS(Ae,pe.mode,He),He.return=pe,pe=He}return $(pe);case R:return Ae=jd(Ae),or(pe,he,Ae,He)}if(H(Ae))return St(pe,he,Ae,He);if(L(Ae)){if(It=L(Ae),typeof It!="function")throw Error(r(150));return Ae=It.call(Ae),$t(pe,he,Ae,He)}if(typeof Ae.then=="function")return or(pe,he,ky(Ae),He);if(Ae.$$typeof===C)return or(pe,he,jy(pe,Ae),He);Oy(pe,Ae)}return typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint"?(Ae=""+Ae,he!==null&&he.tag===6?(g(pe,he.sibling),He=T(he,Ae),He.return=pe,pe=He):(g(pe,he),He=HS(Ae,pe.mode,He),He.return=pe,pe=He),$(pe)):g(pe,he)}return function(pe,he,Ae,He){try{H0=0;var It=or(pe,he,Ae,He);return tp=null,It}catch(Ot){if(Ot===ep||Ot===_y)throw Ot;var Nn=Sa(29,Ot,null,pe.mode);return Nn.lanes=He,Nn.return=pe,Nn}finally{}}}var _d=pM(!0),mM=pM(!1),zu=!1;function ej(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tj(u,d){u=u.updateQueue,d.updateQueue===u&&(d.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function qu(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function Qu(u,d,g){var b=u.updateQueue;if(b===null)return null;if(b=b.shared,($n&2)!==0){var T=b.pending;return T===null?d.next=d:(d.next=T.next,T.next=d),b.pending=d,d=xy(u),Z4(u,null,g),d}return yy(u,b,d,g),xy(u)}function q0(u,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194048)!==0)){var b=d.lanes;b&=u.pendingLanes,g|=b,d.lanes=g,nt(u,g)}}function nj(u,d){var g=u.updateQueue,b=u.alternate;if(b!==null&&(b=b.updateQueue,g===b)){var T=null,E=null;if(g=g.firstBaseUpdate,g!==null){do{var $={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};E===null?T=E=$:E=E.next=$,g=g.next}while(g!==null);E===null?T=E=d:E=E.next=d}else T=E=d;g={baseState:b.baseState,firstBaseUpdate:T,lastBaseUpdate:E,shared:b.shared,callbacks:b.callbacks},u.updateQueue=g;return}u=g.lastBaseUpdate,u===null?g.firstBaseUpdate=d:u.next=d,g.lastBaseUpdate=d}var rj=!1;function Q0(){if(rj){var u=Jf;if(u!==null)throw u}}function U0(u,d,g,b){rj=!1;var T=u.updateQueue;zu=!1;var E=T.firstBaseUpdate,$=T.lastBaseUpdate,Z=T.shared.pending;if(Z!==null){T.shared.pending=null;var oe=Z,we=oe.next;oe.next=null,$===null?E=we:$.next=we,$=oe;var Ne=u.alternate;Ne!==null&&(Ne=Ne.updateQueue,Z=Ne.lastBaseUpdate,Z!==$&&(Z===null?Ne.firstBaseUpdate=we:Z.next=we,Ne.lastBaseUpdate=oe))}if(E!==null){var Qe=T.baseState;$=0,Ne=we=oe=null,Z=E;do{var je=Z.lane&-536870913,Ee=je!==Z.lane;if(Ee?(yn&je)===je:(b&je)===je){je!==0&&je===Zf&&(rj=!0),Ne!==null&&(Ne=Ne.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var St=u,$t=Z;je=d;var or=g;switch($t.tag){case 1:if(St=$t.payload,typeof St=="function"){Qe=St.call(or,Qe,je);break e}Qe=St;break e;case 3:St.flags=St.flags&-65537|128;case 0:if(St=$t.payload,je=typeof St=="function"?St.call(or,Qe,je):St,je==null)break e;Qe=p({},Qe,je);break e;case 2:zu=!0}}je=Z.callback,je!==null&&(u.flags|=64,Ee&&(u.flags|=8192),Ee=T.callbacks,Ee===null?T.callbacks=[je]:Ee.push(je))}else Ee={lane:je,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Ne===null?(we=Ne=Ee,oe=Qe):Ne=Ne.next=Ee,$|=je;if(Z=Z.next,Z===null){if(Z=T.shared.pending,Z===null)break;Ee=Z,Z=Ee.next,Ee.next=null,T.lastBaseUpdate=Ee,T.shared.pending=null}}while(!0);Ne===null&&(oe=Qe),T.baseState=oe,T.firstBaseUpdate=we,T.lastBaseUpdate=Ne,E===null&&(T.shared.lanes=0),Gu|=$,u.lanes=$,u.memoizedState=Qe}}function gM(u,d){if(typeof u!="function")throw Error(r(191,u));u.call(d)}function vM(u,d){var g=u.callbacks;if(g!==null)for(u.callbacks=null,u=0;u<g.length;u++)gM(g[u],d)}var np=U(null),Ey=U(0);function bM(u,d){u=Pc,G(Ey,u),G(np,d),Pc=u|d.baseLanes}function ij(){G(Ey,Pc),G(np,np.current)}function sj(){Pc=Ey.current,V(np),V(Ey)}var ja=U(null),oo=null;function Uu(u){var d=u.alternate;G(ci,ci.current&1),G(ja,u),oo===null&&(d===null||np.current!==null||d.memoizedState!==null)&&(oo=u)}function aj(u){G(ci,ci.current),G(ja,u),oo===null&&(oo=u)}function yM(u){u.tag===22?(G(ci,ci.current),G(ja,u),oo===null&&(oo=u)):Wu()}function Wu(){G(ci,ci.current),G(ja,ja.current)}function Ca(u){V(ja),oo===u&&(oo=null),V(ci)}var ci=U(0);function My(u){for(var d=u;d!==null;){if(d.tag===13){var g=d.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||dC(g)||fC(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===u)break;for(;d.sibling===null;){if(d.return===null||d.return===u)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var Ec=0,rn=null,sr=null,yi=null,Ry=!1,rp=!1,Td=!1,Dy=0,W0=0,ip=null,xG=0;function Jr(){throw Error(r(321))}function oj(u,d){if(d===null)return!1;for(var g=0;g<d.length&&g<u.length;g++)if(!Yt(u[g],d[g]))return!1;return!0}function lj(u,d,g,b,T,E){return Ec=E,rn=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,B.H=u===null||u.memoizedState===null?nR:Sj,Td=!1,E=g(b,T),Td=!1,rp&&(E=AM(d,g,b,T)),xM(u),E}function xM(u){B.H=G0;var d=sr!==null&&sr.next!==null;if(Ec=0,yi=sr=rn=null,Ry=!1,W0=0,ip=null,d)throw Error(r(300));u===null||xi||(u=u.dependencies,u!==null&&Sy(u)&&(xi=!0))}function AM(u,d,g,b){rn=u;var T=0;do{if(rp&&(ip=null),W0=0,rp=!1,25<=T)throw Error(r(301));if(T+=1,yi=sr=null,u.updateQueue!=null){var E=u.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}B.H=rR,E=d(g,b)}while(rp);return E}function AG(){var u=B.H,d=u.useState()[0];return d=typeof d.then=="function"?Y0(d):d,u=u.useState()[0],(sr!==null?sr.memoizedState:null)!==u&&(rn.flags|=1024),d}function cj(){var u=Dy!==0;return Dy=0,u}function uj(u,d,g){d.updateQueue=u.updateQueue,d.flags&=-2053,u.lanes&=~g}function hj(u){if(Ry){for(u=u.memoizedState;u!==null;){var d=u.queue;d!==null&&(d.pending=null),u=u.next}Ry=!1}Ec=0,yi=sr=rn=null,rp=!1,W0=Dy=0,ip=null}function Bs(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yi===null?rn.memoizedState=yi=u:yi=yi.next=u,yi}function ui(){if(sr===null){var u=rn.alternate;u=u!==null?u.memoizedState:null}else u=sr.next;var d=yi===null?rn.memoizedState:yi.next;if(d!==null)yi=d,sr=u;else{if(u===null)throw rn.alternate===null?Error(r(467)):Error(r(310));sr=u,u={memoizedState:sr.memoizedState,baseState:sr.baseState,baseQueue:sr.baseQueue,queue:sr.queue,next:null},yi===null?rn.memoizedState=yi=u:yi=yi.next=u}return yi}function Ny(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Y0(u){var d=W0;return W0+=1,ip===null&&(ip=[]),u=hM(ip,u,d),d=rn,(yi===null?d.memoizedState:yi.next)===null&&(d=d.alternate,B.H=d===null||d.memoizedState===null?nR:Sj),u}function Iy(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return Y0(u);if(u.$$typeof===C)return is(u)}throw Error(r(438,String(u)))}function dj(u){var d=null,g=rn.updateQueue;if(g!==null&&(d=g.memoCache),d==null){var b=rn.alternate;b!==null&&(b=b.updateQueue,b!==null&&(b=b.memoCache,b!=null&&(d={data:b.data.map(function(T){return T.slice()}),index:0})))}if(d==null&&(d={data:[],index:0}),g===null&&(g=Ny(),rn.updateQueue=g),g.memoCache=d,g=d.data[d.index],g===void 0)for(g=d.data[d.index]=Array(u),b=0;b<u;b++)g[b]=I;return d.index++,g}function Mc(u,d){return typeof d=="function"?d(u):d}function Ly(u){var d=ui();return fj(d,sr,u)}function fj(u,d,g){var b=u.queue;if(b===null)throw Error(r(311));b.lastRenderedReducer=g;var T=u.baseQueue,E=b.pending;if(E!==null){if(T!==null){var $=T.next;T.next=E.next,E.next=$}d.baseQueue=T=E,b.pending=null}if(E=u.baseState,T===null)u.memoizedState=E;else{d=T.next;var Z=$=null,oe=null,we=d,Ne=!1;do{var Qe=we.lane&-536870913;if(Qe!==we.lane?(yn&Qe)===Qe:(Ec&Qe)===Qe){var je=we.revertLane;if(je===0)oe!==null&&(oe=oe.next={lane:0,revertLane:0,gesture:null,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null}),Qe===Zf&&(Ne=!0);else if((Ec&je)===je){we=we.next,je===Zf&&(Ne=!0);continue}else Qe={lane:0,revertLane:we.revertLane,gesture:null,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null},oe===null?(Z=oe=Qe,$=E):oe=oe.next=Qe,rn.lanes|=je,Gu|=je;Qe=we.action,Td&&g(E,Qe),E=we.hasEagerState?we.eagerState:g(E,Qe)}else je={lane:Qe,revertLane:we.revertLane,gesture:we.gesture,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null},oe===null?(Z=oe=je,$=E):oe=oe.next=je,rn.lanes|=Qe,Gu|=Qe;we=we.next}while(we!==null&&we!==d);if(oe===null?$=E:oe.next=Z,!Yt(E,u.memoizedState)&&(xi=!0,Ne&&(g=Jf,g!==null)))throw g;u.memoizedState=E,u.baseState=$,u.baseQueue=oe,b.lastRenderedState=E}return T===null&&(b.lanes=0),[u.memoizedState,b.dispatch]}function pj(u){var d=ui(),g=d.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=u;var b=g.dispatch,T=g.pending,E=d.memoizedState;if(T!==null){g.pending=null;var $=T=T.next;do E=u(E,$.action),$=$.next;while($!==T);Yt(E,d.memoizedState)||(xi=!0),d.memoizedState=E,d.baseQueue===null&&(d.baseState=E),g.lastRenderedState=E}return[E,b]}function wM(u,d,g){var b=rn,T=ui(),E=Sn;if(E){if(g===void 0)throw Error(r(407));g=g()}else g=d();var $=!Yt((sr||T).memoizedState,g);if($&&(T.memoizedState=g,xi=!0),T=T.queue,vj(CM.bind(null,b,T,u),[u]),T.getSnapshot!==d||$||yi!==null&&yi.memoizedState.tag&1){if(b.flags|=2048,sp(9,{destroy:void 0},jM.bind(null,b,T,g,d),null),ur===null)throw Error(r(349));E||(Ec&127)!==0||SM(b,d,g)}return g}function SM(u,d,g){u.flags|=16384,u={getSnapshot:d,value:g},d=rn.updateQueue,d===null?(d=Ny(),rn.updateQueue=d,d.stores=[u]):(g=d.stores,g===null?d.stores=[u]:g.push(u))}function jM(u,d,g,b){d.value=g,d.getSnapshot=b,_M(d)&&TM(u)}function CM(u,d,g){return g(function(){_M(d)&&TM(u)})}function _M(u){var d=u.getSnapshot;u=u.value;try{var g=d();return!Yt(u,g)}catch{return!0}}function TM(u){var d=bd(u,2);d!==null&&ia(d,u,2)}function mj(u){var d=Bs();if(typeof u=="function"){var g=u;if(u=g(),Td){Lt(!0);try{g()}finally{Lt(!1)}}}return d.memoizedState=d.baseState=u,d.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mc,lastRenderedState:u},d}function kM(u,d,g,b){return u.baseState=g,fj(u,sr,typeof b=="function"?b:Mc)}function wG(u,d,g,b,T){if(Fy(u))throw Error(r(485));if(u=d.action,u!==null){var E={payload:T,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function($){E.listeners.push($)}};B.T!==null?g(!0):E.isTransition=!1,b(E),g=d.pending,g===null?(E.next=d.pending=E,OM(d,E)):(E.next=g.next,d.pending=g.next=E)}}function OM(u,d){var g=d.action,b=d.payload,T=u.state;if(d.isTransition){var E=B.T,$={};B.T=$;try{var Z=g(T,b),oe=B.S;oe!==null&&oe($,Z),EM(u,d,Z)}catch(we){gj(u,d,we)}finally{E!==null&&$.types!==null&&(E.types=$.types),B.T=E}}else try{E=g(T,b),EM(u,d,E)}catch(we){gj(u,d,we)}}function EM(u,d,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(b){MM(u,d,b)},function(b){return gj(u,d,b)}):MM(u,d,g)}function MM(u,d,g){d.status="fulfilled",d.value=g,RM(d),u.state=g,d=u.pending,d!==null&&(g=d.next,g===d?u.pending=null:(g=g.next,d.next=g,OM(u,g)))}function gj(u,d,g){var b=u.pending;if(u.pending=null,b!==null){b=b.next;do d.status="rejected",d.reason=g,RM(d),d=d.next;while(d!==b)}u.action=null}function RM(u){u=u.listeners;for(var d=0;d<u.length;d++)(0,u[d])()}function DM(u,d){return d}function NM(u,d){if(Sn){var g=ur.formState;if(g!==null){e:{var b=rn;if(Sn){if(kr){t:{for(var T=kr,E=ao;T.nodeType!==8;){if(!E){T=null;break t}if(T=lo(T.nextSibling),T===null){T=null;break t}}E=T.data,T=E==="F!"||E==="F"?T:null}if(T){kr=lo(T.nextSibling),b=T.data==="F!";break e}}$u(b)}b=!1}b&&(d=g[0])}}return g=Bs(),g.memoizedState=g.baseState=d,b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:DM,lastRenderedState:d},g.queue=b,g=JM.bind(null,rn,b),b.dispatch=g,b=mj(!1),E=wj.bind(null,rn,!1,b.queue),b=Bs(),T={state:d,dispatch:null,action:u,pending:null},b.queue=T,g=wG.bind(null,rn,T,E,g),T.dispatch=g,b.memoizedState=u,[d,g,!1]}function IM(u){var d=ui();return LM(d,sr,u)}function LM(u,d,g){if(d=fj(u,d,DM)[0],u=Ly(Mc)[0],typeof d=="object"&&d!==null&&typeof d.then=="function")try{var b=Y0(d)}catch($){throw $===ep?_y:$}else b=d;d=ui();var T=d.queue,E=T.dispatch;return g!==d.memoizedState&&(rn.flags|=2048,sp(9,{destroy:void 0},SG.bind(null,T,g),null)),[b,E,u]}function SG(u,d){u.action=d}function BM(u){var d=ui(),g=sr;if(g!==null)return LM(d,g,u);ui(),d=d.memoizedState,g=ui();var b=g.queue.dispatch;return g.memoizedState=u,[d,b,!1]}function sp(u,d,g,b){return u={tag:u,create:g,deps:b,inst:d,next:null},d=rn.updateQueue,d===null&&(d=Ny(),rn.updateQueue=d),g=d.lastEffect,g===null?d.lastEffect=u.next=u:(b=g.next,g.next=u,u.next=b,d.lastEffect=u),u}function PM(){return ui().memoizedState}function By(u,d,g,b){var T=Bs();rn.flags|=u,T.memoizedState=sp(1|d,{destroy:void 0},g,b===void 0?null:b)}function Py(u,d,g,b){var T=ui();b=b===void 0?null:b;var E=T.memoizedState.inst;sr!==null&&b!==null&&oj(b,sr.memoizedState.deps)?T.memoizedState=sp(d,E,g,b):(rn.flags|=u,T.memoizedState=sp(1|d,E,g,b))}function FM(u,d){By(8390656,8,u,d)}function vj(u,d){Py(2048,8,u,d)}function jG(u){rn.flags|=4;var d=rn.updateQueue;if(d===null)d=Ny(),rn.updateQueue=d,d.events=[u];else{var g=d.events;g===null?d.events=[u]:g.push(u)}}function $M(u){var d=ui().memoizedState;return jG({ref:d,nextImpl:u}),function(){if(($n&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}function HM(u,d){return Py(4,2,u,d)}function zM(u,d){return Py(4,4,u,d)}function qM(u,d){if(typeof d=="function"){u=u();var g=d(u);return function(){typeof g=="function"?g():d(null)}}if(d!=null)return u=u(),d.current=u,function(){d.current=null}}function QM(u,d,g){g=g!=null?g.concat([u]):null,Py(4,4,qM.bind(null,d,u),g)}function bj(){}function UM(u,d){var g=ui();d=d===void 0?null:d;var b=g.memoizedState;return d!==null&&oj(d,b[1])?b[0]:(g.memoizedState=[u,d],u)}function WM(u,d){var g=ui();d=d===void 0?null:d;var b=g.memoizedState;if(d!==null&&oj(d,b[1]))return b[0];if(b=u(),Td){Lt(!0);try{u()}finally{Lt(!1)}}return g.memoizedState=[b,d],b}function yj(u,d,g){return g===void 0||(Ec&1073741824)!==0&&(yn&261930)===0?u.memoizedState=d:(u.memoizedState=g,u=YR(),rn.lanes|=u,Gu|=u,g)}function YM(u,d,g,b){return Yt(g,d)?g:np.current!==null?(u=yj(u,g,b),Yt(u,d)||(xi=!0),u):(Ec&42)===0||(Ec&1073741824)!==0&&(yn&261930)===0?(xi=!0,u.memoizedState=g):(u=YR(),rn.lanes|=u,Gu|=u,d)}function VM(u,d,g,b,T){var E=F.p;F.p=E!==0&&8>E?E:8;var $=B.T,Z={};B.T=Z,wj(u,!1,d,g);try{var oe=T(),we=B.S;if(we!==null&&we(Z,oe),oe!==null&&typeof oe=="object"&&typeof oe.then=="function"){var Ne=yG(oe,b);V0(u,d,Ne,ka(u))}else V0(u,d,b,ka(u))}catch(Qe){V0(u,d,{then:function(){},status:"rejected",reason:Qe},ka())}finally{F.p=E,$!==null&&Z.types!==null&&($.types=Z.types),B.T=$}}function CG(){}function xj(u,d,g,b){if(u.tag!==5)throw Error(r(476));var T=GM(u).queue;VM(u,T,d,q,g===null?CG:function(){return XM(u),g(b)})}function GM(u){var d=u.memoizedState;if(d!==null)return d;d={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mc,lastRenderedState:q},next:null};var g={};return d.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mc,lastRenderedState:g},next:null},u.memoizedState=d,u=u.alternate,u!==null&&(u.memoizedState=d),d}function XM(u){var d=GM(u);d.next===null&&(d=u.alternate.memoizedState),V0(u,d.next.queue,{},ka())}function Aj(){return is(hg)}function KM(){return ui().memoizedState}function ZM(){return ui().memoizedState}function _G(u){for(var d=u.return;d!==null;){switch(d.tag){case 24:case 3:var g=ka();u=qu(g);var b=Qu(d,u,g);b!==null&&(ia(b,d,g),q0(b,d,g)),d={cache:XS()},u.payload=d;return}d=d.return}}function TG(u,d,g){var b=ka();g={lane:b,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Fy(u)?eR(d,g):(g=FS(u,d,g,b),g!==null&&(ia(g,u,b),tR(g,d,b)))}function JM(u,d,g){var b=ka();V0(u,d,g,b)}function V0(u,d,g,b){var T={lane:b,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Fy(u))eR(d,T);else{var E=u.alternate;if(u.lanes===0&&(E===null||E.lanes===0)&&(E=d.lastRenderedReducer,E!==null))try{var $=d.lastRenderedState,Z=E($,g);if(T.hasEagerState=!0,T.eagerState=Z,Yt(Z,$))return yy(u,d,T,0),ur===null&&by(),!1}catch{}finally{}if(g=FS(u,d,T,b),g!==null)return ia(g,u,b),tR(g,d,b),!0}return!1}function wj(u,d,g,b){if(b={lane:2,revertLane:eC(),gesture:null,action:b,hasEagerState:!1,eagerState:null,next:null},Fy(u)){if(d)throw Error(r(479))}else d=FS(u,g,b,2),d!==null&&ia(d,u,2)}function Fy(u){var d=u.alternate;return u===rn||d!==null&&d===rn}function eR(u,d){rp=Ry=!0;var g=u.pending;g===null?d.next=d:(d.next=g.next,g.next=d),u.pending=d}function tR(u,d,g){if((g&4194048)!==0){var b=d.lanes;b&=u.pendingLanes,g|=b,d.lanes=g,nt(u,g)}}var G0={readContext:is,use:Iy,useCallback:Jr,useContext:Jr,useEffect:Jr,useImperativeHandle:Jr,useLayoutEffect:Jr,useInsertionEffect:Jr,useMemo:Jr,useReducer:Jr,useRef:Jr,useState:Jr,useDebugValue:Jr,useDeferredValue:Jr,useTransition:Jr,useSyncExternalStore:Jr,useId:Jr,useHostTransitionStatus:Jr,useFormState:Jr,useActionState:Jr,useOptimistic:Jr,useMemoCache:Jr,useCacheRefresh:Jr};G0.useEffectEvent=Jr;var nR={readContext:is,use:Iy,useCallback:function(u,d){return Bs().memoizedState=[u,d===void 0?null:d],u},useContext:is,useEffect:FM,useImperativeHandle:function(u,d,g){g=g!=null?g.concat([u]):null,By(4194308,4,qM.bind(null,d,u),g)},useLayoutEffect:function(u,d){return By(4194308,4,u,d)},useInsertionEffect:function(u,d){By(4,2,u,d)},useMemo:function(u,d){var g=Bs();d=d===void 0?null:d;var b=u();if(Td){Lt(!0);try{u()}finally{Lt(!1)}}return g.memoizedState=[b,d],b},useReducer:function(u,d,g){var b=Bs();if(g!==void 0){var T=g(d);if(Td){Lt(!0);try{g(d)}finally{Lt(!1)}}}else T=d;return b.memoizedState=b.baseState=T,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:T},b.queue=u,u=u.dispatch=TG.bind(null,rn,u),[b.memoizedState,u]},useRef:function(u){var d=Bs();return u={current:u},d.memoizedState=u},useState:function(u){u=mj(u);var d=u.queue,g=JM.bind(null,rn,d);return d.dispatch=g,[u.memoizedState,g]},useDebugValue:bj,useDeferredValue:function(u,d){var g=Bs();return yj(g,u,d)},useTransition:function(){var u=mj(!1);return u=VM.bind(null,rn,u.queue,!0,!1),Bs().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,d,g){var b=rn,T=Bs();if(Sn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=d(),ur===null)throw Error(r(349));(yn&127)!==0||SM(b,d,g)}T.memoizedState=g;var E={value:g,getSnapshot:d};return T.queue=E,FM(CM.bind(null,b,E,u),[u]),b.flags|=2048,sp(9,{destroy:void 0},jM.bind(null,b,E,g,d),null),g},useId:function(){var u=Bs(),d=ur.identifierPrefix;if(Sn){var g=Tl,b=_l;g=(b&~(1<<32-Wt(b)-1)).toString(32)+g,d="_"+d+"R_"+g,g=Dy++,0<g&&(d+="H"+g.toString(32)),d+="_"}else g=xG++,d="_"+d+"r_"+g.toString(32)+"_";return u.memoizedState=d},useHostTransitionStatus:Aj,useFormState:NM,useActionState:NM,useOptimistic:function(u){var d=Bs();d.memoizedState=d.baseState=u;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return d.queue=g,d=wj.bind(null,rn,!0,g),g.dispatch=d,[u,d]},useMemoCache:dj,useCacheRefresh:function(){return Bs().memoizedState=_G.bind(null,rn)},useEffectEvent:function(u){var d=Bs(),g={impl:u};return d.memoizedState=g,function(){if(($n&2)!==0)throw Error(r(440));return g.impl.apply(void 0,arguments)}}},Sj={readContext:is,use:Iy,useCallback:UM,useContext:is,useEffect:vj,useImperativeHandle:QM,useInsertionEffect:HM,useLayoutEffect:zM,useMemo:WM,useReducer:Ly,useRef:PM,useState:function(){return Ly(Mc)},useDebugValue:bj,useDeferredValue:function(u,d){var g=ui();return YM(g,sr.memoizedState,u,d)},useTransition:function(){var u=Ly(Mc)[0],d=ui().memoizedState;return[typeof u=="boolean"?u:Y0(u),d]},useSyncExternalStore:wM,useId:KM,useHostTransitionStatus:Aj,useFormState:IM,useActionState:IM,useOptimistic:function(u,d){var g=ui();return kM(g,sr,u,d)},useMemoCache:dj,useCacheRefresh:ZM};Sj.useEffectEvent=$M;var rR={readContext:is,use:Iy,useCallback:UM,useContext:is,useEffect:vj,useImperativeHandle:QM,useInsertionEffect:HM,useLayoutEffect:zM,useMemo:WM,useReducer:pj,useRef:PM,useState:function(){return pj(Mc)},useDebugValue:bj,useDeferredValue:function(u,d){var g=ui();return sr===null?yj(g,u,d):YM(g,sr.memoizedState,u,d)},useTransition:function(){var u=pj(Mc)[0],d=ui().memoizedState;return[typeof u=="boolean"?u:Y0(u),d]},useSyncExternalStore:wM,useId:KM,useHostTransitionStatus:Aj,useFormState:BM,useActionState:BM,useOptimistic:function(u,d){var g=ui();return sr!==null?kM(g,sr,u,d):(g.baseState=u,[u,g.queue.dispatch])},useMemoCache:dj,useCacheRefresh:ZM};rR.useEffectEvent=$M;function jj(u,d,g,b){d=u.memoizedState,g=g(b,d),g=g==null?d:p({},d,g),u.memoizedState=g,u.lanes===0&&(u.updateQueue.baseState=g)}var Cj={enqueueSetState:function(u,d,g){u=u._reactInternals;var b=ka(),T=qu(b);T.payload=d,g!=null&&(T.callback=g),d=Qu(u,T,b),d!==null&&(ia(d,u,b),q0(d,u,b))},enqueueReplaceState:function(u,d,g){u=u._reactInternals;var b=ka(),T=qu(b);T.tag=1,T.payload=d,g!=null&&(T.callback=g),d=Qu(u,T,b),d!==null&&(ia(d,u,b),q0(d,u,b))},enqueueForceUpdate:function(u,d){u=u._reactInternals;var g=ka(),b=qu(g);b.tag=2,d!=null&&(b.callback=d),d=Qu(u,b,g),d!==null&&(ia(d,u,g),q0(d,u,g))}};function iR(u,d,g,b,T,E,$){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(b,E,$):d.prototype&&d.prototype.isPureReactComponent?!Jt(g,b)||!Jt(T,E):!0}function sR(u,d,g,b){u=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(g,b),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(g,b),d.state!==u&&Cj.enqueueReplaceState(d,d.state,null)}function kd(u,d){var g=d;if("ref"in d){g={};for(var b in d)b!=="ref"&&(g[b]=d[b])}if(u=u.defaultProps){g===d&&(g=p({},g));for(var T in u)g[T]===void 0&&(g[T]=u[T])}return g}function aR(u){vy(u)}function oR(u){console.error(u)}function lR(u){vy(u)}function $y(u,d){try{var g=u.onUncaughtError;g(d.value,{componentStack:d.stack})}catch(b){setTimeout(function(){throw b})}}function cR(u,d,g){try{var b=u.onCaughtError;b(g.value,{componentStack:g.stack,errorBoundary:d.tag===1?d.stateNode:null})}catch(T){setTimeout(function(){throw T})}}function _j(u,d,g){return g=qu(g),g.tag=3,g.payload={element:null},g.callback=function(){$y(u,d)},g}function uR(u){return u=qu(u),u.tag=3,u}function hR(u,d,g,b){var T=g.type.getDerivedStateFromError;if(typeof T=="function"){var E=b.value;u.payload=function(){return T(E)},u.callback=function(){cR(d,g,b)}}var $=g.stateNode;$!==null&&typeof $.componentDidCatch=="function"&&(u.callback=function(){cR(d,g,b),typeof T!="function"&&(Xu===null?Xu=new Set([this]):Xu.add(this));var Z=b.stack;this.componentDidCatch(b.value,{componentStack:Z!==null?Z:""})})}function kG(u,d,g,b,T){if(g.flags|=32768,b!==null&&typeof b=="object"&&typeof b.then=="function"){if(d=g.alternate,d!==null&&Kf(d,g,T,!0),g=ja.current,g!==null){switch(g.tag){case 31:case 13:return oo===null?Zy():g.alternate===null&&ei===0&&(ei=3),g.flags&=-257,g.flags|=65536,g.lanes=T,b===Ty?g.flags|=16384:(d=g.updateQueue,d===null?g.updateQueue=new Set([b]):d.add(b),Kj(u,b,T)),!1;case 22:return g.flags|=65536,b===Ty?g.flags|=16384:(d=g.updateQueue,d===null?(d={transitions:null,markerInstances:null,retryQueue:new Set([b])},g.updateQueue=d):(g=d.retryQueue,g===null?d.retryQueue=new Set([b]):g.add(b)),Kj(u,b,T)),!1}throw Error(r(435,g.tag))}return Kj(u,b,T),Zy(),!1}if(Sn)return d=ja.current,d!==null?((d.flags&65536)===0&&(d.flags|=256),d.flags|=65536,d.lanes=T,b!==US&&(u=Error(r(422),{cause:b}),P0(ro(u,g)))):(b!==US&&(d=Error(r(423),{cause:b}),P0(ro(d,g))),u=u.current.alternate,u.flags|=65536,T&=-T,u.lanes|=T,b=ro(b,g),T=_j(u.stateNode,b,T),nj(u,T),ei!==4&&(ei=2)),!1;var E=Error(r(520),{cause:b});if(E=ro(E,g),rg===null?rg=[E]:rg.push(E),ei!==4&&(ei=2),d===null)return!0;b=ro(b,g),g=d;do{switch(g.tag){case 3:return g.flags|=65536,u=T&-T,g.lanes|=u,u=_j(g.stateNode,b,u),nj(g,u),!1;case 1:if(d=g.type,E=g.stateNode,(g.flags&128)===0&&(typeof d.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Xu===null||!Xu.has(E))))return g.flags|=65536,T&=-T,g.lanes|=T,T=uR(T),hR(T,u,g,b),nj(g,T),!1}g=g.return}while(g!==null);return!1}var Tj=Error(r(461)),xi=!1;function ss(u,d,g,b){d.child=u===null?mM(d,null,g,b):_d(d,u.child,g,b)}function dR(u,d,g,b,T){g=g.render;var E=d.ref;if("ref"in b){var $={};for(var Z in b)Z!=="ref"&&($[Z]=b[Z])}else $=b;return wd(d),b=lj(u,d,g,$,E,T),Z=cj(),u!==null&&!xi?(uj(u,d,T),Rc(u,d,T)):(Sn&&Z&&qS(d),d.flags|=1,ss(u,d,b,T),d.child)}function fR(u,d,g,b,T){if(u===null){var E=g.type;return typeof E=="function"&&!$S(E)&&E.defaultProps===void 0&&g.compare===null?(d.tag=15,d.type=E,pR(u,d,E,b,T)):(u=Ay(g.type,null,b,d,d.mode,T),u.ref=d.ref,u.return=d,d.child=u)}if(E=u.child,!Ij(u,T)){var $=E.memoizedProps;if(g=g.compare,g=g!==null?g:Jt,g($,b)&&u.ref===d.ref)return Rc(u,d,T)}return d.flags|=1,u=_c(E,b),u.ref=d.ref,u.return=d,d.child=u}function pR(u,d,g,b,T){if(u!==null){var E=u.memoizedProps;if(Jt(E,b)&&u.ref===d.ref)if(xi=!1,d.pendingProps=b=E,Ij(u,T))(u.flags&131072)!==0&&(xi=!0);else return d.lanes=u.lanes,Rc(u,d,T)}return kj(u,d,g,b,T)}function mR(u,d,g,b){var T=b.children,E=u!==null?u.memoizedState:null;if(u===null&&d.stateNode===null&&(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),b.mode==="hidden"){if((d.flags&128)!==0){if(E=E!==null?E.baseLanes|g:g,u!==null){for(b=d.child=u.child,T=0;b!==null;)T=T|b.lanes|b.childLanes,b=b.sibling;b=T&~E}else b=0,d.child=null;return gR(u,d,E,g,b)}if((g&536870912)!==0)d.memoizedState={baseLanes:0,cachePool:null},u!==null&&Cy(d,E!==null?E.cachePool:null),E!==null?bM(d,E):ij(),yM(d);else return b=d.lanes=536870912,gR(u,d,E!==null?E.baseLanes|g:g,g,b)}else E!==null?(Cy(d,E.cachePool),bM(d,E),Wu(),d.memoizedState=null):(u!==null&&Cy(d,null),ij(),Wu());return ss(u,d,T,g),d.child}function X0(u,d){return u!==null&&u.tag===22||d.stateNode!==null||(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.sibling}function gR(u,d,g,b,T){var E=ZS();return E=E===null?null:{parent:bi._currentValue,pool:E},d.memoizedState={baseLanes:g,cachePool:E},u!==null&&Cy(d,null),ij(),yM(d),u!==null&&Kf(u,d,b,!0),d.childLanes=T,null}function Hy(u,d){return d=qy({mode:d.mode,children:d.children},u.mode),d.ref=u.ref,u.child=d,d.return=u,d}function vR(u,d,g){return _d(d,u.child,null,g),u=Hy(d,d.pendingProps),u.flags|=2,Ca(d),d.memoizedState=null,u}function OG(u,d,g){var b=d.pendingProps,T=(d.flags&128)!==0;if(d.flags&=-129,u===null){if(Sn){if(b.mode==="hidden")return u=Hy(d,b),d.lanes=536870912,X0(null,u);if(aj(d),(u=kr)?(u=OD(u,ao),u=u!==null&&u.data==="&"?u:null,u!==null&&(d.memoizedState={dehydrated:u,treeContext:Pu!==null?{id:_l,overflow:Tl}:null,retryLane:536870912,hydrationErrors:null},g=eM(u),g.return=d,d.child=g,rs=d,kr=null)):u=null,u===null)throw $u(d);return d.lanes=536870912,null}return Hy(d,b)}var E=u.memoizedState;if(E!==null){var $=E.dehydrated;if(aj(d),T)if(d.flags&256)d.flags&=-257,d=vR(u,d,g);else if(d.memoizedState!==null)d.child=u.child,d.flags|=128,d=null;else throw Error(r(558));else if(xi||Kf(u,d,g,!1),T=(g&u.childLanes)!==0,xi||T){if(b=ur,b!==null&&($=_t(b,g),$!==0&&$!==E.retryLane))throw E.retryLane=$,bd(u,$),ia(b,u,$),Tj;Zy(),d=vR(u,d,g)}else u=E.treeContext,kr=lo($.nextSibling),rs=d,Sn=!0,Fu=null,ao=!1,u!==null&&rM(d,u),d=Hy(d,b),d.flags|=4096;return d}return u=_c(u.child,{mode:b.mode,children:b.children}),u.ref=d.ref,d.child=u,u.return=d,u}function zy(u,d){var g=d.ref;if(g===null)u!==null&&u.ref!==null&&(d.flags|=4194816);else{if(typeof g!="function"&&typeof g!="object")throw Error(r(284));(u===null||u.ref!==g)&&(d.flags|=4194816)}}function kj(u,d,g,b,T){return wd(d),g=lj(u,d,g,b,void 0,T),b=cj(),u!==null&&!xi?(uj(u,d,T),Rc(u,d,T)):(Sn&&b&&qS(d),d.flags|=1,ss(u,d,g,T),d.child)}function bR(u,d,g,b,T,E){return wd(d),d.updateQueue=null,g=AM(d,b,g,T),xM(u),b=cj(),u!==null&&!xi?(uj(u,d,E),Rc(u,d,E)):(Sn&&b&&qS(d),d.flags|=1,ss(u,d,g,E),d.child)}function yR(u,d,g,b,T){if(wd(d),d.stateNode===null){var E=Yf,$=g.contextType;typeof $=="object"&&$!==null&&(E=is($)),E=new g(b,E),d.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Cj,d.stateNode=E,E._reactInternals=d,E=d.stateNode,E.props=b,E.state=d.memoizedState,E.refs={},ej(d),$=g.contextType,E.context=typeof $=="object"&&$!==null?is($):Yf,E.state=d.memoizedState,$=g.getDerivedStateFromProps,typeof $=="function"&&(jj(d,g,$,b),E.state=d.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||($=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),$!==E.state&&Cj.enqueueReplaceState(E,E.state,null),U0(d,b,E,T),Q0(),E.state=d.memoizedState),typeof E.componentDidMount=="function"&&(d.flags|=4194308),b=!0}else if(u===null){E=d.stateNode;var Z=d.memoizedProps,oe=kd(g,Z);E.props=oe;var we=E.context,Ne=g.contextType;$=Yf,typeof Ne=="object"&&Ne!==null&&($=is(Ne));var Qe=g.getDerivedStateFromProps;Ne=typeof Qe=="function"||typeof E.getSnapshotBeforeUpdate=="function",Z=d.pendingProps!==Z,Ne||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(Z||we!==$)&&sR(d,E,b,$),zu=!1;var je=d.memoizedState;E.state=je,U0(d,b,E,T),Q0(),we=d.memoizedState,Z||je!==we||zu?(typeof Qe=="function"&&(jj(d,g,Qe,b),we=d.memoizedState),(oe=zu||iR(d,g,oe,b,je,we,$))?(Ne||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(d.flags|=4194308)):(typeof E.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=b,d.memoizedState=we),E.props=b,E.state=we,E.context=$,b=oe):(typeof E.componentDidMount=="function"&&(d.flags|=4194308),b=!1)}else{E=d.stateNode,tj(u,d),$=d.memoizedProps,Ne=kd(g,$),E.props=Ne,Qe=d.pendingProps,je=E.context,we=g.contextType,oe=Yf,typeof we=="object"&&we!==null&&(oe=is(we)),Z=g.getDerivedStateFromProps,(we=typeof Z=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||($!==Qe||je!==oe)&&sR(d,E,b,oe),zu=!1,je=d.memoizedState,E.state=je,U0(d,b,E,T),Q0();var Ee=d.memoizedState;$!==Qe||je!==Ee||zu||u!==null&&u.dependencies!==null&&Sy(u.dependencies)?(typeof Z=="function"&&(jj(d,g,Z,b),Ee=d.memoizedState),(Ne=zu||iR(d,g,Ne,b,je,Ee,oe)||u!==null&&u.dependencies!==null&&Sy(u.dependencies))?(we||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(b,Ee,oe),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(b,Ee,oe)),typeof E.componentDidUpdate=="function"&&(d.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof E.componentDidUpdate!="function"||$===u.memoizedProps&&je===u.memoizedState||(d.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||$===u.memoizedProps&&je===u.memoizedState||(d.flags|=1024),d.memoizedProps=b,d.memoizedState=Ee),E.props=b,E.state=Ee,E.context=oe,b=Ne):(typeof E.componentDidUpdate!="function"||$===u.memoizedProps&&je===u.memoizedState||(d.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||$===u.memoizedProps&&je===u.memoizedState||(d.flags|=1024),b=!1)}return E=b,zy(u,d),b=(d.flags&128)!==0,E||b?(E=d.stateNode,g=b&&typeof g.getDerivedStateFromError!="function"?null:E.render(),d.flags|=1,u!==null&&b?(d.child=_d(d,u.child,null,T),d.child=_d(d,null,g,T)):ss(u,d,g,T),d.memoizedState=E.state,u=d.child):u=Rc(u,d,T),u}function xR(u,d,g,b){return xd(),d.flags|=256,ss(u,d,g,b),d.child}var Oj={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ej(u){return{baseLanes:u,cachePool:cM()}}function Mj(u,d,g){return u=u!==null?u.childLanes&~g:0,d&&(u|=Ta),u}function AR(u,d,g){var b=d.pendingProps,T=!1,E=(d.flags&128)!==0,$;if(($=E)||($=u!==null&&u.memoizedState===null?!1:(ci.current&2)!==0),$&&(T=!0,d.flags&=-129),$=(d.flags&32)!==0,d.flags&=-33,u===null){if(Sn){if(T?Uu(d):Wu(),(u=kr)?(u=OD(u,ao),u=u!==null&&u.data!=="&"?u:null,u!==null&&(d.memoizedState={dehydrated:u,treeContext:Pu!==null?{id:_l,overflow:Tl}:null,retryLane:536870912,hydrationErrors:null},g=eM(u),g.return=d,d.child=g,rs=d,kr=null)):u=null,u===null)throw $u(d);return fC(u)?d.lanes=32:d.lanes=536870912,null}var Z=b.children;return b=b.fallback,T?(Wu(),T=d.mode,Z=qy({mode:"hidden",children:Z},T),b=yd(b,T,g,null),Z.return=d,b.return=d,Z.sibling=b,d.child=Z,b=d.child,b.memoizedState=Ej(g),b.childLanes=Mj(u,$,g),d.memoizedState=Oj,X0(null,b)):(Uu(d),Rj(d,Z))}var oe=u.memoizedState;if(oe!==null&&(Z=oe.dehydrated,Z!==null)){if(E)d.flags&256?(Uu(d),d.flags&=-257,d=Dj(u,d,g)):d.memoizedState!==null?(Wu(),d.child=u.child,d.flags|=128,d=null):(Wu(),Z=b.fallback,T=d.mode,b=qy({mode:"visible",children:b.children},T),Z=yd(Z,T,g,null),Z.flags|=2,b.return=d,Z.return=d,b.sibling=Z,d.child=b,_d(d,u.child,null,g),b=d.child,b.memoizedState=Ej(g),b.childLanes=Mj(u,$,g),d.memoizedState=Oj,d=X0(null,b));else if(Uu(d),fC(Z)){if($=Z.nextSibling&&Z.nextSibling.dataset,$)var we=$.dgst;$=we,b=Error(r(419)),b.stack="",b.digest=$,P0({value:b,source:null,stack:null}),d=Dj(u,d,g)}else if(xi||Kf(u,d,g,!1),$=(g&u.childLanes)!==0,xi||$){if($=ur,$!==null&&(b=_t($,g),b!==0&&b!==oe.retryLane))throw oe.retryLane=b,bd(u,b),ia($,u,b),Tj;dC(Z)||Zy(),d=Dj(u,d,g)}else dC(Z)?(d.flags|=192,d.child=u.child,d=null):(u=oe.treeContext,kr=lo(Z.nextSibling),rs=d,Sn=!0,Fu=null,ao=!1,u!==null&&rM(d,u),d=Rj(d,b.children),d.flags|=4096);return d}return T?(Wu(),Z=b.fallback,T=d.mode,oe=u.child,we=oe.sibling,b=_c(oe,{mode:"hidden",children:b.children}),b.subtreeFlags=oe.subtreeFlags&65011712,we!==null?Z=_c(we,Z):(Z=yd(Z,T,g,null),Z.flags|=2),Z.return=d,b.return=d,b.sibling=Z,d.child=b,X0(null,b),b=d.child,Z=u.child.memoizedState,Z===null?Z=Ej(g):(T=Z.cachePool,T!==null?(oe=bi._currentValue,T=T.parent!==oe?{parent:oe,pool:oe}:T):T=cM(),Z={baseLanes:Z.baseLanes|g,cachePool:T}),b.memoizedState=Z,b.childLanes=Mj(u,$,g),d.memoizedState=Oj,X0(u.child,b)):(Uu(d),g=u.child,u=g.sibling,g=_c(g,{mode:"visible",children:b.children}),g.return=d,g.sibling=null,u!==null&&($=d.deletions,$===null?(d.deletions=[u],d.flags|=16):$.push(u)),d.child=g,d.memoizedState=null,g)}function Rj(u,d){return d=qy({mode:"visible",children:d},u.mode),d.return=u,u.child=d}function qy(u,d){return u=Sa(22,u,null,d),u.lanes=0,u}function Dj(u,d,g){return _d(d,u.child,null,g),u=Rj(d,d.pendingProps.children),u.flags|=2,d.memoizedState=null,u}function wR(u,d,g){u.lanes|=d;var b=u.alternate;b!==null&&(b.lanes|=d),VS(u.return,d,g)}function Nj(u,d,g,b,T,E){var $=u.memoizedState;$===null?u.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:b,tail:g,tailMode:T,treeForkCount:E}:($.isBackwards=d,$.rendering=null,$.renderingStartTime=0,$.last=b,$.tail=g,$.tailMode=T,$.treeForkCount=E)}function SR(u,d,g){var b=d.pendingProps,T=b.revealOrder,E=b.tail;b=b.children;var $=ci.current,Z=($&2)!==0;if(Z?($=$&1|2,d.flags|=128):$&=1,G(ci,$),ss(u,d,b,g),b=Sn?B0:0,!Z&&u!==null&&(u.flags&128)!==0)e:for(u=d.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&wR(u,g,d);else if(u.tag===19)wR(u,g,d);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===d)break e;for(;u.sibling===null;){if(u.return===null||u.return===d)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}switch(T){case"forwards":for(g=d.child,T=null;g!==null;)u=g.alternate,u!==null&&My(u)===null&&(T=g),g=g.sibling;g=T,g===null?(T=d.child,d.child=null):(T=g.sibling,g.sibling=null),Nj(d,!1,T,g,E,b);break;case"backwards":case"unstable_legacy-backwards":for(g=null,T=d.child,d.child=null;T!==null;){if(u=T.alternate,u!==null&&My(u)===null){d.child=T;break}u=T.sibling,T.sibling=g,g=T,T=u}Nj(d,!0,g,null,E,b);break;case"together":Nj(d,!1,null,null,void 0,b);break;default:d.memoizedState=null}return d.child}function Rc(u,d,g){if(u!==null&&(d.dependencies=u.dependencies),Gu|=d.lanes,(g&d.childLanes)===0)if(u!==null){if(Kf(u,d,g,!1),(g&d.childLanes)===0)return null}else return null;if(u!==null&&d.child!==u.child)throw Error(r(153));if(d.child!==null){for(u=d.child,g=_c(u,u.pendingProps),d.child=g,g.return=d;u.sibling!==null;)u=u.sibling,g=g.sibling=_c(u,u.pendingProps),g.return=d;g.sibling=null}return d.child}function Ij(u,d){return(u.lanes&d)!==0?!0:(u=u.dependencies,!!(u!==null&&Sy(u)))}function EG(u,d,g){switch(d.tag){case 3:ke(d,d.stateNode.containerInfo),Hu(d,bi,u.memoizedState.cache),xd();break;case 27:case 5:Oe(d);break;case 4:ke(d,d.stateNode.containerInfo);break;case 10:Hu(d,d.type,d.memoizedProps.value);break;case 31:if(d.memoizedState!==null)return d.flags|=128,aj(d),null;break;case 13:var b=d.memoizedState;if(b!==null)return b.dehydrated!==null?(Uu(d),d.flags|=128,null):(g&d.child.childLanes)!==0?AR(u,d,g):(Uu(d),u=Rc(u,d,g),u!==null?u.sibling:null);Uu(d);break;case 19:var T=(u.flags&128)!==0;if(b=(g&d.childLanes)!==0,b||(Kf(u,d,g,!1),b=(g&d.childLanes)!==0),T){if(b)return SR(u,d,g);d.flags|=128}if(T=d.memoizedState,T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),G(ci,ci.current),b)break;return null;case 22:return d.lanes=0,mR(u,d,g,d.pendingProps);case 24:Hu(d,bi,u.memoizedState.cache)}return Rc(u,d,g)}function jR(u,d,g){if(u!==null)if(u.memoizedProps!==d.pendingProps)xi=!0;else{if(!Ij(u,g)&&(d.flags&128)===0)return xi=!1,EG(u,d,g);xi=(u.flags&131072)!==0}else xi=!1,Sn&&(d.flags&1048576)!==0&&nM(d,B0,d.index);switch(d.lanes=0,d.tag){case 16:e:{var b=d.pendingProps;if(u=jd(d.elementType),d.type=u,typeof u=="function")$S(u)?(b=kd(u,b),d.tag=1,d=yR(null,d,u,b,g)):(d.tag=0,d=kj(null,d,u,b,g));else{if(u!=null){var T=u.$$typeof;if(T===j){d.tag=11,d=dR(null,d,u,b,g);break e}else if(T===M){d.tag=14,d=fR(null,d,u,b,g);break e}}throw d=P(u)||u,Error(r(306,d,""))}}return d;case 0:return kj(u,d,d.type,d.pendingProps,g);case 1:return b=d.type,T=kd(b,d.pendingProps),yR(u,d,b,T,g);case 3:e:{if(ke(d,d.stateNode.containerInfo),u===null)throw Error(r(387));b=d.pendingProps;var E=d.memoizedState;T=E.element,tj(u,d),U0(d,b,null,g);var $=d.memoizedState;if(b=$.cache,Hu(d,bi,b),b!==E.cache&&GS(d,[bi],g,!0),Q0(),b=$.element,E.isDehydrated)if(E={element:b,isDehydrated:!1,cache:$.cache},d.updateQueue.baseState=E,d.memoizedState=E,d.flags&256){d=xR(u,d,b,g);break e}else if(b!==T){T=ro(Error(r(424)),d),P0(T),d=xR(u,d,b,g);break e}else{switch(u=d.stateNode.containerInfo,u.nodeType){case 9:u=u.body;break;default:u=u.nodeName==="HTML"?u.ownerDocument.body:u}for(kr=lo(u.firstChild),rs=d,Sn=!0,Fu=null,ao=!0,g=mM(d,null,b,g),d.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling}else{if(xd(),b===T){d=Rc(u,d,g);break e}ss(u,d,b,g)}d=d.child}return d;case 26:return zy(u,d),u===null?(g=ID(d.type,null,d.pendingProps,null))?d.memoizedState=g:Sn||(g=d.type,u=d.pendingProps,b=s1(de.current).createElement(g),b[jr]=d,b[Pi]=u,as(b,g,u),Hr(b),d.stateNode=b):d.memoizedState=ID(d.type,u.memoizedProps,d.pendingProps,u.memoizedState),null;case 27:return Oe(d),u===null&&Sn&&(b=d.stateNode=RD(d.type,d.pendingProps,de.current),rs=d,ao=!0,T=kr,eh(d.type)?(pC=T,kr=lo(b.firstChild)):kr=T),ss(u,d,d.pendingProps.children,g),zy(u,d),u===null&&(d.flags|=4194304),d.child;case 5:return u===null&&Sn&&((T=b=kr)&&(b=aX(b,d.type,d.pendingProps,ao),b!==null?(d.stateNode=b,rs=d,kr=lo(b.firstChild),ao=!1,T=!0):T=!1),T||$u(d)),Oe(d),T=d.type,E=d.pendingProps,$=u!==null?u.memoizedProps:null,b=E.children,cC(T,E)?b=null:$!==null&&cC(T,$)&&(d.flags|=32),d.memoizedState!==null&&(T=lj(u,d,AG,null,null,g),hg._currentValue=T),zy(u,d),ss(u,d,b,g),d.child;case 6:return u===null&&Sn&&((u=g=kr)&&(g=oX(g,d.pendingProps,ao),g!==null?(d.stateNode=g,rs=d,kr=null,u=!0):u=!1),u||$u(d)),null;case 13:return AR(u,d,g);case 4:return ke(d,d.stateNode.containerInfo),b=d.pendingProps,u===null?d.child=_d(d,null,b,g):ss(u,d,b,g),d.child;case 11:return dR(u,d,d.type,d.pendingProps,g);case 7:return ss(u,d,d.pendingProps,g),d.child;case 8:return ss(u,d,d.pendingProps.children,g),d.child;case 12:return ss(u,d,d.pendingProps.children,g),d.child;case 10:return b=d.pendingProps,Hu(d,d.type,b.value),ss(u,d,b.children,g),d.child;case 9:return T=d.type._context,b=d.pendingProps.children,wd(d),T=is(T),b=b(T),d.flags|=1,ss(u,d,b,g),d.child;case 14:return fR(u,d,d.type,d.pendingProps,g);case 15:return pR(u,d,d.type,d.pendingProps,g);case 19:return SR(u,d,g);case 31:return OG(u,d,g);case 22:return mR(u,d,g,d.pendingProps);case 24:return wd(d),b=is(bi),u===null?(T=ZS(),T===null&&(T=ur,E=XS(),T.pooledCache=E,E.refCount++,E!==null&&(T.pooledCacheLanes|=g),T=E),d.memoizedState={parent:b,cache:T},ej(d),Hu(d,bi,T)):((u.lanes&g)!==0&&(tj(u,d),U0(d,null,null,g),Q0()),T=u.memoizedState,E=d.memoizedState,T.parent!==b?(T={parent:b,cache:b},d.memoizedState=T,d.lanes===0&&(d.memoizedState=d.updateQueue.baseState=T),Hu(d,bi,b)):(b=E.cache,Hu(d,bi,b),b!==T.cache&&GS(d,[bi],g,!0))),ss(u,d,d.pendingProps.children,g),d.child;case 29:throw d.pendingProps}throw Error(r(156,d.tag))}function Dc(u){u.flags|=4}function Lj(u,d,g,b,T){if((d=(u.mode&32)!==0)&&(d=!1),d){if(u.flags|=16777216,(T&335544128)===T)if(u.stateNode.complete)u.flags|=8192;else if(KR())u.flags|=8192;else throw Cd=Ty,JS}else u.flags&=-16777217}function CR(u,d){if(d.type!=="stylesheet"||(d.state.loading&4)!==0)u.flags&=-16777217;else if(u.flags|=16777216,!$D(d))if(KR())u.flags|=8192;else throw Cd=Ty,JS}function Qy(u,d){d!==null&&(u.flags|=4),u.flags&16384&&(d=u.tag!==22?We():536870912,u.lanes|=d,cp|=d)}function K0(u,d){if(!Sn)switch(u.tailMode){case"hidden":d=u.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?u.tail=null:g.sibling=null;break;case"collapsed":g=u.tail;for(var b=null;g!==null;)g.alternate!==null&&(b=g),g=g.sibling;b===null?d||u.tail===null?u.tail=null:u.tail.sibling=null:b.sibling=null}}function Or(u){var d=u.alternate!==null&&u.alternate.child===u.child,g=0,b=0;if(d)for(var T=u.child;T!==null;)g|=T.lanes|T.childLanes,b|=T.subtreeFlags&65011712,b|=T.flags&65011712,T.return=u,T=T.sibling;else for(T=u.child;T!==null;)g|=T.lanes|T.childLanes,b|=T.subtreeFlags,b|=T.flags,T.return=u,T=T.sibling;return u.subtreeFlags|=b,u.childLanes=g,d}function MG(u,d,g){var b=d.pendingProps;switch(QS(d),d.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Or(d),null;case 1:return Or(d),null;case 3:return g=d.stateNode,b=null,u!==null&&(b=u.memoizedState.cache),d.memoizedState.cache!==b&&(d.flags|=2048),Oc(bi),Me(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(u===null||u.child===null)&&(Xf(d)?Dc(d):u===null||u.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,WS())),Or(d),null;case 26:var T=d.type,E=d.memoizedState;return u===null?(Dc(d),E!==null?(Or(d),CR(d,E)):(Or(d),Lj(d,T,null,b,g))):E?E!==u.memoizedState?(Dc(d),Or(d),CR(d,E)):(Or(d),d.flags&=-16777217):(u=u.memoizedProps,u!==b&&Dc(d),Or(d),Lj(d,T,u,b,g)),null;case 27:if(Ye(d),g=de.current,T=d.type,u!==null&&d.stateNode!=null)u.memoizedProps!==b&&Dc(d);else{if(!b){if(d.stateNode===null)throw Error(r(166));return Or(d),null}u=J.current,Xf(d)?iM(d):(u=RD(T,b,g),d.stateNode=u,Dc(d))}return Or(d),null;case 5:if(Ye(d),T=d.type,u!==null&&d.stateNode!=null)u.memoizedProps!==b&&Dc(d);else{if(!b){if(d.stateNode===null)throw Error(r(166));return Or(d),null}if(E=J.current,Xf(d))iM(d);else{var $=s1(de.current);switch(E){case 1:E=$.createElementNS("http://www.w3.org/2000/svg",T);break;case 2:E=$.createElementNS("http://www.w3.org/1998/Math/MathML",T);break;default:switch(T){case"svg":E=$.createElementNS("http://www.w3.org/2000/svg",T);break;case"math":E=$.createElementNS("http://www.w3.org/1998/Math/MathML",T);break;case"script":E=$.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof b.is=="string"?$.createElement("select",{is:b.is}):$.createElement("select"),b.multiple?E.multiple=!0:b.size&&(E.size=b.size);break;default:E=typeof b.is=="string"?$.createElement(T,{is:b.is}):$.createElement(T)}}E[jr]=d,E[Pi]=b;e:for($=d.child;$!==null;){if($.tag===5||$.tag===6)E.appendChild($.stateNode);else if($.tag!==4&&$.tag!==27&&$.child!==null){$.child.return=$,$=$.child;continue}if($===d)break e;for(;$.sibling===null;){if($.return===null||$.return===d)break e;$=$.return}$.sibling.return=$.return,$=$.sibling}d.stateNode=E;e:switch(as(E,T,b),T){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}b&&Dc(d)}}return Or(d),Lj(d,d.type,u===null?null:u.memoizedProps,d.pendingProps,g),null;case 6:if(u&&d.stateNode!=null)u.memoizedProps!==b&&Dc(d);else{if(typeof b!="string"&&d.stateNode===null)throw Error(r(166));if(u=de.current,Xf(d)){if(u=d.stateNode,g=d.memoizedProps,b=null,T=rs,T!==null)switch(T.tag){case 27:case 5:b=T.memoizedProps}u[jr]=d,u=!!(u.nodeValue===g||b!==null&&b.suppressHydrationWarning===!0||AD(u.nodeValue,g)),u||$u(d,!0)}else u=s1(u).createTextNode(b),u[jr]=d,d.stateNode=u}return Or(d),null;case 31:if(g=d.memoizedState,u===null||u.memoizedState!==null){if(b=Xf(d),g!==null){if(u===null){if(!b)throw Error(r(318));if(u=d.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(557));u[jr]=d}else xd(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;Or(d),u=!1}else g=WS(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=g),u=!0;if(!u)return d.flags&256?(Ca(d),d):(Ca(d),null);if((d.flags&128)!==0)throw Error(r(558))}return Or(d),null;case 13:if(b=d.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(T=Xf(d),b!==null&&b.dehydrated!==null){if(u===null){if(!T)throw Error(r(318));if(T=d.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(r(317));T[jr]=d}else xd(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;Or(d),T=!1}else T=WS(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=T),T=!0;if(!T)return d.flags&256?(Ca(d),d):(Ca(d),null)}return Ca(d),(d.flags&128)!==0?(d.lanes=g,d):(g=b!==null,u=u!==null&&u.memoizedState!==null,g&&(b=d.child,T=null,b.alternate!==null&&b.alternate.memoizedState!==null&&b.alternate.memoizedState.cachePool!==null&&(T=b.alternate.memoizedState.cachePool.pool),E=null,b.memoizedState!==null&&b.memoizedState.cachePool!==null&&(E=b.memoizedState.cachePool.pool),E!==T&&(b.flags|=2048)),g!==u&&g&&(d.child.flags|=8192),Qy(d,d.updateQueue),Or(d),null);case 4:return Me(),u===null&&iC(d.stateNode.containerInfo),Or(d),null;case 10:return Oc(d.type),Or(d),null;case 19:if(V(ci),b=d.memoizedState,b===null)return Or(d),null;if(T=(d.flags&128)!==0,E=b.rendering,E===null)if(T)K0(b,!1);else{if(ei!==0||u!==null&&(u.flags&128)!==0)for(u=d.child;u!==null;){if(E=My(u),E!==null){for(d.flags|=128,K0(b,!1),u=E.updateQueue,d.updateQueue=u,Qy(d,u),d.subtreeFlags=0,u=g,g=d.child;g!==null;)J4(g,u),g=g.sibling;return G(ci,ci.current&1|2),Sn&&Tc(d,b.treeForkCount),d.child}u=u.sibling}b.tail!==null&&De()>Gy&&(d.flags|=128,T=!0,K0(b,!1),d.lanes=4194304)}else{if(!T)if(u=My(E),u!==null){if(d.flags|=128,T=!0,u=u.updateQueue,d.updateQueue=u,Qy(d,u),K0(b,!0),b.tail===null&&b.tailMode==="hidden"&&!E.alternate&&!Sn)return Or(d),null}else 2*De()-b.renderingStartTime>Gy&&g!==536870912&&(d.flags|=128,T=!0,K0(b,!1),d.lanes=4194304);b.isBackwards?(E.sibling=d.child,d.child=E):(u=b.last,u!==null?u.sibling=E:d.child=E,b.last=E)}return b.tail!==null?(u=b.tail,b.rendering=u,b.tail=u.sibling,b.renderingStartTime=De(),u.sibling=null,g=ci.current,G(ci,T?g&1|2:g&1),Sn&&Tc(d,b.treeForkCount),u):(Or(d),null);case 22:case 23:return Ca(d),sj(),b=d.memoizedState!==null,u!==null?u.memoizedState!==null!==b&&(d.flags|=8192):b&&(d.flags|=8192),b?(g&536870912)!==0&&(d.flags&128)===0&&(Or(d),d.subtreeFlags&6&&(d.flags|=8192)):Or(d),g=d.updateQueue,g!==null&&Qy(d,g.retryQueue),g=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),b=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),b!==g&&(d.flags|=2048),u!==null&&V(Sd),null;case 24:return g=null,u!==null&&(g=u.memoizedState.cache),d.memoizedState.cache!==g&&(d.flags|=2048),Oc(bi),Or(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function RG(u,d){switch(QS(d),d.tag){case 1:return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 3:return Oc(bi),Me(),u=d.flags,(u&65536)!==0&&(u&128)===0?(d.flags=u&-65537|128,d):null;case 26:case 27:case 5:return Ye(d),null;case 31:if(d.memoizedState!==null){if(Ca(d),d.alternate===null)throw Error(r(340));xd()}return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 13:if(Ca(d),u=d.memoizedState,u!==null&&u.dehydrated!==null){if(d.alternate===null)throw Error(r(340));xd()}return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 19:return V(ci),null;case 4:return Me(),null;case 10:return Oc(d.type),null;case 22:case 23:return Ca(d),sj(),u!==null&&V(Sd),u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 24:return Oc(bi),null;case 25:return null;default:return null}}function _R(u,d){switch(QS(d),d.tag){case 3:Oc(bi),Me();break;case 26:case 27:case 5:Ye(d);break;case 4:Me();break;case 31:d.memoizedState!==null&&Ca(d);break;case 13:Ca(d);break;case 19:V(ci);break;case 10:Oc(d.type);break;case 22:case 23:Ca(d),sj(),u!==null&&V(Sd);break;case 24:Oc(bi)}}function Z0(u,d){try{var g=d.updateQueue,b=g!==null?g.lastEffect:null;if(b!==null){var T=b.next;g=T;do{if((g.tag&u)===u){b=void 0;var E=g.create,$=g.inst;b=E(),$.destroy=b}g=g.next}while(g!==T)}}catch(Z){er(d,d.return,Z)}}function Yu(u,d,g){try{var b=d.updateQueue,T=b!==null?b.lastEffect:null;if(T!==null){var E=T.next;b=E;do{if((b.tag&u)===u){var $=b.inst,Z=$.destroy;if(Z!==void 0){$.destroy=void 0,T=d;var oe=g,we=Z;try{we()}catch(Ne){er(T,oe,Ne)}}}b=b.next}while(b!==E)}}catch(Ne){er(d,d.return,Ne)}}function TR(u){var d=u.updateQueue;if(d!==null){var g=u.stateNode;try{vM(d,g)}catch(b){er(u,u.return,b)}}}function kR(u,d,g){g.props=kd(u.type,u.memoizedProps),g.state=u.memoizedState;try{g.componentWillUnmount()}catch(b){er(u,d,b)}}function J0(u,d){try{var g=u.ref;if(g!==null){switch(u.tag){case 26:case 27:case 5:var b=u.stateNode;break;case 30:b=u.stateNode;break;default:b=u.stateNode}typeof g=="function"?u.refCleanup=g(b):g.current=b}}catch(T){er(u,d,T)}}function kl(u,d){var g=u.ref,b=u.refCleanup;if(g!==null)if(typeof b=="function")try{b()}catch(T){er(u,d,T)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(T){er(u,d,T)}else g.current=null}function OR(u){var d=u.type,g=u.memoizedProps,b=u.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":g.autoFocus&&b.focus();break e;case"img":g.src?b.src=g.src:g.srcSet&&(b.srcset=g.srcSet)}}catch(T){er(u,u.return,T)}}function Bj(u,d,g){try{var b=u.stateNode;eX(b,u.type,g,d),b[Pi]=d}catch(T){er(u,u.return,T)}}function ER(u){return u.tag===5||u.tag===3||u.tag===26||u.tag===27&&eh(u.type)||u.tag===4}function Pj(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||ER(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.tag===27&&eh(u.type)||u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function Fj(u,d,g){var b=u.tag;if(b===5||b===6)u=u.stateNode,d?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(u,d):(d=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,d.appendChild(u),g=g._reactRootContainer,g!=null||d.onclick!==null||(d.onclick=it));else if(b!==4&&(b===27&&eh(u.type)&&(g=u.stateNode,d=null),u=u.child,u!==null))for(Fj(u,d,g),u=u.sibling;u!==null;)Fj(u,d,g),u=u.sibling}function Uy(u,d,g){var b=u.tag;if(b===5||b===6)u=u.stateNode,d?g.insertBefore(u,d):g.appendChild(u);else if(b!==4&&(b===27&&eh(u.type)&&(g=u.stateNode),u=u.child,u!==null))for(Uy(u,d,g),u=u.sibling;u!==null;)Uy(u,d,g),u=u.sibling}function MR(u){var d=u.stateNode,g=u.memoizedProps;try{for(var b=u.type,T=d.attributes;T.length;)d.removeAttributeNode(T[0]);as(d,b,g),d[jr]=u,d[Pi]=g}catch(E){er(u,u.return,E)}}var Nc=!1,Ai=!1,$j=!1,RR=typeof WeakSet=="function"?WeakSet:Set,zi=null;function DG(u,d){if(u=u.containerInfo,oC=d1,u=Tr(u),Zr(u)){if("selectionStart"in u)var g={start:u.selectionStart,end:u.selectionEnd};else e:{g=(g=u.ownerDocument)&&g.defaultView||window;var b=g.getSelection&&g.getSelection();if(b&&b.rangeCount!==0){g=b.anchorNode;var T=b.anchorOffset,E=b.focusNode;b=b.focusOffset;try{g.nodeType,E.nodeType}catch{g=null;break e}var $=0,Z=-1,oe=-1,we=0,Ne=0,Qe=u,je=null;t:for(;;){for(var Ee;Qe!==g||T!==0&&Qe.nodeType!==3||(Z=$+T),Qe!==E||b!==0&&Qe.nodeType!==3||(oe=$+b),Qe.nodeType===3&&($+=Qe.nodeValue.length),(Ee=Qe.firstChild)!==null;)je=Qe,Qe=Ee;for(;;){if(Qe===u)break t;if(je===g&&++we===T&&(Z=$),je===E&&++Ne===b&&(oe=$),(Ee=Qe.nextSibling)!==null)break;Qe=je,je=Qe.parentNode}Qe=Ee}g=Z===-1||oe===-1?null:{start:Z,end:oe}}else g=null}g=g||{start:0,end:0}}else g=null;for(lC={focusedElem:u,selectionRange:g},d1=!1,zi=d;zi!==null;)if(d=zi,u=d.child,(d.subtreeFlags&1028)!==0&&u!==null)u.return=d,zi=u;else for(;zi!==null;){switch(d=zi,E=d.alternate,u=d.flags,d.tag){case 0:if((u&4)!==0&&(u=d.updateQueue,u=u!==null?u.events:null,u!==null))for(g=0;g<u.length;g++)T=u[g],T.ref.impl=T.nextImpl;break;case 11:case 15:break;case 1:if((u&1024)!==0&&E!==null){u=void 0,g=d,T=E.memoizedProps,E=E.memoizedState,b=g.stateNode;try{var St=kd(g.type,T);u=b.getSnapshotBeforeUpdate(St,E),b.__reactInternalSnapshotBeforeUpdate=u}catch($t){er(g,g.return,$t)}}break;case 3:if((u&1024)!==0){if(u=d.stateNode.containerInfo,g=u.nodeType,g===9)hC(u);else if(g===1)switch(u.nodeName){case"HEAD":case"HTML":case"BODY":hC(u);break;default:u.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(r(163))}if(u=d.sibling,u!==null){u.return=d.return,zi=u;break}zi=d.return}}function DR(u,d,g){var b=g.flags;switch(g.tag){case 0:case 11:case 15:Lc(u,g),b&4&&Z0(5,g);break;case 1:if(Lc(u,g),b&4)if(u=g.stateNode,d===null)try{u.componentDidMount()}catch($){er(g,g.return,$)}else{var T=kd(g.type,d.memoizedProps);d=d.memoizedState;try{u.componentDidUpdate(T,d,u.__reactInternalSnapshotBeforeUpdate)}catch($){er(g,g.return,$)}}b&64&&TR(g),b&512&&J0(g,g.return);break;case 3:if(Lc(u,g),b&64&&(u=g.updateQueue,u!==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{vM(u,d)}catch($){er(g,g.return,$)}}break;case 27:d===null&&b&4&&MR(g);case 26:case 5:Lc(u,g),d===null&&b&4&&OR(g),b&512&&J0(g,g.return);break;case 12:Lc(u,g);break;case 31:Lc(u,g),b&4&&LR(u,g);break;case 13:Lc(u,g),b&4&&BR(u,g),b&64&&(u=g.memoizedState,u!==null&&(u=u.dehydrated,u!==null&&(g=zG.bind(null,g),lX(u,g))));break;case 22:if(b=g.memoizedState!==null||Nc,!b){d=d!==null&&d.memoizedState!==null||Ai,T=Nc;var E=Ai;Nc=b,(Ai=d)&&!E?Bc(u,g,(g.subtreeFlags&8772)!==0):Lc(u,g),Nc=T,Ai=E}break;case 30:break;default:Lc(u,g)}}function NR(u){var d=u.alternate;d!==null&&(u.alternate=null,NR(d)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(d=u.stateNode,d!==null&&Ir(d)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}var Lr=null,ea=!1;function Ic(u,d,g){for(g=g.child;g!==null;)IR(u,d,g),g=g.sibling}function IR(u,d,g){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(tn,g)}catch{}switch(g.tag){case 26:Ai||kl(g,d),Ic(u,d,g),g.memoizedState?g.memoizedState.count--:g.stateNode&&(g=g.stateNode,g.parentNode.removeChild(g));break;case 27:Ai||kl(g,d);var b=Lr,T=ea;eh(g.type)&&(Lr=g.stateNode,ea=!1),Ic(u,d,g),lg(g.stateNode),Lr=b,ea=T;break;case 5:Ai||kl(g,d);case 6:if(b=Lr,T=ea,Lr=null,Ic(u,d,g),Lr=b,ea=T,Lr!==null)if(ea)try{(Lr.nodeType===9?Lr.body:Lr.nodeName==="HTML"?Lr.ownerDocument.body:Lr).removeChild(g.stateNode)}catch(E){er(g,d,E)}else try{Lr.removeChild(g.stateNode)}catch(E){er(g,d,E)}break;case 18:Lr!==null&&(ea?(u=Lr,TD(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,g.stateNode),vp(u)):TD(Lr,g.stateNode));break;case 4:b=Lr,T=ea,Lr=g.stateNode.containerInfo,ea=!0,Ic(u,d,g),Lr=b,ea=T;break;case 0:case 11:case 14:case 15:Yu(2,g,d),Ai||Yu(4,g,d),Ic(u,d,g);break;case 1:Ai||(kl(g,d),b=g.stateNode,typeof b.componentWillUnmount=="function"&&kR(g,d,b)),Ic(u,d,g);break;case 21:Ic(u,d,g);break;case 22:Ai=(b=Ai)||g.memoizedState!==null,Ic(u,d,g),Ai=b;break;default:Ic(u,d,g)}}function LR(u,d){if(d.memoizedState===null&&(u=d.alternate,u!==null&&(u=u.memoizedState,u!==null))){u=u.dehydrated;try{vp(u)}catch(g){er(d,d.return,g)}}}function BR(u,d){if(d.memoizedState===null&&(u=d.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{vp(u)}catch(g){er(d,d.return,g)}}function NG(u){switch(u.tag){case 31:case 13:case 19:var d=u.stateNode;return d===null&&(d=u.stateNode=new RR),d;case 22:return u=u.stateNode,d=u._retryCache,d===null&&(d=u._retryCache=new RR),d;default:throw Error(r(435,u.tag))}}function Wy(u,d){var g=NG(u);d.forEach(function(b){if(!g.has(b)){g.add(b);var T=qG.bind(null,u,b);b.then(T,T)}})}function ta(u,d){var g=d.deletions;if(g!==null)for(var b=0;b<g.length;b++){var T=g[b],E=u,$=d,Z=$;e:for(;Z!==null;){switch(Z.tag){case 27:if(eh(Z.type)){Lr=Z.stateNode,ea=!1;break e}break;case 5:Lr=Z.stateNode,ea=!1;break e;case 3:case 4:Lr=Z.stateNode.containerInfo,ea=!0;break e}Z=Z.return}if(Lr===null)throw Error(r(160));IR(E,$,T),Lr=null,ea=!1,E=T.alternate,E!==null&&(E.return=null),T.return=null}if(d.subtreeFlags&13886)for(d=d.child;d!==null;)PR(d,u),d=d.sibling}var No=null;function PR(u,d){var g=u.alternate,b=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:ta(d,u),na(u),b&4&&(Yu(3,u,u.return),Z0(3,u),Yu(5,u,u.return));break;case 1:ta(d,u),na(u),b&512&&(Ai||g===null||kl(g,g.return)),b&64&&Nc&&(u=u.updateQueue,u!==null&&(b=u.callbacks,b!==null&&(g=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=g===null?b:g.concat(b))));break;case 26:var T=No;if(ta(d,u),na(u),b&512&&(Ai||g===null||kl(g,g.return)),b&4){var E=g!==null?g.memoizedState:null;if(b=u.memoizedState,g===null)if(b===null)if(u.stateNode===null){e:{b=u.type,g=u.memoizedProps,T=T.ownerDocument||T;t:switch(b){case"title":E=T.getElementsByTagName("title")[0],(!E||E[Cr]||E[jr]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=T.createElement(b),T.head.insertBefore(E,T.querySelector("head > title"))),as(E,b,g),E[jr]=u,Hr(E),b=E;break e;case"link":var $=PD("link","href",T).get(b+(g.href||""));if($){for(var Z=0;Z<$.length;Z++)if(E=$[Z],E.getAttribute("href")===(g.href==null||g.href===""?null:g.href)&&E.getAttribute("rel")===(g.rel==null?null:g.rel)&&E.getAttribute("title")===(g.title==null?null:g.title)&&E.getAttribute("crossorigin")===(g.crossOrigin==null?null:g.crossOrigin)){$.splice(Z,1);break t}}E=T.createElement(b),as(E,b,g),T.head.appendChild(E);break;case"meta":if($=PD("meta","content",T).get(b+(g.content||""))){for(Z=0;Z<$.length;Z++)if(E=$[Z],E.getAttribute("content")===(g.content==null?null:""+g.content)&&E.getAttribute("name")===(g.name==null?null:g.name)&&E.getAttribute("property")===(g.property==null?null:g.property)&&E.getAttribute("http-equiv")===(g.httpEquiv==null?null:g.httpEquiv)&&E.getAttribute("charset")===(g.charSet==null?null:g.charSet)){$.splice(Z,1);break t}}E=T.createElement(b),as(E,b,g),T.head.appendChild(E);break;default:throw Error(r(468,b))}E[jr]=u,Hr(E),b=E}u.stateNode=b}else FD(T,u.type,u.stateNode);else u.stateNode=BD(T,b,u.memoizedProps);else E!==b?(E===null?g.stateNode!==null&&(g=g.stateNode,g.parentNode.removeChild(g)):E.count--,b===null?FD(T,u.type,u.stateNode):BD(T,b,u.memoizedProps)):b===null&&u.stateNode!==null&&Bj(u,u.memoizedProps,g.memoizedProps)}break;case 27:ta(d,u),na(u),b&512&&(Ai||g===null||kl(g,g.return)),g!==null&&b&4&&Bj(u,u.memoizedProps,g.memoizedProps);break;case 5:if(ta(d,u),na(u),b&512&&(Ai||g===null||kl(g,g.return)),u.flags&32){T=u.stateNode;try{Pt(T,"")}catch(St){er(u,u.return,St)}}b&4&&u.stateNode!=null&&(T=u.memoizedProps,Bj(u,T,g!==null?g.memoizedProps:T)),b&1024&&($j=!0);break;case 6:if(ta(d,u),na(u),b&4){if(u.stateNode===null)throw Error(r(162));b=u.memoizedProps,g=u.stateNode;try{g.nodeValue=b}catch(St){er(u,u.return,St)}}break;case 3:if(l1=null,T=No,No=a1(d.containerInfo),ta(d,u),No=T,na(u),b&4&&g!==null&&g.memoizedState.isDehydrated)try{vp(d.containerInfo)}catch(St){er(u,u.return,St)}$j&&($j=!1,FR(u));break;case 4:b=No,No=a1(u.stateNode.containerInfo),ta(d,u),na(u),No=b;break;case 12:ta(d,u),na(u);break;case 31:ta(d,u),na(u),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,Wy(u,b)));break;case 13:ta(d,u),na(u),u.child.flags&8192&&u.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(Vy=De()),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,Wy(u,b)));break;case 22:T=u.memoizedState!==null;var oe=g!==null&&g.memoizedState!==null,we=Nc,Ne=Ai;if(Nc=we||T,Ai=Ne||oe,ta(d,u),Ai=Ne,Nc=we,na(u),b&8192)e:for(d=u.stateNode,d._visibility=T?d._visibility&-2:d._visibility|1,T&&(g===null||oe||Nc||Ai||Od(u)),g=null,d=u;;){if(d.tag===5||d.tag===26){if(g===null){oe=g=d;try{if(E=oe.stateNode,T)$=E.style,typeof $.setProperty=="function"?$.setProperty("display","none","important"):$.display="none";else{Z=oe.stateNode;var Qe=oe.memoizedProps.style,je=Qe!=null&&Qe.hasOwnProperty("display")?Qe.display:null;Z.style.display=je==null||typeof je=="boolean"?"":(""+je).trim()}}catch(St){er(oe,oe.return,St)}}}else if(d.tag===6){if(g===null){oe=d;try{oe.stateNode.nodeValue=T?"":oe.memoizedProps}catch(St){er(oe,oe.return,St)}}}else if(d.tag===18){if(g===null){oe=d;try{var Ee=oe.stateNode;T?kD(Ee,!0):kD(oe.stateNode,!1)}catch(St){er(oe,oe.return,St)}}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===u)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===u)break e;for(;d.sibling===null;){if(d.return===null||d.return===u)break e;g===d&&(g=null),d=d.return}g===d&&(g=null),d.sibling.return=d.return,d=d.sibling}b&4&&(b=u.updateQueue,b!==null&&(g=b.retryQueue,g!==null&&(b.retryQueue=null,Wy(u,g))));break;case 19:ta(d,u),na(u),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,Wy(u,b)));break;case 30:break;case 21:break;default:ta(d,u),na(u)}}function na(u){var d=u.flags;if(d&2){try{for(var g,b=u.return;b!==null;){if(ER(b)){g=b;break}b=b.return}if(g==null)throw Error(r(160));switch(g.tag){case 27:var T=g.stateNode,E=Pj(u);Uy(u,E,T);break;case 5:var $=g.stateNode;g.flags&32&&(Pt($,""),g.flags&=-33);var Z=Pj(u);Uy(u,Z,$);break;case 3:case 4:var oe=g.stateNode.containerInfo,we=Pj(u);Fj(u,we,oe);break;default:throw Error(r(161))}}catch(Ne){er(u,u.return,Ne)}u.flags&=-3}d&4096&&(u.flags&=-4097)}function FR(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var d=u;FR(d),d.tag===5&&d.flags&1024&&d.stateNode.reset(),u=u.sibling}}function Lc(u,d){if(d.subtreeFlags&8772)for(d=d.child;d!==null;)DR(u,d.alternate,d),d=d.sibling}function Od(u){for(u=u.child;u!==null;){var d=u;switch(d.tag){case 0:case 11:case 14:case 15:Yu(4,d,d.return),Od(d);break;case 1:kl(d,d.return);var g=d.stateNode;typeof g.componentWillUnmount=="function"&&kR(d,d.return,g),Od(d);break;case 27:lg(d.stateNode);case 26:case 5:kl(d,d.return),Od(d);break;case 22:d.memoizedState===null&&Od(d);break;case 30:Od(d);break;default:Od(d)}u=u.sibling}}function Bc(u,d,g){for(g=g&&(d.subtreeFlags&8772)!==0,d=d.child;d!==null;){var b=d.alternate,T=u,E=d,$=E.flags;switch(E.tag){case 0:case 11:case 15:Bc(T,E,g),Z0(4,E);break;case 1:if(Bc(T,E,g),b=E,T=b.stateNode,typeof T.componentDidMount=="function")try{T.componentDidMount()}catch(we){er(b,b.return,we)}if(b=E,T=b.updateQueue,T!==null){var Z=b.stateNode;try{var oe=T.shared.hiddenCallbacks;if(oe!==null)for(T.shared.hiddenCallbacks=null,T=0;T<oe.length;T++)gM(oe[T],Z)}catch(we){er(b,b.return,we)}}g&&$&64&&TR(E),J0(E,E.return);break;case 27:MR(E);case 26:case 5:Bc(T,E,g),g&&b===null&&$&4&&OR(E),J0(E,E.return);break;case 12:Bc(T,E,g);break;case 31:Bc(T,E,g),g&&$&4&&LR(T,E);break;case 13:Bc(T,E,g),g&&$&4&&BR(T,E);break;case 22:E.memoizedState===null&&Bc(T,E,g),J0(E,E.return);break;case 30:break;default:Bc(T,E,g)}d=d.sibling}}function Hj(u,d){var g=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),u=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(u=d.memoizedState.cachePool.pool),u!==g&&(u!=null&&u.refCount++,g!=null&&F0(g))}function zj(u,d){u=null,d.alternate!==null&&(u=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==u&&(d.refCount++,u!=null&&F0(u))}function Io(u,d,g,b){if(d.subtreeFlags&10256)for(d=d.child;d!==null;)$R(u,d,g,b),d=d.sibling}function $R(u,d,g,b){var T=d.flags;switch(d.tag){case 0:case 11:case 15:Io(u,d,g,b),T&2048&&Z0(9,d);break;case 1:Io(u,d,g,b);break;case 3:Io(u,d,g,b),T&2048&&(u=null,d.alternate!==null&&(u=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==u&&(d.refCount++,u!=null&&F0(u)));break;case 12:if(T&2048){Io(u,d,g,b),u=d.stateNode;try{var E=d.memoizedProps,$=E.id,Z=E.onPostCommit;typeof Z=="function"&&Z($,d.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(oe){er(d,d.return,oe)}}else Io(u,d,g,b);break;case 31:Io(u,d,g,b);break;case 13:Io(u,d,g,b);break;case 23:break;case 22:E=d.stateNode,$=d.alternate,d.memoizedState!==null?E._visibility&2?Io(u,d,g,b):eg(u,d):E._visibility&2?Io(u,d,g,b):(E._visibility|=2,ap(u,d,g,b,(d.subtreeFlags&10256)!==0||!1)),T&2048&&Hj($,d);break;case 24:Io(u,d,g,b),T&2048&&zj(d.alternate,d);break;default:Io(u,d,g,b)}}function ap(u,d,g,b,T){for(T=T&&((d.subtreeFlags&10256)!==0||!1),d=d.child;d!==null;){var E=u,$=d,Z=g,oe=b,we=$.flags;switch($.tag){case 0:case 11:case 15:ap(E,$,Z,oe,T),Z0(8,$);break;case 23:break;case 22:var Ne=$.stateNode;$.memoizedState!==null?Ne._visibility&2?ap(E,$,Z,oe,T):eg(E,$):(Ne._visibility|=2,ap(E,$,Z,oe,T)),T&&we&2048&&Hj($.alternate,$);break;case 24:ap(E,$,Z,oe,T),T&&we&2048&&zj($.alternate,$);break;default:ap(E,$,Z,oe,T)}d=d.sibling}}function eg(u,d){if(d.subtreeFlags&10256)for(d=d.child;d!==null;){var g=u,b=d,T=b.flags;switch(b.tag){case 22:eg(g,b),T&2048&&Hj(b.alternate,b);break;case 24:eg(g,b),T&2048&&zj(b.alternate,b);break;default:eg(g,b)}d=d.sibling}}var tg=8192;function op(u,d,g){if(u.subtreeFlags&tg)for(u=u.child;u!==null;)HR(u,d,g),u=u.sibling}function HR(u,d,g){switch(u.tag){case 26:op(u,d,g),u.flags&tg&&u.memoizedState!==null&&xX(g,No,u.memoizedState,u.memoizedProps);break;case 5:op(u,d,g);break;case 3:case 4:var b=No;No=a1(u.stateNode.containerInfo),op(u,d,g),No=b;break;case 22:u.memoizedState===null&&(b=u.alternate,b!==null&&b.memoizedState!==null?(b=tg,tg=16777216,op(u,d,g),tg=b):op(u,d,g));break;default:op(u,d,g)}}function zR(u){var d=u.alternate;if(d!==null&&(u=d.child,u!==null)){d.child=null;do d=u.sibling,u.sibling=null,u=d;while(u!==null)}}function ng(u){var d=u.deletions;if((u.flags&16)!==0){if(d!==null)for(var g=0;g<d.length;g++){var b=d[g];zi=b,QR(b,u)}zR(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)qR(u),u=u.sibling}function qR(u){switch(u.tag){case 0:case 11:case 15:ng(u),u.flags&2048&&Yu(9,u,u.return);break;case 3:ng(u);break;case 12:ng(u);break;case 22:var d=u.stateNode;u.memoizedState!==null&&d._visibility&2&&(u.return===null||u.return.tag!==13)?(d._visibility&=-3,Yy(u)):ng(u);break;default:ng(u)}}function Yy(u){var d=u.deletions;if((u.flags&16)!==0){if(d!==null)for(var g=0;g<d.length;g++){var b=d[g];zi=b,QR(b,u)}zR(u)}for(u=u.child;u!==null;){switch(d=u,d.tag){case 0:case 11:case 15:Yu(8,d,d.return),Yy(d);break;case 22:g=d.stateNode,g._visibility&2&&(g._visibility&=-3,Yy(d));break;default:Yy(d)}u=u.sibling}}function QR(u,d){for(;zi!==null;){var g=zi;switch(g.tag){case 0:case 11:case 15:Yu(8,g,d);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var b=g.memoizedState.cachePool.pool;b!=null&&b.refCount++}break;case 24:F0(g.memoizedState.cache)}if(b=g.child,b!==null)b.return=g,zi=b;else e:for(g=u;zi!==null;){b=zi;var T=b.sibling,E=b.return;if(NR(b),b===g){zi=null;break e}if(T!==null){T.return=E,zi=T;break e}zi=E}}}var IG={getCacheForType:function(u){var d=is(bi),g=d.data.get(u);return g===void 0&&(g=u(),d.data.set(u,g)),g},cacheSignal:function(){return is(bi).controller.signal}},LG=typeof WeakMap=="function"?WeakMap:Map,$n=0,ur=null,pn=null,yn=0,Jn=0,_a=null,Vu=!1,lp=!1,qj=!1,Pc=0,ei=0,Gu=0,Ed=0,Qj=0,Ta=0,cp=0,rg=null,ra=null,Uj=!1,Vy=0,UR=0,Gy=1/0,Xy=null,Xu=null,Ti=0,Ku=null,up=null,Fc=0,Wj=0,Yj=null,WR=null,ig=0,Vj=null;function ka(){return($n&2)!==0&&yn!==0?yn&-yn:B.T!==null?eC():Vr()}function YR(){if(Ta===0)if((yn&536870912)===0||Sn){var u=bn;bn<<=1,(bn&3932160)===0&&(bn=262144),Ta=u}else Ta=536870912;return u=ja.current,u!==null&&(u.flags|=32),Ta}function ia(u,d,g){(u===ur&&(Jn===2||Jn===9)||u.cancelPendingCommit!==null)&&(hp(u,0),Zu(u,yn,Ta,!1)),Qt(u,g),(($n&2)===0||u!==ur)&&(u===ur&&(($n&2)===0&&(Ed|=g),ei===4&&Zu(u,yn,Ta,!1)),Ol(u))}function VR(u,d,g){if(($n&6)!==0)throw Error(r(327));var b=!g&&(d&127)===0&&(d&u.expiredLanes)===0||Re(u,d),T=b?FG(u,d):Xj(u,d,!0),E=b;do{if(T===0){lp&&!b&&Zu(u,d,0,!1);break}else{if(g=u.current.alternate,E&&!BG(g)){T=Xj(u,d,!1),E=!1;continue}if(T===2){if(E=d,u.errorRecoveryDisabledLanes&E)var $=0;else $=u.pendingLanes&-536870913,$=$!==0?$:$&536870912?536870912:0;if($!==0){d=$;e:{var Z=u;T=rg;var oe=Z.current.memoizedState.isDehydrated;if(oe&&(hp(Z,$).flags|=256),$=Xj(Z,$,!1),$!==2){if(qj&&!oe){Z.errorRecoveryDisabledLanes|=E,Ed|=E,T=4;break e}E=ra,ra=T,E!==null&&(ra===null?ra=E:ra.push.apply(ra,E))}T=$}if(E=!1,T!==2)continue}}if(T===1){hp(u,0),Zu(u,d,0,!0);break}e:{switch(b=u,E=T,E){case 0:case 1:throw Error(r(345));case 4:if((d&4194048)!==d)break;case 6:Zu(b,d,Ta,!Vu);break e;case 2:ra=null;break;case 3:case 5:break;default:throw Error(r(329))}if((d&62914560)===d&&(T=Vy+300-De(),10<T)){if(Zu(b,d,Ta,!Vu),re(b,0,!0)!==0)break e;Fc=d,b.timeoutHandle=CD(GR.bind(null,b,g,ra,Xy,Uj,d,Ta,Ed,cp,Vu,E,"Throttled",-0,0),T);break e}GR(b,g,ra,Xy,Uj,d,Ta,Ed,cp,Vu,E,null,-0,0)}}break}while(!0);Ol(u)}function GR(u,d,g,b,T,E,$,Z,oe,we,Ne,Qe,je,Ee){if(u.timeoutHandle=-1,Qe=d.subtreeFlags,Qe&8192||(Qe&16785408)===16785408){Qe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:it},HR(d,E,Qe);var St=(E&62914560)===E?Vy-De():(E&4194048)===E?UR-De():0;if(St=AX(Qe,St),St!==null){Fc=E,u.cancelPendingCommit=St(rD.bind(null,u,d,E,g,b,T,$,Z,oe,Ne,Qe,null,je,Ee)),Zu(u,E,$,!we);return}}rD(u,d,E,g,b,T,$,Z,oe)}function BG(u){for(var d=u;;){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 b=0;b<g.length;b++){var T=g[b],E=T.getSnapshot;T=T.value;try{if(!Yt(E(),T))return!1}catch{return!1}}if(g=d.child,d.subtreeFlags&16384&&g!==null)g.return=d,d=g;else{if(d===u)break;for(;d.sibling===null;){if(d.return===null||d.return===u)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Zu(u,d,g,b){d&=~Qj,d&=~Ed,u.suspendedLanes|=d,u.pingedLanes&=~d,b&&(u.warmLanes|=d),b=u.expirationTimes;for(var T=d;0<T;){var E=31-Wt(T),$=1<<E;b[E]=-1,T&=~$}g!==0&&Pe(u,g,d)}function Ky(){return($n&6)===0?(sg(0),!1):!0}function Gj(){if(pn!==null){if(Jn===0)var u=pn.return;else u=pn,kc=Ad=null,hj(u),tp=null,H0=0,u=pn;for(;u!==null;)_R(u.alternate,u),u=u.return;pn=null}}function hp(u,d){var g=u.timeoutHandle;g!==-1&&(u.timeoutHandle=-1,rX(g)),g=u.cancelPendingCommit,g!==null&&(u.cancelPendingCommit=null,g()),Fc=0,Gj(),ur=u,pn=g=_c(u.current,null),yn=d,Jn=0,_a=null,Vu=!1,lp=Re(u,d),qj=!1,cp=Ta=Qj=Ed=Gu=ei=0,ra=rg=null,Uj=!1,(d&8)!==0&&(d|=d&32);var b=u.entangledLanes;if(b!==0)for(u=u.entanglements,b&=d;0<b;){var T=31-Wt(b),E=1<<T;d|=u[T],b&=~E}return Pc=d,by(),g}function XR(u,d){rn=null,B.H=G0,d===ep||d===_y?(d=dM(),Jn=3):d===JS?(d=dM(),Jn=4):Jn=d===Tj?8:d!==null&&typeof d=="object"&&typeof d.then=="function"?6:1,_a=d,pn===null&&(ei=1,$y(u,ro(d,u.current)))}function KR(){var u=ja.current;return u===null?!0:(yn&4194048)===yn?oo===null:(yn&62914560)===yn||(yn&536870912)!==0?u===oo:!1}function ZR(){var u=B.H;return B.H=G0,u===null?G0:u}function JR(){var u=B.A;return B.A=IG,u}function Zy(){ei=4,Vu||(yn&4194048)!==yn&&ja.current!==null||(lp=!0),(Gu&134217727)===0&&(Ed&134217727)===0||ur===null||Zu(ur,yn,Ta,!1)}function Xj(u,d,g){var b=$n;$n|=2;var T=ZR(),E=JR();(ur!==u||yn!==d)&&(Xy=null,hp(u,d)),d=!1;var $=ei;e:do try{if(Jn!==0&&pn!==null){var Z=pn,oe=_a;switch(Jn){case 8:Gj(),$=6;break e;case 3:case 2:case 9:case 6:ja.current===null&&(d=!0);var we=Jn;if(Jn=0,_a=null,dp(u,Z,oe,we),g&&lp){$=0;break e}break;default:we=Jn,Jn=0,_a=null,dp(u,Z,oe,we)}}PG(),$=ei;break}catch(Ne){XR(u,Ne)}while(!0);return d&&u.shellSuspendCounter++,kc=Ad=null,$n=b,B.H=T,B.A=E,pn===null&&(ur=null,yn=0,by()),$}function PG(){for(;pn!==null;)eD(pn)}function FG(u,d){var g=$n;$n|=2;var b=ZR(),T=JR();ur!==u||yn!==d?(Xy=null,Gy=De()+500,hp(u,d)):lp=Re(u,d);e:do try{if(Jn!==0&&pn!==null){d=pn;var E=_a;t:switch(Jn){case 1:Jn=0,_a=null,dp(u,d,E,1);break;case 2:case 9:if(uM(E)){Jn=0,_a=null,tD(d);break}d=function(){Jn!==2&&Jn!==9||ur!==u||(Jn=7),Ol(u)},E.then(d,d);break e;case 3:Jn=7;break e;case 4:Jn=5;break e;case 7:uM(E)?(Jn=0,_a=null,tD(d)):(Jn=0,_a=null,dp(u,d,E,7));break;case 5:var $=null;switch(pn.tag){case 26:$=pn.memoizedState;case 5:case 27:var Z=pn;if($?$D($):Z.stateNode.complete){Jn=0,_a=null;var oe=Z.sibling;if(oe!==null)pn=oe;else{var we=Z.return;we!==null?(pn=we,Jy(we)):pn=null}break t}}Jn=0,_a=null,dp(u,d,E,5);break;case 6:Jn=0,_a=null,dp(u,d,E,6);break;case 8:Gj(),ei=6;break e;default:throw Error(r(462))}}$G();break}catch(Ne){XR(u,Ne)}while(!0);return kc=Ad=null,B.H=b,B.A=T,$n=g,pn!==null?0:(ur=null,yn=0,by(),ei)}function $G(){for(;pn!==null&&!ut();)eD(pn)}function eD(u){var d=jR(u.alternate,u,Pc);u.memoizedProps=u.pendingProps,d===null?Jy(u):pn=d}function tD(u){var d=u,g=d.alternate;switch(d.tag){case 15:case 0:d=bR(g,d,d.pendingProps,d.type,void 0,yn);break;case 11:d=bR(g,d,d.pendingProps,d.type.render,d.ref,yn);break;case 5:hj(d);default:_R(g,d),d=pn=J4(d,Pc),d=jR(g,d,Pc)}u.memoizedProps=u.pendingProps,d===null?Jy(u):pn=d}function dp(u,d,g,b){kc=Ad=null,hj(d),tp=null,H0=0;var T=d.return;try{if(kG(u,T,d,g,yn)){ei=1,$y(u,ro(g,u.current)),pn=null;return}}catch(E){if(T!==null)throw pn=T,E;ei=1,$y(u,ro(g,u.current)),pn=null;return}d.flags&32768?(Sn||b===1?u=!0:lp||(yn&536870912)!==0?u=!1:(Vu=u=!0,(b===2||b===9||b===3||b===6)&&(b=ja.current,b!==null&&b.tag===13&&(b.flags|=16384))),nD(d,u)):Jy(d)}function Jy(u){var d=u;do{if((d.flags&32768)!==0){nD(d,Vu);return}u=d.return;var g=MG(d.alternate,d,Pc);if(g!==null){pn=g;return}if(d=d.sibling,d!==null){pn=d;return}pn=d=u}while(d!==null);ei===0&&(ei=5)}function nD(u,d){do{var g=RG(u.alternate,u);if(g!==null){g.flags&=32767,pn=g;return}if(g=u.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!d&&(u=u.sibling,u!==null)){pn=u;return}pn=u=g}while(u!==null);ei=6,pn=null}function rD(u,d,g,b,T,E,$,Z,oe){u.cancelPendingCommit=null;do e1();while(Ti!==0);if(($n&6)!==0)throw Error(r(327));if(d!==null){if(d===u.current)throw Error(r(177));if(E=d.lanes|d.childLanes,E|=PS,tt(u,g,E,$,Z,oe),u===ur&&(pn=ur=null,yn=0),up=d,Ku=u,Fc=g,Wj=E,Yj=T,WR=b,(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?(u.callbackNode=null,u.callbackPriority=0,QG(Rt,function(){return lD(),null})):(u.callbackNode=null,u.callbackPriority=0),b=(d.flags&13878)!==0,(d.subtreeFlags&13878)!==0||b){b=B.T,B.T=null,T=F.p,F.p=2,$=$n,$n|=4;try{DG(u,d,g)}finally{$n=$,F.p=T,B.T=b}}Ti=1,iD(),sD(),aD()}}function iD(){if(Ti===1){Ti=0;var u=Ku,d=up,g=(d.flags&13878)!==0;if((d.subtreeFlags&13878)!==0||g){g=B.T,B.T=null;var b=F.p;F.p=2;var T=$n;$n|=4;try{PR(d,u);var E=lC,$=Tr(u.containerInfo),Z=E.focusedElem,oe=E.selectionRange;if($!==Z&&Z&&Z.ownerDocument&&ir(Z.ownerDocument.documentElement,Z)){if(oe!==null&&Zr(Z)){var we=oe.start,Ne=oe.end;if(Ne===void 0&&(Ne=we),"selectionStart"in Z)Z.selectionStart=we,Z.selectionEnd=Math.min(Ne,Z.value.length);else{var Qe=Z.ownerDocument||document,je=Qe&&Qe.defaultView||window;if(je.getSelection){var Ee=je.getSelection(),St=Z.textContent.length,$t=Math.min(oe.start,St),or=oe.end===void 0?$t:Math.min(oe.end,St);!Ee.extend&&$t>or&&($=or,or=$t,$t=$);var pe=Mt(Z,$t),he=Mt(Z,or);if(pe&&he&&(Ee.rangeCount!==1||Ee.anchorNode!==pe.node||Ee.anchorOffset!==pe.offset||Ee.focusNode!==he.node||Ee.focusOffset!==he.offset)){var Ae=Qe.createRange();Ae.setStart(pe.node,pe.offset),Ee.removeAllRanges(),$t>or?(Ee.addRange(Ae),Ee.extend(he.node,he.offset)):(Ae.setEnd(he.node,he.offset),Ee.addRange(Ae))}}}}for(Qe=[],Ee=Z;Ee=Ee.parentNode;)Ee.nodeType===1&&Qe.push({element:Ee,left:Ee.scrollLeft,top:Ee.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<Qe.length;Z++){var He=Qe[Z];He.element.scrollLeft=He.left,He.element.scrollTop=He.top}}d1=!!oC,lC=oC=null}finally{$n=T,F.p=b,B.T=g}}u.current=d,Ti=2}}function sD(){if(Ti===2){Ti=0;var u=Ku,d=up,g=(d.flags&8772)!==0;if((d.subtreeFlags&8772)!==0||g){g=B.T,B.T=null;var b=F.p;F.p=2;var T=$n;$n|=4;try{DR(u,d.alternate,d)}finally{$n=T,F.p=b,B.T=g}}Ti=3}}function aD(){if(Ti===4||Ti===3){Ti=0,Ue();var u=Ku,d=up,g=Fc,b=WR;(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?Ti=5:(Ti=0,up=Ku=null,oD(u,u.pendingLanes));var T=u.pendingLanes;if(T===0&&(Xu=null),on(g),d=d.stateNode,Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(tn,d,void 0,(d.current.flags&128)===128)}catch{}if(b!==null){d=B.T,T=F.p,F.p=2,B.T=null;try{for(var E=u.onRecoverableError,$=0;$<b.length;$++){var Z=b[$];E(Z.value,{componentStack:Z.stack})}}finally{B.T=d,F.p=T}}(Fc&3)!==0&&e1(),Ol(u),T=u.pendingLanes,(g&261930)!==0&&(T&42)!==0?u===Vj?ig++:(ig=0,Vj=u):ig=0,sg(0)}}function oD(u,d){(u.pooledCacheLanes&=d)===0&&(d=u.pooledCache,d!=null&&(u.pooledCache=null,F0(d)))}function e1(){return iD(),sD(),aD(),lD()}function lD(){if(Ti!==5)return!1;var u=Ku,d=Wj;Wj=0;var g=on(Fc),b=B.T,T=F.p;try{F.p=32>g?32:g,B.T=null,g=Yj,Yj=null;var E=Ku,$=Fc;if(Ti=0,up=Ku=null,Fc=0,($n&6)!==0)throw Error(r(331));var Z=$n;if($n|=4,qR(E.current),$R(E,E.current,$,g),$n=Z,sg(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(tn,E)}catch{}return!0}finally{F.p=T,B.T=b,oD(u,d)}}function cD(u,d,g){d=ro(g,d),d=_j(u.stateNode,d,2),u=Qu(u,d,2),u!==null&&(Qt(u,2),Ol(u))}function er(u,d,g){if(u.tag===3)cD(u,u,g);else for(;d!==null;){if(d.tag===3){cD(d,u,g);break}else if(d.tag===1){var b=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(Xu===null||!Xu.has(b))){u=ro(g,u),g=uR(2),b=Qu(d,g,2),b!==null&&(hR(g,b,d,u),Qt(b,2),Ol(b));break}}d=d.return}}function Kj(u,d,g){var b=u.pingCache;if(b===null){b=u.pingCache=new LG;var T=new Set;b.set(d,T)}else T=b.get(d),T===void 0&&(T=new Set,b.set(d,T));T.has(g)||(qj=!0,T.add(g),u=HG.bind(null,u,d,g),d.then(u,u))}function HG(u,d,g){var b=u.pingCache;b!==null&&b.delete(d),u.pingedLanes|=u.suspendedLanes&g,u.warmLanes&=~g,ur===u&&(yn&g)===g&&(ei===4||ei===3&&(yn&62914560)===yn&&300>De()-Vy?($n&2)===0&&hp(u,0):Qj|=g,cp===yn&&(cp=0)),Ol(u)}function uD(u,d){d===0&&(d=We()),u=bd(u,d),u!==null&&(Qt(u,d),Ol(u))}function zG(u){var d=u.memoizedState,g=0;d!==null&&(g=d.retryLane),uD(u,g)}function qG(u,d){var g=0;switch(u.tag){case 31:case 13:var b=u.stateNode,T=u.memoizedState;T!==null&&(g=T.retryLane);break;case 19:b=u.stateNode;break;case 22:b=u.stateNode._retryCache;break;default:throw Error(r(314))}b!==null&&b.delete(d),uD(u,g)}function QG(u,d){return Ve(u,d)}var t1=null,fp=null,Zj=!1,n1=!1,Jj=!1,Ju=0;function Ol(u){u!==fp&&u.next===null&&(fp===null?t1=fp=u:fp=fp.next=u),n1=!0,Zj||(Zj=!0,WG())}function sg(u,d){if(!Jj&&n1){Jj=!0;do for(var g=!1,b=t1;b!==null;){if(u!==0){var T=b.pendingLanes;if(T===0)var E=0;else{var $=b.suspendedLanes,Z=b.pingedLanes;E=(1<<31-Wt(42|u)+1)-1,E&=T&~($&~Z),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(g=!0,pD(b,E))}else E=yn,E=re(b,b===ur?E:0,b.cancelPendingCommit!==null||b.timeoutHandle!==-1),(E&3)===0||Re(b,E)||(g=!0,pD(b,E));b=b.next}while(g);Jj=!1}}function UG(){hD()}function hD(){n1=Zj=!1;var u=0;Ju!==0&&nX()&&(u=Ju);for(var d=De(),g=null,b=t1;b!==null;){var T=b.next,E=dD(b,d);E===0?(b.next=null,g===null?t1=T:g.next=T,T===null&&(fp=g)):(g=b,(u!==0||(E&3)!==0)&&(n1=!0)),b=T}Ti!==0&&Ti!==5||sg(u),Ju!==0&&(Ju=0)}function dD(u,d){for(var g=u.suspendedLanes,b=u.pingedLanes,T=u.expirationTimes,E=u.pendingLanes&-62914561;0<E;){var $=31-Wt(E),Z=1<<$,oe=T[$];oe===-1?((Z&g)===0||(Z&b)!==0)&&(T[$]=ye(Z,d)):oe<=d&&(u.expiredLanes|=Z),E&=~Z}if(d=ur,g=yn,g=re(u,u===d?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),b=u.callbackNode,g===0||u===d&&(Jn===2||Jn===9)||u.cancelPendingCommit!==null)return b!==null&&b!==null&&Ge(b),u.callbackNode=null,u.callbackPriority=0;if((g&3)===0||Re(u,g)){if(d=g&-g,d===u.callbackPriority)return d;switch(b!==null&&Ge(b),on(g)){case 2:case 8:g=ht;break;case 32:g=Rt;break;case 268435456:g=fn;break;default:g=Rt}return b=fD.bind(null,u),g=Ve(g,b),u.callbackPriority=d,u.callbackNode=g,d}return b!==null&&b!==null&&Ge(b),u.callbackPriority=2,u.callbackNode=null,2}function fD(u,d){if(Ti!==0&&Ti!==5)return u.callbackNode=null,u.callbackPriority=0,null;var g=u.callbackNode;if(e1()&&u.callbackNode!==g)return null;var b=yn;return b=re(u,u===ur?b:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),b===0?null:(VR(u,b,d),dD(u,De()),u.callbackNode!=null&&u.callbackNode===g?fD.bind(null,u):null)}function pD(u,d){if(e1())return null;VR(u,d,!0)}function WG(){iX(function(){($n&6)!==0?Ve(ze,UG):hD()})}function eC(){if(Ju===0){var u=Zf;u===0&&(u=qn,qn<<=1,(qn&261888)===0&&(qn=256)),Ju=u}return Ju}function mD(u){return u==null||typeof u=="symbol"||typeof u=="boolean"?null:typeof u=="function"?u:Ja(""+u)}function gD(u,d){var g=d.ownerDocument.createElement("input");return g.name=d.name,g.value=d.value,u.id&&g.setAttribute("form",u.id),d.parentNode.insertBefore(g,d),u=new FormData(u),g.parentNode.removeChild(g),u}function YG(u,d,g,b,T){if(d==="submit"&&g&&g.stateNode===T){var E=mD((T[Pi]||null).action),$=b.submitter;$&&(d=(d=$[Pi]||null)?mD(d.formAction):$.getAttribute("formAction"),d!==null&&(E=d,$=null));var Z=new zr("action","action",null,b,T);u.push({event:Z,listeners:[{instance:null,listener:function(){if(b.defaultPrevented){if(Ju!==0){var oe=$?gD(T,$):new FormData(T);xj(g,{pending:!0,data:oe,method:T.method,action:E},null,oe)}}else typeof E=="function"&&(Z.preventDefault(),oe=$?gD(T,$):new FormData(T),xj(g,{pending:!0,data:oe,method:T.method,action:E},E,oe))},currentTarget:T}]})}}for(var tC=0;tC<BS.length;tC++){var nC=BS[tC],VG=nC.toLowerCase(),GG=nC[0].toUpperCase()+nC.slice(1);Do(VG,"on"+GG)}Do(Hi,"onAnimationEnd"),Do(Cs,"onAnimationIteration"),Do(Cl,"onAnimationStart"),Do("dblclick","onDoubleClick"),Do("focusin","onFocus"),Do("focusout","onBlur"),Do(ns,"onTransitionRun"),Do(gy,"onTransitionStart"),Do(fG,"onTransitionCancel"),Do(X4,"onTransitionEnd"),Je("onMouseEnter",["mouseout","mouseover"]),Je("onMouseLeave",["mouseout","mouseover"]),Je("onPointerEnter",["pointerout","pointerover"]),Je("onPointerLeave",["pointerout","pointerover"]),bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),bs("onBeforeInput",["compositionend","keypress","textInput","paste"]),bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ag="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(" "),XG=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ag));function vD(u,d){d=(d&4)!==0;for(var g=0;g<u.length;g++){var b=u[g],T=b.event;b=b.listeners;e:{var E=void 0;if(d)for(var $=b.length-1;0<=$;$--){var Z=b[$],oe=Z.instance,we=Z.currentTarget;if(Z=Z.listener,oe!==E&&T.isPropagationStopped())break e;E=Z,T.currentTarget=we;try{E(T)}catch(Ne){vy(Ne)}T.currentTarget=null,E=oe}else for($=0;$<b.length;$++){if(Z=b[$],oe=Z.instance,we=Z.currentTarget,Z=Z.listener,oe!==E&&T.isPropagationStopped())break e;E=Z,T.currentTarget=we;try{E(T)}catch(Ne){vy(Ne)}T.currentTarget=null,E=oe}}}}function mn(u,d){var g=d[ud];g===void 0&&(g=d[ud]=new Set);var b=u+"__bubble";g.has(b)||(bD(d,u,2,!1),g.add(b))}function rC(u,d,g){var b=0;d&&(b|=4),bD(g,u,b,d)}var r1="_reactListening"+Math.random().toString(36).slice(2);function iC(u){if(!u[r1]){u[r1]=!0,_u.forEach(function(g){g!=="selectionchange"&&(XG.has(g)||rC(g,!1,u),rC(g,!0,u))});var d=u.nodeType===9?u:u.ownerDocument;d===null||d[r1]||(d[r1]=!0,rC("selectionchange",!1,d))}}function bD(u,d,g,b){switch(YD(d)){case 2:var T=jX;break;case 8:T=CX;break;default:T=yC}g=T.bind(null,d,g,u),T=void 0,!Qf||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(T=!0),b?T!==void 0?u.addEventListener(d,g,{capture:!0,passive:T}):u.addEventListener(d,g,!0):T!==void 0?u.addEventListener(d,g,{passive:T}):u.addEventListener(d,g,!1)}function sC(u,d,g,b,T){var E=b;if((d&1)===0&&(d&2)===0&&b!==null)e:for(;;){if(b===null)return;var $=b.tag;if($===3||$===4){var Z=b.stateNode.containerInfo;if(Z===T)break;if($===4)for($=b.return;$!==null;){var oe=$.tag;if((oe===3||oe===4)&&$.stateNode.containerInfo===T)return;$=$.return}for(;Z!==null;){if($=kn(Z),$===null)return;if(oe=$.tag,oe===5||oe===6||oe===26||oe===27){b=E=$;continue e}Z=Z.parentNode}}b=b.return}Mu(function(){var we=E,Ne=zt(g),Qe=[];e:{var je=K4.get(u);if(je!==void 0){var Ee=zr,St=u;switch(u){case"keypress":if(Qn(g)===0)break e;case"keydown":case"keyup":Ee=IS;break;case"focusin":St="focus",Ee=wa;break;case"focusout":St="blur",Ee=wa;break;case"beforeblur":case"afterblur":Ee=wa;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":Ee=sy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ee=RS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ee=cy;break;case Hi:case Cs:case Cl:Ee=Ac;break;case X4:Ee=R0;break;case"scroll":case"scrollend":Ee=Du;break;case"wheel":Ee=uy;break;case"copy":case"cut":case"paste":Ee=NS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ee=Ro;break;case"toggle":case"beforetoggle":Ee=dy}var $t=(d&4)!==0,or=!$t&&(u==="scroll"||u==="scrollend"),pe=$t?je!==null?je+"Capture":null:je;$t=[];for(var he=we,Ae;he!==null;){var He=he;if(Ae=He.stateNode,He=He.tag,He!==5&&He!==26&&He!==27||Ae===null||pe===null||(He=eo(he,pe),He!=null&&$t.push(og(he,He,Ae))),or)break;he=he.return}0<$t.length&&(je=new Ee(je,St,null,g,Ne),Qe.push({event:je,listeners:$t}))}}if((d&7)===0){e:{if(je=u==="mouseover"||u==="pointerover",Ee=u==="mouseout"||u==="pointerout",je&&g!==Ct&&(St=g.relatedTarget||g.fromElement)&&(kn(St)||St[vs]))break e;if((Ee||je)&&(je=Ne.window===Ne?Ne:(je=Ne.ownerDocument)?je.defaultView||je.parentWindow:window,Ee?(St=g.relatedTarget||g.toElement,Ee=we,St=St?kn(St):null,St!==null&&(or=s(St),$t=St.tag,St!==or||$t!==5&&$t!==27&&$t!==6)&&(St=null)):(Ee=null,St=we),Ee!==St)){if($t=sy,He="onMouseLeave",pe="onMouseEnter",he="mouse",(u==="pointerout"||u==="pointerover")&&($t=Ro,He="onPointerLeave",pe="onPointerEnter",he="pointer"),or=Ee==null?je:mi(Ee),Ae=St==null?je:mi(St),je=new $t(He,he+"leave",Ee,g,Ne),je.target=or,je.relatedTarget=Ae,He=null,kn(Ne)===we&&($t=new $t(pe,he+"enter",St,g,Ne),$t.target=Ae,$t.relatedTarget=or,He=$t),or=He,Ee&&St)t:{for($t=KG,pe=Ee,he=St,Ae=0,He=pe;He;He=$t(He))Ae++;He=0;for(var It=he;It;It=$t(It))He++;for(;0<Ae-He;)pe=$t(pe),Ae--;for(;0<He-Ae;)he=$t(he),He--;for(;Ae--;){if(pe===he||he!==null&&pe===he.alternate){$t=pe;break t}pe=$t(pe),he=$t(he)}$t=null}else $t=null;Ee!==null&&yD(Qe,je,Ee,$t,!1),St!==null&&or!==null&&yD(Qe,or,St,$t,!0)}}e:{if(je=we?mi(we):window,Ee=je.nodeName&&je.nodeName.toLowerCase(),Ee==="select"||Ee==="input"&&je.type==="file")var Nn=ee;else if(Bu(je))if(te)Nn=Ut;else{Nn=bt;var Ot=gt}else Ee=je.nodeName,!Ee||Ee.toLowerCase()!=="input"||je.type!=="checkbox"&&je.type!=="radio"?we&&Al(we.elementType)&&(Nn=ee):Nn=At;if(Nn&&(Nn=Nn(u,we))){my(Qe,Nn,g,Ne);break e}Ot&&Ot(u,je,we),u==="focusout"&&we&&je.type==="number"&&we.memoizedProps.value!=null&&bc(je,"number",je.value)}switch(Ot=we?mi(we):window,u){case"focusin":(Bu(Ot)||Ot.contentEditable==="true")&&(Zn=Ot,ts=we,li=null);break;case"focusout":li=ts=Zn=null;break;case"mousedown":Ss=!0;break;case"contextmenu":case"mouseup":case"dragend":Ss=!1,Zs(Qe,g,Ne);break;case"selectionchange":if(Un)break;case"keydown":case"keyup":Zs(Qe,g,Ne)}var sn;if(Uf)e:{switch(u){case"compositionstart":var xn="onCompositionStart";break e;case"compositionend":xn="onCompositionEnd";break e;case"compositionupdate":xn="onCompositionUpdate";break e}xn=void 0}else jc?gd(u,g)&&(xn="onCompositionEnd"):u==="keydown"&&g.keyCode===229&&(xn="onCompositionStart");xn&&(N0&&g.locale!=="ko"&&(jc||xn!=="onCompositionStart"?xn==="onCompositionEnd"&&jc&&(sn=T0()):(Is=Ne,Sl="value"in Is?Is.value:Is.textContent,jc=!0)),Ot=i1(we,xn),0<Ot.length&&(xn=new ay(xn,u,null,g,Ne),Qe.push({event:xn,listeners:Ot}),sn?xn.data=sn:(sn=oi(g),sn!==null&&(xn.data=sn)))),(sn=LS?Kr(u,g):py(u,g))&&(xn=i1(we,"onBeforeInput"),0<xn.length&&(Ot=new ay("onBeforeInput","beforeinput",null,g,Ne),Qe.push({event:Ot,listeners:xn}),Ot.data=sn)),YG(Qe,u,we,g,Ne)}vD(Qe,d)})}function og(u,d,g){return{instance:u,listener:d,currentTarget:g}}function i1(u,d){for(var g=d+"Capture",b=[];u!==null;){var T=u,E=T.stateNode;if(T=T.tag,T!==5&&T!==26&&T!==27||E===null||(T=eo(u,g),T!=null&&b.unshift(og(u,T,E)),T=eo(u,d),T!=null&&b.push(og(u,T,E))),u.tag===3)return b;u=u.return}return[]}function KG(u){if(u===null)return null;do u=u.return;while(u&&u.tag!==5&&u.tag!==27);return u||null}function yD(u,d,g,b,T){for(var E=d._reactName,$=[];g!==null&&g!==b;){var Z=g,oe=Z.alternate,we=Z.stateNode;if(Z=Z.tag,oe!==null&&oe===b)break;Z!==5&&Z!==26&&Z!==27||we===null||(oe=we,T?(we=eo(g,E),we!=null&&$.unshift(og(g,we,oe))):T||(we=eo(g,E),we!=null&&$.push(og(g,we,oe)))),g=g.return}$.length!==0&&u.push({event:d,listeners:$})}var ZG=/\r\n?/g,JG=/\u0000|\uFFFD/g;function xD(u){return(typeof u=="string"?u:""+u).replace(ZG,`
`).replace(JG,"")}function AD(u,d){return d=xD(d),xD(u)===d}function ar(u,d,g,b,T,E){switch(g){case"children":typeof b=="string"?d==="body"||d==="textarea"&&b===""||Pt(u,b):(typeof b=="number"||typeof b=="bigint")&&d!=="body"&&Pt(u,""+b);break;case"className":Ji(u,"class",b);break;case"tabIndex":Ji(u,"tabindex",b);break;case"dir":case"role":case"viewBox":case"width":case"height":Ji(u,g,b);break;case"style":Pn(u,b,E);break;case"data":if(d!=="object"){Ji(u,"data",b);break}case"src":case"href":if(b===""&&(d!=="a"||g!=="href")){u.removeAttribute(g);break}if(b==null||typeof b=="function"||typeof b=="symbol"||typeof b=="boolean"){u.removeAttribute(g);break}b=Ja(""+b),u.setAttribute(g,b);break;case"action":case"formAction":if(typeof b=="function"){u.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 E=="function"&&(g==="formAction"?(d!=="input"&&ar(u,d,"name",T.name,T,null),ar(u,d,"formEncType",T.formEncType,T,null),ar(u,d,"formMethod",T.formMethod,T,null),ar(u,d,"formTarget",T.formTarget,T,null)):(ar(u,d,"encType",T.encType,T,null),ar(u,d,"method",T.method,T,null),ar(u,d,"target",T.target,T,null)));if(b==null||typeof b=="symbol"||typeof b=="boolean"){u.removeAttribute(g);break}b=Ja(""+b),u.setAttribute(g,b);break;case"onClick":b!=null&&(u.onclick=it);break;case"onScroll":b!=null&&mn("scroll",u);break;case"onScrollEnd":b!=null&&mn("scrollend",u);break;case"dangerouslySetInnerHTML":if(b!=null){if(typeof b!="object"||!("__html"in b))throw Error(r(61));if(g=b.__html,g!=null){if(T.children!=null)throw Error(r(60));u.innerHTML=g}}break;case"multiple":u.multiple=b&&typeof b!="function"&&typeof b!="symbol";break;case"muted":u.muted=b&&typeof b!="function"&&typeof b!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(b==null||typeof b=="function"||typeof b=="boolean"||typeof b=="symbol"){u.removeAttribute("xlink:href");break}g=Ja(""+b),u.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":b!=null&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(g,""+b):u.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":b&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(g,""):u.removeAttribute(g);break;case"capture":case"download":b===!0?u.setAttribute(g,""):b!==!1&&b!=null&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(g,b):u.removeAttribute(g);break;case"cols":case"rows":case"size":case"span":b!=null&&typeof b!="function"&&typeof b!="symbol"&&!isNaN(b)&&1<=b?u.setAttribute(g,b):u.removeAttribute(g);break;case"rowSpan":case"start":b==null||typeof b=="function"||typeof b=="symbol"||isNaN(b)?u.removeAttribute(g):u.setAttribute(g,b);break;case"popover":mn("beforetoggle",u),mn("toggle",u),gi(u,"popover",b);break;case"xlinkActuate":Gn(u,"http://www.w3.org/1999/xlink","xlink:actuate",b);break;case"xlinkArcrole":Gn(u,"http://www.w3.org/1999/xlink","xlink:arcrole",b);break;case"xlinkRole":Gn(u,"http://www.w3.org/1999/xlink","xlink:role",b);break;case"xlinkShow":Gn(u,"http://www.w3.org/1999/xlink","xlink:show",b);break;case"xlinkTitle":Gn(u,"http://www.w3.org/1999/xlink","xlink:title",b);break;case"xlinkType":Gn(u,"http://www.w3.org/1999/xlink","xlink:type",b);break;case"xmlBase":Gn(u,"http://www.w3.org/XML/1998/namespace","xml:base",b);break;case"xmlLang":Gn(u,"http://www.w3.org/XML/1998/namespace","xml:lang",b);break;case"xmlSpace":Gn(u,"http://www.w3.org/XML/1998/namespace","xml:space",b);break;case"is":gi(u,"is",b);break;case"innerText":case"textContent":break;default:(!(2<g.length)||g[0]!=="o"&&g[0]!=="O"||g[1]!=="n"&&g[1]!=="N")&&(g=xs.get(g)||g,gi(u,g,b))}}function aC(u,d,g,b,T,E){switch(g){case"style":Pn(u,b,E);break;case"dangerouslySetInnerHTML":if(b!=null){if(typeof b!="object"||!("__html"in b))throw Error(r(61));if(g=b.__html,g!=null){if(T.children!=null)throw Error(r(60));u.innerHTML=g}}break;case"children":typeof b=="string"?Pt(u,b):(typeof b=="number"||typeof b=="bigint")&&Pt(u,""+b);break;case"onScroll":b!=null&&mn("scroll",u);break;case"onScrollEnd":b!=null&&mn("scrollend",u);break;case"onClick":b!=null&&(u.onclick=it);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Za.hasOwnProperty(g))e:{if(g[0]==="o"&&g[1]==="n"&&(T=g.endsWith("Capture"),d=g.slice(2,T?g.length-7:void 0),E=u[Pi]||null,E=E!=null?E[g]:null,typeof E=="function"&&u.removeEventListener(d,E,T),typeof b=="function")){typeof E!="function"&&E!==null&&(g in u?u[g]=null:u.hasAttribute(g)&&u.removeAttribute(g)),u.addEventListener(d,b,T);break e}g in u?u[g]=b:b===!0?u.setAttribute(g,""):gi(u,g,b)}}}function as(u,d,g){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mn("error",u),mn("load",u);var b=!1,T=!1,E;for(E in g)if(g.hasOwnProperty(E)){var $=g[E];if($!=null)switch(E){case"src":b=!0;break;case"srcSet":T=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:ar(u,d,E,$,g,null)}}T&&ar(u,d,"srcSet",g.srcSet,g,null),b&&ar(u,d,"src",g.src,g,null);return;case"input":mn("invalid",u);var Z=E=$=T=null,oe=null,we=null;for(b in g)if(g.hasOwnProperty(b)){var Ne=g[b];if(Ne!=null)switch(b){case"name":T=Ne;break;case"type":$=Ne;break;case"checked":oe=Ne;break;case"defaultChecked":we=Ne;break;case"value":E=Ne;break;case"defaultValue":Z=Ne;break;case"children":case"dangerouslySetInnerHTML":if(Ne!=null)throw Error(r(137,d));break;default:ar(u,d,b,Ne,g,null)}}vc(u,E,Z,oe,we,$,T,!1);return;case"select":mn("invalid",u),b=$=E=null;for(T in g)if(g.hasOwnProperty(T)&&(Z=g[T],Z!=null))switch(T){case"value":E=Z;break;case"defaultValue":$=Z;break;case"multiple":b=Z;default:ar(u,d,T,Z,g,null)}d=E,g=$,u.multiple=!!b,d!=null?ai(u,!!b,d,!1):g!=null&&ai(u,!!b,g,!0);return;case"textarea":mn("invalid",u),E=T=b=null;for($ in g)if(g.hasOwnProperty($)&&(Z=g[$],Z!=null))switch($){case"value":b=Z;break;case"defaultValue":T=Z;break;case"children":E=Z;break;case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(91));break;default:ar(u,d,$,Z,g,null)}Eo(u,b,T,E);return;case"option":for(oe in g)if(g.hasOwnProperty(oe)&&(b=g[oe],b!=null))switch(oe){case"selected":u.selected=b&&typeof b!="function"&&typeof b!="symbol";break;default:ar(u,d,oe,b,g,null)}return;case"dialog":mn("beforetoggle",u),mn("toggle",u),mn("cancel",u),mn("close",u);break;case"iframe":case"object":mn("load",u);break;case"video":case"audio":for(b=0;b<ag.length;b++)mn(ag[b],u);break;case"image":mn("error",u),mn("load",u);break;case"details":mn("toggle",u);break;case"embed":case"source":case"link":mn("error",u),mn("load",u);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)&&(b=g[we],b!=null))switch(we){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:ar(u,d,we,b,g,null)}return;default:if(Al(d)){for(Ne in g)g.hasOwnProperty(Ne)&&(b=g[Ne],b!==void 0&&aC(u,d,Ne,b,g,void 0));return}}for(Z in g)g.hasOwnProperty(Z)&&(b=g[Z],b!=null&&ar(u,d,Z,b,g,null))}function eX(u,d,g,b){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var T=null,E=null,$=null,Z=null,oe=null,we=null,Ne=null;for(Ee in g){var Qe=g[Ee];if(g.hasOwnProperty(Ee)&&Qe!=null)switch(Ee){case"checked":break;case"value":break;case"defaultValue":oe=Qe;default:b.hasOwnProperty(Ee)||ar(u,d,Ee,null,b,Qe)}}for(var je in b){var Ee=b[je];if(Qe=g[je],b.hasOwnProperty(je)&&(Ee!=null||Qe!=null))switch(je){case"type":E=Ee;break;case"name":T=Ee;break;case"checked":we=Ee;break;case"defaultChecked":Ne=Ee;break;case"value":$=Ee;break;case"defaultValue":Z=Ee;break;case"children":case"dangerouslySetInnerHTML":if(Ee!=null)throw Error(r(137,d));break;default:Ee!==Qe&&ar(u,d,je,Ee,b,Qe)}}Ou(u,$,Z,oe,we,Ne,E,T);return;case"select":Ee=$=Z=je=null;for(E in g)if(oe=g[E],g.hasOwnProperty(E)&&oe!=null)switch(E){case"value":break;case"multiple":Ee=oe;default:b.hasOwnProperty(E)||ar(u,d,E,null,b,oe)}for(T in b)if(E=b[T],oe=g[T],b.hasOwnProperty(T)&&(E!=null||oe!=null))switch(T){case"value":je=E;break;case"defaultValue":Z=E;break;case"multiple":$=E;default:E!==oe&&ar(u,d,T,E,b,oe)}d=Z,g=$,b=Ee,je!=null?ai(u,!!g,je,!1):!!b!=!!g&&(d!=null?ai(u,!!g,d,!0):ai(u,!!g,g?[]:"",!1));return;case"textarea":Ee=je=null;for(Z in g)if(T=g[Z],g.hasOwnProperty(Z)&&T!=null&&!b.hasOwnProperty(Z))switch(Z){case"value":break;case"children":break;default:ar(u,d,Z,null,b,T)}for($ in b)if(T=b[$],E=g[$],b.hasOwnProperty($)&&(T!=null||E!=null))switch($){case"value":je=T;break;case"defaultValue":Ee=T;break;case"children":break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:T!==E&&ar(u,d,$,T,b,E)}yc(u,je,Ee);return;case"option":for(var St in g)if(je=g[St],g.hasOwnProperty(St)&&je!=null&&!b.hasOwnProperty(St))switch(St){case"selected":u.selected=!1;break;default:ar(u,d,St,null,b,je)}for(oe in b)if(je=b[oe],Ee=g[oe],b.hasOwnProperty(oe)&&je!==Ee&&(je!=null||Ee!=null))switch(oe){case"selected":u.selected=je&&typeof je!="function"&&typeof je!="symbol";break;default:ar(u,d,oe,je,b,Ee)}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 $t in g)je=g[$t],g.hasOwnProperty($t)&&je!=null&&!b.hasOwnProperty($t)&&ar(u,d,$t,null,b,je);for(we in b)if(je=b[we],Ee=g[we],b.hasOwnProperty(we)&&je!==Ee&&(je!=null||Ee!=null))switch(we){case"children":case"dangerouslySetInnerHTML":if(je!=null)throw Error(r(137,d));break;default:ar(u,d,we,je,b,Ee)}return;default:if(Al(d)){for(var or in g)je=g[or],g.hasOwnProperty(or)&&je!==void 0&&!b.hasOwnProperty(or)&&aC(u,d,or,void 0,b,je);for(Ne in b)je=b[Ne],Ee=g[Ne],!b.hasOwnProperty(Ne)||je===Ee||je===void 0&&Ee===void 0||aC(u,d,Ne,je,b,Ee);return}}for(var pe in g)je=g[pe],g.hasOwnProperty(pe)&&je!=null&&!b.hasOwnProperty(pe)&&ar(u,d,pe,null,b,je);for(Qe in b)je=b[Qe],Ee=g[Qe],!b.hasOwnProperty(Qe)||je===Ee||je==null&&Ee==null||ar(u,d,Qe,je,b,Ee)}function wD(u){switch(u){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tX(){if(typeof performance.getEntriesByType=="function"){for(var u=0,d=0,g=performance.getEntriesByType("resource"),b=0;b<g.length;b++){var T=g[b],E=T.transferSize,$=T.initiatorType,Z=T.duration;if(E&&Z&&wD($)){for($=0,Z=T.responseEnd,b+=1;b<g.length;b++){var oe=g[b],we=oe.startTime;if(we>Z)break;var Ne=oe.transferSize,Qe=oe.initiatorType;Ne&&wD(Qe)&&(oe=oe.responseEnd,$+=Ne*(oe<Z?1:(Z-we)/(oe-we)))}if(--b,d+=8*(E+$)/(T.duration/1e3),u++,10<u)break}}if(0<u)return d/u/1e6}return navigator.connection&&(u=navigator.connection.downlink,typeof u=="number")?u:5}var oC=null,lC=null;function s1(u){return u.nodeType===9?u:u.ownerDocument}function SD(u){switch(u){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jD(u,d){if(u===0)switch(d){case"svg":return 1;case"math":return 2;default:return 0}return u===1&&d==="foreignObject"?0:u}function cC(u,d){return u==="textarea"||u==="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 uC=null;function nX(){var u=window.event;return u&&u.type==="popstate"?u===uC?!1:(uC=u,!0):(uC=null,!1)}var CD=typeof setTimeout=="function"?setTimeout:void 0,rX=typeof clearTimeout=="function"?clearTimeout:void 0,_D=typeof Promise=="function"?Promise:void 0,iX=typeof queueMicrotask=="function"?queueMicrotask:typeof _D<"u"?function(u){return _D.resolve(null).then(u).catch(sX)}:CD;function sX(u){setTimeout(function(){throw u})}function eh(u){return u==="head"}function TD(u,d){var g=d,b=0;do{var T=g.nextSibling;if(u.removeChild(g),T&&T.nodeType===8)if(g=T.data,g==="/$"||g==="/&"){if(b===0){u.removeChild(T),vp(d);return}b--}else if(g==="$"||g==="$?"||g==="$~"||g==="$!"||g==="&")b++;else if(g==="html")lg(u.ownerDocument.documentElement);else if(g==="head"){g=u.ownerDocument.head,lg(g);for(var E=g.firstChild;E;){var $=E.nextSibling,Z=E.nodeName;E[Cr]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&E.rel.toLowerCase()==="stylesheet"||g.removeChild(E),E=$}}else g==="body"&&lg(u.ownerDocument.body);g=T}while(g);vp(d)}function kD(u,d){var g=u;u=0;do{var b=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||""),b&&b.nodeType===8)if(g=b.data,g==="/$"){if(u===0)break;u--}else g!=="$"&&g!=="$?"&&g!=="$~"&&g!=="$!"||u++;g=b}while(g)}function hC(u){var d=u.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":hC(g),Ir(g);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(g.rel.toLowerCase()==="stylesheet")continue}u.removeChild(g)}}function aX(u,d,g,b){for(;u.nodeType===1;){var T=g;if(u.nodeName.toLowerCase()!==d.toLowerCase()){if(!b&&(u.nodeName!=="INPUT"||u.type!=="hidden"))break}else if(b){if(!u[Cr])switch(d){case"meta":if(!u.hasAttribute("itemprop"))break;return u;case"link":if(E=u.getAttribute("rel"),E==="stylesheet"&&u.hasAttribute("data-precedence"))break;if(E!==T.rel||u.getAttribute("href")!==(T.href==null||T.href===""?null:T.href)||u.getAttribute("crossorigin")!==(T.crossOrigin==null?null:T.crossOrigin)||u.getAttribute("title")!==(T.title==null?null:T.title))break;return u;case"style":if(u.hasAttribute("data-precedence"))break;return u;case"script":if(E=u.getAttribute("src"),(E!==(T.src==null?null:T.src)||u.getAttribute("type")!==(T.type==null?null:T.type)||u.getAttribute("crossorigin")!==(T.crossOrigin==null?null:T.crossOrigin))&&E&&u.hasAttribute("async")&&!u.hasAttribute("itemprop"))break;return u;default:return u}}else if(d==="input"&&u.type==="hidden"){var E=T.name==null?null:""+T.name;if(T.type==="hidden"&&u.getAttribute("name")===E)return u}else return u;if(u=lo(u.nextSibling),u===null)break}return null}function oX(u,d,g){if(d==="")return null;for(;u.nodeType!==3;)if((u.nodeType!==1||u.nodeName!=="INPUT"||u.type!=="hidden")&&!g||(u=lo(u.nextSibling),u===null))return null;return u}function OD(u,d){for(;u.nodeType!==8;)if((u.nodeType!==1||u.nodeName!=="INPUT"||u.type!=="hidden")&&!d||(u=lo(u.nextSibling),u===null))return null;return u}function dC(u){return u.data==="$?"||u.data==="$~"}function fC(u){return u.data==="$!"||u.data==="$?"&&u.ownerDocument.readyState!=="loading"}function lX(u,d){var g=u.ownerDocument;if(u.data==="$~")u._reactRetry=d;else if(u.data!=="$?"||g.readyState!=="loading")d();else{var b=function(){d(),g.removeEventListener("DOMContentLoaded",b)};g.addEventListener("DOMContentLoaded",b),u._reactRetry=b}}function lo(u){for(;u!=null;u=u.nextSibling){var d=u.nodeType;if(d===1||d===3)break;if(d===8){if(d=u.data,d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"||d==="F!"||d==="F")break;if(d==="/$"||d==="/&")return null}}return u}var pC=null;function ED(u){u=u.nextSibling;for(var d=0;u;){if(u.nodeType===8){var g=u.data;if(g==="/$"||g==="/&"){if(d===0)return lo(u.nextSibling);d--}else g!=="$"&&g!=="$!"&&g!=="$?"&&g!=="$~"&&g!=="&"||d++}u=u.nextSibling}return null}function MD(u){u=u.previousSibling;for(var d=0;u;){if(u.nodeType===8){var g=u.data;if(g==="$"||g==="$!"||g==="$?"||g==="$~"||g==="&"){if(d===0)return u;d--}else g!=="/$"&&g!=="/&"||d++}u=u.previousSibling}return null}function RD(u,d,g){switch(d=s1(g),u){case"html":if(u=d.documentElement,!u)throw Error(r(452));return u;case"head":if(u=d.head,!u)throw Error(r(453));return u;case"body":if(u=d.body,!u)throw Error(r(454));return u;default:throw Error(r(451))}}function lg(u){for(var d=u.attributes;d.length;)u.removeAttributeNode(d[0]);Ir(u)}var co=new Map,DD=new Set;function a1(u){return typeof u.getRootNode=="function"?u.getRootNode():u.nodeType===9?u:u.ownerDocument}var $c=F.d;F.d={f:cX,r:uX,D:hX,C:dX,L:fX,m:pX,X:gX,S:mX,M:vX};function cX(){var u=$c.f(),d=Ky();return u||d}function uX(u){var d=Gs(u);d!==null&&d.tag===5&&d.type==="form"?XM(d):$c.r(u)}var pp=typeof document>"u"?null:document;function ND(u,d,g){var b=pp;if(b&&typeof d=="string"&&d){var T=es(d);T='link[rel="'+u+'"][href="'+T+'"]',typeof g=="string"&&(T+='[crossorigin="'+g+'"]'),DD.has(T)||(DD.add(T),u={rel:u,crossOrigin:g,href:d},b.querySelector(T)===null&&(d=b.createElement("link"),as(d,"link",u),Hr(d),b.head.appendChild(d)))}}function hX(u){$c.D(u),ND("dns-prefetch",u,null)}function dX(u,d){$c.C(u,d),ND("preconnect",u,d)}function fX(u,d,g){$c.L(u,d,g);var b=pp;if(b&&u&&d){var T='link[rel="preload"][as="'+es(d)+'"]';d==="image"&&g&&g.imageSrcSet?(T+='[imagesrcset="'+es(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(T+='[imagesizes="'+es(g.imageSizes)+'"]')):T+='[href="'+es(u)+'"]';var E=T;switch(d){case"style":E=mp(u);break;case"script":E=gp(u)}co.has(E)||(u=p({rel:"preload",href:d==="image"&&g&&g.imageSrcSet?void 0:u,as:d},g),co.set(E,u),b.querySelector(T)!==null||d==="style"&&b.querySelector(cg(E))||d==="script"&&b.querySelector(ug(E))||(d=b.createElement("link"),as(d,"link",u),Hr(d),b.head.appendChild(d)))}}function pX(u,d){$c.m(u,d);var g=pp;if(g&&u){var b=d&&typeof d.as=="string"?d.as:"script",T='link[rel="modulepreload"][as="'+es(b)+'"][href="'+es(u)+'"]',E=T;switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=gp(u)}if(!co.has(E)&&(u=p({rel:"modulepreload",href:u},d),co.set(E,u),g.querySelector(T)===null)){switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(ug(E)))return}b=g.createElement("link"),as(b,"link",u),Hr(b),g.head.appendChild(b)}}}function mX(u,d,g){$c.S(u,d,g);var b=pp;if(b&&u){var T=Xs(b).hoistableStyles,E=mp(u);d=d||"default";var $=T.get(E);if(!$){var Z={loading:0,preload:null};if($=b.querySelector(cg(E)))Z.loading=5;else{u=p({rel:"stylesheet",href:u,"data-precedence":d},g),(g=co.get(E))&&mC(u,g);var oe=$=b.createElement("link");Hr(oe),as(oe,"link",u),oe._p=new Promise(function(we,Ne){oe.onload=we,oe.onerror=Ne}),oe.addEventListener("load",function(){Z.loading|=1}),oe.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,o1($,d,b)}$={type:"stylesheet",instance:$,count:1,state:Z},T.set(E,$)}}}function gX(u,d){$c.X(u,d);var g=pp;if(g&&u){var b=Xs(g).hoistableScripts,T=gp(u),E=b.get(T);E||(E=g.querySelector(ug(T)),E||(u=p({src:u,async:!0},d),(d=co.get(T))&&gC(u,d),E=g.createElement("script"),Hr(E),as(E,"link",u),g.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},b.set(T,E))}}function vX(u,d){$c.M(u,d);var g=pp;if(g&&u){var b=Xs(g).hoistableScripts,T=gp(u),E=b.get(T);E||(E=g.querySelector(ug(T)),E||(u=p({src:u,async:!0,type:"module"},d),(d=co.get(T))&&gC(u,d),E=g.createElement("script"),Hr(E),as(E,"link",u),g.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},b.set(T,E))}}function ID(u,d,g,b){var T=(T=de.current)?a1(T):null;if(!T)throw Error(r(446));switch(u){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(d=mp(g.href),g=Xs(T).hoistableStyles,b=g.get(d),b||(b={type:"style",instance:null,count:0,state:null},g.set(d,b)),b):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){u=mp(g.href);var E=Xs(T).hoistableStyles,$=E.get(u);if($||(T=T.ownerDocument||T,$={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(u,$),(E=T.querySelector(cg(u)))&&!E._p&&($.instance=E,$.state.loading=5),co.has(u)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},co.set(u,g),E||bX(T,u,g,$.state))),d&&b===null)throw Error(r(528,""));return $}if(d&&b!==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=gp(g),g=Xs(T).hoistableScripts,b=g.get(d),b||(b={type:"script",instance:null,count:0,state:null},g.set(d,b)),b):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,u))}}function mp(u){return'href="'+es(u)+'"'}function cg(u){return'link[rel="stylesheet"]['+u+"]"}function LD(u){return p({},u,{"data-precedence":u.precedence,precedence:null})}function bX(u,d,g,b){u.querySelector('link[rel="preload"][as="style"]['+d+"]")?b.loading=1:(d=u.createElement("link"),b.preload=d,d.addEventListener("load",function(){return b.loading|=1}),d.addEventListener("error",function(){return b.loading|=2}),as(d,"link",g),Hr(d),u.head.appendChild(d))}function gp(u){return'[src="'+es(u)+'"]'}function ug(u){return"script[async]"+u}function BD(u,d,g){if(d.count++,d.instance===null)switch(d.type){case"style":var b=u.querySelector('style[data-href~="'+es(g.href)+'"]');if(b)return d.instance=b,Hr(b),b;var T=p({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return b=(u.ownerDocument||u).createElement("style"),Hr(b),as(b,"style",T),o1(b,g.precedence,u),d.instance=b;case"stylesheet":T=mp(g.href);var E=u.querySelector(cg(T));if(E)return d.state.loading|=4,d.instance=E,Hr(E),E;b=LD(g),(T=co.get(T))&&mC(b,T),E=(u.ownerDocument||u).createElement("link"),Hr(E);var $=E;return $._p=new Promise(function(Z,oe){$.onload=Z,$.onerror=oe}),as(E,"link",b),d.state.loading|=4,o1(E,g.precedence,u),d.instance=E;case"script":return E=gp(g.src),(T=u.querySelector(ug(E)))?(d.instance=T,Hr(T),T):(b=g,(T=co.get(E))&&(b=p({},g),gC(b,T)),u=u.ownerDocument||u,T=u.createElement("script"),Hr(T),as(T,"link",b),u.head.appendChild(T),d.instance=T);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(b=d.instance,d.state.loading|=4,o1(b,g.precedence,u));return d.instance}function o1(u,d,g){for(var b=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),T=b.length?b[b.length-1]:null,E=T,$=0;$<b.length;$++){var Z=b[$];if(Z.dataset.precedence===d)E=Z;else if(E!==T)break}E?E.parentNode.insertBefore(u,E.nextSibling):(d=g.nodeType===9?g.head:g,d.insertBefore(u,d.firstChild))}function mC(u,d){u.crossOrigin==null&&(u.crossOrigin=d.crossOrigin),u.referrerPolicy==null&&(u.referrerPolicy=d.referrerPolicy),u.title==null&&(u.title=d.title)}function gC(u,d){u.crossOrigin==null&&(u.crossOrigin=d.crossOrigin),u.referrerPolicy==null&&(u.referrerPolicy=d.referrerPolicy),u.integrity==null&&(u.integrity=d.integrity)}var l1=null;function PD(u,d,g){if(l1===null){var b=new Map,T=l1=new Map;T.set(g,b)}else T=l1,b=T.get(g),b||(b=new Map,T.set(g,b));if(b.has(u))return b;for(b.set(u,null),g=g.getElementsByTagName(u),T=0;T<g.length;T++){var E=g[T];if(!(E[Cr]||E[jr]||u==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var $=E.getAttribute(d)||"";$=u+$;var Z=b.get($);Z?Z.push(E):b.set($,[E])}}return b}function FD(u,d,g){u=u.ownerDocument||u,u.head.insertBefore(g,d==="title"?u.querySelector("head > title"):null)}function yX(u,d,g){if(g===1||d.itemProp!=null)return!1;switch(u){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 u=d.disabled,typeof d.precedence=="string"&&u==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 $D(u){return!(u.type==="stylesheet"&&(u.state.loading&3)===0)}function xX(u,d,g,b){if(g.type==="stylesheet"&&(typeof b.media!="string"||matchMedia(b.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var T=mp(b.href),E=d.querySelector(cg(T));if(E){d=E._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(u.count++,u=c1.bind(u),d.then(u,u)),g.state.loading|=4,g.instance=E,Hr(E);return}E=d.ownerDocument||d,b=LD(b),(T=co.get(T))&&mC(b,T),E=E.createElement("link"),Hr(E);var $=E;$._p=new Promise(function(Z,oe){$.onload=Z,$.onerror=oe}),as(E,"link",b),g.instance=E}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(g,d),(d=g.state.preload)&&(g.state.loading&3)===0&&(u.count++,g=c1.bind(u),d.addEventListener("load",g),d.addEventListener("error",g))}}var vC=0;function AX(u,d){return u.stylesheets&&u.count===0&&h1(u,u.stylesheets),0<u.count||0<u.imgCount?function(g){var b=setTimeout(function(){if(u.stylesheets&&h1(u,u.stylesheets),u.unsuspend){var E=u.unsuspend;u.unsuspend=null,E()}},6e4+d);0<u.imgBytes&&vC===0&&(vC=62500*tX());var T=setTimeout(function(){if(u.waitingForImages=!1,u.count===0&&(u.stylesheets&&h1(u,u.stylesheets),u.unsuspend)){var E=u.unsuspend;u.unsuspend=null,E()}},(u.imgBytes>vC?50:800)+d);return u.unsuspend=g,function(){u.unsuspend=null,clearTimeout(b),clearTimeout(T)}}:null}function c1(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)h1(this,this.stylesheets);else if(this.unsuspend){var u=this.unsuspend;this.unsuspend=null,u()}}}var u1=null;function h1(u,d){u.stylesheets=null,u.unsuspend!==null&&(u.count++,u1=new Map,d.forEach(wX,u),u1=null,c1.call(u))}function wX(u,d){if(!(d.state.loading&4)){var g=u1.get(u);if(g)var b=g.get(null);else{g=new Map,u1.set(u,g);for(var T=u.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<T.length;E++){var $=T[E];($.nodeName==="LINK"||$.getAttribute("media")!=="not all")&&(g.set($.dataset.precedence,$),b=$)}b&&g.set(null,b)}T=d.instance,$=T.getAttribute("data-precedence"),E=g.get($)||b,E===b&&g.set(null,T),g.set($,T),this.count++,b=c1.bind(this),T.addEventListener("load",b),T.addEventListener("error",b),E?E.parentNode.insertBefore(T,E.nextSibling):(u=u.nodeType===9?u.head:u,u.insertBefore(T,u.firstChild)),d.state.loading|=4}}var hg={$$typeof:C,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function SX(u,d,g,b,T,E,$,Z,oe){this.tag=1,this.containerInfo=u,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=qt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qt(0),this.hiddenUpdates=qt(null),this.identifierPrefix=b,this.onUncaughtError=T,this.onCaughtError=E,this.onRecoverableError=$,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=oe,this.incompleteTransitions=new Map}function HD(u,d,g,b,T,E,$,Z,oe,we,Ne,Qe){return u=new SX(u,d,g,$,oe,we,Ne,Qe,Z),d=1,E===!0&&(d|=24),E=Sa(3,null,null,d),u.current=E,E.stateNode=u,d=XS(),d.refCount++,u.pooledCache=d,d.refCount++,E.memoizedState={element:b,isDehydrated:g,cache:d},ej(E),u}function zD(u){return u?(u=Yf,u):Yf}function qD(u,d,g,b,T,E){T=zD(T),b.context===null?b.context=T:b.pendingContext=T,b=qu(d),b.payload={element:g},E=E===void 0?null:E,E!==null&&(b.callback=E),g=Qu(u,b,d),g!==null&&(ia(g,u,d),q0(g,u,d))}function QD(u,d){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var g=u.retryLane;u.retryLane=g!==0&&g<d?g:d}}function bC(u,d){QD(u,d),(u=u.alternate)&&QD(u,d)}function UD(u){if(u.tag===13||u.tag===31){var d=bd(u,67108864);d!==null&&ia(d,u,67108864),bC(u,67108864)}}function WD(u){if(u.tag===13||u.tag===31){var d=ka();d=Tt(d);var g=bd(u,d);g!==null&&ia(g,u,d),bC(u,d)}}var d1=!0;function jX(u,d,g,b){var T=B.T;B.T=null;var E=F.p;try{F.p=2,yC(u,d,g,b)}finally{F.p=E,B.T=T}}function CX(u,d,g,b){var T=B.T;B.T=null;var E=F.p;try{F.p=8,yC(u,d,g,b)}finally{F.p=E,B.T=T}}function yC(u,d,g,b){if(d1){var T=xC(b);if(T===null)sC(u,d,b,f1,g),VD(u,b);else if(TX(T,u,d,g,b))b.stopPropagation();else if(VD(u,b),d&4&&-1<_X.indexOf(u)){for(;T!==null;){var E=Gs(T);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var $=ct(E.pendingLanes);if($!==0){var Z=E;for(Z.pendingLanes|=2,Z.entangledLanes|=2;$;){var oe=1<<31-Wt($);Z.entanglements[1]|=oe,$&=~oe}Ol(E),($n&6)===0&&(Gy=De()+500,sg(0))}}break;case 31:case 13:Z=bd(E,2),Z!==null&&ia(Z,E,2),Ky(),bC(E,2)}if(E=xC(b),E===null&&sC(u,d,b,f1,g),E===T)break;T=E}T!==null&&b.stopPropagation()}else sC(u,d,b,null,g)}}function xC(u){return u=zt(u),AC(u)}var f1=null;function AC(u){if(f1=null,u=kn(u),u!==null){var d=s(u);if(d===null)u=null;else{var g=d.tag;if(g===13){if(u=o(d),u!==null)return u;u=null}else if(g===31){if(u=l(d),u!==null)return u;u=null}else if(g===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;u=null}else d!==u&&(u=null)}}return f1=u,null}function YD(u){switch(u){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(Ce()){case ze:return 2;case ht:return 8;case Rt:case Tn:return 32;case fn:return 268435456;default:return 32}default:return 32}}var wC=!1,th=null,nh=null,rh=null,dg=new Map,fg=new Map,ih=[],_X="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 VD(u,d){switch(u){case"focusin":case"focusout":th=null;break;case"dragenter":case"dragleave":nh=null;break;case"mouseover":case"mouseout":rh=null;break;case"pointerover":case"pointerout":dg.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":fg.delete(d.pointerId)}}function pg(u,d,g,b,T,E){return u===null||u.nativeEvent!==E?(u={blockedOn:d,domEventName:g,eventSystemFlags:b,nativeEvent:E,targetContainers:[T]},d!==null&&(d=Gs(d),d!==null&&UD(d)),u):(u.eventSystemFlags|=b,d=u.targetContainers,T!==null&&d.indexOf(T)===-1&&d.push(T),u)}function TX(u,d,g,b,T){switch(d){case"focusin":return th=pg(th,u,d,g,b,T),!0;case"dragenter":return nh=pg(nh,u,d,g,b,T),!0;case"mouseover":return rh=pg(rh,u,d,g,b,T),!0;case"pointerover":var E=T.pointerId;return dg.set(E,pg(dg.get(E)||null,u,d,g,b,T)),!0;case"gotpointercapture":return E=T.pointerId,fg.set(E,pg(fg.get(E)||null,u,d,g,b,T)),!0}return!1}function GD(u){var d=kn(u.target);if(d!==null){var g=s(d);if(g!==null){if(d=g.tag,d===13){if(d=o(g),d!==null){u.blockedOn=d,Gr(u.priority,function(){WD(g)});return}}else if(d===31){if(d=l(g),d!==null){u.blockedOn=d,Gr(u.priority,function(){WD(g)});return}}else if(d===3&&g.stateNode.current.memoizedState.isDehydrated){u.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}u.blockedOn=null}function p1(u){if(u.blockedOn!==null)return!1;for(var d=u.targetContainers;0<d.length;){var g=xC(u.nativeEvent);if(g===null){g=u.nativeEvent;var b=new g.constructor(g.type,g);Ct=b,g.target.dispatchEvent(b),Ct=null}else return d=Gs(g),d!==null&&UD(d),u.blockedOn=g,!1;d.shift()}return!0}function XD(u,d,g){p1(u)&&g.delete(d)}function kX(){wC=!1,th!==null&&p1(th)&&(th=null),nh!==null&&p1(nh)&&(nh=null),rh!==null&&p1(rh)&&(rh=null),dg.forEach(XD),fg.forEach(XD)}function m1(u,d){u.blockedOn===d&&(u.blockedOn=null,wC||(wC=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kX)))}var g1=null;function KD(u){g1!==u&&(g1=u,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){g1===u&&(g1=null);for(var d=0;d<u.length;d+=3){var g=u[d],b=u[d+1],T=u[d+2];if(typeof b!="function"){if(AC(b||g)===null)continue;break}var E=Gs(g);E!==null&&(u.splice(d,3),d-=3,xj(E,{pending:!0,data:T,method:g.method,action:b},b,T))}}))}function vp(u){function d(oe){return m1(oe,u)}th!==null&&m1(th,u),nh!==null&&m1(nh,u),rh!==null&&m1(rh,u),dg.forEach(d),fg.forEach(d);for(var g=0;g<ih.length;g++){var b=ih[g];b.blockedOn===u&&(b.blockedOn=null)}for(;0<ih.length&&(g=ih[0],g.blockedOn===null);)GD(g),g.blockedOn===null&&ih.shift();if(g=(u.ownerDocument||u).$$reactFormReplay,g!=null)for(b=0;b<g.length;b+=3){var T=g[b],E=g[b+1],$=T[Pi]||null;if(typeof E=="function")$||KD(g);else if($){var Z=null;if(E&&E.hasAttribute("formAction")){if(T=E,$=E[Pi]||null)Z=$.formAction;else if(AC(T)!==null)continue}else Z=$.action;typeof Z=="function"?g[b+1]=Z:(g.splice(b,3),b-=3),KD(g)}}}function ZD(){function u(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function($){return T=$})},focusReset:"manual",scroll:"manual"})}function d(){T!==null&&(T(),T=null),b||setTimeout(g,20)}function g(){if(!b&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var b=!1,T=null;return navigation.addEventListener("navigate",u),navigation.addEventListener("navigatesuccess",d),navigation.addEventListener("navigateerror",d),setTimeout(g,100),function(){b=!0,navigation.removeEventListener("navigate",u),navigation.removeEventListener("navigatesuccess",d),navigation.removeEventListener("navigateerror",d),T!==null&&(T(),T=null)}}}function SC(u){this._internalRoot=u}v1.prototype.render=SC.prototype.render=function(u){var d=this._internalRoot;if(d===null)throw Error(r(409));var g=d.current,b=ka();qD(g,b,u,d,null,null)},v1.prototype.unmount=SC.prototype.unmount=function(){var u=this._internalRoot;if(u!==null){this._internalRoot=null;var d=u.containerInfo;qD(u.current,2,null,u,null,null),Ky(),d[vs]=null}};function v1(u){this._internalRoot=u}v1.prototype.unstable_scheduleHydration=function(u){if(u){var d=Vr();u={blockedOn:null,target:u,priority:d};for(var g=0;g<ih.length&&d!==0&&d<ih[g].priority;g++);ih.splice(g,0,u),g===0&&GD(u)}};var JD=e.version;if(JD!=="19.2.7")throw Error(r(527,JD,"19.2.7"));F.findDOMNode=function(u){var d=u._reactInternals;if(d===void 0)throw typeof u.render=="function"?Error(r(188)):(u=Object.keys(u).join(","),Error(r(268,u)));return u=h(d),u=u!==null?f(u):null,u=u===null?null:u.stateNode,u};var OX={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var b1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!b1.isDisabled&&b1.supportsFiber)try{tn=b1.inject(OX),Bt=b1}catch{}}return gg.createRoot=function(u,d){if(!i(u))throw Error(r(299));var g=!1,b="",T=aR,E=oR,$=lR;return d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(T=d.onUncaughtError),d.onCaughtError!==void 0&&(E=d.onCaughtError),d.onRecoverableError!==void 0&&($=d.onRecoverableError)),d=HD(u,1,!1,null,null,g,b,null,T,E,$,ZD),u[vs]=d.current,iC(u),new SC(d)},gg.hydrateRoot=function(u,d,g){if(!i(u))throw Error(r(299));var b=!1,T="",E=aR,$=oR,Z=lR,oe=null;return g!=null&&(g.unstable_strictMode===!0&&(b=!0),g.identifierPrefix!==void 0&&(T=g.identifierPrefix),g.onUncaughtError!==void 0&&(E=g.onUncaughtError),g.onCaughtError!==void 0&&($=g.onCaughtError),g.onRecoverableError!==void 0&&(Z=g.onRecoverableError),g.formState!==void 0&&(oe=g.formState)),d=HD(u,1,!0,d,g??null,b,T,oe,E,$,Z,ZD),d.context=zD(null),g=d.current,b=ka(),b=Tt(b),T=qu(b),T.callback=null,Qu(g,T,b),g=b,d.current.lanes=g,Qt(d,g),Ol(d),u[vs]=d.current,iC(u),new v1(d)},gg.version="19.2.7",gg}var u8;function HX(){if(u8)return TC.exports;u8=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(),TC.exports=$X(),TC.exports}var zX=HX();const qX=pl(zX),QX="_link_88ik9_12",y1={link:QX},UX="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";function ri(t){return Object.keys(t)}function MC(t){return t&&typeof t=="object"&&!Array.isArray(t)}function kO(t,e){const n={...t},r=e;return MC(t)&&MC(e)&&Object.keys(e).forEach(i=>{MC(r[i])&&i in t?n[i]=kO(n[i],r[i]):n[i]=r[i]}),n}function WX(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function YX(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 pv(t){const e=YX(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 h8(t){return t==="0rem"?"0rem":`calc(${t} * var(--mantine-scale))`}function TP(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?h8(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?h8(s):s}}return r}return n}const me=TP("rem",{shouldScale:!0}),Rs=TP("em");function ub(t){return Object.keys(t).reduce((e,n)=>(t[n]!==void 0&&(e[n]=t[n]),e),{})}function kP(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(n=>e.test(n))}return!1}function OO(t){return Array.isArray(t)||t===null?!1:typeof t=="object"?t.type!==O.Fragment:!1}function Ki(t){const e=O.createContext(null);return[e,()=>{const r=O.use(e);if(r===null)throw new Error(t);return r}]}function oA(t,e){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(e);return`${t}-${n}`}}function lA(t,e){let n=t;for(;(n=n.parentElement)&&!n.matches(e););return n}function VX(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 GX(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 XX(t,e,n){return lA(t,n)===lA(e,n)}function hb({parentSelector:t,siblingSelector:e,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:s="rtl",orientation:o}){return l=>{var y;n==null||n(l);const c=Array.from(((y=lA(l.currentTarget,t))==null?void 0:y.querySelectorAll(e))||[]).filter(x=>XX(l.currentTarget,x,t)),h=c.findIndex(x=>l.currentTarget===x),f=GX(h,c,r),p=VX(h,c,r),m=s==="rtl"?p:f,v=s==="rtl"?f:p;switch(l.key){case"ArrowRight":o==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[m].focus(),i&&c[m].click());break;case"ArrowLeft":o==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[v].focus(),i&&c[v].click());break;case"ArrowUp":o==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[p].focus(),i&&c[p].click());break;case"ArrowDown":o==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[f].focus(),i&&c[f].click());break;case"Home":l.stopPropagation(),l.preventDefault(),!c[0].disabled&&c[0].focus();break;case"End":{l.stopPropagation(),l.preventDefault();const x=c.length-1;!c[x].disabled&&c[x].focus();break}}}}const KX={app:100,modal:200,popover:300,overlay:400,max:9999};function jo(t){return KX[t]}const cA=()=>{};function ZX(t,e={active:!0}){return typeof t!="function"||!e.active?e.onKeyDown||cA:n=>{var r;n.key==="Escape"&&(t(n),(r=e.onTrigger)==null||r.call(e))}}function Gt(t,e="size",n=!0){if(t!==void 0)return kP(t)?n?me(t):t:`var(--${e}-${t})`}function Gi(t){return Gt(t,"mantine-spacing")}function rr(t){return t===void 0?"var(--mantine-radius-default)":Gt(t,"mantine-radius")}function Dr(t){return Gt(t,"mantine-font-size")}function OP(t){return Gt(t,"mantine-line-height",!1)}function EO(t){if(t)return Gt(t,"mantine-shadow",!1)}function cr(t,e){return n=>{t==null||t(n),e==null||e(n)}}function MO(t,e){return t in e?pv(e[t]):pv(t)}function t3(t,e){const n=t.map(r=>({value:r,px:MO(r,e)}));return n.sort((r,i)=>r.px-i.px),n}function Qp(t){return typeof t=="object"&&t!==null?"base"in t?t.base:void 0:t}function JX(t,e,n){var r;return n?Array.from(((r=lA(n,e))==null?void 0:r.querySelectorAll(t))||[]).findIndex(i=>i===n):null}function Lh(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 Em(t="mantine-"){return`${t}${Math.random().toString(36).slice(2,11)}`}function eK(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 Bp(t){const e=O.useRef(t);return O.useEffect(()=>{e.current=t}),O.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}function jw(t,e){const{delay:n,flushOnUnmount:r,leading:i,maxWait:s}=typeof e=="number"?{delay:e,flushOnUnmount:!1,leading:!1,maxWait:void 0}:e,o=Bp(t),l=O.useRef(0),c=O.useRef(0),h=O.useRef(null),f=O.useMemo(()=>{const p=Object.assign((...m)=>{window.clearTimeout(l.current),h.current=m;const v=p._isFirstCall;p._isFirstCall=!1;function y(){window.clearTimeout(l.current),window.clearTimeout(c.current),l.current=0,c.current=0,p._isFirstCall=!0,p._hasPendingCallback=!1}function x(){s!==void 0&&c.current===0&&(c.current=window.setTimeout(()=>{if(l.current!==0){const A=h.current;y(),o(...A)}},s))}if(i&&v){o(...m);const A=()=>{y()},C=()=>{l.current!==0&&(y(),o(...m))},j=()=>{y()};p.flush=C,p.cancel=j,l.current=window.setTimeout(A,n),x();return}if(i&&!v){p._hasPendingCallback=!0;const A=()=>{l.current!==0&&(y(),o(...m))},C=()=>{y()};p.flush=A,p.cancel=C;const j=()=>{y()};l.current=window.setTimeout(j,n),x();return}p._hasPendingCallback=!0;const S=()=>{l.current!==0&&(y(),o(...m))},w=()=>{y()};p.flush=S,p.cancel=w,l.current=window.setTimeout(S,n),x()},{flush:()=>{},cancel:()=>{},isPending:()=>p._hasPendingCallback,_isFirstCall:!0,_hasPendingCallback:!1});return p},[o,n,i,s]);return O.useEffect(()=>()=>{r?f.flush():f.cancel()},[f,r]),f}const tK=["mousedown","touchstart"];function nK(t,e,n,r=!0){const i=O.useRef(null),s=e||tK,o=O.useEffectEvent(c=>{const{target:h}=c??{};if(!document.body.contains(h)&&(h==null?void 0:h.tagName)!=="HTML")return;const f=c.composedPath();Array.isArray(n)?n.every(p=>!!p&&!f.includes(p))&&t(c):i.current&&!f.includes(i.current)&&t(c)}),l=s.join(",");return O.useEffect(()=>{if(!r)return;const c=l.split(",");return c.forEach(h=>document.addEventListener(h,o)),()=>{c.forEach(h=>document.removeEventListener(h,o))}},[l,r]),i}function EP(t={}){const e=t.timeout??2e3,[n,r]=O.useState(null),[i,s]=O.useState(!1),o=O.useRef(null);O.useEffect(()=>()=>{window.clearTimeout(o.current)},[]);const l=f=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>s(!1),e),s(f)};return{copy:f=>{"clipboard"in navigator?navigator.clipboard.writeText(f).then(()=>{r(null),l(!0)}).catch(p=>r(p)):r(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{s(!1),r(null),window.clearTimeout(o.current)},error:n,copied:i}}function rK(t,e){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(t).matches:!1}function MP(t,e,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=O.useState(n?e:rK(t));return O.useEffect(()=>{try{if("matchMedia"in window){const s=window.matchMedia(t);i(s.matches);const o=l=>i(l.matches);return s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}}}catch{return}},[t]),r||!1}function RP(t,e){return MP("(prefers-color-scheme: dark)",t==="dark",e)?"dark":"light"}function db(t,e,n={leading:!1}){const[r,i]=O.useState(t),s=O.useRef(!1),o=O.useRef(null),l=O.useRef(!1),c=O.useRef(t);c.current=t;const h=O.useCallback(()=>{window.clearTimeout(o.current),o.current=null,l.current=!1},[]),f=O.useCallback(()=>{o.current&&(h(),l.current=!1,i(c.current))},[]);return O.useEffect(()=>{s.current&&(!l.current&&n.leading?(l.current=!0,i(t),o.current=window.setTimeout(()=>{l.current=!1},e)):(h(),o.current=window.setTimeout(()=>{l.current=!1,i(t)},e)))},[t,n.leading,e]),O.useEffect(()=>(s.current=!0,h),[]),[r,h,{cancel:h,flush:f}]}const nc=typeof document<"u"?O.useLayoutEffect:O.useEffect;function vu(t,e){const n=O.useRef(!1);O.useEffect(()=>()=>{n.current=!1},[]),O.useEffect(()=>{if(n.current)return t();n.current=!0},e)}function DP({opened:t,shouldReturnFocus:e=!0}){const n=O.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 vu(()=>{let i=-1;const s=o=>{o.key==="Tab"&&window.clearTimeout(i)};if(document.addEventListener("keydown",s),t)n.current=document.activeElement;else if(e){const o=document.activeElement;i=window.setTimeout(()=>{const l=document.activeElement;(l===null||l===document.body||l===o)&&r()},10)}return()=>{window.clearTimeout(i),document.removeEventListener("keydown",s)}},[t,e]),r}const iK=/input|select|textarea|button|object/,NP="a, input, select, textarea, button, object, [tabindex]";function sK(t){return t.style.display==="none"}function aK(t){if(t.getAttribute("aria-hidden")||t.getAttribute("hidden")||t.getAttribute("type")==="hidden")return!1;let e=t;for(;e&&!(e===document.body||e.nodeType===11);){if(sK(e))return!1;e=e.parentNode}return!0}function IP(t){let e=t.getAttribute("tabindex");return e===null&&(e=void 0),parseInt(e,10)}function n3(t){const e=t.nodeName.toLowerCase(),n=!Number.isNaN(IP(t));return(iK.test(e)&&!t.disabled||t instanceof HTMLAnchorElement&&t.href||n)&&aK(t)}function LP(t){const e=IP(t);return(Number.isNaN(e)||e>=0)&&n3(t)}function oK(t){return Array.from(t.querySelectorAll(NP)).filter(LP)}function lK(t,e){const n=oK(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(c=>c.getAttribute("type")==="radio"&&c.getAttribute("name")===o.getAttribute("name")).includes(r)),!s)return;e.preventDefault();const l=n[e.shiftKey?n.length-1:0];l&&l.focus()}function cK(t=!0){const e=O.useRef(null),n=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const o=Array.from(i.querySelectorAll(NP));s=o.find(LP)||o.find(n3)||null,!s&&n3(i)&&(s=i)}s?s.focus({preventScroll:!0}):console.warn("[@mantine/hooks/use-focus-trap] Failed to find focusable element within provided node",i)},r=O.useCallback(i=>{if(t){if(i===null){e.current=null;return}e.current!==i&&(setTimeout(()=>{i.getRootNode()?n(i):console.warn("[@mantine/hooks/use-focus-trap] Ref node is not part of the dom",i)}),e.current=i)}},[t]);return O.useEffect(()=>{if(!t)return;e.current&&setTimeout(()=>{e.current&&n(e.current)});const i=s=>{s.key==="Tab"&&e.current&&lK(e.current,s)};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]),r}const uK=t=>(t+1)%1e6;function hK(){const[,t]=O.useReducer(uK,0);return t}function Ii(t){const[e,n]=O.useState(`mantine-${O.useId().replace(/:/g,"")}`),r=O.useRef(!1);return nc(()=>{r.current||(r.current=!0,n(Em()))},[]),typeof t=="string"?t:e}function uA(t,e,n){const r=O.useEffectEvent(e);O.useEffect(()=>(window.addEventListener(t,r,n),()=>window.removeEventListener(t,r,n)),[t])}function dK(t,e="use-local-storage"){try{return JSON.stringify(t)}catch{throw new Error(`@mantine/hooks ${e}: Failed to serialize the value`)}}function fK(t){try{return t&&JSON.parse(t)}catch{return t}}function pK(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 mK(t,e){const n="mantine-local-storage",{getItem:r,setItem:i,removeItem:s}=pK(t);return function({key:l,defaultValue:c,getInitialValueInEffect:h=!0,sync:f=!0,deserialize:p=fK,serialize:m=v=>dK(v,e)}){const v=O.useCallback(A=>{let C;try{C=typeof window>"u"||!(t in window)||window[t]===null||!!A}catch{C=!0}if(C)return c;const j=r(l);return j!==null?p(j):c},[l,c]),[y,x]=O.useState(v(h)),S=O.useCallback(A=>{A instanceof Function?x(C=>{const j=A(C);return i(l,m(j)),queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(n,{detail:{key:l,value:j}}))}),j}):(i(l,m(A)),window.dispatchEvent(new CustomEvent(n,{detail:{key:l,value:A}})),x(A))},[l]),w=O.useCallback(()=>{s(l),x(c),window.dispatchEvent(new CustomEvent(n,{detail:{key:l,value:c}}))},[l,c]);return uA("storage",A=>{f&&A.storageArea===window[t]&&A.key===l&&x(p(A.newValue??void 0))}),uA(n,A=>{f&&A.detail.key===l&&x(A.detail.value)}),O.useEffect(()=>{c!==void 0&&y===void 0&&S(c)},[c,y,S]),O.useEffect(()=>{const A=v();A!==void 0&&S(A)},[l]),[y===void 0?c:y,S,w]}}function fb(t){return mK("localStorage","use-local-storage")(t)}function hA(t,e){if(typeof t=="function")return t(e);typeof t=="object"&&t!==null&&"current"in t&&(t.current=e)}function RO(...t){const e=new Map;return n=>{if(t.forEach(r=>{const i=hA(r,n);i&&e.set(r,i)}),e.size>0)return()=>{t.forEach(r=>{const i=e.get(r);i&&typeof i=="function"?i():hA(r,null)}),e.clear()}}}function En(...t){return O.useCallback(RO(...t),t)}function si({value:t,defaultValue:e,finalValue:n,onChange:r=()=>{}}){const[i,s]=O.useState(e!==void 0?e:n),o=(l,...c)=>{s(l),r==null||r(l,...c)};return t!==void 0?[t,r,!0]:[i,o,!1]}function ah(t,e){const n=e-t+1;return Array.from({length:n},(r,i)=>i+t)}const x1="dots";function gK({total:t,siblings:e=1,boundaries:n=1,page:r,initialPage:i,onChange:s,startValue:o=1}){const l=Math.max(Math.trunc(o),1),c=Math.max(Math.trunc(t),l),h=c-l+1,f=i??l,[p,m]=si({value:r,onChange:s,defaultValue:f,finalValue:f}),v=O.useCallback(A=>{A<l?m(l):A>c?m(c):m(A)},[l,c,m]),y=O.useCallback(()=>v(p+1),[p,v]),x=O.useCallback(()=>v(p-1),[p,v]),S=O.useCallback(()=>v(l),[v,l]),w=O.useCallback(()=>v(c),[c,v]);return{range:O.useMemo(()=>{if(e*2+3+n*2>=h)return ah(l,c);const A=Math.max(p-e,l+n-1),C=Math.min(p+e,c-n),j=A>l+n+1,_=C<c-n;if(!j&&_)return[...ah(l,l+(e*2+n+2)-1),x1,...ah(c-(n-1),c)];if(j&&!_){const k=n+1+2*e;return[...ah(l,l+n-1),x1,...ah(c-k,c)]}return[...ah(l,l+n-1),x1,...ah(A,C),x1,...ah(c-n+1,c)]},[h,e,p,l,c,n]),active:p,setPage:v,next:y,previous:x,first:S,last:w}}function pb(t,e){return MP("(prefers-reduced-motion: reduce)",t,e)}const vK={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function bK(t){const e=O.useRef(0),[n,r]=O.useState(vK),i=O.useRef(null);return[O.useCallback(s=>{i.current&&(i.current.disconnect(),i.current=null),e.current&&cancelAnimationFrame(e.current),s&&(i.current=new ResizeObserver(o=>{const l=o[0];l&&(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{var h,f;const c=((h=l.borderBoxSize)==null?void 0:h[0])||((f=l.contentBoxSize)==null?void 0:f[0]);if(c){const p=c.inlineSize,m=c.blockSize;r({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 r(l.contentRect)}))}),i.current.observe(s,t))},[t]),n]}function yK(t){const[e,{width:n,height:r}]=bK(t);return{ref:e,width:n,height:r}}function xK(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(!eK(t[n],e[n]))return!1;return!0}function AK(t){const e=O.useRef([]),n=O.useRef(0);return xK(e.current,t)||(e.current=t,n.current+=1),[n.current]}function wK(t,e){O.useEffect(t,AK(e))}function Cw(t=!1,e={}){const[n,r]=O.useState(t),i=O.useCallback(()=>{r(o=>{var l;return o||((l=e.onOpen)==null||l.call(e),!0)})},[e.onOpen]),s=O.useCallback(()=>{r(o=>{var l;return o&&((l=e.onClose)==null||l.call(e),!1)})},[e.onClose]);return[n,{open:i,close:s,toggle:O.useCallback(()=>{n?s():i()},[s,i,n]),set:r}]}function SK(t,e,n={autoInvoke:!1}){const r=O.useRef(null),i=Bp(t),s=O.useCallback((...l)=>{r.current||(r.current=window.setTimeout(()=>{i(...l),r.current=null},e))},[e]),o=O.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return O.useEffect(()=>(n.autoInvoke&&s(),o),[o,s]),{start:s,clear:o}}function jK(t){const e=O.useRef(void 0);return O.useEffect(()=>{e.current=t},[t]),e.current}function CK(t,e,n){const r=O.useRef(null);O.useEffect(()=>{r.current&&(r.current.disconnect(),r.current=null);const i=typeof n=="function"?n():n;return i&&(r.current=new MutationObserver(t),r.current.observe(i,e)),()=>{r.current&&(r.current.disconnect(),r.current=null)}},[t,e,n])}function _K(){const[t,e]=O.useState(!1);return O.useEffect(()=>e(!0),[]),t}const TK=["mouse","touch"],kK=10;function OK(t,e={}){const{threshold:n=400,events:r=TK,cancelOnMove:i=!1,onStart:s,onFinish:o,onCancel:l}=e,c=O.useRef(!1),h=O.useRef(!1),f=O.useRef(-1),p=O.useRef(null);return O.useEffect(()=>()=>window.clearTimeout(f.current),[]),O.useMemo(()=>{if(typeof t!="function")return{};const m=i!==!1,v=i===!0?kK:i===!1?0:i,y=A=>{!f8(A)&&!r3(A)||(s&&s(A),p.current=d8(A),h.current=!0,f.current=window.setTimeout(()=>{t(A),c.current=!0},n))},x=A=>{!f8(A)&&!r3(A)||(c.current?o&&o(A):h.current&&l&&l(A),c.current=!1,h.current=!1,p.current=null,f.current!==-1&&(window.clearTimeout(f.current),f.current=-1))},S=A=>{if(!m||!h.current||c.current)return;const C=d8(A);if(!C||!p.current)return;const j=C.x-p.current.x,_=C.y-p.current.y;Math.sqrt(j*j+_*_)>v&&x(A)},w={};return r.includes("mouse")&&(w.onMouseDown=y,w.onMouseUp=x,w.onMouseLeave=x,m&&(w.onMouseMove=S)),r.includes("touch")&&(w.onTouchStart=y,w.onTouchEnd=x,w.onTouchCancel=x,m&&(w.onTouchMove=S)),w},[t,n,l,o,s,i,r.join(",")])}function d8(t){if(r3(t)){const e=t.touches[0]??t.changedTouches[0];return e?{x:e.clientX,y:e.clientY}:null}return{x:t.clientX,y:t.clientY}}function r3(t){return window.TouchEvent?t.nativeEvent instanceof TouchEvent:"touches"in t.nativeEvent}function f8(t){return t.nativeEvent instanceof MouseEvent}var nu=_P();const Lg=pl(nu);function EK(t){if(!t||typeof t=="string")return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function RC(t){return t.current?t.current.scrollHeight:"auto"}function MK({transitionDuration:t,transitionTimingFunction:e="ease",onTransitionEnd:n,onTransitionStart:r,expanded:i,keepMounted:s}){const o={height:0,overflow:"hidden",...s?{}:{display:"none"}},l=O.useEffectEvent(()=>r==null?void 0:r()),c=O.useRef(null),[h,f]=O.useState(i?{}:o),[p,m]=O.useState(i?"entered":"exited"),v=w=>{nu.flushSync(()=>f(w))},y=w=>{v(A=>({...A,...w}))},x=w=>{const A=t??EK(w);return{transition:`height ${A}ms ${e}, opacity ${A}ms ${e}`}};vu(()=>{t!==0&&l(),i?window.requestAnimationFrame(()=>{nu.flushSync(()=>m("entering")),y({willChange:"height",display:"block",overflow:"hidden"}),window.requestAnimationFrame(()=>{const w=RC(c);y({...x(w),height:w})})}):window.requestAnimationFrame(()=>{nu.flushSync(()=>m("exiting"));const w=RC(c);y({...x(w),willChange:"height",height:w}),window.requestAnimationFrame(()=>y({height:0,overflow:"hidden"}))})},[i]);const S=w=>{if(!(w.target!==c.current||w.propertyName!=="height"))if(i){const A=RC(c);A===h.height?v({}):y({height:A}),m("entered"),n==null||n()}else h.height===0&&(v(o),m("exited"),n==null||n())};return{state:p,getCollapseProps:w=>({"aria-hidden":!i,inert:!i,ref:RO(c,w==null?void 0:w.ref),onTransitionEnd:S,style:{boxSizing:"border-box",...w==null?void 0:w.style,...h}})}}function RK(t){if(!t||typeof t=="string")return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function DC(t){return t.current?t.current.scrollWidth:"auto"}function DK({transitionDuration:t,transitionTimingFunction:e="ease",onTransitionEnd:n,onTransitionStart:r,expanded:i,keepMounted:s}){const o={width:0,overflow:"hidden",...s?{}:{display:"none"}},l=O.useEffectEvent(()=>r==null?void 0:r()),c=O.useRef(null),[h,f]=O.useState(i?{}:o),[p,m]=O.useState(i?"entered":"exited"),v=w=>{nu.flushSync(()=>f(w))},y=w=>{v(A=>({...A,...w}))},x=w=>{const A=t??RK(w);return{transition:`width ${A}ms ${e}, opacity ${A}ms ${e}`}};vu(()=>{t!==0&&l(),i?window.requestAnimationFrame(()=>{nu.flushSync(()=>m("entering")),y({willChange:"width",display:"block",overflow:"hidden"}),window.requestAnimationFrame(()=>{const w=DC(c);y({...x(w),width:w})})}):window.requestAnimationFrame(()=>{nu.flushSync(()=>m("exiting"));const w=DC(c);y({...x(w),willChange:"width",width:w}),window.requestAnimationFrame(()=>y({width:0,overflow:"hidden"}))})},[i]);const S=w=>{if(!(w.target!==c.current||w.propertyName!=="width"))if(i){const A=DC(c);A===h.width?v({}):y({width:A}),m("entered"),n==null||n()}else h.width===0&&(v(o),m("exited"),n==null||n())};return{state:p,getCollapseProps:w=>({"aria-hidden":!i,inert:!i,ref:RO(c,w==null?void 0:w.ref),onTransitionEnd:S,style:{boxSizing:"border-box",...w==null?void 0:w.style,...h}})}}const NK=100;function bp(t){return t>0?1:t<0?-1:0}function p8(t){const e=t??0;return typeof e=="number"?[e,e]:e}function IK(){return{isActive:!1,pointerId:-1,startXY:[0,0],prevXY:[0,0],startTimestamp:0,prevTimestamp:0,thresholdMet:!1,firstFired:!1,lockedAxis:null,canceled:!1,lastVelocity:[0,0]}}function LK(t,e={}){const[n,r]=O.useState(!1),i=O.useRef(t);i.current=t;const s=O.useRef(e);s.current=e;const o=O.useRef(IK()),l=O.useRef(null);return{ref:O.useCallback(c=>{if(!c)return;const h=new AbortController,f=A=>{const C=s.current,j=o.current;if(C.axis==="x")return[A[0],0];if(C.axis==="y")return[0,A[1]];if(C.axis==="lock"){if(j.lockedAxis===null){const _=C.axisThreshold??1;(Math.abs(A[0])>_||Math.abs(A[1])>_)&&(j.lockedAxis=Math.abs(A[0])>=Math.abs(A[1])?"x":"y")}if(j.lockedAxis==="x")return[A[0],0];if(j.lockedAxis==="y")return[0,A[1]]}return A},p=()=>{var C;const A=o.current;A.isActive=!1,A.pointerId=-1,A.thresholdMet=!1,A.firstFired=!1,A.lockedAxis=null,A.canceled=!1,r(!1),document.body.style.userSelect="",document.body.style.webkitUserSelect="",(C=l.current)==null||C.abort(),l.current=null},m=()=>{o.current.isActive&&(o.current.canceled=!0,p())},v=()=>{r(!0),document.body.style.userSelect="none",document.body.style.webkitUserSelect="none"},y=A=>{var M;if(s.current.enabled===!1||A.button!==0||o.current.isActive)return;const C=o.current;C.isActive=!0,C.pointerId=A.pointerId,C.startXY=[A.clientX,A.clientY],C.prevXY=[A.clientX,A.clientY],C.startTimestamp=A.timeStamp,C.prevTimestamp=A.timeStamp,C.thresholdMet=!1,C.firstFired=!1,C.lockedAxis=null,C.canceled=!1,C.lastVelocity=[0,0];const[j,_]=p8(s.current.threshold);j===0&&_===0&&(C.thresholdMet=!0,C.firstFired=!0,v(),i.current({xy:[A.clientX,A.clientY],initial:[A.clientX,A.clientY],movement:[0,0],delta:[0,0],distance:[0,0],direction:[0,0],velocity:[0,0],elapsedTime:0,first:!0,last:!1,active:!0,tap:!1,canceled:!1,cancel:m,event:A})),(M=l.current)==null||M.abort(),l.current=new AbortController;const k=l.current.signal;document.addEventListener("pointermove",x,{signal:k}),document.addEventListener("pointerup",S,{signal:k}),document.addEventListener("pointercancel",w,{signal:k})},x=A=>{const C=o.current;if(!C.isActive||A.pointerId!==C.pointerId)return;const j=[A.clientX-C.startXY[0],A.clientY-C.startXY[1]];if(!C.thresholdMet){const[I,D]=p8(s.current.threshold);if(Math.abs(j[0])<I&&Math.abs(j[1])<D){C.prevXY=[A.clientX,A.clientY],C.prevTimestamp=A.timeStamp;return}C.thresholdMet=!0,v()}const _=f(j),k=f([A.clientX-C.prevXY[0],A.clientY-C.prevXY[1]]),M=A.timeStamp-C.prevTimestamp,R=M>0?[Math.abs(k[0])/M,Math.abs(k[1])/M]:C.lastVelocity;C.lastVelocity=R;const N=!C.firstFired;C.firstFired=!0,C.prevXY=[A.clientX,A.clientY],C.prevTimestamp=A.timeStamp,i.current({xy:[A.clientX,A.clientY],initial:[...C.startXY],movement:_,delta:k,distance:[Math.abs(_[0]),Math.abs(_[1])],direction:[bp(k[0]),bp(k[1])],velocity:R,elapsedTime:A.timeStamp-C.startTimestamp,first:N,last:!1,active:!0,tap:!1,canceled:!1,cancel:m,event:A})},S=A=>{const C=o.current;if(!C.isActive||A.pointerId!==C.pointerId)return;const j=s.current;if(!C.thresholdMet){if(j.filterTaps){const D=f([A.clientX-C.startXY[0],A.clientY-C.startXY[1]]),L=[Math.abs(D[0]),Math.abs(D[1])],z=Math.max(L[0],L[1])<(j.tapThreshold??3);i.current({xy:[A.clientX,A.clientY],initial:[...C.startXY],movement:D,delta:D,distance:L,direction:[bp(D[0]),bp(D[1])],velocity:[0,0],elapsedTime:A.timeStamp-C.startTimestamp,first:!0,last:!0,active:!1,tap:z,canceled:!1,cancel:m,event:A})}p();return}const _=f([A.clientX-C.startXY[0],A.clientY-C.startXY[1]]),k=[Math.abs(_[0]),Math.abs(_[1])],M=f([A.clientX-C.prevXY[0],A.clientY-C.prevXY[1]]),R=A.timeStamp-C.prevTimestamp>NK?[0,0]:C.lastVelocity,N=Math.max(k[0],k[1]),I=j.filterTaps===!0&&N<(j.tapThreshold??3);i.current({xy:[A.clientX,A.clientY],initial:[...C.startXY],movement:_,delta:M,distance:k,direction:[bp(M[0]),bp(M[1])],velocity:R,elapsedTime:A.timeStamp-C.startTimestamp,first:!C.firstFired,last:!0,active:!1,tap:I,canceled:!1,cancel:m,event:A}),p()},w=A=>{const C=o.current;if(!C.isActive||A.pointerId!==C.pointerId)return;const j=f([A.clientX-C.startXY[0],A.clientY-C.startXY[1]]);i.current({xy:[A.clientX,A.clientY],initial:[...C.startXY],movement:j,delta:[0,0],distance:[Math.abs(j[0]),Math.abs(j[1])],direction:[0,0],velocity:[0,0],elapsedTime:A.timeStamp-C.startTimestamp,first:!C.firstFired,last:!0,active:!1,tap:!1,canceled:!0,cancel:m,event:A}),p()};return c.addEventListener("pointerdown",y,{signal:h.signal}),()=>{var A;h.abort(),(A=l.current)==null||A.abort(),l.current=null,o.current.isActive&&(o.current.isActive=!1,r(!1),document.body.style.userSelect="",document.body.style.webkitUserSelect="")}},[]),active:n}}var BK={};function BP(){return"development"}function _w(t){var n;const e=zn.version;return typeof zn.version!="string"||e.startsWith("18.")?t==null?void 0:t.ref:(n=t==null?void 0:t.props)==null?void 0:n.ref}function PK(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"}function wx(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=wx(t,s.shadowRoot);if(o)return o}}return null}function Yc(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=Yc(t,o.shadowRoot);n.push(...l)}}return n}function Hc(t){if(!t)return document;const e=t.getRootNode();return e instanceof ShadowRoot||e instanceof Document?e:document}function bu(t){const e=O.Children.toArray(t);return e.length!==1||!OO(e[0])?null:e[0]}function PP(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=PP(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function $r(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=PP(t))&&(r&&(r+=" "),r+=e);return r}const FK={};function $K(t){const e={};return t.forEach(n=>{Object.entries(n).forEach(([r,i])=>{e[r]?e[r]=$r(e[r],i):e[r]=i})}),e}function mv({theme:t,classNames:e,props:n,stylesCtx:r}){return $K((Array.isArray(e)?e:[e]).map(i=>typeof i=="function"?i(t,n,r):i||FK))}function dA({theme:t,styles:e,props:n,stylesCtx:r}){const i=Array.isArray(e)?e:[e],s={};for(const o of i)typeof o=="function"?Object.assign(s,o(t,n,r)):o&&Object.assign(s,o);return s}function m8(t){return t==="auto"||t==="dark"||t==="light"}function HK({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 m8(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&&m8(r.newValue)&&n(r.newValue)},window.addEventListener("storage",e)},unsubscribe:()=>{window.removeEventListener("storage",e)},clear:()=>{window.localStorage.removeItem(t)}}}function gv(t,e){return typeof t.primaryShade=="number"?t.primaryShade:e==="dark"?t.primaryShade.dark:t.primaryShade.light}function zK(t){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(t)}function qK(t){let e=t.replace("#","");if(e.length===3){const r=e.split("");e=[r[0],r[0],r[1],r[1],r[2],r[2]].join("")}if(e.length===8){const r=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:r}}const n=parseInt(e,16);return{r:n>>16&255,g:n>>8&255,b:n&255,a:1}}function QK(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 UK(t){const e=t.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!e)return{r:0,g:0,b:0,a:1};const n=parseInt(e[1],10),r=parseInt(e[2],10)/100,i=parseInt(e[3],10)/100,s=e[5]?parseFloat(e[5]):void 0,o=(1-Math.abs(2*i-1))*r,l=n/60,c=o*(1-Math.abs(l%2-1)),h=i-o/2;let f,p,m;return l>=0&&l<1?(f=o,p=c,m=0):l>=1&&l<2?(f=c,p=o,m=0):l>=2&&l<3?(f=0,p=o,m=c):l>=3&&l<4?(f=0,p=c,m=o):l>=4&&l<5?(f=c,p=0,m=o):(f=o,p=0,m=c),{r:Math.round((f+h)*255),g:Math.round((p+h)*255),b:Math.round((m+h)*255),a:s||1}}function Tw(t){return zK(t)?qK(t):t.startsWith("rgb")?QK(t):t.startsWith("hsl")?UK(t):{r:0,g:0,b:0,a:1}}function NC(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function WK(t){const e=t.match(/oklch\((.*?)%\s/);return e?parseFloat(e[1]):null}function YK(t){if(t.startsWith("oklch("))return(WK(t)||0)/100;const{r:e,g:n,b:r}=Tw(t),i=e/255,s=n/255,o=r/255,l=NC(i),c=NC(s),h=NC(o);return .2126*l+.7152*c+.0722*h}function vg(t,e=.179){return t.startsWith("var(")?!1:YK(t)>e}function sc({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:vg(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:vg(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:vg(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][gv(e,n||"light")];return{color:r,value:l,shade:s,isThemeColor:o,isLight:vg(l,e.luminanceThreshold),variable:i?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:t,value:t,isThemeColor:o,isLight:vg(t,e.luminanceThreshold),shade:s,variable:void 0}}function wr(t,e){const n=sc({color:t||e.primaryColor,theme:e});return n.variable?`var(${n.variable})`:t}function qd(t,e){if(t.startsWith("var("))return`color-mix(in srgb, ${t}, black ${e*100}%)`;const{r:n,g:r,b:i,a:s}=Tw(t),o=1-e,l=c=>Math.round(c*o);return`rgba(${l(n)}, ${l(r)}, ${l(i)}, ${s})`}function i3(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=wr(n.from,e),i=wr(n.to,e);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function mh(t,e){if(typeof t!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";if(t.startsWith("var("))return`color-mix(in srgb, ${t}, transparent ${(1-e)*100}%)`;if(t.startsWith("oklch"))return t.includes("/")?t.replace(/\/\s*[\d.]+\s*\)/,`/ ${e})`):t.replace(")",` / ${e})`);const{r:n,g:r,b:i}=Tw(t);return`rgba(${n}, ${r}, ${i}, ${e})`}const g8=mh,VK=({color:t,theme:e,variant:n,gradient:r,autoContrast:i})=>{const s=sc({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:`${me(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:`${me(1)} solid transparent`}:{background:t,hover:qd(t,.1),color:l,border:`${me(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:`${me(1)} solid transparent`};const l=e.colors[s.color][s.shade];return{background:l,hover:qd(l,.1),color:`var(--mantine-color-${s.color}-light-color)`,border:`${me(1)} solid transparent`}}return{background:mh(t,.1),hover:mh(t,.12),color:t,border:`${me(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:`${me(1)} solid var(--mantine-color-${t}-outline)`}:{background:"transparent",hover:mh(e.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${me(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:mh(t,.05),color:t,border:`${me(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:`${me(1)} solid transparent`};const l=e.colors[s.color][s.shade];return{background:"transparent",hover:mh(l,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${me(1)} solid transparent`}}return{background:"transparent",hover:mh(t,.12),color:t,border:`${me(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${t}-light-color)`,border:`${me(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${me(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:t,border:`${me(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:qd(e.white,.01),color:`var(--mantine-color-${t}-filled)`,border:`${me(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:qd(e.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${me(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:qd(e.white,.01),color:t,border:`${me(1)} solid transparent`}:n==="gradient"?{background:i3(r,e),hover:i3(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:`${me(1)} solid var(--mantine-color-default-border)`}:{}};function FP(t,e){if(t.startsWith("var("))return`color-mix(in srgb, ${t}, white ${e*100}%)`;const{r:n,g:r,b:i,a:s}=Tw(t),o=l=>Math.round(l+(255-l)*e);return`rgba(${o(n)}, ${o(r)}, ${o(i)}, ${s})`}function id({color:t,theme:e,autoContrast:n}){return(typeof n=="boolean"?n:e.autoContrast)&&sc({color:t||e.primaryColor,theme:e}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function v8(t,e){return id({color:t.colors[t.primaryColor][gv(t,e)],theme:t,autoContrast:null})}function t0(t,e){return typeof t=="boolean"?t:e.autoContrast}const DO=O.createContext(null);function ac(){const t=O.use(DO);if(!t)throw new Error("[@mantine/core] MantineProvider was not found in tree");return t}function GK(){return ac().cssVariablesResolver}function XK(){return ac().classNamesPrefix}function kw(){return ac().getStyleNonce}function KK(){return ac().withStaticClasses}function ZK(){return ac().headless}function JK(){var t;return(t=ac().stylesTransform)==null?void 0:t.sx}function eZ(){var t;return(t=ac().stylesTransform)==null?void 0:t.styles}function mb(){return ac().env||"default"}function tZ(){return ac().deduplicateInlineStyles}function b8(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 $P({keepTransitions:t}={}){var f;const e=O.useRef(cA),n=O.useRef(-1),r=O.use(DO),i=O.useRef((f=kw())==null?void 0:f());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const s=p=>{r.setColorScheme(p),e.current=t?()=>{}:b8(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var m;(m=e.current)==null||m.call(e)},10)},o=()=>{r.clearColorScheme(),e.current=t?()=>{}:b8(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var p;(p=e.current)==null||p.call(e)},10)},l=RP("light",{getInitialValueInEffect:!1}),c=r.colorScheme==="auto"?l:r.colorScheme,h=O.useCallback(()=>s(c==="light"?"dark":"light"),[s,c]);return O.useEffect(()=>()=>{var p;(p=e.current)==null||p.call(e),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:s,clearColorScheme:o,toggleColorScheme:h}}function yp(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 nZ({manager:t,defaultColorScheme:e,getRootElement:n,forceColorScheme:r}){const i=O.useRef(null),[s,o]=O.useState(()=>t.get(e)),l=r||s,c=O.useCallback(f=>{r||(yp(f,n),o(f),t.set(f))},[t.set,l,r]),h=O.useCallback(()=>{o(e),yp(e,n),t.clear()},[t.clear,e]);return O.useEffect(()=>(t.subscribe(c),t.unsubscribe),[t.subscribe,t.unsubscribe]),nc(()=>{yp(t.get(e),n)},[]),O.useEffect(()=>{var p;if(r)return yp(r,n),()=>{};r===void 0&&yp(s,n),typeof window<"u"&&"matchMedia"in window&&(i.current=window.matchMedia("(prefers-color-scheme: dark)"));const f=m=>{s==="auto"&&yp(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:c,clearColorScheme:h}}function Ow(t,e={getInitialValueInEffect:!0}){const n=RP(t,e),{colorScheme:r}=$P();return r==="auto"?n:r}const rZ={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"]},y8="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",NO={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:rZ,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:VK,autoContrast:!1,luminanceThreshold:.3,fontFamily:y8,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:"md",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:y8,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:me(34),lineHeight:"1.3"},h2:{fontSize:me(26),lineHeight:"1.35"},h3:{fontSize:me(22),lineHeight:"1.4"},h4:{fontSize:me(18),lineHeight:"1.45"},h5:{fontSize:me(16),lineHeight:"1.5"},h6:{fontSize:me(14),lineHeight:"1.5"}}},fontSizes:{xs:me(12),sm:me(14),md:me(16),lg:me(18),xl:me(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},fontWeights:{regular:"400",medium:"600",bold:"700"},radius:{xs:me(2),sm:me(4),md:me(8),lg:me(16),xl:me(32)},spacing:{xs:me(10),sm:me(12),md:me(16),lg:me(20),xl:me(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${me(1)} ${me(3)} rgba(0, 0, 0, 0.05), 0 ${me(1)} ${me(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${me(1)} ${me(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${me(10)} ${me(15)} ${me(-5)}, rgba(0, 0, 0, 0.04) 0 ${me(7)} ${me(7)} ${me(-5)}`,md:`0 ${me(1)} ${me(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${me(20)} ${me(25)} ${me(-5)}, rgba(0, 0, 0, 0.04) 0 ${me(10)} ${me(10)} ${me(-5)}`,lg:`0 ${me(1)} ${me(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${me(28)} ${me(23)} ${me(-7)}, rgba(0, 0, 0, 0.04) 0 ${me(12)} ${me(12)} ${me(-7)}`,xl:`0 ${me(1)} ${me(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${me(36)} ${me(28)} ${me(-7)}, rgba(0, 0, 0, 0.04) 0 ${me(17)} ${me(17)} ${me(-7)}`},other:{},components:{}},iZ="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",x8="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function IC(t){return t<0||t>9?!1:parseInt(t.toString(),10)===t}function A8(t){if(!(t.primaryColor in t.colors))throw new Error(iZ);if(typeof t.primaryShade=="object"&&(!IC(t.primaryShade.dark)||!IC(t.primaryShade.light)))throw new Error(x8);if(typeof t.primaryShade=="number"&&!IC(t.primaryShade))throw new Error(x8)}function sZ(t,e){var r;if(!e)return A8(t),t;const n=kO(t,e);return e.fontFamily&&!((r=e.headings)!=null&&r.fontFamily)&&(n.headings={...n.headings,fontFamily:e.fontFamily}),A8(n),n}const IO=O.createContext(null),aZ=()=>O.use(IO)||NO;function pi(){const t=O.use(IO);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 HP({theme:t,children:e,inherit:n=!0}){const r=aZ();return a.jsx(IO,{value:O.useMemo(()=>sZ(n?r:NO,t),[t,r,n]),children:e})}HP.displayName="@mantine/core/MantineThemeProvider";function LC(t){return Object.entries(t).map(([e,n])=>`${e}: ${n};`).join("")}function zP(t,e){const n=e?[e]:[":root",":host"],r=LC(t.variables),i=r?`${n.join(", ")}{${r}}`:"",s=LC(t.dark),o=LC(t.light),l=c=>n.map(h=>h===":host"?`${h}([data-mantine-color-scheme="${c}"])`:`${h}[data-mantine-color-scheme="${c}"]`).join(", ");return`${i}

${s?`${l("dark")}{${s}}`:""}

${o?`${l("light")}{${o}}`:""}`}function A1({theme:t,color:e,colorScheme:n,name:r=e,withColorValues:i=!0}){if(!t.colors[e])return{};if(n==="light"){const l=gv(t,"light"),c={[`--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`]:`var(--mantine-color-${r}-1)`,[`--mantine-color-${r}-light-hover`]:`var(--mantine-color-${r}-2)`,[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-9)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline-hover`]:g8(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],...c}:c}const s=gv(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`]:qd(t.colors[e][9],.5),[`--mantine-color-${r}-light-hover`]:qd(t.colors[e][9],.3),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-0)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(s-4,0)})`,[`--mantine-color-${r}-outline-hover`]:g8(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 oZ(t){return!!t&&typeof t=="object"&&"mantine-virtual-color"in t}function Rd(t,e,n){ri(e).forEach(r=>Object.assign(t,{[`--mantine-${n}-${r}`]:e[r]}))}const qP=t=>{const e=gv(t,"light"),n=t.defaultRadius in t.radius?t.radius[t.defaultRadius]:me(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":v8(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":v8(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)"}};Rd(r.variables,t.breakpoints,"breakpoint"),Rd(r.variables,t.spacing,"spacing"),Rd(r.variables,t.fontSizes,"font-size"),Rd(r.variables,t.lineHeights,"line-height"),Rd(r.variables,t.shadows,"shadow"),Rd(r.variables,t.radius,"radius"),Rd(r.variables,t.fontWeights,"font-weight"),t.colors[t.primaryColor].forEach((s,o)=>{r.variables[`--mantine-primary-color-${o}`]=`var(--mantine-color-${t.primaryColor}-${o})`}),ri(t.colors).forEach(s=>{const o=t.colors[s];if(oZ(o)){Object.assign(r.light,A1({theme:t,name:o.name,color:o.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,A1({theme:t,name:o.name,color:o.dark,colorScheme:"dark",withColorValues:!0}));return}o.forEach((l,c)=>{r.variables[`--mantine-color-${s}-${c}`]=l}),Object.assign(r.light,A1({theme:t,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,A1({theme:t,color:s,colorScheme:"dark",withColorValues:!1}))});const i=t.headings.sizes;return ri(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 lZ(){const t=pi(),e=kw(),n=ri(t.breakpoints).reduce((r,i)=>{const s=t.breakpoints[i].includes("px"),o=pv(t.breakpoints[i]);return`${r}@media (max-width: ${s?`${o-.1}px`:Rs(o-.1)}) {.mantine-visible-from-${i} {display: none !important;}}@media (min-width: ${s?`${o}px`:Rs(o)}) {.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 cZ({theme:t,generator:e}){const n=qP(t),r=e==null?void 0:e(t);return r?kO(n,r):n}const BC=qP(NO);function uZ(t){const e={variables:{},light:{},dark:{}};return ri(t.variables).forEach(n=>{BC.variables[n]!==t.variables[n]&&(e.variables[n]=t.variables[n])}),ri(t.light).forEach(n=>{BC.light[n]!==t.light[n]&&(e.light[n]=t.light[n])}),ri(t.dark).forEach(n=>{BC.dark[n]!==t.dark[n]&&(e.dark[n]=t.dark[n])}),e}function hZ(t){return zP({variables:{},dark:{"--mantine-color-scheme":"dark"},light:{"--mantine-color-scheme":"light"}},t)}function QP({cssVariablesSelector:t,deduplicateCssVariables:e}){const n=pi(),r=kw(),i=cZ({theme:n,generator:GK()}),s=(t===void 0||t===":root"||t===":host")&&e,o=zP(s?uZ(i):i,t);return o?a.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${o}${s?"":hZ(t)}`}}):null}QP.displayName="@mantine/CssVariables";function dZ({respectReducedMotion:t,getRootElement:e}){nc(()=>{var n;t&&((n=e())==null||n.setAttribute("data-respect-reduced-motion","true"))},[t])}function UP({theme:t,children:e,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:s=!0,withCssVariables:o=!0,cssVariablesSelector:l,classNamesPrefix:c="mantine",colorSchemeManager:h=HK(),defaultColorScheme:f="light",getRootElement:p=()=>document.documentElement,cssVariablesResolver:m,forceColorScheme:v,stylesTransform:y,env:x,deduplicateInlineStyles:S=!1}){const{colorScheme:w,setColorScheme:A,clearColorScheme:C}=nZ({defaultColorScheme:f,forceColorScheme:v,manager:h,getRootElement:p});return dZ({respectReducedMotion:(t==null?void 0:t.respectReducedMotion)||!1,getRootElement:p}),a.jsx(DO,{value:{colorScheme:w,setColorScheme:A,clearColorScheme:C,getRootElement:p,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:m,cssVariablesSelector:l??":root",withStaticClasses:r,stylesTransform:y,env:x,deduplicateInlineStyles:S},children:a.jsxs(HP,{theme:t,children:[o&&a.jsx(QP,{cssVariablesSelector:l,deduplicateCssVariables:s}),i&&a.jsx(lZ,{}),e]})})}UP.displayName="@mantine/core/MantineProvider";function xe(t,e,n){var o;const r=pi(),i=(Array.isArray(t)?t:[t]).filter(Boolean);let s={};for(const l of i){const c=(o=r.components[l])==null?void 0:o.defaultProps,h=typeof c=="function"?c(r):c;h&&(s={...s,...h})}return{...e,...s,...ub(n)}}function Ya({classNames:t,styles:e,props:n,stylesCtx:r}){const i=pi();return{resolvedClassNames:t===void 0?void 0:mv({theme:i,classNames:t,props:n,stylesCtx:r||void 0}),resolvedStyles:e===void 0?void 0:dA({theme:i,styles:e,props:n,stylesCtx:r||void 0})}}const fZ={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function pZ({theme:t,options:e,unstyled:n}){return $r((e==null?void 0:e.focusable)&&!n&&(t.focusClassName||fZ[t.focusRing]),(e==null?void 0:e.active)&&!n&&t.activeClassName)}function mZ({selector:t,stylesCtx:e,options:n,props:r,theme:i}){return mv({theme:i,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:e})[t]}function gZ({selector:t,stylesCtx:e,theme:n,classNames:r,props:i}){return mv({theme:n,classNames:r,props:i,stylesCtx:e})[t]}function vZ({rootSelector:t,selector:e,className:n}){return t===e?n:void 0}function bZ({selector:t,classes:e,unstyled:n}){return n?void 0:e[t]}function yZ({themeName:t,classNamesPrefix:e,selector:n,withStaticClass:r}){return r===!1?[]:t.map(i=>`${e}-${i}-${n}`)}function xZ({options:t,classes:e,selector:n,unstyled:r}){return t!=null&&t.variant&&!r?e[`${n}--${t.variant}`]:void 0}function AZ({theme:t,options:e,themeName:n,selector:r,classNamesPrefix:i,resolvedClassNames:s,resolvedThemeClassNames:o,classes:l,unstyled:c,className:h,rootSelector:f,props:p,stylesCtx:m,withStaticClasses:v,headless:y,transformedStyles:x}){return $r(pZ({theme:t,options:e,unstyled:c||y}),o.map(S=>S[r]),xZ({options:e,classes:l,selector:r,unstyled:c||y}),s[r],gZ({selector:r,stylesCtx:m,theme:t,classNames:x,props:p}),mZ({selector:r,stylesCtx:m,options:e,props:p,theme:t}),vZ({rootSelector:f,selector:r,className:h}),bZ({selector:r,classes:l,unstyled:c||y}),v&&!y&&yZ({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:e==null?void 0:e.withStaticClass}),e==null?void 0:e.className)}function LO({style:t,theme:e}){return Array.isArray(t)?t.reduce((n,r)=>({...n,...LO({style:r,theme:e})}),{}):typeof t=="function"?t(e):t??{}}function wZ({theme:t,selector:e,options:n,props:r,stylesCtx:i,rootSelector:s,withStylesTransform:o,resolvedStyles:l,resolvedThemeStyles:c,resolvedVars:h,resolvedRootStyle:f}){return{...c[e],...l[e],...!o&&dA({theme:t,styles:n==null?void 0:n.styles,props:(n==null?void 0:n.props)||r,stylesCtx:i})[e],...h[e],...s===e?f:null,...LO({style:n==null?void 0:n.style,theme:t})}}function SZ(t){return t.reduce((e,n)=>(n&&Object.keys(n).forEach(r=>{e[r]={...e[r],...ub(n[r])}}),e),{})}function jZ({props:t,stylesCtx:e,themeName:n,theme:r}){var o;const i=(o=eZ())==null?void 0:o();return{getTransformedStyles:l=>i?[...l.map(c=>i(c,{props:t,theme:r,ctx:e})),...n.map(c=>{var h;return i((h=r.components[c])==null?void 0:h.styles,{props:t,theme:r,ctx:e})})].filter(Boolean):[],withStylesTransform:!!i}}function mt({name:t,classes:e,props:n,stylesCtx:r,className:i,style:s,rootSelector:o="root",unstyled:l,classNames:c,styles:h,vars:f,varsResolver:p,attributes:m}){var I;const v=pi(),y=XK(),x=KK(),S=ZK(),w=(Array.isArray(t)?t:[t]).filter(D=>D),{withStylesTransform:A,getTransformedStyles:C}=jZ({props:n,stylesCtx:r,themeName:w,theme:v}),j=mv({theme:v,classNames:c,props:n,stylesCtx:r}),_=w.map(D=>{var L;return mv({theme:v,classNames:(L=v.components[D])==null?void 0:L.classNames,props:n,stylesCtx:r})}),k=A?{}:dA({theme:v,styles:h,props:n,stylesCtx:r}),M={};if(!A)for(const D of w){const L=dA({theme:v,styles:(I=v.components[D])==null?void 0:I.styles,props:n,stylesCtx:r});for(const z of Object.keys(L))M[z]={...M[z],...L[z]}}const R=SZ([S?{}:p==null?void 0:p(v,n,r),...w.map(D=>{var L,z,P;return(P=(z=(L=v.components)==null?void 0:L[D])==null?void 0:z.vars)==null?void 0:P.call(z,v,n,r)}),f==null?void 0:f(v,n,r)]),N=LO({style:s,theme:v});return(D,L)=>({...m==null?void 0:m[D],className:AZ({theme:v,options:L,themeName:w,selector:D,classNamesPrefix:y,resolvedClassNames:j,resolvedThemeClassNames:_,classes:e,unstyled:l,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:x,headless:S,transformedStyles:C([L==null?void 0:L.styles,h])}),style:wZ({theme:v,selector:D,options:L,props:n,stylesCtx:r,rootSelector:o,withStylesTransform:A,resolvedStyles:k,resolvedThemeStyles:M,resolvedVars:R,resolvedRootStyle:N})})}function ev(t){return ri(t).reduce((e,n)=>t[n]!==void 0?`${e}${WX(n)}:${t[n]};`:e,"").trim()}function CZ({selector:t,styles:e,media:n,container:r}){const i=e?ev(e):"",s=Array.isArray(n)?n.map(l=>`@media${l.query}{${t}{${ev(l.styles)}}}`):[],o=Array.isArray(r)?r.map(l=>`@container ${l.query}{${t}{${ev(l.styles)}}}`):[];return`${i?`${t}{${i}}`:""}${s.join("")}${o.join("")}`.trim()}function _Z(t){let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n)&4294967295;return(e>>>0).toString(36)}function Ew({deduplicate:t,...e}){const n=kw(),r=CZ(e);return t?a.jsx("style",{href:`mantine-${_Z(r)}`,precedence:"mantine",nonce:n==null?void 0:n(),children:r}):a.jsx("style",{"data-mantine-styles":"inline",nonce:n==null?void 0:n(),dangerouslySetInnerHTML:{__html:r}})}function TZ(t){let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n)&4294967295;return(e>>>0).toString(36)}function kZ(t,e){return`__mdi__-${TZ(`${t?ev(t):""}|${Array.isArray(e)?e.map(n=>`${n.query}:${ev(n.styles)}`).join("|"):""}`)}`}function gb(t){const{m:e,mx:n,my:r,mt:i,mb:s,ml:o,mr:l,me:c,ms:h,mis:f,mie:p,p:m,px:v,py:y,pt:x,pb:S,pl:w,pr:A,pe:C,ps:j,pis:_,pie:k,bd:M,bdrs:R,bg:N,c:I,opacity:D,ff:L,fz:z,fw:P,lts:H,ta:B,lh:F,fs:q,tt:X,td:Y,w:U,miw:V,maw:G,h:J,mih:ne,mah:de,bgsz:fe,bgp:ke,bgr:Me,bga:Oe,pos:Ye,top:ie,left:Se,bottom:se,right:_e,inset:et,display:Te,flex:Xe,hiddenFrom:at,visibleFrom:Ve,lightHidden:Ge,darkHidden:ut,sx:Ue,...De}=t;return{styleProps:ub({m:e,mx:n,my:r,mt:i,mb:s,ml:o,mr:l,me:c,ms:h,mis:f,mie:p,p:m,px:v,py:y,pt:x,pb:S,pl:w,pr:A,pis:_,pie:k,pe:C,ps:j,bd:M,bg:N,c:I,opacity:D,ff:L,fz:z,fw:P,lts:H,ta:B,lh:F,fs:q,tt:X,td:Y,w:U,miw:V,maw:G,h:J,mih:ne,mah:de,bgsz:fe,bgp:ke,bgr:Me,bga:Oe,pos:Ye,top:ie,left:Se,bottom:se,right:_e,inset:et,display:Te,flex:Xe,bdrs:R,hiddenFrom:at,visibleFrom:Ve,lightHidden:Ge,darkHidden:ut,sx:Ue}),rest:De}}const OZ={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"},mis:{type:"spacing",property:"marginInlineStart"},mie:{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"},pis:{type:"spacing",property:"paddingInlineStart"},pie:{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 BO(t,e){const n=sc({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 EZ(t,e){const n=sc({color:t,theme:e});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:BO(t,e)}function MZ(t,e){if(typeof t=="number")return me(t);if(typeof t=="string"){const[n,r,...i]=t.split(" ").filter(o=>o.trim()!=="");let s=`${me(n)}`;return r&&(s+=` ${r}`),i.length>0&&(s+=` ${BO(i.join(" "),e)}`),s.trim()}return t}const w8={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 RZ(t){return typeof t=="string"&&t in w8?w8[t]:t}const DZ=["h1","h2","h3","h4","h5","h6"];function NZ(t,e){return typeof t=="string"&&t in e.fontSizes?`var(--mantine-font-size-${t})`:typeof t=="string"&&DZ.includes(t)?`var(--mantine-${t}-font-size)`:typeof t=="number"||typeof t=="string"?me(t):t}function IZ(t){return t}const LZ=["h1","h2","h3","h4","h5","h6"];function BZ(t,e){return typeof t=="string"&&t in e.lineHeights?`var(--mantine-line-height-${t})`:typeof t=="string"&&LZ.includes(t)?`var(--mantine-${t}-line-height)`:t}function PZ(t,e){return typeof t=="string"&&t in e.radius?`var(--mantine-radius-${t})`:typeof t=="number"||typeof t=="string"?me(t):t}function FZ(t){return typeof t=="number"?me(t):t}function $Z(t,e){if(typeof t=="number")return me(t);if(typeof t=="string"){const n=t.replace("-","");if(!(n in e.spacing))return me(t);const r=`--mantine-spacing-${n}`;return t.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return t}const PC={color:BO,textColor:EZ,fontSize:NZ,spacing:$Z,radius:PZ,identity:IZ,size:FZ,lineHeight:BZ,fontFamily:RZ,border:MZ};function S8(t){return t.replace("(min-width: ","").replace("em)","")}function HZ({media:t,...e}){const n=Object.keys(t).sort((r,i)=>Number(S8(r))-Number(S8(i))).map(r=>({query:r,styles:t[r]}));return{...e,media:n}}function zZ(t){if(typeof t!="object"||t===null)return!1;const e=Object.keys(t);return!(e.length===1&&e[0]==="base")}function qZ(t){return typeof t=="object"&&t!==null?"base"in t?t.base:void 0:t}function QZ(t){return typeof t=="object"&&t!==null?ri(t).filter(e=>e!=="base"):[]}function UZ(t,e){return typeof t=="object"&&t!==null&&e in t?t[e]:t}function WZ({styleProps:t,data:e,theme:n}){return HZ(ri(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=qZ(t[i]);if(!zZ(t[i]))return o.forEach(h=>{r.inlineStyles[h]=PC[s.type](l,n)}),r;r.hasResponsiveStyles=!0;const c=QZ(t[i]);return o.forEach(h=>{l!=null&&(r.styles[h]=PC[s.type](l,n)),c.forEach(f=>{const p=`(min-width: ${n.breakpoints[f]})`;r.media[p]={...r.media[p],[h]:PC[s.type](UZ(t[i],f),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function WP(){return`__m__-${O.useId().replace(/[:«»]/g,"")}`}function vv(t,e){return Array.isArray(t)?[...t].reduce((n,r)=>({...n,...vv(r,e)}),{}):typeof t=="function"?t(e):t??{}}function YZ(t){return t}const YP=YZ;function VP(t){return t}function Ie(t){const e=t;return e.extend=VP,e.withProps=n=>{const r=i=>a.jsx(e,{...n,...i});return r.extend=e.extend,r.displayName=`WithProps(${e.displayName})`,r},e}function sd(t){return Ie(t)}function Zi(t){const e=t;return e.withProps=n=>{const r=i=>a.jsx(e,{...n,...i});return r.extend=e.extend,r.displayName=`WithProps(${e.displayName})`,r},e.extend=VP,e}function GP(t){return`data-${(t.startsWith("data-")?t.slice(5):t).replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`}function VZ(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];return r===void 0||r===""||r===!1||r===null||(e[GP(n)]=t[n]),e},{})}function XP(t){return t?typeof t=="string"?{[GP(t)]:!0}:Array.isArray(t)?[...t].reduce((e,n)=>({...e,...XP(n)}),{}):VZ(t):null}function s3(t,e){return Array.isArray(t)?[...t].reduce((n,r)=>({...n,...s3(r,e)}),{}):typeof t=="function"?t(e):t??{}}function GZ({theme:t,style:e,vars:n,styleProps:r}){const i=s3(e,t),s=s3(n,t);return{...i,...s,...r}}function KP({component:t,style:e,__vars:n,className:r,variant:i,mod:s,size:o,hiddenFrom:l,visibleFrom:c,lightHidden:h,darkHidden:f,renderRoot:p,__size:m,ref:v,...y}){var N,I;const x=pi(),S=t||"div",{styleProps:w,rest:A}=gb(y),C=(I=(N=JK())==null?void 0:N())==null?void 0:I(w.sx),j=WP(),_=WZ({styleProps:w,theme:x,data:OZ}),k=tZ(),M=k&&_.hasResponsiveStyles?kZ(_.styles,_.media):j,R={ref:v,style:GZ({theme:x,style:e,vars:n,styleProps:_.inlineStyles}),className:$r(r,C,{[M]:_.hasResponsiveStyles,"mantine-light-hidden":h,"mantine-dark-hidden":f,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${c}`]:c}),"data-variant":i,"data-size":kP(o)?void 0:o||void 0,size:m,...XP(s),...A};return a.jsxs(a.Fragment,{children:[_.hasResponsiveStyles&&a.jsx(Ew,{selector:`.${M}`,styles:_.styles,media:_.media,deduplicate:k}),typeof p=="function"?p(R):a.jsx(S,{...R})]})}KP.displayName="@mantine/core/Box";const ve=YP(KP),XZ=O.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function oc(){return O.use(XZ)}const KZ={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0,orientation:"vertical",keepMounted:!0},Mw=Ie(t=>{const{children:e,expanded:n,transitionDuration:r,transitionTimingFunction:i,style:s,onTransitionEnd:o,onTransitionStart:l,animateOpacity:c,keepMounted:h,ref:f,orientation:p,...m}=xe("Collapse",KZ,t),v=mb(),y=pi(),x=pb(),S=y.respectReducedMotion&&x?0:r,w=(p==="horizontal"?DK:MK)({expanded:n,transitionDuration:S,transitionTimingFunction:i,onTransitionEnd:o,onTransitionStart:l,keepMounted:!1});if(S===0)return h===!0&&v!=="test"?a.jsx(O.Activity,{mode:n?"visible":"hidden",children:a.jsx(ve,{...m,children:e})}):n?a.jsx(ve,{...m,children:e}):null;const A=w.state==="exited";let C;return h===!1?C=A?null:e:h===!0?C=a.jsx(O.Activity,{mode:A?"hidden":"visible",children:e}):C=e,a.jsx(ve,{...m,...w.getCollapseProps({style:{opacity:n||!c?1:0,transition:c?`opacity ${S}ms ${i}`:"none",...vv(s,y)},ref:f}),children:C})});Mw.displayName="@mantine/core/Collapse";const[ZZ,Co]=Ki("ScrollArea.Root component was not found in tree");function Hh(t,e){const n=O.useEffectEvent(e);nc(()=>{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])}function JZ(t){const{style:e,...n}=t,r=Co(),[i,s]=O.useState(0),[o,l]=O.useState(0),c=!!(i&&o);return Hh(r.scrollbarX,()=>{var f;const h=((f=r.scrollbarX)==null?void 0:f.offsetHeight)||0;r.onCornerHeightChange(h),l(h)}),Hh(r.scrollbarY,()=>{var f;const h=((f=r.scrollbarY)==null?void 0:f.offsetWidth)||0;r.onCornerWidthChange(h),s(h)}),c?a.jsx("div",{...n,style:{...e,width:i,height:o}}):null}function eJ(t){const e=Co(),n=!!(e.scrollbarX&&e.scrollbarY);return e.type!=="scroll"&&n?a.jsx(JZ,{...t}):null}const tJ={scrollHideDelay:1e3,type:"hover"};function ZP(t){const{type:e,scrollHideDelay:n,scrollbars:r,getStyles:i,ref:s,...o}=xe("ScrollAreaRoot",tJ,t),[l,c]=O.useState(null),[h,f]=O.useState(null),[p,m]=O.useState(null),[v,y]=O.useState(null),[x,S]=O.useState(null),[w,A]=O.useState(0),[C,j]=O.useState(0),[_,k]=O.useState(!1),[M,R]=O.useState(!1),N=En(s,c);return a.jsx(ZZ,{value:{type:e,scrollHideDelay:n,scrollArea:l,viewport:h,onViewportChange:f,content:p,onContentChange:m,scrollbarX:v,onScrollbarXChange:y,scrollbarXEnabled:_,onScrollbarXEnabledChange:k,scrollbarY:x,onScrollbarYChange:S,scrollbarYEnabled:M,onScrollbarYEnabledChange:R,onCornerWidthChange:A,onCornerHeightChange:j,getStyles:i},children:a.jsx(ve,{...o,ref:N,__vars:{"--sa-corner-width":r!=="xy"?"0px":`${w}px`,"--sa-corner-height":r!=="xy"?"0px":`${C}px`}})})}ZP.displayName="@mantine/core/ScrollAreaRoot";function JP(t,e){const n=t/e;return Number.isNaN(n)?0:n}function Rw(t){const e=JP(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function e7(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 nJ(t,[e,n]){return Math.min(n,Math.max(e,t))}function j8(t,e,n="ltr"){const r=Rw(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-i,o=e.content-e.viewport,l=s-r,c=nJ(t,n==="ltr"?[0,o]:[o*-1,0]);return e7([0,o],[0,l])(c)}function rJ(t,e,n,r="ltr"){const i=Rw(n),s=i/2,o=e||s,l=i-o,c=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 e7([c,h],p)(t)}function t7(t,e){return t>0&&t<e}function Eh(t){return t?parseInt(t,10):0}function gf(t,e,{checkForDefaultPrevented:n=!0}={}){return r=>{t==null||t(r),(n===!1||!r.defaultPrevented)&&(e==null||e(r))}}const[iJ,n7]=Ki("ScrollAreaScrollbar was not found in tree");function r7(t){const{sizes:e,hasThumb:n,onThumbChange:r,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:o,onDragScroll:l,onWheelScroll:c,onResize:h,ref:f,...p}=t,m=Co(),[v,y]=O.useState(null),x=En(f,y),S=O.useRef(null),w=O.useRef(""),{viewport:A}=m,C=e.content-e.viewport,j=O.useEffectEvent(c),_=Bp(o),k=jw(h,10),M=R=>{S.current&&l({x:R.clientX-S.current.left,y:R.clientY-S.current.top})};return O.useEffect(()=>{const R=N=>{const I=N.target;v!=null&&v.contains(I)&&j(N,C)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[A,v,C]),O.useEffect(_,[e,_]),Hh(v,k),Hh(m.content,k),a.jsx(iJ,{value:{scrollbar:v,hasThumb:n,onThumbChange:Bp(r),onThumbPointerUp:Bp(i),onThumbPositionChange:_,onThumbPointerDown:Bp(s)},children:a.jsx("div",{...p,ref:x,"data-mantine-scrollbar":!0,style:{position:"absolute",...p.style},onPointerDown:gf(t.onPointerDown,R=>{R.preventDefault(),R.button===0&&(R.target.setPointerCapture(R.pointerId),S.current=v.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(R))}),onPointerMove:gf(t.onPointerMove,M),onPointerUp:gf(t.onPointerUp,R=>{const N=R.target;N.hasPointerCapture(R.pointerId)&&(R.preventDefault(),N.releasePointerCapture(R.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=w.current,S.current=null}})})}const i7=t=>{const{sizes:e,onSizesChange:n,style:r,ref:i,...s}=t,o=Co(),[l,c]=O.useState(),h=O.useRef(null),f=En(i,h,o.onScrollbarXChange);return O.useEffect(()=>{h.current&&c(getComputedStyle(h.current))},[h]),a.jsx(r7,{"data-orientation":"horizontal",...s,ref:f,sizes:e,style:{...r,"--sa-thumb-width":`${Rw(e)}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),t7(v,m)&&p.preventDefault()}},onResize:()=>{h.current&&o.viewport&&l&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:Eh(l.paddingLeft),paddingEnd:Eh(l.paddingRight)}})}})};i7.displayName="@mantine/core/ScrollAreaScrollbarX";function s7(t){const{sizes:e,onSizesChange:n,style:r,ref:i,...s}=t,o=Co(),[l,c]=O.useState(),h=O.useRef(null),f=En(i,h,o.onScrollbarYChange);return O.useEffect(()=>{h.current&&c(window.getComputedStyle(h.current))},[]),a.jsx(r7,{...s,"data-orientation":"vertical",ref:f,sizes:e,style:{"--sa-thumb-height":`${Rw(e)}px`,...r},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),t7(v,m)&&p.preventDefault()}},onResize:()=>{h.current&&o.viewport&&l&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:Eh(l.paddingTop),paddingEnd:Eh(l.paddingBottom)}})}})}s7.displayName="@mantine/core/ScrollAreaScrollbarY";function Dw(t){const{orientation:e="vertical",...n}=t,{dir:r}=oc(),i=Co(),s=O.useRef(null),o=O.useRef(0),[l,c]=O.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=JP(l.viewport,l.content),f={...n,sizes:l,onSizesChange:c,hasThumb:h>0&&h<1,onThumbChange:m=>{s.current=m},onThumbPointerUp:()=>{o.current=0},onThumbPointerDown:m=>{o.current=m}},p=(m,v)=>rJ(m,o.current,l,v);return e==="horizontal"?a.jsx(i7,{...f,onThumbPositionChange:()=>{if(i.viewport&&s.current){const m=i.viewport.scrollLeft,v=j8(m,l,r);s.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=p(m,r))}}):e==="vertical"?a.jsx(s7,{...f,onThumbPositionChange:()=>{if(i.viewport&&s.current){const m=i.viewport.scrollTop,v=j8(m,l);l.scrollbar.size===0?s.current.style.setProperty("--thumb-opacity","0"):s.current.style.setProperty("--thumb-opacity","1"),s.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=p(m))}}):null}Dw.displayName="@mantine/core/ScrollAreaScrollbarVisible";function PO(t){const e=Co(),{forceMount:n,...r}=t,[i,s]=O.useState(!1),o=t.orientation==="horizontal",l=jw(()=>{if(e.viewport){const c=e.viewport.offsetWidth<e.viewport.scrollWidth,h=e.viewport.offsetHeight<e.viewport.scrollHeight;s(o?c:h)}},10);return Hh(e.viewport,l),Hh(e.content,l),n||i?a.jsx(Dw,{"data-state":i?"visible":"hidden",...r}):null}PO.displayName="@mantine/core/ScrollAreaScrollbarAuto";function a7(t){const{forceMount:e,...n}=t,r=Co(),[i,s]=O.useState(!1);return O.useEffect(()=>{const{scrollArea:o}=r;let l=0;if(o){const c=()=>{window.clearTimeout(l),s(!0)},h=()=>{l=window.setTimeout(()=>s(!1),r.scrollHideDelay)};return o.addEventListener("pointerenter",c),o.addEventListener("pointerleave",h),()=>{window.clearTimeout(l),o.removeEventListener("pointerenter",c),o.removeEventListener("pointerleave",h)}}},[r.scrollArea,r.scrollHideDelay]),e||i?a.jsx(PO,{"data-state":i?"visible":"hidden",...n}):null}a7.displayName="@mantine/core/ScrollAreaScrollbarHover";function sJ(t){const{forceMount:e,...n}=t,r=Co(),i=t.orientation==="horizontal",[s,o]=O.useState("hidden"),l=jw(()=>o("idle"),100);return O.useEffect(()=>{if(s==="idle"){const c=window.setTimeout(()=>o("hidden"),r.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,r.scrollHideDelay]),O.useEffect(()=>{const{viewport:c}=r,h=i?"scrollLeft":"scrollTop";if(c){let f=c[h];const p=()=>{const m=c[h];f!==m&&(o("scrolling"),l()),f=m};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[r.viewport,i,l]),e||s!=="hidden"?a.jsx(Dw,{"data-state":s==="hidden"?"hidden":"visible",...n,onPointerEnter:gf(t.onPointerEnter,()=>o("interacting")),onPointerLeave:gf(t.onPointerLeave,()=>o("idle"))}):null}function a3(t){const{forceMount:e,...n}=t,r=Co(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=r,o=t.orientation==="horizontal";return O.useEffect(()=>(o?i(!0):s(!0),()=>{o?i(!1):s(!1)}),[o,i,s]),r.type==="hover"?a.jsx(a7,{...n,forceMount:e}):r.type==="scroll"?a.jsx(sJ,{...n,forceMount:e}):r.type==="auto"?a.jsx(PO,{...n,forceMount:e}):r.type==="always"?a.jsx(Dw,{...n}):null}a3.displayName="@mantine/core/ScrollAreaScrollbar";function aJ(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)}function o7(t){const{style:e,ref:n,...r}=t,i=Co(),s=n7(),{onThumbPositionChange:o}=s,l=En(n,s.onThumbChange),c=O.useRef(void 0),h=jw(()=>{c.current&&(c.current(),c.current=void 0)},100);return O.useEffect(()=>{const{viewport:f}=i;if(f){const p=()=>{h(),c.current||(c.current=aJ(f,o),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)",...e},onPointerDownCapture:gf(t.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),m=f.clientX-p.left,v=f.clientY-p.top;s.onThumbPointerDown({x:m,y:v})}),onPointerUp:gf(t.onPointerUp,s.onThumbPointerUp)})}o7.displayName="@mantine/core/ScrollAreaThumb";function o3(t){const{forceMount:e,...n}=t,r=n7();return e||r.hasThumb?a.jsx(o7,{...n}):null}o3.displayName="@mantine/core/ScrollAreaThumb";function l7({children:t,style:e,ref:n,onWheel:r,...i}){const s=Co(),o=En(n,s.onViewportChange),l=c=>{if(r==null||r(c),s.scrollbarXEnabled&&s.viewport&&c.shiftKey){const{scrollTop:h,scrollHeight:f,clientHeight:p,scrollWidth:m,clientWidth:v}=s.viewport,y=h<1,x=h>=f-p-1;m>v&&(y||x)&&c.stopPropagation()}};return a.jsx(ve,{...i,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})})}l7.displayName="@mantine/core/ScrollAreaViewport";var FO={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};function Nw(){return typeof window<"u"}function n0(t){return c7(t)?(t.nodeName||"").toLowerCase():"#document"}function ma(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function lc(t){var e;return(e=(c7(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function c7(t){return Nw()?t instanceof Node||t instanceof ma(t).Node:!1}function xr(t){return Nw()?t instanceof Element||t instanceof ma(t).Element:!1}function _o(t){return Nw()?t instanceof HTMLElement||t instanceof ma(t).HTMLElement:!1}function fA(t){return!Nw()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ma(t).ShadowRoot}function vb(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=wo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function oJ(t){return/^(table|td|th)$/.test(n0(t))}function Iw(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const lJ=/transform|translate|scale|rotate|perspective|filter/,cJ=/paint|layout|strict|content/,Dd=t=>!!t&&t!=="none";let FC;function $O(t){const e=xr(t)?wo(t):t;return Dd(e.transform)||Dd(e.translate)||Dd(e.scale)||Dd(e.rotate)||Dd(e.perspective)||!Lw()&&(Dd(e.backdropFilter)||Dd(e.filter))||lJ.test(e.willChange||"")||cJ.test(e.contain||"")}function uJ(t){let e=uu(t);for(;_o(e)&&!ru(e);){if($O(e))return e;if(Iw(e))return null;e=uu(e)}return null}function Lw(){return FC==null&&(FC=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),FC}function ru(t){return/^(html|body|#document)$/.test(n0(t))}function wo(t){return ma(t).getComputedStyle(t)}function Bw(t){return xr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function uu(t){if(n0(t)==="html")return t;const e=t.assignedSlot||t.parentNode||fA(t)&&t.host||lc(t);return fA(e)?e.host:e}function u7(t){const e=uu(t);return ru(e)?t.ownerDocument?t.ownerDocument.body:t.body:_o(e)&&vb(e)?e:u7(e)}function iu(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=u7(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=ma(i);if(s){const l=l3(o);return e.concat(o,o.visualViewport||[],vb(i)?i:[],l&&n?iu(l):[])}else return e.concat(i,iu(i,[],n))}function l3(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const hJ=["top","right","bottom","left"],cl=Math.min,Es=Math.max,pA=Math.round,w1=Math.floor,Zl=t=>({x:t,y:t}),dJ={left:"right",right:"left",bottom:"top",top:"bottom"};function c3(t,e,n){return Es(t,cl(e,n))}function rc(t,e){return typeof t=="function"?t(e):t}function ul(t){return t.split("-")[0]}function r0(t){return t.split("-")[1]}function HO(t){return t==="x"?"y":"x"}function zO(t){return t==="y"?"height":"width"}function nl(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function qO(t){return HO(nl(t))}function fJ(t,e,n){n===void 0&&(n=!1);const r=r0(t),i=qO(t),s=zO(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=mA(o)),[o,mA(o)]}function pJ(t){const e=mA(t);return[u3(t),e,u3(e)]}function u3(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const C8=["left","right"],_8=["right","left"],mJ=["top","bottom"],gJ=["bottom","top"];function vJ(t,e,n){switch(t){case"top":case"bottom":return n?e?_8:C8:e?C8:_8;case"left":case"right":return e?mJ:gJ;default:return[]}}function bJ(t,e,n,r){const i=r0(t);let s=vJ(ul(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(u3)))),s}function mA(t){const e=ul(t);return dJ[e]+t.slice(e.length)}function yJ(t){return{top:0,right:0,bottom:0,left:0,...t}}function QO(t){return typeof t!="number"?yJ(t):{top:t,right:t,bottom:t,left:t}}function Mm(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 xJ(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function AJ(){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 wJ(){return/apple/i.test(navigator.vendor)}function SJ(){return xJ().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function jJ(){return AJ().includes("jsdom/")}const T8="data-floating-ui-focusable",CJ="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function k8(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 bv(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&fA(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function kp(t){return"composedPath"in t?t.composedPath()[0]:t.target}function $C(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 _J(t){return t.matches("html,body")}function Vd(t){return(t==null?void 0:t.ownerDocument)||document}function TJ(t){return _o(t)&&t.matches(CJ)}function kJ(t){if(!t||jJ())return!0;try{return t.matches(":focus-visible")}catch{return!0}}function OJ(t){return t?t.hasAttribute(T8)?t:t.querySelector("["+T8+"]")||t:null}function Sx(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,...Sx(t,i.id,n)])}function EJ(t){return"nativeEvent"in t}function h3(t,e){const n=["mouse","pen"];return n.push("",void 0),n.includes(t)}var MJ=typeof document<"u",RJ=function(){},Jl=MJ?O.useLayoutEffect:RJ;const DJ={...CP};function S1(t){const e=O.useRef(t);return Jl(()=>{e.current=t}),e}const NJ=DJ.useInsertionEffect,IJ=NJ||(t=>t());function $l(t){const e=O.useRef(()=>{});return IJ(()=>{e.current=t}),O.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 O8(t,e,n){let{reference:r,floating:i}=t;const s=nl(e),o=qO(e),l=zO(o),c=ul(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(c){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(r0(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 LJ(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:l,strategy:c}=t,{boundary:h="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=rc(e,t),y=QO(v),S=l[m?p==="floating"?"reference":"floating":p],w=Mm(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(S)))==null||n?S:S.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:h,rootBoundary:f,strategy:c})),A=p==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),j=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},_=Mm(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:A,offsetParent:C,strategy:c}):A);return{top:(w.top-_.top+y.top)/j.y,bottom:(_.bottom-w.bottom+y.bottom)/j.y,left:(w.left-_.left+y.left)/j.x,right:(_.right-w.right+y.right)/j.x}}const BJ=50,PJ=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:LJ},c=await(o.isRTL==null?void 0:o.isRTL(e));let h=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:p}=O8(h,r,c),m=r,v=0;const y={};for(let x=0;x<s.length;x++){const S=s[x];if(!S)continue;const{name:w,fn:A}=S,{x:C,y:j,data:_,reset:k}=await A({x:f,y:p,initialPlacement:r,placement:m,strategy:i,middlewareData:y,rects:h,platform:l,elements:{reference:t,floating:e}});f=C??f,p=j??p,y[w]={...y[w],..._},k&&v<BJ&&(v++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(h=k.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):k.rects),{x:f,y:p}=O8(h,m,c)),x=-1)}return{x:f,y:p,placement:m,strategy:i,middlewareData:y}},FJ=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:l,middlewareData:c}=e,{element:h,padding:f=0}=rc(t,e)||{};if(h==null)return{};const p=QO(f),m={x:n,y:r},v=qO(i),y=zO(v),x=await o.getDimensions(h),S=v==="y",w=S?"top":"left",A=S?"bottom":"right",C=S?"clientHeight":"clientWidth",j=s.reference[y]+s.reference[v]-m[v]-s.floating[y],_=m[v]-s.reference[v],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(h));let M=k?k[C]:0;(!M||!await(o.isElement==null?void 0:o.isElement(k)))&&(M=l.floating[C]||s.floating[y]);const R=j/2-_/2,N=M/2-x[y]/2-1,I=cl(p[w],N),D=cl(p[A],N),L=I,z=M-x[y]-D,P=M/2-x[y]/2+R,H=c3(L,P,z),B=!c.arrow&&r0(i)!=null&&P!==H&&s.reference[y]/2-(P<L?I:D)-x[y]/2<0,F=B?P<L?P-L:P-z:0;return{[v]:m[v]+F,data:{[v]:H,centerOffset:P-H-F,...B&&{alignmentOffset:F}},reset:B}}}),$J=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:c,elements:h}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...S}=rc(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=ul(i),A=nl(l),C=ul(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(h.floating)),_=m||(C||!x?[mA(l)]:pJ(l)),k=y!=="none";!m&&k&&_.push(...bJ(l,x,y,j));const M=[l,..._],R=await c.detectOverflow(e,S),N=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&N.push(R[w]),p){const P=fJ(i,o,j);N.push(R[P[0]],R[P[1]])}if(I=[...I,{placement:i,overflows:N}],!N.every(P=>P<=0)){var D,L;const P=(((D=s.flip)==null?void 0:D.index)||0)+1,H=M[P];if(H&&(!(p==="alignment"?A!==nl(H):!1)||I.every(q=>nl(q.placement)===A?q.overflows[0]>0:!0)))return{data:{index:P,overflows:I},reset:{placement:H}};let B=(L=I.filter(F=>F.overflows[0]<=0).sort((F,q)=>F.overflows[1]-q.overflows[1])[0])==null?void 0:L.placement;if(!B)switch(v){case"bestFit":{var z;const F=(z=I.filter(q=>{if(k){const X=nl(q.placement);return X===A||X==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(X=>X>0).reduce((X,Y)=>X+Y,0)]).sort((q,X)=>q[1]-X[1])[0])==null?void 0:z[0];F&&(B=F);break}case"initialPlacement":B=l;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function E8(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function M8(t){return hJ.some(e=>t[e]>=0)}const HJ=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...s}=rc(t,e);switch(i){case"referenceHidden":{const o=await r.detectOverflow(e,{...s,elementContext:"reference"}),l=E8(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:M8(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...s,altBoundary:!0}),l=E8(o,n.floating);return{data:{escapedOffsets:l,escaped:M8(l)}}}default:return{}}}}};function h7(t){const e=cl(...t.map(s=>s.left)),n=cl(...t.map(s=>s.top)),r=Es(...t.map(s=>s.right)),i=Es(...t.map(s=>s.bottom));return{x:e,y:n,width:r-e,height:i-n}}function zJ(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=>Mm(h7(i)))}const qJ=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:c,y:h}=rc(t,e),f=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),p=zJ(f),m=Mm(h7(f)),v=QO(l);function y(){if(p.length===2&&p[0].left>p[1].right&&c!=null&&h!=null)return p.find(S=>c>S.left-v.left&&c<S.right+v.right&&h>S.top-v.top&&h<S.bottom+v.bottom)||m;if(p.length>=2){if(nl(n)==="y"){const I=p[0],D=p[p.length-1],L=ul(n)==="top",z=I.top,P=D.bottom,H=L?I.left:D.left,B=L?I.right:D.right,F=B-H,q=P-z;return{top:z,bottom:P,left:H,right:B,width:F,height:q,x:H,y:z}}const S=ul(n)==="left",w=Es(...p.map(I=>I.right)),A=cl(...p.map(I=>I.left)),C=p.filter(I=>S?I.left===A:I.right===w),j=C[0].top,_=C[C.length-1].bottom,k=A,M=w,R=M-k,N=_-j;return{top:j,bottom:_,left:k,right:M,width:R,height:N,x:k,y:j}}return m}const x=await s.getElementRects({reference:{getBoundingClientRect:y},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}}:{}}}},d7=new Set(["left","top"]);async function QJ(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ul(n),l=r0(n),c=nl(n)==="y",h=d7.has(o)?-1:1,f=s&&c?-1:1,p=rc(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:y}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof y=="number"&&(v=l==="end"?y*-1:y),c?{x:v*f,y:m*h}:{x:m*h,y:v*f}}const UJ=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,c=await QJ(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},WJ=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:c={fn:w=>{let{x:A,y:C}=w;return{x:A,y:C}}},...h}=rc(t,e),f={x:n,y:r},p=await s.detectOverflow(e,h),m=nl(ul(i)),v=HO(m);let y=f[v],x=f[m];if(o){const w=v==="y"?"top":"left",A=v==="y"?"bottom":"right",C=y+p[w],j=y-p[A];y=c3(C,y,j)}if(l){const w=m==="y"?"top":"left",A=m==="y"?"bottom":"right",C=x+p[w],j=x-p[A];x=c3(C,x,j)}const S=c.fn({...e,[v]:y,[m]:x});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[m]:l}}}}}},YJ=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:c=!0,crossAxis:h=!0}=rc(t,e),f={x:n,y:r},p=nl(i),m=HO(p);let v=f[m],y=f[p];const x=rc(l,e),S=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(c){const C=m==="y"?"height":"width",j=s.reference[m]-s.floating[C]+S.mainAxis,_=s.reference[m]+s.reference[C]-S.mainAxis;v<j?v=j:v>_&&(v=_)}if(h){var w,A;const C=m==="y"?"width":"height",j=d7.has(ul(i)),_=s.reference[p]-s.floating[C]+(j&&((w=o.offset)==null?void 0:w[p])||0)+(j?0:S.crossAxis),k=s.reference[p]+s.reference[C]+(j?0:((A=o.offset)==null?void 0:A[p])||0)-(j?S.crossAxis:0);y<_?y=_:y>k&&(y=k)}return{[m]:v,[p]:y}}}},VJ=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:c=()=>{},...h}=rc(t,e),f=await o.detectOverflow(e,h),p=ul(i),m=r0(i),v=nl(i)==="y",{width:y,height:x}=s.floating;let S,w;p==="top"||p==="bottom"?(S=p,w=m===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(w=p,S=m==="end"?"top":"bottom");const A=x-f.top-f.bottom,C=y-f.left-f.right,j=cl(x-f[S],A),_=cl(y-f[w],C),k=!e.middlewareData.shift;let M=j,R=_;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=C),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=A),k&&!m){const I=Es(f.left,0),D=Es(f.right,0),L=Es(f.top,0),z=Es(f.bottom,0);v?R=y-2*(I!==0||D!==0?I+D:Es(f.left,f.right)):M=x-2*(L!==0||z!==0?L+z:Es(f.top,f.bottom))}await c({...e,availableWidth:R,availableHeight:M});const N=await o.getDimensions(l.floating);return y!==N.width||x!==N.height?{reset:{rects:!0}}:{}}}};function f7(t){const e=wo(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=_o(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,l=pA(n)!==s||pA(r)!==o;return l&&(n=s,r=o),{width:n,height:r,$:l}}function UO(t){return xr(t)?t:t.contextElement}function Up(t){const e=UO(t);if(!_o(e))return Zl(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=f7(e);let o=(s?pA(n.width):n.width)/r,l=(s?pA(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const GJ=Zl(0);function p7(t){const e=ma(t);return!Lw()||!e.visualViewport?GJ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function XJ(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ma(t)?!1:e}function jf(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=UO(t);let o=Zl(1);e&&(r?xr(r)&&(o=Up(r)):o=Up(t));const l=XJ(s,n,r)?p7(s):Zl(0);let c=(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=ma(s),v=r&&xr(r)?ma(r):r;let y=m,x=l3(y);for(;x&&r&&v!==y;){const S=Up(x),w=x.getBoundingClientRect(),A=wo(x),C=w.left+(x.clientLeft+parseFloat(A.paddingLeft))*S.x,j=w.top+(x.clientTop+parseFloat(A.paddingTop))*S.y;c*=S.x,h*=S.y,f*=S.x,p*=S.y,c+=C,h+=j,y=ma(x),x=l3(y)}}return Mm({width:f,height:p,x:c,y:h})}function Pw(t,e){const n=Bw(t).scrollLeft;return e?e.left+n:jf(lc(t)).left+n}function m7(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Pw(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function KJ(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=lc(r),l=e?Iw(e.floating):!1;if(r===o||l&&s)return n;let c={scrollLeft:0,scrollTop:0},h=Zl(1);const f=Zl(0),p=_o(r);if((p||!p&&!s)&&((n0(r)!=="body"||vb(o))&&(c=Bw(r)),p)){const v=jf(r);h=Up(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const m=o&&!p&&!s?m7(o,c):Zl(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-c.scrollLeft*h.x+f.x+m.x,y:n.y*h.y-c.scrollTop*h.y+f.y+m.y}}function ZJ(t){return Array.from(t.getClientRects())}function JJ(t){const e=lc(t),n=Bw(t),r=t.ownerDocument.body,i=Es(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Es(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Pw(t);const l=-n.scrollTop;return wo(r).direction==="rtl"&&(o+=Es(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:l}}const R8=25;function eee(t,e){const n=ma(t),r=lc(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,l=0,c=0;if(i){s=i.width,o=i.height;const f=Lw();(!f||f&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const h=Pw(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,y=Math.abs(r.clientWidth-p.clientWidth-v);y<=R8&&(s-=y)}else h<=R8&&(s+=h);return{width:s,height:o,x:l,y:c}}function tee(t,e){const n=jf(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=_o(t)?Up(t):Zl(1),o=t.clientWidth*s.x,l=t.clientHeight*s.y,c=i*s.x,h=r*s.y;return{width:o,height:l,x:c,y:h}}function D8(t,e,n){let r;if(e==="viewport")r=eee(t,n);else if(e==="document")r=JJ(lc(t));else if(xr(e))r=tee(e,n);else{const i=p7(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Mm(r)}function g7(t,e){const n=uu(t);return n===e||!xr(n)||ru(n)?!1:wo(n).position==="fixed"||g7(n,e)}function nee(t,e){const n=e.get(t);if(n)return n;let r=iu(t,[],!1).filter(l=>xr(l)&&n0(l)!=="body"),i=null;const s=wo(t).position==="fixed";let o=s?uu(t):t;for(;xr(o)&&!ru(o);){const l=wo(o),c=$O(o);!c&&l.position==="fixed"&&(i=null),(s?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||vb(o)&&!c&&g7(t,o))?r=r.filter(f=>f!==o):i=l,o=uu(o)}return e.set(t,r),r}function ree(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?Iw(e)?[]:nee(e,this._c):[].concat(n),r],l=D8(e,o[0],i);let c=l.top,h=l.right,f=l.bottom,p=l.left;for(let m=1;m<o.length;m++){const v=D8(e,o[m],i);c=Es(v.top,c),h=cl(v.right,h),f=cl(v.bottom,f),p=Es(v.left,p)}return{width:h-p,height:f-c,x:p,y:c}}function iee(t){const{width:e,height:n}=f7(t);return{width:e,height:n}}function see(t,e,n){const r=_o(e),i=lc(e),s=n==="fixed",o=jf(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=Zl(0);function h(){c.x=Pw(i)}if(r||!r&&!s)if((n0(e)!=="body"||vb(i))&&(l=Bw(e)),r){const v=jf(e,!0,s,e);c.x=v.x+e.clientLeft,c.y=v.y+e.clientTop}else i&&h();s&&!r&&i&&h();const f=i&&!r&&!s?m7(i,l):Zl(0),p=o.left+l.scrollLeft-c.x-f.x,m=o.top+l.scrollTop-c.y-f.y;return{x:p,y:m,width:o.width,height:o.height}}function HC(t){return wo(t).position==="static"}function N8(t,e){if(!_o(t)||wo(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return lc(t)===n&&(n=n.ownerDocument.body),n}function v7(t,e){const n=ma(t);if(Iw(t))return n;if(!_o(t)){let i=uu(t);for(;i&&!ru(i);){if(xr(i)&&!HC(i))return i;i=uu(i)}return n}let r=N8(t,e);for(;r&&oJ(r)&&HC(r);)r=N8(r,e);return r&&ru(r)&&HC(r)&&!$O(r)?n:r||uJ(t)||n}const aee=async function(t){const e=this.getOffsetParent||v7,n=this.getDimensions,r=await n(t.floating);return{reference:see(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oee(t){return wo(t).direction==="rtl"}const lee={convertOffsetParentRelativeRectToViewportRelativeRect:KJ,getDocumentElement:lc,getClippingRect:ree,getOffsetParent:v7,getElementRects:aee,getClientRects:ZJ,getDimensions:iee,getScale:Up,isElement:xr,isRTL:oee};function b7(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function cee(t,e){let n=null,r;const i=lc(t);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const h=t.getBoundingClientRect(),{left:f,top:p,width:m,height:v}=h;if(l||e(),!m||!v)return;const y=w1(p),x=w1(i.clientWidth-(f+m)),S=w1(i.clientHeight-(p+v)),w=w1(f),C={rootMargin:-y+"px "+-x+"px "+-S+"px "+-w+"px",threshold:Es(0,cl(1,c))||1};let j=!0;function _(k){const M=k[0].intersectionRatio;if(M!==c){if(!j)return o();M?o(!1,M):r=setTimeout(()=>{o(!1,1e-7)},1e3)}M===1&&!b7(h,t.getBoundingClientRect())&&o(),j=!1}try{n=new IntersectionObserver(_,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,C)}n.observe(t)}return o(!0),s}function d3(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:c=!1}=r,h=UO(t),f=i||s?[...h?iu(h):[],...e?iu(e):[]]:[];f.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const p=h&&l?cee(h,n):null;let m=-1,v=null;o&&(v=new ResizeObserver(w=>{let[A]=w;A&&A.target===h&&v&&e&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(e)})),n()}),h&&!c&&v.observe(h),e&&v.observe(e));let y,x=c?jf(t):null;c&&S();function S(){const w=jf(t);x&&!b7(x,w)&&n(),x=w,y=requestAnimationFrame(S)}return n(),()=>{var w;f.forEach(A=>{i&&A.removeEventListener("scroll",n),s&&A.removeEventListener("resize",n)}),p==null||p(),(w=v)==null||w.disconnect(),v=null,c&&cancelAnimationFrame(y)}}const y7=UJ,x7=WJ,A7=$J,uee=VJ,hee=HJ,I8=FJ,dee=qJ,fee=YJ,w7=(t,e,n)=>{const r=new Map,i={platform:lee,...n},s={...i.platform,_c:r};return PJ(t,e,{...i,platform:s})};var pee=typeof document<"u",mee=function(){},jx=pee?O.useLayoutEffect:mee;function gA(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(!gA(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)&&!gA(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function S7(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function L8(t,e){const n=S7(t);return Math.round(e*n)/n}function zC(t){const e=O.useRef(t);return jx(()=>{e.current=t}),e}function gee(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:c,open:h}=t,[f,p]=O.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,v]=O.useState(r);gA(m,r)||v(r);const[y,x]=O.useState(null),[S,w]=O.useState(null),A=O.useCallback(q=>{q!==k.current&&(k.current=q,x(q))},[]),C=O.useCallback(q=>{q!==M.current&&(M.current=q,w(q))},[]),j=s||y,_=o||S,k=O.useRef(null),M=O.useRef(null),R=O.useRef(f),N=c!=null,I=zC(c),D=zC(i),L=zC(h),z=O.useCallback(()=>{if(!k.current||!M.current)return;const q={placement:e,strategy:n,middleware:m};D.current&&(q.platform=D.current),w7(k.current,M.current,q).then(X=>{const Y={...X,isPositioned:L.current!==!1};P.current&&!gA(R.current,Y)&&(R.current=Y,nu.flushSync(()=>{p(Y)}))})},[m,e,n,D,L]);jx(()=>{h===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(q=>({...q,isPositioned:!1})))},[h]);const P=O.useRef(!1);jx(()=>(P.current=!0,()=>{P.current=!1}),[]),jx(()=>{if(j&&(k.current=j),_&&(M.current=_),j&&_){if(I.current)return I.current(j,_,z);z()}},[j,_,z,I,N]);const H=O.useMemo(()=>({reference:k,floating:M,setReference:A,setFloating:C}),[A,C]),B=O.useMemo(()=>({reference:j,floating:_}),[j,_]),F=O.useMemo(()=>{const q={position:n,left:0,top:0};if(!B.floating)return q;const X=L8(B.floating,f.x),Y=L8(B.floating,f.y);return l?{...q,transform:"translate("+X+"px, "+Y+"px)",...S7(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:Y}},[n,l,B.floating,f.x,f.y]);return O.useMemo(()=>({...f,update:z,refs:H,elements:B,floatingStyles:F}),[f,z,H,B,F])}const vee=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?I8({element:r.current,padding:i}).fn(n):{}:r?I8({element:r,padding:i}).fn(n):{}}}},j7=(t,e)=>{const n=y7(t);return{name:n.name,fn:n.fn,options:[t,e]}},WO=(t,e)=>{const n=x7(t);return{name:n.name,fn:n.fn,options:[t,e]}},B8=(t,e)=>({fn:fee(t).fn,options:[t,e]}),f3=(t,e)=>{const n=A7(t);return{name:n.name,fn:n.fn,options:[t,e]}},bee=(t,e)=>{const n=uee(t);return{name:n.name,fn:n.fn,options:[t,e]}},yee=(t,e)=>{const n=hee(t);return{name:n.name,fn:n.fn,options:[t,e]}},tv=(t,e)=>{const n=dee(t);return{name:n.name,fn:n.fn,options:[t,e]}},C7=(t,e)=>{const n=vee(t);return{name:n.name,fn:n.fn,options:[t,e]}};function _7(t){const e=O.useRef(void 0),n=O.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 O.useMemo(()=>t.every(r=>r==null)?null:r=>{e.current&&(e.current(),e.current=void 0),r!=null&&(e.current=n(r))},t)}const xee="data-floating-ui-focusable",P8="active",F8="selected",Aee={...CP};let $8=!1,wee=0;const H8=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+wee++;function See(){const[t,e]=O.useState(()=>$8?H8():void 0);return Jl(()=>{t==null&&e(H8())},[]),O.useEffect(()=>{$8=!0},[]),t}const jee=Aee.useId,T7=jee||See;function Cee(){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 _ee=O.createContext(null),Tee=O.createContext(null),YO=()=>{var t;return((t=O.useContext(_ee))==null?void 0:t.id)||null},VO=()=>O.useContext(Tee);function GO(t){return"data-floating-ui-"+t}function aa(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}const z8=GO("safe-polygon");function Cx(t,e,n){if(n&&!h3(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 qC(t){return typeof t=="function"?t():t}function k7(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:i,events:s,elements:o}=t,{enabled:l=!0,delay:c=0,handleClose:h=null,mouseOnly:f=!1,restMs:p=0,move:m=!0}=e,v=VO(),y=YO(),x=S1(h),S=S1(c),w=S1(n),A=S1(p),C=O.useRef(),j=O.useRef(-1),_=O.useRef(),k=O.useRef(-1),M=O.useRef(!0),R=O.useRef(!1),N=O.useRef(()=>{}),I=O.useRef(!1),D=$l(()=>{var F;const q=(F=i.current.openEvent)==null?void 0:F.type;return(q==null?void 0:q.includes("mouse"))&&q!=="mousedown"});O.useEffect(()=>{if(!l)return;function F(q){let{open:X}=q;X||(aa(j),aa(k),M.current=!0,I.current=!1)}return s.on("openchange",F),()=>{s.off("openchange",F)}},[l,s]),O.useEffect(()=>{if(!l||!x.current||!n)return;function F(X){D()&&r(!1,X,"hover")}const q=Vd(o.floating).documentElement;return q.addEventListener("mouseleave",F),()=>{q.removeEventListener("mouseleave",F)}},[o.floating,n,r,l,x,D]);const L=O.useCallback(function(F,q,X){q===void 0&&(q=!0),X===void 0&&(X="hover");const Y=Cx(S.current,"close",C.current);Y&&!_.current?(aa(j),j.current=window.setTimeout(()=>r(!1,F,X),Y)):q&&(aa(j),r(!1,F,X))},[S,r]),z=$l(()=>{N.current(),_.current=void 0}),P=$l(()=>{if(R.current){const F=Vd(o.floating).body;F.style.pointerEvents="",F.removeAttribute(z8),R.current=!1}}),H=$l(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);O.useEffect(()=>{if(!l)return;function F(V){if(aa(j),M.current=!1,f&&!h3(C.current)||qC(A.current)>0&&!Cx(S.current,"open"))return;const G=Cx(S.current,"open",C.current);G?j.current=window.setTimeout(()=>{w.current||r(!0,V,"hover")},G):n||r(!0,V,"hover")}function q(V){if(H()){P();return}N.current();const G=Vd(o.floating);if(aa(k),I.current=!1,x.current&&i.current.floatingContext){n||aa(j),_.current=x.current({...i.current.floatingContext,tree:v,x:V.clientX,y:V.clientY,onClose(){P(),z(),H()||L(V,!0,"safe-polygon")}});const ne=_.current;G.addEventListener("mousemove",ne),N.current=()=>{G.removeEventListener("mousemove",ne)};return}(C.current==="touch"?!bv(o.floating,V.relatedTarget):!0)&&L(V)}function X(V){H()||i.current.floatingContext&&(x.current==null||x.current({...i.current.floatingContext,tree:v,x:V.clientX,y:V.clientY,onClose(){P(),z(),H()||L(V)}})(V))}function Y(){aa(j)}function U(V){H()||L(V,!1)}if(xr(o.domReference)){const V=o.domReference,G=o.floating;return n&&V.addEventListener("mouseleave",X),m&&V.addEventListener("mousemove",F,{once:!0}),V.addEventListener("mouseenter",F),V.addEventListener("mouseleave",q),G&&(G.addEventListener("mouseleave",X),G.addEventListener("mouseenter",Y),G.addEventListener("mouseleave",U)),()=>{n&&V.removeEventListener("mouseleave",X),m&&V.removeEventListener("mousemove",F),V.removeEventListener("mouseenter",F),V.removeEventListener("mouseleave",q),G&&(G.removeEventListener("mouseleave",X),G.removeEventListener("mouseenter",Y),G.removeEventListener("mouseleave",U))}}},[o,l,t,f,m,L,z,P,r,n,w,v,S,x,i,H,A]),Jl(()=>{var F;if(l&&n&&(F=x.current)!=null&&(F=F.__options)!=null&&F.blockPointerEvents&&D()){R.current=!0;const X=o.floating;if(xr(o.domReference)&&X){var q;const Y=Vd(o.floating).body;Y.setAttribute(z8,"");const U=o.domReference,V=v==null||(q=v.nodesRef.current.find(G=>G.id===y))==null||(q=q.context)==null?void 0:q.elements.floating;return V&&(V.style.pointerEvents=""),Y.style.pointerEvents="none",U.style.pointerEvents="auto",X.style.pointerEvents="auto",()=>{Y.style.pointerEvents="",U.style.pointerEvents="",X.style.pointerEvents=""}}}},[l,n,y,o,v,x,D]),Jl(()=>{n||(C.current=void 0,I.current=!1,z(),P())},[n,z,P]),O.useEffect(()=>()=>{z(),aa(j),aa(k),P()},[l,o.domReference,z,P]);const B=O.useMemo(()=>{function F(q){C.current=q.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(q){const{nativeEvent:X}=q;function Y(){!M.current&&!w.current&&r(!0,X,"hover")}f&&!h3(C.current)||n||qC(A.current)===0||I.current&&q.movementX**2+q.movementY**2<2||(aa(k),C.current==="touch"?Y():(I.current=!0,k.current=window.setTimeout(Y,qC(A.current))))}}},[f,r,n,w,A]);return O.useMemo(()=>l?{reference:B}:{},[l,B])}const p3=()=>{},O7=O.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:p3,setState:p3,isInstantPhase:!1}),kee=()=>O.useContext(O7);function Oee(t){const{children:e,delay:n,timeoutMs:r=0}=t,[i,s]=O.useReducer((c,h)=>({...c,...h}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=O.useRef(null),l=O.useCallback(c=>{s({currentId:c})},[]);return Jl(()=>{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(O7.Provider,{value:O.useMemo(()=>({...i,setState:s,setCurrentId:l}),[i,l]),children:e})}function Eee(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,floatingId:i}=t,{id:s,enabled:o=!0}=e,l=s??i,c=kee(),{currentId:h,setCurrentId:f,initialDelay:p,setState:m,timeoutMs:v}=c;return Jl(()=>{o&&h&&(m({delay:{open:1,close:Cx(p,"close")}}),h!==l&&r(!1))},[o,l,r,m,h,p]),Jl(()=>{function y(){r(!1),m({delay:p,currentId:null})}if(o&&h&&!n&&h===l){if(v){const x=window.setTimeout(y,v);return()=>{clearTimeout(x)}}y()}},[o,n,m,h,l,r,p,v]),Jl(()=>{o&&(f===p3||!n||f(l))},[o,n,f,l]),c}function QC(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&fA(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function Mee(t){return"composedPath"in t?t.composedPath()[0]:t.target}const Ree={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Dee={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},q8=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 Nee(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=t,{enabled:o=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:h="pointerdown",referencePress:f=!1,referencePressEvent:p="pointerdown",ancestorScroll:m=!1,bubbles:v,capture:y}=e,x=VO(),S=$l(typeof c=="function"?c:()=>!1),w=typeof c=="function"?S:c,A=O.useRef(!1),{escapeKey:C,outsidePress:j}=q8(v),{escapeKey:_,outsidePress:k}=q8(y),M=O.useRef(!1),R=$l(P=>{var H;if(!n||!o||!l||P.key!=="Escape"||M.current)return;const B=(H=s.current.floatingContext)==null?void 0:H.nodeId,F=x?Sx(x.nodesRef.current,B):[];if(!C&&(P.stopPropagation(),F.length>0)){let q=!0;if(F.forEach(X=>{var Y;if((Y=X.context)!=null&&Y.open&&!X.context.dataRef.current.__escapeKeyBubbles){q=!1;return}}),!q)return}r(!1,EJ(P)?P.nativeEvent:P,"escape-key")}),N=$l(P=>{var H;const B=()=>{var F;R(P),(F=kp(P))==null||F.removeEventListener("keydown",B)};(H=kp(P))==null||H.addEventListener("keydown",B)}),I=$l(P=>{var H;const B=s.current.insideReactTree;s.current.insideReactTree=!1;const F=A.current;if(A.current=!1,h==="click"&&F||B||typeof w=="function"&&!w(P))return;const q=kp(P),X="["+GO("inert")+"]",Y=Vd(i.floating).querySelectorAll(X);let U=xr(q)?q:null;for(;U&&!ru(U);){const ne=uu(U);if(ru(ne)||!xr(ne))break;U=ne}if(Y.length&&xr(q)&&!_J(q)&&!bv(q,i.floating)&&Array.from(Y).every(ne=>!bv(U,ne)))return;if(_o(q)&&z){const ne=ru(q),de=wo(q),fe=/auto|scroll/,ke=ne||fe.test(de.overflowX),Me=ne||fe.test(de.overflowY),Oe=ke&&q.clientWidth>0&&q.scrollWidth>q.clientWidth,Ye=Me&&q.clientHeight>0&&q.scrollHeight>q.clientHeight,ie=de.direction==="rtl",Se=Ye&&(ie?P.offsetX<=q.offsetWidth-q.clientWidth:P.offsetX>q.clientWidth),se=Oe&&P.offsetY>q.clientHeight;if(Se||se)return}const V=(H=s.current.floatingContext)==null?void 0:H.nodeId,G=x&&Sx(x.nodesRef.current,V).some(ne=>{var de;return $C(P,(de=ne.context)==null?void 0:de.elements.floating)});if($C(P,i.floating)||$C(P,i.domReference)||G)return;const J=x?Sx(x.nodesRef.current,V):[];if(J.length>0){let ne=!0;if(J.forEach(de=>{var fe;if((fe=de.context)!=null&&fe.open&&!de.context.dataRef.current.__outsidePressBubbles){ne=!1;return}}),!ne)return}r(!1,P,"outside-press")}),D=$l(P=>{var H;const B=()=>{var F;I(P),(F=kp(P))==null||F.removeEventListener(h,B)};(H=kp(P))==null||H.addEventListener(h,B)});O.useEffect(()=>{if(!n||!o)return;s.current.__escapeKeyBubbles=C,s.current.__outsidePressBubbles=j;let P=-1;function H(Y){r(!1,Y,"ancestor-scroll")}function B(){window.clearTimeout(P),M.current=!0}function F(){P=window.setTimeout(()=>{M.current=!1},Lw()?5:0)}const q=Vd(i.floating);l&&(q.addEventListener("keydown",_?N:R,_),q.addEventListener("compositionstart",B),q.addEventListener("compositionend",F)),w&&q.addEventListener(h,k?D:I,k);let X=[];return m&&(xr(i.domReference)&&(X=iu(i.domReference)),xr(i.floating)&&(X=X.concat(iu(i.floating))),!xr(i.reference)&&i.reference&&i.reference.contextElement&&(X=X.concat(iu(i.reference.contextElement)))),X=X.filter(Y=>{var U;return Y!==((U=q.defaultView)==null?void 0:U.visualViewport)}),X.forEach(Y=>{Y.addEventListener("scroll",H,{passive:!0})}),()=>{l&&(q.removeEventListener("keydown",_?N:R,_),q.removeEventListener("compositionstart",B),q.removeEventListener("compositionend",F)),w&&q.removeEventListener(h,k?D:I,k),X.forEach(Y=>{Y.removeEventListener("scroll",H)}),window.clearTimeout(P)}},[s,i,l,w,h,n,r,m,o,C,j,R,_,N,I,k,D]),O.useEffect(()=>{s.current.insideReactTree=!1},[s,w,h]);const L=O.useMemo(()=>({onKeyDown:R,...f&&{[Ree[p]]:P=>{r(!1,P.nativeEvent,"reference-press")},...p!=="click"&&{onClick(P){r(!1,P.nativeEvent,"reference-press")}}}}),[R,r,f,p]),z=O.useMemo(()=>{function P(H){H.button===0&&(A.current=!0)}return{onKeyDown:R,onMouseDown:P,onMouseUp:P,[Dee[h]]:()=>{s.current.insideReactTree=!0}}},[R,h,s]);return O.useMemo(()=>o?{reference:L,floating:z}:{},[o,L,z])}function Iee(t){const{open:e=!1,onOpenChange:n,elements:r}=t,i=T7(),s=O.useRef({}),[o]=O.useState(()=>Cee()),l=YO()!=null,[c,h]=O.useState(r.reference),f=$l((v,y,x)=>{s.current.openEvent=v?y:void 0,o.emit("openchange",{open:v,event:y,reason:x,nested:l}),n==null||n(v,y,x)}),p=O.useMemo(()=>({setPositionReference:h}),[]),m=O.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return O.useMemo(()=>({dataRef:s,open:e,onOpenChange:f,elements:m,events:o,floatingId:i,refs:p}),[e,f,m,o,i,p])}function Fw(t){t===void 0&&(t={});const{nodeId:e}=t,n=Iee({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,i=r.elements,[s,o]=O.useState(null),[l,c]=O.useState(null),f=(i==null?void 0:i.domReference)||s,p=O.useRef(null),m=VO();Jl(()=>{f&&(p.current=f)},[f]);const v=gee({...t,elements:{...i,...l&&{reference:l}}}),y=O.useCallback(C=>{const j=xr(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;c(j),v.refs.setReference(j)},[v.refs]),x=O.useCallback(C=>{(xr(C)||C===null)&&(p.current=C,o(C)),(xr(v.refs.reference.current)||v.refs.reference.current===null||C!==null&&!xr(C))&&v.refs.setReference(C)},[v.refs]),S=O.useMemo(()=>({...v.refs,setReference:x,setPositionReference:y,domReference:p}),[v.refs,x,y]),w=O.useMemo(()=>({...v.elements,domReference:f}),[v.elements,f]),A=O.useMemo(()=>({...v,...r,refs:S,elements:w,nodeId:e}),[v,S,w,e,r]);return Jl(()=>{r.dataRef.current.floatingContext=A;const C=m==null?void 0:m.nodesRef.current.find(j=>j.id===e);C&&(C.context=A)}),O.useMemo(()=>({...v,context:A,refs:S,elements:w}),[v,S,w,A])}function UC(){return SJ()&&wJ()}function Lee(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:o}=t,{enabled:l=!0,visibleOnly:c=!0}=e,h=O.useRef(!1),f=O.useRef(-1),p=O.useRef(!0);O.useEffect(()=>{if(!l)return;const v=ma(o.domReference);function y(){!n&&_o(o.domReference)&&o.domReference===k8(Vd(o.domReference))&&(h.current=!0)}function x(){p.current=!0}function S(){p.current=!1}return v.addEventListener("blur",y),UC()&&(v.addEventListener("keydown",x,!0),v.addEventListener("pointerdown",S,!0)),()=>{v.removeEventListener("blur",y),UC()&&(v.removeEventListener("keydown",x,!0),v.removeEventListener("pointerdown",S,!0))}},[o.domReference,n,l]),O.useEffect(()=>{if(!l)return;function v(y){let{reason:x}=y;(x==="reference-press"||x==="escape-key")&&(h.current=!0)}return i.on("openchange",v),()=>{i.off("openchange",v)}},[i,l]),O.useEffect(()=>()=>{aa(f)},[]);const m=O.useMemo(()=>({onMouseLeave(){h.current=!1},onFocus(v){if(h.current)return;const y=kp(v.nativeEvent);if(c&&xr(y)){if(UC()&&!v.relatedTarget){if(!p.current&&!TJ(y))return}else if(!kJ(y))return}r(!0,v.nativeEvent,"focus")},onBlur(v){h.current=!1;const y=v.relatedTarget,x=v.nativeEvent,S=xr(y)&&y.hasAttribute(GO("focus-guard"))&&y.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{var w;const A=k8(o.domReference?o.domReference.ownerDocument:document);!y&&A===o.domReference||bv((w=s.current.floatingContext)==null?void 0:w.refs.floating.current,A)||bv(o.domReference,A)||S||r(!1,x,"focus")})}}),[s,o.domReference,r,c]);return O.useMemo(()=>l?{reference:m}:{},[l,m])}function WC(t,e,n){const r=new Map,i=n==="item";let s=t;if(i&&t){const{[P8]:o,[F8]:l,...c}=t;s=c}return{...n==="floating"&&{tabIndex:-1,[xee]:""},...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(c=>{let[h,f]=c;if(!(i&&[P8,F8].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,y=new Array(v),x=0;x<v;x++)y[x]=arguments[x];return(m=r.get(h))==null?void 0:m.map(S=>S(...y)).find(S=>S!==void 0)}}}else o[h]=f}),o),{})}}function E7(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=O.useCallback(l=>WC(l,t,"reference"),e),s=O.useCallback(l=>WC(l,t,"floating"),n),o=O.useCallback(l=>WC(l,t,"item"),r);return O.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:o}),[i,s,o])}const Bee=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Pee(t,e){var n,r;e===void 0&&(e={});const{open:i,elements:s,floatingId:o}=t,{enabled:l=!0,role:c="dialog"}=e,h=T7(),f=((n=s.domReference)==null?void 0:n.id)||h,p=O.useMemo(()=>{var A;return((A=OJ(s.floating))==null?void 0:A.id)||o},[s.floating,o]),m=(r=Bee.get(c))!=null?r:c,y=YO()!=null,x=O.useMemo(()=>m==="tooltip"||c==="label"?{["aria-"+(c==="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"&&y&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[m,p,y,i,f,c]),S=O.useMemo(()=>{const A={id:p,...m&&{role:m}};return m==="tooltip"||c==="label"?A:{...A,...m==="menu"&&{"aria-labelledby":f}}},[m,p,f,c]),w=O.useCallback(A=>{let{active:C,selected:j}=A;const _={role:"option",...C&&{id:p+"-fui-option"}};switch(c){case"select":case"combobox":return{..._,"aria-selected":j}}return{}},[p,c]);return O.useMemo(()=>l?{reference:x,floating:S,item:w}:{},[l,x,S,w])}function M7(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,...M7(t,i.id,n)])}function Q8(t,e){const[n,r]=t;let i=!1;const s=e.length;for(let o=0,l=s-1;o<s;l=o++){const[c,h]=e[o]||[0,0],[f,p]=e[l]||[0,0];h>=r!=p>=r&&n<=(f-c)*(r-h)/(p-h)+c&&(i=!i)}return i}function Fee(t,e){return t[0]>=e.x&&t[0]<=e.x+e.width&&t[1]>=e.y&&t[1]<=e.y+e.height}function $ee(t){t===void 0&&(t={});const{buffer:e=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=t,i={current:-1};let s=!1,o=null,l=null,c=typeof performance<"u"?performance.now():0;function h(p,m){const v=performance.now(),y=v-c;if(o===null||l===null||y===0)return o=p,l=m,c=v,null;const x=p-o,S=m-l,A=Math.sqrt(x*x+S*S)/y;return o=p,l=m,c=v,A}const f=p=>{let{x:m,y:v,placement:y,elements:x,onClose:S,nodeId:w,tree:A}=p;return function(j){function _(){aa(i),S()}if(aa(i),!x.domReference||!x.floating||y==null||m==null||v==null)return;const{clientX:k,clientY:M}=j,R=[k,M],N=Mee(j),I=j.type==="mouseleave",D=QC(x.floating,N),L=QC(x.domReference,N),z=x.domReference.getBoundingClientRect(),P=x.floating.getBoundingClientRect(),H=y.split("-")[0],B=m>P.right-P.width/2,F=v>P.bottom-P.height/2,q=Fee(R,z),X=P.width>z.width,Y=P.height>z.height,U=(X?z:P).left,V=(X?z:P).right,G=(Y?z:P).top,J=(Y?z:P).bottom;if(D&&(s=!0,!I))return;if(L&&(s=!1),L&&!I){s=!0;return}if(I&&xr(j.relatedTarget)&&QC(x.floating,j.relatedTarget)||A&&M7(A.nodesRef.current,w).length)return;if(H==="top"&&v>=z.bottom-1||H==="bottom"&&v<=z.top+1||H==="left"&&m>=z.right-1||H==="right"&&m<=z.left+1)return _();let ne=[];switch(H){case"top":ne=[[U,z.top+1],[U,P.bottom-1],[V,P.bottom-1],[V,z.top+1]];break;case"bottom":ne=[[U,P.top+1],[U,z.bottom-1],[V,z.bottom-1],[V,P.top+1]];break;case"left":ne=[[P.right-1,J],[P.right-1,G],[z.left+1,G],[z.left+1,J]];break;case"right":ne=[[z.right-1,J],[z.right-1,G],[P.left+1,G],[P.left+1,J]];break}function de(fe){let[ke,Me]=fe;switch(H){case"top":{const Oe=[X?ke+e/2:B?ke+e*4:ke-e*4,Me+e+1],Ye=[X?ke-e/2:B?ke+e*4:ke-e*4,Me+e+1],ie=[[P.left,B||X?P.bottom-e:P.top],[P.right,B?X?P.bottom-e:P.top:P.bottom-e]];return[Oe,Ye,...ie]}case"bottom":{const Oe=[X?ke+e/2:B?ke+e*4:ke-e*4,Me-e],Ye=[X?ke-e/2:B?ke+e*4:ke-e*4,Me-e],ie=[[P.left,B||X?P.top+e:P.bottom],[P.right,B?X?P.top+e:P.bottom:P.top+e]];return[Oe,Ye,...ie]}case"left":{const Oe=[ke+e+1,Y?Me+e/2:F?Me+e*4:Me-e*4],Ye=[ke+e+1,Y?Me-e/2:F?Me+e*4:Me-e*4];return[...[[F||Y?P.right-e:P.left,P.top],[F?Y?P.right-e:P.left:P.right-e,P.bottom]],Oe,Ye]}case"right":{const Oe=[ke-e,Y?Me+e/2:F?Me+e*4:Me-e*4],Ye=[ke-e,Y?Me-e/2:F?Me+e*4:Me-e*4],ie=[[F||Y?P.left+e:P.right,P.top],[F?Y?P.left+e:P.right:P.left+e,P.bottom]];return[Oe,Ye,...ie]}}}if(!Q8([k,M],ne)){if(s&&!q)return _();if(!I&&r){const fe=h(j.clientX,j.clientY);if(fe!==null&&fe<.1)return _()}Q8([k,M],de([m,v]))?!s&&r&&(i.current=window.setTimeout(_,40)):_()}}};return f.__options={blockPointerEvents:n},f}const R7={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},D7=(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":me(e),"--scrollarea-over-scroll-behavior":i}}},ga=Ie(t=>{const e=xe("ScrollArea",R7,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,scrollbarSize:l,vars:c,type:h,scrollHideDelay:f,viewportProps:p,viewportRef:m,onScrollPositionChange:v,children:y,offsetScrollbars:x,scrollbars:S,onBottomReached:w,onTopReached:A,onLeftReached:C,onRightReached:j,overscrollBehavior:_,startScrollPosition:k,attributes:M,...R}=e,[N,I]=O.useState(!1),[D,L]=O.useState(!1),[z,P]=O.useState(!1),H=O.useRef(!0),B=O.useRef(!1),F=O.useRef(!0),q=O.useRef(!1),X=mt({name:"ScrollArea",props:e,classes:FO,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:M,vars:c,varsResolver:D7}),Y=O.useRef(null),[U,V]=O.useState(null),G=_7([m,Y,O.useCallback(J=>{V(ne=>ne===J?ne:J)},[])]);return Hh(x==="present"?U:null,()=>{const J=Y.current;J&&(L(J.scrollHeight>J.clientHeight),P(J.scrollWidth>J.clientWidth))}),nc(()=>{k&&Y.current&&Y.current.scrollTo({left:k.x??0,top:k.y??0})},[]),a.jsxs(ZP,{getStyles:X,type:h==="never"?"always":h,scrollHideDelay:f,scrollbars:S,...X("root"),...R,children:[a.jsx(l7,{...p,...X("viewport",{style:p==null?void 0:p.style}),ref:G,"data-offset-scrollbars":x===!0?"xy":x||void 0,"data-scrollbars":S||void 0,"data-horizontal-hidden":x==="present"&&!z?"true":void 0,"data-vertical-hidden":x==="present"&&!D?"true":void 0,onScroll:J=>{var _e;(_e=p==null?void 0:p.onScroll)==null||_e.call(p,J),v==null||v({x:J.currentTarget.scrollLeft,y:J.currentTarget.scrollTop});const{scrollTop:ne,scrollHeight:de,clientHeight:fe,scrollLeft:ke,scrollWidth:Me,clientWidth:Oe}=J.currentTarget,Ye=ne-(de-fe)>=-.8,ie=ne===0;Ye&&!B.current&&(w==null||w()),ie&&!H.current&&(A==null||A()),B.current=Ye,H.current=ie;const Se=ke-(Me-Oe)>=-.8,se=ke===0;Se&&!q.current&&(j==null||j()),se&&!F.current&&(C==null||C()),q.current=Se,F.current=se},children:y}),(S==="xy"||S==="x")&&a.jsx(a3,{...X("scrollbar"),orientation:"horizontal","data-hidden":h==="never"||x==="present"&&!z?!0:void 0,forceMount:!0,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),children:a.jsx(o3,{...X("thumb")})}),(S==="xy"||S==="y")&&a.jsx(a3,{...X("scrollbar"),orientation:"vertical","data-hidden":h==="never"||x==="present"&&!D?!0:void 0,forceMount:!0,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),children:a.jsx(o3,{...X("thumb")})}),a.jsx(eJ,{...X("corner"),"data-hovered":N||void 0,"data-hidden":h==="never"||void 0})]})});ga.displayName="@mantine/core/ScrollArea";const XO=Ie(t=>{const{children:e,classNames:n,styles:r,scrollbarSize:i,scrollHideDelay:s,type:o,dir:l,offsetScrollbars:c,overscrollBehavior:h,viewportRef:f,onScrollPositionChange:p,unstyled:m,variant:v,viewportProps:y,scrollbars:x,style:S,vars:w,onBottomReached:A,onTopReached:C,startScrollPosition:j,onOverflowChange:_,...k}=xe("ScrollAreaAutosize",R7,t),M=O.useRef(null),[R,N]=O.useState(null),I=_7([f,M,O.useCallback(P=>{N(H=>H===P?H:P)},[])]),D=O.useRef(!1),L=O.useRef(!1),z=O.useEffectEvent(()=>{const P=M.current;if(!P||!_)return;const H=P.scrollHeight>P.clientHeight;H!==D.current&&(L.current?_(H):(L.current=!0,H&&_(!0)),D.current=H)});return Hh(_?R:null,z),a.jsx(ve,{...k,variant:v,style:[{display:"flex",overflow:"hidden"},S],children:a.jsx(ve,{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",...x==="y"&&{minWidth:0},...x==="x"&&{minHeight:0},...x==="xy"&&{minWidth:0,minHeight:0},...x===!1&&{minWidth:0,minHeight:0}},children:a.jsx(ga,{classNames:n,styles:r,scrollHideDelay:s,scrollbarSize:i,type:o,dir:l,offsetScrollbars:c,overscrollBehavior:h,viewportRef:I,onScrollPositionChange:p,unstyled:m,variant:v,viewportProps:y,vars:w,scrollbars:x,onBottomReached:A,onTopReached:C,startScrollPosition:j,"data-autosize":"true",children:e})})})});ga.classes=FO;ga.varsResolver=D7;XO.displayName="@mantine/core/ScrollAreaAutosize";XO.classes=FO;ga.Autosize=XO;var N7={root:"m_87cf2631"};const Hee={__staticSelector:"UnstyledButton"},Nr=Zi(t=>{const e=xe("UnstyledButton",Hee,t),{className:n,component:r="button",__staticSelector:i,unstyled:s,classNames:o,styles:l,style:c,attributes:h,...f}=e;return a.jsx(ve,{...mt({name:i,props:e,classes:N7,className:n,style:c,classNames:o,styles:l,unstyled:s,attributes:h})("root",{focusable:!0}),component:r,type:r==="button"?"button":void 0,...f})});Nr.classes=N7;Nr.displayName="@mantine/core/UnstyledButton";var I7={root:"m_515a97f8"};const KO=Ie(t=>{const e=xe("VisuallyHidden",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,attributes:c,...h}=e;return a.jsx(ve,{component:"span",...mt({name:"VisuallyHidden",classes:I7,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:c})("root"),...h})});KO.classes=I7;KO.displayName="@mantine/core/VisuallyHidden";var L7={root:"m_1b7284a3"};const B7=(t,{radius:e,shadow:n})=>({root:{"--paper-radius":e===void 0?void 0:rr(e),"--paper-shadow":EO(n)}}),bb=Zi(t=>{const e=xe("Paper",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,withBorder:l,vars:c,radius:h,shadow:f,variant:p,mod:m,attributes:v,...y}=e,x=mt({name:"Paper",props:e,classes:L7,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:v,vars:c,varsResolver:B7});return a.jsx(ve,{mod:[{"data-with-border":l},m],...x("root"),variant:p,...y})});bb.classes=L7;bb.varsResolver=B7;bb.displayName="@mantine/core/Paper";function U8(t,e,n,r){return t==="center"||r==="center"?{top:e}:t==="end"?{bottom:n}:t==="start"?{top:n}:{}}function W8(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 zee={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function qee({position:t,arrowSize:e,dir:n}){const[r,i]=t.split("-");if(!i)return;const s={width:e,height:e,position:"absolute"};if(r==="bottom"){const o=i==="start",l=o?n==="ltr"?"left":"right":n==="ltr"?"right":"left";return{...s,top:-e,[l]:0,clipPath:o!==(n==="rtl")?"polygon(0% 0%, 0% 100%, 100% 100%)":"polygon(100% 0%, 0% 100%, 100% 100%)"}}if(r==="top"){const o=i==="start",l=o?n==="ltr"?"left":"right":n==="ltr"?"right":"left";return{...s,bottom:-e,[l]:0,clipPath:o!==(n==="rtl")?"polygon(0% 0%, 100% 0%, 0% 100%)":"polygon(0% 0%, 100% 0%, 100% 100%)"}}if(r==="left")return{...s,right:-e,[i==="start"?"top":"bottom"]:0,clipPath:i==="start"?"polygon(0% 0%, 100% 0%, 0% 100%)":"polygon(0% 0%, 0% 100%, 100% 100%)"};if(r==="right")return{...s,left:-e,[i==="start"?"top":"bottom"]:0,clipPath:i==="start"?"polygon(0% 0%, 100% 0%, 100% 100%)":"polygon(100% 0%, 0% 100%, 100% 100%)"}}function Qee({position:t,arrowSize:e,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:s,arrowY:o,dir:l}){if(i==="merge"){const m=qee({position:t,arrowSize:e,dir:l});if(m)return m}const[c,h="center"]=t.split("-"),f={width:e,height:e,transform:"rotate(45deg)",position:"absolute",[zee[c]]:r},p=-e/2;return c==="left"?{...f,...U8(h,o,n,i),right:p,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:c==="right"?{...f,...U8(h,o,n,i),left:p,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:c==="top"?{...f,...W8(h,s,n,i,l),bottom:p,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:c==="bottom"?{...f,...W8(h,s,n,i,l),top:p,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}function P7({position:t,dir:e}){const[n,r]=t.split("-");if(!r)return;const i=r==="start"&&e==="ltr"||r==="end"&&e==="rtl";if(n==="bottom")return i?{borderTopLeftRadius:0}:{borderTopRightRadius:0};if(n==="top")return i?{borderBottomLeftRadius:0}:{borderBottomRightRadius:0};if(n==="left")return r==="start"?{borderTopRightRadius:0}:{borderBottomRightRadius:0};if(n==="right")return r==="start"?{borderTopLeftRadius:0}:{borderBottomLeftRadius:0}}function vA({position:t,arrowSize:e,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:s,arrowX:o,arrowY:l,style:c,...h}){const{dir:f}=oc();return s?a.jsx("div",{...h,style:{...c,...Qee({position:t,arrowSize:e,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:f,arrowX:o,arrowY:l})}}):null}vA.displayName="@mantine/core/FloatingArrow";function ZO(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}function Uee({open:t,close:e,openDelay:n,closeDelay:r}){const i=O.useRef(-1),s=O.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)},c=()=>{o(),r===0||r===void 0?e():s.current=window.setTimeout(e,r)};return O.useEffect(()=>o,[]),{openDropdown:l,closeDropdown:c}}var F7={root:"m_9814e45f"};const Wee={zIndex:jo("modal")},$7=(t,{gradient:e,color:n,backgroundOpacity:r,blur:i,radius:s,zIndex:o})=>({root:{"--overlay-bg":e||(n!==void 0||r!==void 0)&&mh(n||"#000",r??.6)||void 0,"--overlay-filter":i?`blur(${me(i)})`:void 0,"--overlay-radius":s===void 0?void 0:rr(s),"--overlay-z-index":o==null?void 0:o.toString()}}),Cf=Zi(t=>{const e=xe("Overlay",Wee,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,fixed:c,center:h,children:f,radius:p,zIndex:m,gradient:v,blur:y,color:x,backgroundOpacity:S,mod:w,attributes:A,...C}=e;return a.jsx(ve,{...mt({name:"Overlay",props:e,classes:F7,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:A,vars:l,varsResolver:$7})("root"),mod:[{center:h,fixed:c},w],...C,children:f})});Cf.classes=F7;Cf.varsResolver=$7;Cf.displayName="@mantine/core/Overlay";function YC(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 Yee({target:t,reuseTargetNode:e,...n}){if(t)return typeof t=="string"?document.querySelector(t)||YC(n):t;if(e){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const i=YC(n);return i.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(i),i}return YC(n)}const Vee={reuseTargetNode:!0},H7=Ie(t=>{const{children:e,target:n,reuseTargetNode:r,ref:i,...s}=xe("Portal",Vee,t),[o,l]=O.useState(!1),c=O.useRef(null);return nc(()=>(l(!0),c.current=Yee({target:n,reuseTargetNode:r,...s}),hA(i,c.current),!n&&!r&&c.current&&document.body.appendChild(c.current),()=>{!n&&!r&&c.current&&document.body.removeChild(c.current)}),[n]),!o||!c.current?null:nu.createPortal(a.jsx(a.Fragment,{children:e}),c.current)});H7.displayName="@mantine/core/Portal";const zh=Ie(({withinPortal:t=!0,children:e,...n})=>mb()==="test"||!t?a.jsx(a.Fragment,{children:e}):a.jsx(H7,{...n,children:e}));zh.displayName="@mantine/core/OptionalPortal";const bg=t=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${t==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),j1={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:{...bg("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...bg("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...bg("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...bg("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...bg("top"),common:{transformOrigin:"top right"}}},Y8={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function V8({transition:t,state:e,duration:n,timingFunction:r}){const i={WebkitBackfaceVisibility:"hidden",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof t=="string"?t in j1?{transitionProperty:j1[t].transitionProperty,...i,...j1[t].common,...j1[t][Y8[e]]}:{}:{transitionProperty:t.transitionProperty,...i,...t.common,...t[Y8[e]]}}function Gee({duration:t,exitDuration:e,timingFunction:n,mounted:r,onEnter:i,onExit:s,onEntered:o,onExited:l,enterDelay:c,exitDelay:h}){const f=pi(),p=pb(),m=f.respectReducedMotion?p:!1,[v,y]=O.useState(m?0:t),[x,S]=O.useState(r?"entered":"exited"),w=O.useRef(-1),A=O.useRef(-1),C=O.useRef(-1);function j(){window.clearTimeout(w.current),window.clearTimeout(A.current),cancelAnimationFrame(C.current)}const _=M=>{j();const R=M?i:s,N=M?o:l,I=m?0:M?t:e;y(I),I===0?(typeof R=="function"&&R(),typeof N=="function"&&N(),S(M?"entered":"exited")):C.current=requestAnimationFrame(()=>{Lg.flushSync(()=>{S(M?"pre-entering":"pre-exiting")}),C.current=requestAnimationFrame(()=>{typeof R=="function"&&R(),S(M?"entering":"exiting"),w.current=window.setTimeout(()=>{typeof N=="function"&&N(),S(M?"entered":"exited")},I)})})},k=M=>{if(j(),typeof(M?c:h)!="number"){_(M);return}A.current=window.setTimeout(()=>{_(M)},M?c:h)};return vu(()=>{k(r)},[r]),O.useEffect(()=>()=>{j()},[]),{transitionDuration:v,transitionStatus:x,transitionTimingFunction:n||"ease"}}function ic({keepMounted:t,transition:e="fade",duration:n=250,exitDuration:r=n,mounted:i,children:s,timingFunction:o="ease",onExit:l,onEntered:c,onEnter:h,onExited:f,enterDelay:p,exitDelay:m}){const v=mb(),{transitionDuration:y,transitionStatus:x,transitionTimingFunction:S}=Gee({mounted:i,exitDuration:r,duration:n,timingFunction:o,onExit:l,onEntered:c,onEnter:h,onExited:f,enterDelay:p,exitDelay:m});if(v==="test")return i?a.jsx(a.Fragment,{children:s({})}):t?s({display:"none"}):null;if(y===0)return t?a.jsx(O.Activity,{mode:i?"visible":"hidden",children:s({})}):i?a.jsx(a.Fragment,{children:s({})}):null;const w=x==="exited";return t?a.jsx(O.Activity,{mode:w?"hidden":"visible",children:s(w?{}:V8({transition:e,duration:y,state:x,timingFunction:S}))}):w?null:a.jsx(a.Fragment,{children:s(V8({transition:e,duration:y,state:x,timingFunction:S}))})}ic.displayName="@mantine/core/Transition";const Xee={duration:100,transition:"fade"};function G8(t,e){return{...Xee,...e,...t}}const[Kee,$w]=Ki("Popover component was not found in the tree");function z7({childProps:t,disabled:e,opened:n,longPressDelay:r=500,setReference:i,open:s}){const o=O.useRef(!1),l=O.useRef(!1),c=O.useRef(null),h=O.useRef(e);h.current=e;const f=(y,x,S)=>{i({getBoundingClientRect:()=>({x:y,y:x,width:0,height:0,top:x,left:y,right:y,bottom:x,toJSON:()=>{}}),contextElement:S}),s()},p=cr(t.onMouseDown,y=>{e||y.button===2&&y.stopPropagation()}),m=cr(t.onContextMenu,y=>{e||y.defaultPrevented||(y.preventDefault(),!l.current&&(f(y.clientX,y.clientY,y.currentTarget),o.current&&(l.current=!0)))}),v=OK(y=>{if(h.current||l.current)return;const x=y,S=x.touches[0]??x.changedTouches[0];S&&(f(S.clientX,S.clientY,c.current),l.current=!0)},{threshold:r,events:["touch"],cancelOnMove:!0,onStart:y=>{o.current=!0,l.current=!1,c.current=y.currentTarget},onFinish:y=>{o.current=!1,l.current=!1,h.current||y.preventDefault()},onCancel:()=>{o.current=!1,l.current=!1}});return{onContextMenu:m,onMouseDown:p,onTouchStart:cr(t.onTouchStart,v.onTouchStart),onTouchEnd:cr(t.onTouchEnd,v.onTouchEnd),onTouchCancel:cr(t.onTouchCancel,v.onTouchCancel),onTouchMove:cr(t.onTouchMove,v.onTouchMove),style:e?t.style:{...t.style,WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"},"data-expanded":n?!0:void 0}}function q7(t){const{children:e,disabled:n,longPressDelay:r}=xe("PopoverContextMenu",null,t),i=bu(e);if(!i)throw new Error("Popover.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const s=$w();return O.cloneElement(i,z7({childProps:i.props,disabled:n||s.disabled,opened:s.opened,longPressDelay:r,setReference:s.reference,open:()=>{s.opened||s.onToggle()}}))}q7.displayName="@mantine/core/PopoverContextMenu";function Hw({children:t,active:e=!0,refProp:n="ref",innerRef:r}){const i=En(cK(e),r),s=bu(t);return s?O.cloneElement(s,{[n]:i}):t}function Q7(t){return a.jsx(KO,{tabIndex:-1,"data-autofocus":!0,...t})}Hw.displayName="@mantine/core/FocusTrap";Q7.displayName="@mantine/core/FocusTrapInitialFocus";Hw.InitialFocus=Q7;var U7={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const JO=Ie(t=>{var A,C,j,_;const e=xe("PopoverDropdown",null,t),{className:n,style:r,vars:i,children:s,onKeyDownCapture:o,variant:l,classNames:c,styles:h,ref:f,...p}=e,m=$w(),{dir:v}=oc(),y=m.arrowPosition==="merge"&&m.withArrow?P7({position:m.placement,dir:v}):void 0,x=DP({opened:m.opened,shouldReturnFocus:m.returnFocus}),S=m.withRoles?{"aria-labelledby":m.getTargetId(),id:m.getDropdownId(),role:"dialog",tabIndex:-1}:{},w=En(f,m.floating);return m.disabled?null:a.jsx(zh,{...m.portalProps,withinPortal:m.withinPortal,children:a.jsx(ic,{mounted:m.opened,...m.transitionProps,transition:((A=m.transitionProps)==null?void 0:A.transition)||"fade",duration:((C=m.transitionProps)==null?void 0:C.duration)??150,keepMounted:m.keepMounted,exitDuration:typeof((j=m.transitionProps)==null?void 0:j.exitDuration)=="number"?m.transitionProps.exitDuration:(_=m.transitionProps)==null?void 0:_.duration,children:k=>{var M;return a.jsx(Hw,{active:m.trapFocus&&m.opened,innerRef:w,children:a.jsxs(ve,{...S,...p,variant:l,onKeyDownCapture:ZX(()=>{var R,N;(R=m.onClose)==null||R.call(m),(N=m.onDismiss)==null||N.call(m)},{active:m.closeOnEscape,onTrigger:x,onKeyDown:o}),"data-position":m.placement,"data-fixed":m.floatingStrategy==="fixed"||void 0,...m.getStyles("dropdown",{className:n,props:e,classNames:c,styles:h,style:[{...k,...y,zIndex:m.zIndex,top:m.y??0,left:m.x??0,width:m.width==="target"?void 0:me(m.width),...m.referenceHidden?{display:"none"}:null},(M=m.resolvedStyles)==null?void 0:M.dropdown,h==null?void 0:h.dropdown,r]}),children:[s,a.jsx(vA,{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:e,classNames:c,styles:h})})]})})}})})});JO.classes=U7;JO.displayName="@mantine/core/PopoverDropdown";const Zee={refProp:"ref",popupType:"dialog"},W7=Ie(t=>{const{children:e,refProp:n,popupType:r,ref:i,...s}=xe("PopoverTarget",Zee,t),o=bu(e);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,c=$w(),h=En(c.reference,_w(o),i),f=c.withRoles?{"aria-haspopup":r,"aria-expanded":c.opened,"aria-controls":c.opened?c.getDropdownId():void 0,id:c.getTargetId()}:{},p=o.props;return O.cloneElement(o,{...l,...f,...c.targetProps,className:$r(c.targetProps.className,l.className,p.className),[n]:h,...c.controlled?null:{onClick:m=>{var v;c.onToggle(),(v=p.onClick)==null||v.call(p,m)}}})});W7.displayName="@mantine/core/PopoverTarget";function Jee(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 ete(t,e,n,r){const i=Jee(t.middlewares),s=[j7(t.offset),yee()];if(i.flip&&!n){const o=typeof i.flip=="boolean"?{}:i.flip,l=r?{fallbackStrategy:"initialPlacement",...o}:o;s.push(f3(l))}return i.shift&&s.push(WO(typeof i.shift=="boolean"?{limiter:B8(),padding:5}:{limiter:B8(),padding:5,...i.shift})),i.inline&&s.push(typeof i.inline=="boolean"?tv():tv(i.inline)),s.push(C7({element:t.arrowRef,padding:t.arrowOffset})),(i.size||t.width==="target")&&s.push(bee({...typeof i.size=="boolean"?{}:i.size,apply({rects:o,availableWidth:l,availableHeight:c,...h}){var p;const f=((p=e().refs.floating.current)==null?void 0:p.style)??{};i.size&&(typeof i.size=="object"&&i.size.apply?i.size.apply({rects:o,availableWidth:l,availableHeight:c,...h}):Object.assign(f,{maxWidth:`${l}px`,maxHeight:`${c}px`})),t.width==="target"&&Object.assign(f,{width:`${o.reference.width}px`})}})),s}function tte(t){const[e,n]=si({value:t.opened,defaultValue:t.defaultOpened,finalValue:!1,onChange:t.onChange}),r=O.useRef(e),[i,s]=O.useState(null),o=t.preventPositionChangeWhenVisible!==!1,l=O.useRef(e);e!==l.current&&(l.current=e,e&&i!==null&&s(null));const c=O.useCallback(()=>s(null),[]),h=()=>{e&&!t.disabled&&n(!1)},f=()=>{t.disabled||n(!e)},p=Fw({open:e,strategy:t.strategy,placement:o?i??t.position:t.position,middleware:ete(t,()=>p,o&&i!==null,o),whileElementsMounted:t.keepMounted?void 0:d3});O.useEffect(()=>{if(!(!p.refs.reference.current||!p.refs.floating.current)&&e)return d3(p.refs.reference.current,p.refs.floating.current,p.update)},[e,p.update]);const m=O.useRef(!1);nc(()=>{if(!e){m.current=!1;return}if(!o||i!==null)return;const y=p.refs.floating.current;if(!(!y||y.offsetHeight===0||y.offsetWidth===0)){if(!m.current){m.current=!0,p.update();return}p.isPositioned&&s(p.placement)}},[o,e,p.isPositioned,p.placement,i,p.update]);const v=O.useRef(p.placement);return nc(()=>{var y;v.current!==p.placement&&(v.current=p.placement,(y=t.onPositionChange)==null||y.call(t,p.placement))},[p.placement]),vu(()=>{var y,x;e!==r.current&&(e?(x=t.onOpen)==null||x.call(t):(y=t.onClose)==null||y.call(t)),r.current=e},[e,t.onClose,t.onOpen]),{floating:p,controlled:typeof t.opened=="boolean",opened:e,onClose:h,onToggle:f,resetLockedPlacement:c}}const nte={position:"bottom",offset:8,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,preventPositionChangeWhenVisible:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:jo("popover"),__staticSelector:"Popover",width:"max-content"},Y7=(t,{radius:e,shadow:n})=>({dropdown:{"--popover-radius":e===void 0?void 0:rr(e),"--popover-shadow":EO(n)}});function Cn(t){var Rt,Tn,fn,Zt,lt,tn,Bt;const e=xe("Popover",nte,t),{children:n,position:r,offset:i,onPositionChange:s,opened:o,transitionProps:l,onExitTransitionEnd:c,onEnterTransitionEnd:h,width:f,middlewares:p,withArrow:m,arrowSize:v,arrowOffset:y,arrowRadius:x,arrowPosition:S,unstyled:w,classNames:A,styles:C,closeOnClickOutside:j,withinPortal:_,portalProps:k,closeOnEscape:M,clickOutsideEvents:R,trapFocus:N,onClose:I,onDismiss:D,onOpen:L,onChange:z,zIndex:P,radius:H,shadow:B,id:F,defaultOpened:q,__staticSelector:X,withRoles:Y,disabled:U,returnFocus:V,variant:G,keepMounted:J,vars:ne,floatingStrategy:de,withOverlay:fe,overlayProps:ke,hideDetached:Me,attributes:Oe,preventPositionChangeWhenVisible:Ye,...ie}=e,Se=mt({name:X,props:e,classes:U7,classNames:A,styles:C,unstyled:w,attributes:Oe,rootSelector:"dropdown",vars:ne,varsResolver:Y7}),{resolvedStyles:se}=Ya({classNames:A,styles:C,props:e}),_e=O.useRef(null),[et,Te]=O.useState(null),[Xe,at]=O.useState(null),{dir:Ve}=oc(),Ge=mb(),ut=Ii(F),Ue=tte({middlewares:p,width:f,position:ZO(Ve,r),offset:typeof i=="number"?i+(m?v/2:0):i,arrowRef:_e,arrowOffset:y,onPositionChange:s,opened:o,defaultOpened:q,onChange:z,onOpen:L,onClose:I,onDismiss:D,strategy:de,disabled:U,preventPositionChangeWhenVisible:Ye,keepMounted:J});nK(()=>{j&&(Ue.onClose(),D==null||D())},R,[et,Xe]);const De=O.useCallback(Lt=>{Te(Lt),Ue.floating.refs.setReference(Lt)},[Ue.floating.refs.setReference]),Ce=O.useCallback(Lt=>{at(Lt),Ue.floating.refs.setFloating(Lt)},[Ue.floating.refs.setFloating]),ze=O.useCallback(()=>{var Lt;(Lt=l==null?void 0:l.onExited)==null||Lt.call(l),c==null||c(),Ue.resetLockedPlacement()},[l==null?void 0:l.onExited,c,Ue.resetLockedPlacement]),ht=O.useCallback(()=>{var Lt;(Lt=l==null?void 0:l.onEntered)==null||Lt.call(l),h==null||h()},[l==null?void 0:l.onEntered,h]);return a.jsxs(Kee,{value:{returnFocus:V,disabled:U,controlled:Ue.controlled,reference:De,floating:Ce,x:Ue.floating.x,y:Ue.floating.y,arrowX:(fn=(Tn=(Rt=Ue.floating)==null?void 0:Rt.middlewareData)==null?void 0:Tn.arrow)==null?void 0:fn.x,arrowY:(tn=(lt=(Zt=Ue.floating)==null?void 0:Zt.middlewareData)==null?void 0:lt.arrow)==null?void 0:tn.y,opened:Ue.opened,arrowRef:_e,transitionProps:{...l,onExited:ze,onEntered:ht},width:f,withArrow:m,arrowSize:v,arrowOffset:y,arrowRadius:x,arrowPosition:S,placement:Ue.floating.placement,trapFocus:N,withinPortal:_,portalProps:k,zIndex:P,radius:H,shadow:B,closeOnEscape:M,onDismiss:D,onClose:Ue.onClose,onToggle:Ue.onToggle,getTargetId:()=>ut,getDropdownId:()=>`${ut}-dropdown`,withRoles:Y,targetProps:ie,__staticSelector:X,classNames:A,styles:C,unstyled:w,variant:G,keepMounted:J,getStyles:Se,resolvedStyles:se,floatingStrategy:de,referenceHidden:Me&&Ge!=="test"?(Bt=Ue.floating.middlewareData.hide)==null?void 0:Bt.referenceHidden:!1},children:[n,fe&&a.jsx(ic,{transition:"fade",mounted:Ue.opened,duration:(l==null?void 0:l.duration)||250,exitDuration:(l==null?void 0:l.exitDuration)||250,children:Lt=>a.jsx(zh,{withinPortal:_,children:a.jsx(Cf,{...ke,...Se("overlay",{className:ke==null?void 0:ke.className,style:[Lt,ke==null?void 0:ke.style]})})})})]})}Cn.Target=W7;Cn.Dropdown=JO;Cn.ContextMenu=q7;Cn.varsResolver=Y7;Cn.displayName="@mantine/core/Popover";Cn.extend=t=>t;Cn.withProps=t=>{const e=n=>a.jsx(Cn,{...t,...n});return e.extend=Cn.extend,e.displayName=`WithProps(${Cn.displayName})`,e};var rl={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 V7=({className:t,...e})=>a.jsxs(ve,{component:"span",className:$r(rl.barsLoader,t),...e,children:[a.jsx("span",{className:rl.bar}),a.jsx("span",{className:rl.bar}),a.jsx("span",{className:rl.bar})]});V7.displayName="@mantine/core/Bars";const G7=({className:t,...e})=>a.jsxs(ve,{component:"span",className:$r(rl.dotsLoader,t),...e,children:[a.jsx("span",{className:rl.dot}),a.jsx("span",{className:rl.dot}),a.jsx("span",{className:rl.dot})]});G7.displayName="@mantine/core/Dots";const X7=({className:t,...e})=>a.jsx(ve,{component:"span",className:$r(rl.ovalLoader,t),...e});X7.displayName="@mantine/core/Oval";const K7={bars:V7,oval:X7,dots:G7},rte={loaders:K7,type:"oval"},Z7=(t,{size:e,color:n})=>({root:{"--loader-size":Gt(e,"loader-size"),"--loader-color":n?wr(n,t):void 0}}),So=Ie(t=>{const e=xe("Loader",rte,t),{size:n,color:r,type:i,vars:s,className:o,style:l,classNames:c,styles:h,unstyled:f,loaders:p,variant:m,children:v,attributes:y,...x}=e,S=mt({name:"Loader",props:e,classes:rl,className:o,style:l,classNames:c,styles:h,unstyled:f,attributes:y,vars:s,varsResolver:Z7});return v?a.jsx(ve,{...S("root"),...x,children:v}):a.jsx(ve,{...S("root"),component:p[i],variant:m,size:n,...x})});So.defaultLoaders=K7;So.classes=rl;So.varsResolver=Z7;So.displayName="@mantine/core/Loader";var i0={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const X8={orientation:"horizontal"},J7=(t,{borderWidth:e})=>({group:{"--ai-border-width":me(e)}}),zw=Ie(t=>{const e=xe("ActionIconGroup",X8,t),{className:n,style:r,classNames:i,styles:s,unstyled:o,orientation:l,vars:c,borderWidth:h,variant:f,mod:p,attributes:m,...v}=xe("ActionIconGroup",X8,t);return a.jsx(ve,{...mt({name:"ActionIconGroup",props:e,classes:i0,className:n,style:r,classNames:i,styles:s,unstyled:o,attributes:m,vars:c,varsResolver:J7,rootSelector:"group"})("group"),variant:f,mod:[{"data-orientation":l},p],role:"group",...v})});zw.classes=i0;zw.varsResolver=J7;zw.displayName="@mantine/core/ActionIconGroup";const eF=(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":Gt(o,"section-height"),"--section-padding-x":Gt(o,"section-padding-x"),"--section-fz":Dr(o),"--section-radius":e===void 0?void 0:rr(e),"--section-bg":n||i?l.background:void 0,"--section-color":l.color,"--section-bd":n||i?l.border:void 0}}},qw=Ie(t=>{const e=xe("ActionIconGroupSection",null,t),{className:n,style:r,classNames:i,styles:s,unstyled:o,vars:l,variant:c,gradient:h,radius:f,autoContrast:p,attributes:m,...v}=e;return a.jsx(ve,{...mt({name:"ActionIconGroupSection",props:e,classes:i0,className:n,style:r,classNames:i,styles:s,unstyled:o,attributes:m,vars:l,varsResolver:eF,rootSelector:"groupSection"})("groupSection"),variant:c,...v})});qw.classes=i0;qw.varsResolver=eF;qw.displayName="@mantine/core/ActionIconGroupSection";const tF=(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":Gt(e,"ai-size"),"--ai-radius":n===void 0?void 0:rr(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}}},Sr=Zi(t=>{const e=xe("ActionIcon",null,t),{className:n,unstyled:r,variant:i,classNames:s,styles:o,style:l,loading:c,loaderProps:h,size:f,color:p,radius:m,__staticSelector:v,gradient:y,vars:x,children:S,disabled:w,"data-disabled":A,autoContrast:C,mod:j,attributes:_,...k}=e,M=mt({name:["ActionIcon",v],props:e,className:n,style:l,classes:i0,classNames:s,styles:o,unstyled:r,attributes:_,vars:x,varsResolver:tF});return a.jsxs(Nr,{...M("root",{active:!w&&!c&&!A}),...k,unstyled:r,variant:i,size:f,disabled:w||c,mod:[{loading:c,disabled:w||A},j],children:[typeof c=="boolean"&&a.jsx(ic,{mounted:c,transition:"slide-down",duration:150,children:R=>a.jsx(ve,{component:"span",...M("loader",{style:R}),"aria-hidden":!0,children:a.jsx(So,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...h})})}),a.jsx(ve,{component:"span",mod:{loading:c},...M("icon"),children:S})]})});Sr.classes=i0;Sr.varsResolver=tF;Sr.displayName="@mantine/core/ActionIcon";Sr.Group=zw;Sr.GroupSection=qw;function nF({size:t="var(--cb-icon-size, 70%)",style:e,...n}){return a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:t,height:t},...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"})})}nF.displayName="@mantine/core/CloseIcon";var rF={root:"m_86a44da5","root--subtle":"m_220c80f2"};const ite={variant:"subtle"},iF=(t,{size:e,radius:n,iconSize:r})=>({root:{"--cb-size":Gt(e,"cb-size"),"--cb-radius":n===void 0?void 0:rr(n),"--cb-icon-size":me(r)}}),ml=Zi(t=>{const e=xe("CloseButton",ite,t),{iconSize:n,children:r,vars:i,radius:s,className:o,classNames:l,style:c,styles:h,unstyled:f,"data-disabled":p,disabled:m,variant:v,icon:y,mod:x,attributes:S,__staticSelector:w,...A}=e,C=mt({name:w||"CloseButton",props:e,className:o,style:c,classes:rF,classNames:l,styles:h,unstyled:f,attributes:S,vars:i,varsResolver:iF});return a.jsxs(Nr,{...A,unstyled:f,variant:v,disabled:m,mod:[{disabled:m||p},x],...C("root",{variant:v,active:!m&&!p}),children:[y||a.jsx(nF,{}),r]})});ml.classes=rF;ml.varsResolver=iF;ml.displayName="@mantine/core/CloseButton";function ste(t){return O.Children.toArray(t).filter(Boolean)}var sF={root:"m_4081bf90"};const ate={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},aF=(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":Gi(r),"--group-align":i,"--group-justify":s,"--group-wrap":o}}),ft=Ie(t=>{const e=xe("Group",ate,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,children:l,gap:c,align:h,justify:f,wrap:p,grow:m,preventGrowOverflow:v,vars:y,variant:x,__size:S,mod:w,attributes:A,...C}=e,j=ste(l),_=j.length,k=Gi(c??"md");return a.jsx(ve,{...mt({name:"Group",props:e,stylesCtx:{childWidth:`calc(${100/_}% - (${k} - ${k} / ${_}))`},className:r,style:i,classes:sF,classNames:n,styles:s,unstyled:o,attributes:A,vars:y,varsResolver:aF})("root"),variant:x,mod:[{grow:m},w],size:S,...C,children:j})});ft.classes=sF;ft.varsResolver=aF;ft.displayName="@mantine/core/Group";const[ote,yu]=Ki("ModalBase component was not found in tree");function lte({opened:t,transitionDuration:e}){const[n,r]=O.useState(t),i=O.useRef(-1),s=pb()?0:e;return O.useEffect(()=>(t?(r(!0),window.clearTimeout(i.current)):s===0?r(!1):i.current=window.setTimeout(()=>r(!1),s),()=>window.clearTimeout(i.current)),[t,s]),n}function cte({id:t,transitionProps:e,opened:n,trapFocus:r,closeOnEscape:i,onClose:s,returnFocus:o}){const l=Ii(t),[c,h]=O.useState(!1),[f,p]=O.useState(!1),m=lte({opened:n,transitionDuration:typeof(e==null?void 0:e.duration)=="number"?e==null?void 0:e.duration:200});return uA("keydown",v=>{var y;v.key==="Escape"&&i&&!v.isComposing&&n&&((y=v.target)==null?void 0:y.getAttribute("data-mantine-stop-propagation"))!=="true"&&s()},{capture:!0}),DP({opened:n,shouldReturnFocus:r&&o}),{_id:l,titleMounted:c,bodyMounted:f,shouldLockScroll:m,setTitleMounted:h,setBodyMounted:p}}var Hl=function(){return Hl=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},Hl.apply(this,arguments)};function oF(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 ute(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 _x="right-scroll-bar-position",Tx="width-before-scroll-bar",hte="with-scroll-bars-hidden",dte="--removed-body-scroll-bar-size";function VC(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function fte(t,e){var n=O.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 pte=typeof window<"u"?O.useLayoutEffect:O.useEffect,K8=new WeakMap;function mte(t,e){var n=fte(null,function(r){return t.forEach(function(i){return VC(i,r)})});return pte(function(){var r=K8.get(n);if(r){var i=new Set(r),s=new Set(t),o=n.current;i.forEach(function(l){s.has(l)||VC(l,null)}),s.forEach(function(l){i.has(l)||VC(l,o)})}K8.set(n,t)},[t]),n}function gte(t){return t}function vte(t,e){e===void 0&&(e=gte);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 c=function(){var f=o;o=[],f.forEach(s)},h=function(){return Promise.resolve().then(c)};h(),n={push:function(f){o.push(f),h()},filter:function(f){return o=o.filter(f),n}}}};return i}function bte(t){t===void 0&&(t={});var e=vte(null);return e.options=Hl({async:!0,ssr:!1},t),e}var lF=function(t){var e=t.sideCar,n=oF(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 O.createElement(r,Hl({},n))};lF.isSideCarExport=!0;function yte(t,e){return t.useMedium(e),lF}var cF=bte(),GC=function(){},Qw=O.forwardRef(function(t,e){var n=O.useRef(null),r=O.useState({onScrollCapture:GC,onWheelCapture:GC,onTouchMoveCapture:GC}),i=r[0],s=r[1],o=t.forwardProps,l=t.children,c=t.className,h=t.removeScrollBar,f=t.enabled,p=t.shards,m=t.sideCar,v=t.noRelative,y=t.noIsolation,x=t.inert,S=t.allowPinchZoom,w=t.as,A=w===void 0?"div":w,C=t.gapMode,j=oF(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=m,k=mte([n,e]),M=Hl(Hl({},j),i);return O.createElement(O.Fragment,null,f&&O.createElement(_,{sideCar:cF,removeScrollBar:h,shards:p,noRelative:v,noIsolation:y,inert:x,setCallbacks:s,allowPinchZoom:!!S,lockRef:n,gapMode:C}),o?O.cloneElement(O.Children.only(l),Hl(Hl({},M),{ref:k})):O.createElement(A,Hl({},M,{className:c,ref:k}),l))});Qw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qw.classNames={fullWidth:Tx,zeroRight:_x};var xte=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ate(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=xte();return e&&t.setAttribute("nonce",e),t}function wte(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Ste(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var jte=function(){var t=0,e=null;return{add:function(n){t==0&&(e=Ate())&&(wte(e,n),Ste(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Cte=function(){var t=jte();return function(e,n){O.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},uF=function(){var t=Cte(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},_te={left:0,top:0,right:0,gap:0},XC=function(t){return parseInt(t||"",10)||0},Tte=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[XC(n),XC(r),XC(i)]},kte=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return _te;var e=Tte(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])}},Ote=uF(),Wp="data-scroll-locked",Ete=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(hte,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat(Wp,`] {
    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(_x,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(Tx,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(_x," .").concat(_x,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(Tx," .").concat(Tx,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Wp,`] {
    `).concat(dte,": ").concat(l,`px;
  }
`)},Z8=function(){var t=parseInt(document.body.getAttribute(Wp)||"0",10);return isFinite(t)?t:0},Mte=function(){O.useEffect(function(){return document.body.setAttribute(Wp,(Z8()+1).toString()),function(){var t=Z8()-1;t<=0?document.body.removeAttribute(Wp):document.body.setAttribute(Wp,t.toString())}},[])},Rte=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;Mte();var s=O.useMemo(function(){return kte(i)},[i]);return O.createElement(Ote,{styles:Ete(s,!e,i,n?"":"!important")})},m3=!1;if(typeof window<"u")try{var C1=Object.defineProperty({},"passive",{get:function(){return m3=!0,!0}});window.addEventListener("test",C1,C1),window.removeEventListener("test",C1,C1)}catch{m3=!1}var xp=m3?{passive:!1}:!1,Dte=function(t){return t.tagName==="TEXTAREA"},hF=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Dte(t)&&n[e]==="visible")},Nte=function(t){return hF(t,"overflowY")},Ite=function(t){return hF(t,"overflowX")},J8=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=dF(t,r);if(i){var s=fF(t,r),o=s[1],l=s[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Lte=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Bte=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},dF=function(t,e){return t==="v"?Nte(e):Ite(e)},fF=function(t,e){return t==="v"?Lte(e):Bte(e)},Pte=function(t,e){return t==="h"&&e==="rtl"?-1:1},Fte=function(t,e,n,r,i){var s=Pte(t,window.getComputedStyle(e).direction),o=s*r,l=n.target,c=e.contains(l),h=!1,f=o>0,p=0,m=0;do{if(!l)break;var v=fF(t,l),y=v[0],x=v[1],S=v[2],w=x-S-s*y;(y||w)&&dF(t,l)&&(p+=w,m+=y);var A=l.parentNode;l=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!c&&l!==document.body||c&&(e.contains(l)||e===l));return(f&&Math.abs(p)<1||!f&&Math.abs(m)<1)&&(h=!0),h},_1=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},e5=function(t){return[t.deltaX,t.deltaY]},t5=function(t){return t&&"current"in t?t.current:t},$te=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Hte=function(t){return`
  .block-interactivity-`.concat(t,` {pointer-events: none;}
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},zte=0,Ap=[];function qte(t){var e=O.useRef([]),n=O.useRef([0,0]),r=O.useRef(),i=O.useState(zte++)[0],s=O.useState(uF)[0],o=O.useRef(t);O.useEffect(function(){o.current=t},[t]),O.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var x=ute([t.lockRef.current],(t.shards||[]).map(t5),!0).filter(Boolean);return x.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var l=O.useCallback(function(x,S){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!o.current.allowPinchZoom;var w=_1(x),A=n.current,C="deltaX"in x?x.deltaX:A[0]-w[0],j="deltaY"in x?x.deltaY:A[1]-w[1],_,k=x.target,M=Math.abs(C)>Math.abs(j)?"h":"v";if("touches"in x&&M==="h"&&k.type==="range")return!1;var R=window.getSelection(),N=R&&R.anchorNode,I=N?N===k||N.contains(k):!1;if(I)return!1;var D=J8(M,k);if(!D)return!0;if(D?_=M:(_=M==="v"?"h":"v",D=J8(M,k)),!D)return!1;if(!r.current&&"changedTouches"in x&&(C||j)&&(r.current=_),!_)return!0;var L=r.current||_;return Fte(L,S,x,L==="h"?C:j)},[]),c=O.useCallback(function(x){var S=x;if(!(!Ap.length||Ap[Ap.length-1]!==s)){var w="deltaY"in S?e5(S):_1(S),A=e.current.filter(function(_){return _.name===S.type&&(_.target===S.target||S.target===_.shadowParent)&&$te(_.delta,w)})[0];if(A&&A.should){S.cancelable&&S.preventDefault();return}if(!A){var C=(o.current.shards||[]).map(t5).filter(Boolean).filter(function(_){return _.contains(S.target)}),j=C.length>0?l(S,C[0]):!o.current.noIsolation;j&&S.cancelable&&S.preventDefault()}}},[]),h=O.useCallback(function(x,S,w,A){var C={name:x,delta:S,target:w,should:A,shadowParent:Qte(w)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(j){return j!==C})},1)},[]),f=O.useCallback(function(x){n.current=_1(x),r.current=void 0},[]),p=O.useCallback(function(x){h(x.type,e5(x),x.target,l(x,t.lockRef.current))},[]),m=O.useCallback(function(x){h(x.type,_1(x),x.target,l(x,t.lockRef.current))},[]);O.useEffect(function(){return Ap.push(s),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,xp),document.addEventListener("touchmove",c,xp),document.addEventListener("touchstart",f,xp),function(){Ap=Ap.filter(function(x){return x!==s}),document.removeEventListener("wheel",c,xp),document.removeEventListener("touchmove",c,xp),document.removeEventListener("touchstart",f,xp)}},[]);var v=t.removeScrollBar,y=t.inert;return O.createElement(O.Fragment,null,y?O.createElement(s,{styles:Hte(i)}):null,v?O.createElement(Rte,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Qte(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Ute=yte(cF,qte);var _f=O.forwardRef(function(t,e){return O.createElement(Qw,Hl({},t,{ref:e,sideCar:Ute}))});_f.classNames=Qw.classNames;function pF({keepMounted:t,opened:e,onClose:n,id:r,transitionProps:i,onExitTransitionEnd:s,onEnterTransitionEnd:o,trapFocus:l,closeOnEscape:c,returnFocus:h,closeOnClickOutside:f,withinPortal:p,portalProps:m,lockScroll:v,children:y,zIndex:x,shadow:S,padding:w,__vars:A,unstyled:C,removeScrollProps:j,..._}){const{_id:k,titleMounted:M,bodyMounted:R,shouldLockScroll:N,setTitleMounted:I,setBodyMounted:D}=cte({id:r,transitionProps:i,opened:e,trapFocus:l,closeOnEscape:c,onClose:n,returnFocus:h}),{key:L,...z}=j||{};return a.jsx(zh,{...m,withinPortal:p,children:a.jsx(ote,{value:{opened:e,onClose:n,closeOnClickOutside:f,onExitTransitionEnd:s,onEnterTransitionEnd:o,transitionProps:{...i,keepMounted:t},getTitleId:()=>`${k}-title`,getBodyId:()=>`${k}-body`,titleMounted:M,bodyMounted:R,setTitleMounted:I,setBodyMounted:D,trapFocus:l,closeOnEscape:c,zIndex:x,unstyled:C},children:a.jsx(_f,{enabled:N&&v,...z,children:a.jsx(ve,{..._,id:k,__vars:{...A,"--mb-z-index":(x||jo("modal")).toString(),"--mb-shadow":EO(S),"--mb-padding":Gi(w)},children:y})},L)})})}pF.displayName="@mantine/core/ModalBase";function Wte(){const t=yu();return O.useEffect(()=>(t.setBodyMounted(!0),()=>t.setBodyMounted(!1)),[]),t.getBodyId()}var Rm={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};function mF({className:t,...e}){const n=Wte(),r=yu();return a.jsx(ve,{id:n,className:$r({[Rm.body]:!r.unstyled},t),...e})}mF.displayName="@mantine/core/ModalBaseBody";function gF({className:t,onClick:e,...n}){const r=yu();return a.jsx(ml,{...n,onClick:i=>{r.onClose(),e==null||e(i)},className:$r({[Rm.close]:!r.unstyled},t),unstyled:r.unstyled})}gF.displayName="@mantine/core/ModalBaseCloseButton";function vF({transitionProps:t,className:e,innerProps:n,onKeyDown:r,style:i,ref:s,...o}){const l=yu();return a.jsx(ic,{mounted:l.opened,transition:"pop",...l.transitionProps,onExited:()=>{var c,h,f;(c=l.onExitTransitionEnd)==null||c.call(l),(f=(h=l.transitionProps)==null?void 0:h.onExited)==null||f.call(h)},onEntered:()=>{var c,h,f;(c=l.onEnterTransitionEnd)==null||c.call(l),(f=(h=l.transitionProps)==null?void 0:h.onEntered)==null||f.call(h)},...t,children:c=>a.jsx("div",{...n,className:$r({[Rm.inner]:!l.unstyled},n.className),children:a.jsx(Hw,{active:l.opened&&l.trapFocus,innerRef:s,children:a.jsx(bb,{...o,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,c],className:$r({[Rm.content]:!l.unstyled},e),unstyled:l.unstyled,children:o.children})})})})}vF.displayName="@mantine/core/ModalBaseContent";function bF({className:t,...e}){const n=yu();return a.jsx(ve,{component:"header",className:$r({[Rm.header]:!n.unstyled},t),...e})}bF.displayName="@mantine/core/ModalBaseHeader";const Yte={duration:200,timingFunction:"ease",transition:"fade"};function Vte(t){const e=yu();return{...Yte,...e.transitionProps,...t}}function yF({onClick:t,transitionProps:e,style:n,visible:r,...i}){const s=yu(),o=Vte(e);return a.jsx(ic,{mounted:r!==void 0?r:s.opened,...o,transition:"fade",children:l=>a.jsx(Cf,{fixed:!0,style:[n,l],zIndex:s.zIndex,unstyled:s.unstyled,onClick:c=>{t==null||t(c),s.closeOnClickOutside&&s.onClose()},...i})})}yF.displayName="@mantine/core/ModalBaseOverlay";function Gte(){const t=yu();return O.useEffect(()=>(t.setTitleMounted(!0),()=>t.setTitleMounted(!1)),[]),t.getTitleId()}function xF({className:t,...e}){const n=Gte(),r=yu();return a.jsx(ve,{component:"h2",className:$r({[Rm.title]:!r.unstyled},t),id:n,...e})}xF.displayName="@mantine/core/ModalBaseTitle";function Xte({children:t}){return a.jsx(a.Fragment,{children:t})}const AF=O.createContext({size:"sm"}),wF=Ie(t=>{const e=xe("InputClearButton",null,t),{size:n,variant:r,vars:i,classNames:s,styles:o,...l}=e,c=O.use(AF),{resolvedClassNames:h,resolvedStyles:f}=Ya({classNames:s,styles:o,props:e});return a.jsx(ml,{variant:r||"transparent",size:n||(c==null?void 0:c.size)||"sm",classNames:h,styles:f,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...l.style},...l})});wF.displayName="@mantine/core/InputClearButton";const Kte={xs:7,sm:8,md:10,lg:12,xl:15};function Zte({__clearable:t,__clearSection:e,rightSection:n,__defaultRightSection:r,size:i="sm",__clearSectionMode:s="both"}){const o=t&&e;return s==="rightSection"?n===null?null:n||r:s==="clear"?n===null?null:o||r:o&&(n||r)?a.jsxs("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:Kte[i]},children:[o,n||r]}):n===null?null:n||o||r}const If=O.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var To={wrapper:"m_6c018570",input:"m_8fb7ebe7",bottomSection:"m_93f4ed57",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const SF=(t,{size:e})=>({description:{"--input-description-size":e===void 0?void 0:`calc(${Dr(e)} - ${me(2)})`}}),yb=Ie(t=>{const e=xe("InputDescription",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,__staticSelector:c,__inheritStyles:h=!0,attributes:f,...p}=xe("InputDescription",null,e),m=O.use(If),v=mt({name:["InputWrapper",c],props:e,classes:To,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:f,rootSelector:"description",vars:l,varsResolver:SF});return a.jsx(ve,{component:"p",...(h&&(m==null?void 0:m.getStyles)||v)("description",m!=null&&m.getStyles?{className:r,style:i}:void 0),...p})});yb.classes=To;yb.varsResolver=SF;yb.displayName="@mantine/core/InputDescription";const jF=(t,{size:e})=>({error:{"--input-error-size":e===void 0?void 0:`calc(${Dr(e)} - ${me(2)})`}}),xb=Ie(t=>{const e=xe("InputError",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,attributes:c,__staticSelector:h,__inheritStyles:f=!0,...p}=e,m=mt({name:["InputWrapper",h],props:e,classes:To,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:c,rootSelector:"error",vars:l,varsResolver:jF}),v=O.use(If);return a.jsx(ve,{component:"p",...(f&&(v==null?void 0:v.getStyles)||m)("error",v!=null&&v.getStyles?{className:r,style:i}:void 0),...p})});xb.classes=To;xb.varsResolver=jF;xb.displayName="@mantine/core/InputError";const Jte={labelElement:"label"},CF=(t,{size:e})=>({label:{"--input-label-size":Dr(e),"--input-asterisk-color":void 0}}),Ab=Ie(t=>{const e=xe("InputLabel",Jte,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,labelElement:c,required:h,htmlFor:f,onMouseDown:p,children:m,__staticSelector:v,mod:y,attributes:x,...S}=e,w=mt({name:["InputWrapper",v],props:e,classes:To,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:x,rootSelector:"label",vars:l,varsResolver:CF}),A=O.use(If),C=(A==null?void 0:A.getStyles)||w;return a.jsxs(ve,{...C("label",A!=null&&A.getStyles?{className:r,style:i}:void 0),component:c,htmlFor:c==="label"?f:void 0,mod:[{required:h},y],onMouseDown:j=>{p==null||p(j),!j.defaultPrevented&&j.detail>1&&j.preventDefault()},...S,children:[m,h&&a.jsx("span",{...C("required"),"aria-hidden":!0,children:" *"})]})});Ab.classes=To;Ab.varsResolver=CF;Ab.displayName="@mantine/core/InputLabel";const eE=Ie(t=>{const e=xe("InputPlaceholder",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,__staticSelector:c,error:h,mod:f,attributes:p,...m}=e;return a.jsx(ve,{...mt({name:["InputPlaceholder",c],props:e,classes:To,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:p,rootSelector:"placeholder"})("placeholder"),mod:[{error:!!h},f],component:"span",...m})});eE.classes=To;eE.displayName="@mantine/core/InputPlaceholder";function ene(t,{hasDescription:e,hasError:n}){const r=t.findIndex(l=>l==="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 tne={labelElement:"label",inputContainer:t=>t,inputWrapperOrder:["label","description","input","error"]},_F=(t,{size:e})=>({label:{"--input-label-size":Dr(e),"--input-asterisk-color":void 0},error:{"--input-error-size":e===void 0?void 0:`calc(${Dr(e)} - ${me(2)})`},description:{"--input-description-size":e===void 0?void 0:`calc(${Dr(e)} - ${me(2)})`}}),Uw=Ie(t=>{const e=xe("InputWrapper",tne,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,size:c,variant:h,__staticSelector:f,inputContainer:p,inputWrapperOrder:m,label:v,error:y,description:x,labelProps:S,descriptionProps:w,errorProps:A,labelElement:C,children:j,withAsterisk:_,id:k,required:M,__stylesApiProps:R,mod:N,attributes:I,...D}=e,L=mt({name:["InputWrapper",f],props:R||e,classes:To,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:I,vars:l,varsResolver:_F}),z={size:c,variant:h,__staticSelector:f},P=Ii(k),H=typeof _=="boolean"?_:M,B=(A==null?void 0:A.id)||`${P}-error`,F=(w==null?void 0:w.id)||`${P}-description`,q=P,X=!!y&&typeof y!="boolean",Y=!!x,U=`${X?B:""} ${Y?F:""}`,V=U.trim().length>0?U.trim():void 0,G=(S==null?void 0:S.id)||`${P}-label`,J=v&&a.jsx(Ab,{labelElement:C,id:G,htmlFor:q,required:H,...z,...S,children:v},"label"),ne=Y&&a.jsx(yb,{...w,...z,size:(w==null?void 0:w.size)||z.size,id:(w==null?void 0:w.id)||F,children:x},"description"),de=a.jsx(O.Fragment,{children:p(j)},"input"),fe=X&&O.createElement(xb,{...A,...z,size:(A==null?void 0:A.size)||z.size,key:"error",id:(A==null?void 0:A.id)||B},y),ke=m.map(Me=>{switch(Me){case"label":return J;case"input":return de;case"description":return ne;case"error":return fe;default:return null}});return a.jsx(If,{value:{getStyles:L,describedBy:V,inputId:q,labelId:G,...ene(m,{hasDescription:Y,hasError:X})},children:a.jsx(ve,{variant:h,size:c,mod:[{error:!!y},N],id:C==="label"?void 0:k,...L("root"),...D,children:ke})})});Uw.classes=To;Uw.varsResolver=_F;Uw.displayName="@mantine/core/InputWrapper";const nne={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm",loading:!1,loadingPosition:"right"},TF=(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":Gt(e.size,"input-height"),"--input-fz":Dr(e.size),"--input-radius":e.radius===void 0?void 0:rr(e.radius),"--input-left-section-width":e.leftSectionWidth!==void 0?me(e.leftSectionWidth):void 0,"--input-right-section-width":e.rightSectionWidth!==void 0?me(e.rightSectionWidth):void 0,"--input-padding-y":e.multiline?Gt(e.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":e.leftSectionPointerEvents,"--input-right-section-pointer-events":e.rightSectionPointerEvents}}),Ar=Zi(t=>{const e=xe("Input",nne,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,required:l,__staticSelector:c,__stylesApiProps:h,size:f,wrapperProps:p,error:m,disabled:v,leftSection:y,leftSectionProps:x,leftSectionWidth:S,rightSection:w,rightSectionProps:A,rightSectionWidth:C,rightSectionPointerEvents:j,leftSectionPointerEvents:_,variant:k,vars:M,pointer:R,multiline:N,radius:I,id:D,withAria:L,withErrorStyles:z,mod:P,inputSize:H,attributes:B,__clearSection:F,__clearable:q,__clearSectionMode:X,__defaultRightSection:Y,loading:U,loadingPosition:V,__bottomSection:G,__bottomSectionProps:J,rootRef:ne,dir:de,...fe}=e,{styleProps:ke,rest:Me}=gb(fe),Oe=O.use(If),Ye={offsetBottom:Oe==null?void 0:Oe.offsetBottom,offsetTop:Oe==null?void 0:Oe.offsetTop},ie=mt({name:["Input",c],props:h||e,classes:To,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:B,stylesCtx:Ye,rootSelector:"wrapper",vars:M,varsResolver:TF}),Se=L?{required:l,disabled:v,"aria-invalid":m?!0:void 0,"aria-describedby":Oe==null?void 0:Oe.describedBy,id:(Oe==null?void 0:Oe.inputId)||D}:{},se=U?a.jsx(So,{size:V==="left"?"calc(var(--input-left-section-size) / 2)":"calc(var(--input-right-section-size) / 2)"}):null,_e=U&&V==="left"?se:y,et=Zte({__clearable:q,__clearSection:F,rightSection:U&&V==="right"?se:w,__defaultRightSection:Y,size:f,__clearSectionMode:X});return a.jsx(AF,{value:{size:f||"sm"},children:a.jsxs(ve,{ref:ne,dir:de,...ie("wrapper"),...ke,...p,mod:[{error:!!m&&z,pointer:R,disabled:v,multiline:N,"data-with-right-section":!!et,"data-with-left-section":!!_e,"data-with-bottom-section":!!G},P],variant:k,size:f,children:[_e&&a.jsx("div",{...x,"data-position":"left",...ie("section",{className:x==null?void 0:x.className,style:x==null?void 0:x.style}),children:_e}),a.jsx(ve,{component:"input",...Me,...Se,required:l,mod:{disabled:v,error:!!m&&z},variant:k,__size:H,...ie("input")}),G&&a.jsx("div",{...J,...ie("bottomSection",{className:J==null?void 0:J.className,style:J==null?void 0:J.style}),children:G}),et&&a.jsx("div",{...A,"data-position":"right",...ie("section",{className:A==null?void 0:A.className,style:A==null?void 0:A.style}),children:et})]})})});Ar.classes=To;Ar.varsResolver=TF;Ar.Wrapper=Uw;Ar.Label=Ab;Ar.Error=xb;Ar.Description=yb;Ar.Placeholder=eE;Ar.ClearButton=wF;Ar.displayName="@mantine/core/Input";function kF(t,e,n){const r=xe(["Input","InputWrapper",t],e,n),{label:i,description:s,error:o,required:l,classNames:c,styles:h,className:f,unstyled:p,__staticSelector:m,__stylesApiProps:v,errorProps:y,labelProps:x,descriptionProps:S,wrapperProps:w,id:A,size:C,style:j,inputContainer:_,inputWrapperOrder:k,withAsterisk:M,variant:R,vars:N,mod:I,attributes:D,...L}=r,{styleProps:z,rest:P}=gb(L),H={label:i,description:s,error:o,required:l,classNames:c,className:f,__staticSelector:m,__stylesApiProps:v||r,errorProps:y,labelProps:x,descriptionProps:S,unstyled:p,styles:h,size:C,style:j,inputContainer:_,inputWrapperOrder:k,withAsterisk:M,variant:R,id:A,mod:I,attributes:D,...w};return{...P,classNames:c,styles:h,unstyled:p,wrapperProps:{...H,...z},inputProps:{required:l,classNames:c,styles:h,unstyled:p,size:C,__staticSelector:m,__stylesApiProps:v||r,error:o,variant:R,id:A,attributes:D}}}const rne={__staticSelector:"InputBase",withAria:!0,size:"sm"},Ds=Zi(t=>{const{inputProps:e,wrapperProps:n,...r}=kF("InputBase",rne,t);return a.jsx(Ar.Wrapper,{...n,children:a.jsx(Ar,{...e,...r})})});Ds.classes={...Ar.classes,...Ar.Wrapper.classes};Ds.displayName="@mantine/core/InputBase";function ine(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 sne({target:t,parent:e,ref:n,displayAfterTransitionEnd:r,onTransitionStart:i,onTransitionEnd:s}){const o=O.useRef(-1),l=O.useRef(t),[c,h]=O.useState(!1),[f,p]=O.useState(typeof r=="boolean"?r:!1),m=()=>{if(!t||!e||!n.current)return;const S=t.getBoundingClientRect(),w=e.getBoundingClientRect(),A=window.getComputedStyle(t),C=window.getComputedStyle(e),j=Eh(A.borderTopWidth)+Eh(C.borderTopWidth),_=Eh(A.borderLeftWidth)+Eh(C.borderLeftWidth),k={top:S.top-w.top-j,left:S.left-w.left-_,width:S.width,height:S.height};n.current.style.transform=`translateY(${k.top}px) translateX(${k.left}px)`,n.current.style.width=`${k.width}px`,n.current.style.height=`${k.height}px`},v=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration="0ms"),m(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},y=O.useRef(null),x=O.useRef(null);return O.useEffect(()=>{if(c&&l.current!==t&&i&&i(),l.current=t,m(),t)return y.current=new ResizeObserver(v),y.current.observe(t),e&&(x.current=new ResizeObserver(v),x.current.observe(e)),()=>{var S,w;(S=y.current)==null||S.disconnect(),(w=x.current)==null||w.disconnect()}},[e,t]),O.useEffect(()=>{if(e){const S=w=>{ine(w.target,e)&&(v(),p(!1))};return e.addEventListener("transitionend",S),()=>{e.removeEventListener("transitionend",S)}}},[e]),O.useEffect(()=>{if(n.current&&s){const S=w=>{w.propertyName==="transform"&&s()};return n.current.addEventListener("transitionend",S),()=>{var w;(w=n.current)==null||w.removeEventListener("transitionend",S)}}},[s]),SK(()=>{BP()!=="test"&&h(!0)},20,{autoInvoke:!0}),CK(S=>{S.forEach(w=>{w.type==="attributes"&&w.attributeName==="dir"&&v()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:c,hidden:f}}var OF={root:"m_96b553a6"};const EF=(t,{transitionDuration:e},{shouldReduceMotion:n})=>({root:{"--transition-duration":t.respectReducedMotion&&n?"0ms":typeof e=="number"?`${e}ms`:e||"150ms"}}),Ww=Ie(t=>{const e=xe("FloatingIndicator",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,target:c,parent:h,transitionDuration:f,mod:p,displayAfterTransitionEnd:m,onTransitionStart:v,onTransitionEnd:y,attributes:x,ref:S,...w}=e,A=mt({name:"FloatingIndicator",classes:OF,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:x,vars:l,varsResolver:EF,stylesCtx:{shouldReduceMotion:pb()}}),C=O.useRef(null),{initialized:j,hidden:_}=sne({target:c,parent:h,ref:C,displayAfterTransitionEnd:m,onTransitionStart:v,onTransitionEnd:y}),k=En(S,C);return!c||!h?null:a.jsx(ve,{ref:k,mod:[{initialized:j,hidden:_},p],...A("root"),...w})});Ww.displayName="@mantine/core/FloatingIndicator";Ww.classes=OF;Ww.varsResolver=EF;const[ane,tE]=Ki("Accordion component was not found in the tree");function Dm({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:me(e),height:me(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"})})}Dm.displayName="@mantine/core/AccordionChevron";const[one,MF]=Ki("Accordion.Item component was not found in the tree");var wb={root:"m_9bdbb667",panel:"m_df78851f",content:"m_4ba554d4",itemTitle:"m_8fa820a0",control:"m_4ba585b8","control--default":"m_6939a5e9","control--contained":"m_4271d21b",label:"m_df3ffa0f",chevron:"m_3f35ae96",icon:"m_9bd771fe",item:"m_9bd7b098","item--default":"m_fe19b709","item--contained":"m_1f921b3b","item--filled":"m_2cdf939a","item--separated":"m_9f59b069"};const nE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,chevron:o,icon:l,onClick:c,onKeyDown:h,children:f,disabled:p,mod:m,...v}=xe("AccordionControl",null,t),{value:y}=MF(),x=tE(),S=x.isItemActive(y),w=typeof x.order=="number",A=`h${x.order}`,C=a.jsxs(Nr,{...x.getStyles("control",{className:n,classNames:e,style:r,styles:i,variant:x.variant}),unstyled:x.unstyled,mod:["accordion-control",{active:S,"chevron-position":x.chevronPosition,disabled:p},m],onClick:j=>{c==null||c(j),x.onChange(y)},type:"button",disabled:p,"aria-expanded":S,"aria-controls":x.getRegionId(y),id:x.getControlId(y),onKeyDown:hb({siblingSelector:"[data-accordion-control]",parentSelector:"[data-accordion]",activateOnFocus:!1,loop:x.loop,orientation:"vertical",onKeyDown:h}),...v,children:[a.jsx(ve,{component:"span",mod:{rotate:!x.disableChevronRotation&&S,position:x.chevronPosition},...x.getStyles("chevron",{classNames:e,styles:i}),children:o||x.chevron}),a.jsx("span",{...x.getStyles("label",{classNames:e,styles:i}),children:f}),l&&a.jsx(ve,{component:"span",mod:{"chevron-position":x.chevronPosition},...x.getStyles("icon",{classNames:e,styles:i}),children:l})]});return w?a.jsx(A,{...x.getStyles("itemTitle",{classNames:e,styles:i}),children:C}):C});nE.displayName="@mantine/core/AccordionControl";nE.classes=wb;const rE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,value:o,mod:l,...c}=xe("AccordionItem",null,t),h=tE();return a.jsx(one,{value:{value:o},children:a.jsx(ve,{mod:[{active:h.isItemActive(o)},l],...h.getStyles("item",{className:n,classNames:e,styles:i,style:r,variant:h.variant}),...c})})});rE.displayName="@mantine/core/AccordionItem";rE.classes=wb;const iE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,children:o,keepMounted:l,...c}=xe("AccordionPanel",null,t),{value:h}=MF(),f=tE();return a.jsx(Mw,{...f.getStyles("panel",{className:n,classNames:e,style:r,styles:i}),expanded:f.isItemActive(h),transitionDuration:f.transitionDuration??200,role:"region",id:f.getRegionId(h),"aria-labelledby":f.getControlId(h),keepMounted:l??f.keepMounted,...c,children:a.jsx("div",{...f.getStyles("content",{classNames:e,styles:i}),children:o})})});iE.displayName="@mantine/core/AccordionPanel";iE.classes=wb;const lne={multiple:!1,disableChevronRotation:!1,chevronPosition:"right",variant:"default",chevronSize:"auto",chevronIconSize:16},RF=(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:me(n),"--accordion-radius":r===void 0?void 0:rr(r)}}),Ur=sd(t=>{const e=xe("Accordion",lne,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,children:c,multiple:h,value:f,defaultValue:p,onChange:m,id:v,loop:y,transitionDuration:x,disableChevronRotation:S,chevronPosition:w,chevronSize:A,order:C,chevron:j,variant:_,radius:k,chevronIconSize:M,attributes:R,keepMounted:N,...I}=e,D=Ii(v),[L,z]=si({value:f,defaultValue:p,finalValue:h?[]:null,onChange:m}),P=F=>Array.isArray(L)?L.includes(F):F===L,H=F=>{z(Array.isArray(L)?L.includes(F)?L.filter(q=>q!==F):[...L,F]:F===L?null:F)},B=mt({name:"Accordion",classes:wb,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:R,vars:l,varsResolver:RF});return a.jsx(ane,{value:{isItemActive:P,onChange:H,getControlId:oA(`${D}-control`,"Accordion.Item component was rendered with invalid value or without value"),getRegionId:oA(`${D}-panel`,"Accordion.Item component was rendered with invalid value or without value"),chevron:j===null?null:j||a.jsx(Dm,{size:M}),transitionDuration:x,disableChevronRotation:S,chevronPosition:w,order:C,loop:y,getStyles:B,variant:_,unstyled:o,keepMounted:N},children:a.jsx(ve,{...B("root"),id:D,...I,variant:_,"data-accordion":!0,children:c})})});Ur.classes=wb;Ur.varsResolver=RF;Ur.displayName="@mantine/core/Accordion";Ur.Item=rE;Ur.Panel=iE;Ur.Control=nE;Ur.Chevron=Dm;var DF={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 NF=(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:rr(e),"--alert-bg":n||r?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||r?s.border:void 0}}},Nt=Ie(t=>{const e=xe("Alert",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,radius:c,color:h,title:f,children:p,id:m,icon:v,withCloseButton:y,onClose:x,closeButtonLabel:S,variant:w,autoContrast:A,role:C,attributes:j,..._}=e,k=mt({name:"Alert",classes:DF,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:j,vars:l,varsResolver:NF}),M=Ii(m),R=f&&`${M}-title`||void 0,N=`${M}-body`;return a.jsx(ve,{id:M,...k("root",{variant:w}),variant:w,..._,role:C||"alert","aria-describedby":p?N:void 0,"aria-labelledby":f?R:void 0,children:a.jsxs("div",{...k("wrapper"),children:[v&&a.jsx("div",{...k("icon"),children:v}),a.jsxs("div",{...k("body"),children:[f&&a.jsx("div",{...k("title"),"data-with-close-button":y||void 0,children:a.jsx("span",{id:R,...k("label"),children:f})}),p&&a.jsx("div",{id:N,...k("message"),"data-variant":w,children:p})]}),y&&a.jsx(ml,{...k("closeButton"),onClick:x,variant:"transparent",size:16,iconSize:16,"aria-label":S,unstyled:o})]})})});Nt.classes=DF;Nt.varsResolver=NF;Nt.displayName="@mantine/core/Alert";var IF={root:"m_b6d8b162"};function cne(t){if(t==="start")return"start";if(t==="end"||t)return"end"}const une={inherit:!1},LF=(t,{variant:e,lineClamp:n,gradient:r,size:i,textWrap:s})=>({root:{"--text-fz":Dr(i),"--text-lh":OP(i),"--text-gradient":e==="gradient"?i3(r,t):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-text-wrap":s}}),pt=Zi(t=>{const e=xe("Text",une,t),{lineClamp:n,truncate:r,inline:i,inherit:s,gradient:o,span:l,textWrap:c,__staticSelector:h,vars:f,className:p,style:m,classNames:v,styles:y,unstyled:x,variant:S,mod:w,size:A,attributes:C,...j}=e;return a.jsx(ve,{...mt({name:["Text",h],props:e,classes:IF,className:p,style:m,classNames:v,styles:y,unstyled:x,attributes:C,vars:f,varsResolver:LF})("root",{focusable:!0}),component:l?"span":"p",variant:S,mod:[{"data-truncate":cne(r),"data-line-clamp":typeof n=="number","data-inline":i,"data-inherit":s},w],size:A,...j})});pt.classes=IF;pt.varsResolver=LF;pt.displayName="@mantine/core/Text";var BF={root:"m_849cf0da"};const hne={underline:"hover"},Wr=Zi(t=>{const{underline:e,className:n,unstyled:r,mod:i,...s}=xe("Anchor",hne,t);return a.jsx(pt,{component:"a",className:$r({[BF.root]:!r},n),...s,mod:[{underline:e},i],__staticSelector:"Anchor",unstyled:r})});Wr.classes=BF;Wr.displayName="@mantine/core/Anchor";const[dne,s0]=Ki("AppShell was not found in tree");var ad={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const sE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,unstyled:s,vars:o,withBorder:l,zIndex:c,mod:h,...f}=xe("AppShellAside",null,t),p=s0();return p.disabled?null:a.jsx(ve,{component:"aside",mod:[{"with-border":l??p.withBorder},h],...p.getStyles("aside",{className:$r({[_f.classNames.zeroRight]:p.offsetScrollbars},n),classNames:e,styles:i,style:r}),...f,__vars:{"--app-shell-aside-z-index":`calc(${c??p.zIndex} + 1)`}})});sE.classes=ad;sE.displayName="@mantine/core/AppShellAside";const aE=Ie(t=>{var m;const{classNames:e,className:n,style:r,styles:i,unstyled:s,vars:o,withBorder:l,zIndex:c,mod:h,...f}=xe("AppShellFooter",null,t),p=s0();return p.disabled?null:a.jsx(ve,{component:"footer",mod:[{"with-border":l??p.withBorder},h],...p.getStyles("footer",{className:$r({[_f.classNames.zeroRight]:p.offsetScrollbars},n),classNames:e,styles:i,style:r}),...f,__vars:{"--app-shell-footer-z-index":(m=c??p.zIndex)==null?void 0:m.toString()}})});aE.classes=ad;aE.displayName="@mantine/core/AppShellFooter";const oE=Ie(t=>{var m;const{classNames:e,className:n,style:r,styles:i,unstyled:s,vars:o,withBorder:l,zIndex:c,mod:h,...f}=xe("AppShellHeader",null,t),p=s0();return p.disabled?null:a.jsx(ve,{component:"header",mod:[{"with-border":l??p.withBorder},h],...p.getStyles("header",{className:$r({[_f.classNames.zeroRight]:p.offsetScrollbars},n),classNames:e,styles:i,style:r}),...f,__vars:{"--app-shell-header-z-index":(m=c??p.zIndex)==null?void 0:m.toString()}})});oE.classes=ad;oE.displayName="@mantine/core/AppShellHeader";const lE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("AppShellMain",null,t);return a.jsx(ve,{component:"main",...s0().getStyles("main",{className:n,style:r,classNames:e,styles:i}),...o})});lE.classes=ad;lE.displayName="@mantine/core/AppShellMain";const cE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,unstyled:s,vars:o,withBorder:l,zIndex:c,mod:h,...f}=xe("AppShellNavbar",null,t),p=s0();return p.disabled?null:a.jsx(ve,{component:"nav",mod:[{"with-border":l??p.withBorder},h],...p.getStyles("navbar",{className:n,classNames:e,styles:i,style:r}),...f,__vars:{"--app-shell-navbar-z-index":`calc(${c??p.zIndex} + 1)`}})});cE.classes=ad;cE.displayName="@mantine/core/AppShellNavbar";const uE=Zi(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,grow:o,mod:l,...c}=xe("AppShellSection",null,t),h=s0();return a.jsx(ve,{mod:[{grow:o},l],...h.getStyles("section",{className:n,style:r,classNames:e,styles:i}),...c})});uE.classes=ad;uE.displayName="@mantine/core/AppShellSection";function Sb(t){return typeof t=="object"?t.base:t}function jb(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 Cb(t){return!(typeof t!="object"||t===null||Object.keys(t).length===1&&"base"in t)}function fne({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))",c="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")),jb(o)){const m=me(Sb(o));t["--app-shell-aside-width"]=m,t["--app-shell-aside-offset"]=m}if(Cb(o)&&(typeof o.base<"u"&&(t["--app-shell-aside-width"]=me(o.base),t["--app-shell-aside-offset"]=me(o.base)),ri(o).forEach(m=>{m!=="base"&&(e[m]=e[m]||{},e[m]["--app-shell-aside-width"]=me(o[m]),e[m]["--app-shell-aside-offset"]=me(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"]=c,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=MO(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"]=c,n[m]["--app-shell-aside-scroll-locked-visibility"]="hidden"}}function pne({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"),jb(i)){const l=me(Sb(i));t["--app-shell-footer-height"]=l,o&&(t["--app-shell-footer-offset"]=l)}Cb(i)&&(typeof i.base<"u"&&(t["--app-shell-footer-height"]=me(i.base),o&&(t["--app-shell-footer-offset"]=me(i.base))),ri(i).forEach(l=>{l!=="base"&&(e[l]=e[l]||{},e[l]["--app-shell-footer-height"]=me(i[l]),o&&(e[l]["--app-shell-footer-offset"]=me(i[l])))})),n!=null&&n.collapsed&&(t["--app-shell-footer-transform"]=s,r==="fixed"&&(t["--app-shell-footer-offset"]="0px !important"))}function mne({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"),jb(i)){const l=me(Sb(i));t["--app-shell-header-height"]=l,o&&(t["--app-shell-header-offset"]=l)}Cb(i)&&(typeof i.base<"u"&&(t["--app-shell-header-height"]=me(i.base),o&&(t["--app-shell-header-offset"]=me(i.base))),ri(i).forEach(l=>{l!=="base"&&(e[l]=e[l]||{},e[l]["--app-shell-header-height"]=me(i[l]),o&&(e[l]["--app-shell-header-offset"]=me(i[l])))})),n!=null&&n.collapsed&&(t["--app-shell-header-transform"]=s,r==="fixed"&&(t["--app-shell-header-offset"]="0px !important"))}function gne({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))",c="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")),jb(o)){const m=me(Sb(o));t["--app-shell-navbar-width"]=m,t["--app-shell-navbar-offset"]=m,s==="static"&&(t["--app-shell-navbar-grid-width"]=m)}if(Cb(o)&&(typeof o.base<"u"&&(t["--app-shell-navbar-width"]=me(o.base),t["--app-shell-navbar-offset"]=me(o.base),s==="static"&&(t["--app-shell-navbar-grid-width"]=me(o.base))),ri(o).forEach(m=>{m!=="base"&&(e[m]=e[m]||{},e[m]["--app-shell-navbar-width"]=me(o[m]),e[m]["--app-shell-navbar-offset"]=me(o[m]),s==="static"&&(e[m]["--app-shell-navbar-grid-width"]=me(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"]=c,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=MO(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"]=c}}function KC(t){return Number(t)===0?"0px":Gi(t)}function vne({padding:t,baseStyles:e,minMediaStyles:n}){jb(t)&&(e["--app-shell-padding"]=KC(Sb(t))),Cb(t)&&(t.base&&(e["--app-shell-padding"]=KC(t.base)),ri(t).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=KC(t[r]))}))}function bne({navbar:t,header:e,footer:n,aside:r,padding:i,theme:s,mode:o}){const l={},c={},h={};o==="static"&&(h["--app-shell-main-grid-column"]="1 / -1",h["--app-shell-main-grid-row"]="2"),gne({baseStyles:h,minMediaStyles:l,maxMediaStyles:c,navbar:t,theme:s,mode:o}),fne({baseStyles:h,minMediaStyles:l,maxMediaStyles:c,aside:r,theme:s,mode:o}),mne({baseStyles:h,minMediaStyles:l,header:e,mode:o}),pne({baseStyles:h,minMediaStyles:l,footer:n,mode:o}),vne({baseStyles:h,minMediaStyles:l,padding:i});const f=t3(ri(l),s.breakpoints).map(m=>({query:`(min-width: ${Rs(m.px)})`,styles:l[m.value]})),p=t3(ri(c),s.breakpoints).map(m=>({query:`(max-width: ${Rs(m.px)})`,styles:c[m.value]}));return{baseStyles:h,media:[...f,...p]}}function yne({navbar:t,header:e,aside:n,footer:r,padding:i,mode:s,selector:o}){const l=pi(),c=ac(),{media:h,baseStyles:f}=bne({navbar:t,header:e,footer:r,aside:n,padding:i,theme:l,mode:s});return a.jsx(Ew,{media:h,styles:f,selector:o||c.cssVariablesSelector})}function xne({transitionDuration:t,disabled:e}){const[n,r]=O.useState(!0),i=O.useRef(-1),s=O.useRef(-1);return uA("resize",()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>O.startTransition(()=>{r(!1)}),200)}),nc(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>O.startTransition(()=>{r(!1)}),t||0)},[e,t]),n}const Ane={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:jo("app"),mode:"fixed"},PF=(t,{transitionDuration:e,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${e}ms`,"--app-shell-transition-timing-function":n}}),Ha=Ie(t=>{const e=xe("AppShell",Ane,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,navbar:c,withBorder:h,padding:f,transitionDuration:p,transitionTimingFunction:m,header:v,zIndex:y,layout:x,disabled:S,aside:w,footer:A,offsetScrollbars:C=!0,mode:j,mod:_,attributes:k,id:M,...R}=e,N=mt({name:"AppShell",classes:ad,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:k,vars:l,varsResolver:PF}),I=xne({disabled:S,transitionDuration:p}),D=Ii(M);return a.jsxs(dne,{value:{getStyles:N,withBorder:h,zIndex:y,disabled:S,offsetScrollbars:C,mode:j},children:[a.jsx(yne,{navbar:c,header:v,aside:w,footer:A,padding:f,mode:j,selector:j==="static"?`#${D}`:void 0}),a.jsx(ve,{...N("root"),id:D,mod:[{resizing:I,layout:x,disabled:S,mode:j},_],...R})]})});Ha.classes=ad;Ha.varsResolver=PF;Ha.displayName="@mantine/core/AppShell";Ha.Navbar=cE;Ha.Header=oE;Ha.Main=lE;Ha.Aside=sE;Ha.Footer=aE;Ha.Section=uE;function FF(t){return typeof t=="string"?{value:t,label:t}:typeof t=="object"&&"value"in t&&!("label"in t)?{value:t.value,label:`${t.value}`,disabled:t.disabled}:typeof t=="object"&&"group"in t?{group:t.group,items:t.items.map(e=>FF(e))}:typeof t=="number"||typeof t=="bigint"||typeof t=="boolean"?{value:t,label:`${t}`}:t}function $F(t){return t?t.map(e=>FF(e)):[]}function hE(t){return t.reduce((e,n)=>"group"in n?{...e,...hE(n.items)}:(e[`${n.value}`]=n,e),{})}var Ws={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 wne={error:null},HF=(t,{size:e,color:n})=>({chevron:{"--combobox-chevron-size":Gt(e,"combobox-chevron-size"),"--combobox-chevron-color":n?wr(n,t):void 0}}),_b=Ie(t=>{const e=xe("ComboboxChevron",wne,t),{size:n,error:r,style:i,className:s,classNames:o,styles:l,unstyled:c,vars:h,attributes:f,mod:p,...m}=e,v=mt({name:"ComboboxChevron",classes:Ws,props:e,style:i,className:s,classNames:o,styles:l,unstyled:c,vars:h,varsResolver:HF,attributes:f,rootSelector:"chevron"});return a.jsx(ve,{component:"svg",...m,...v("chevron"),size:n,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:r},p],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"})})});_b.classes=Ws;_b.varsResolver=HF;_b.displayName="@mantine/core/ComboboxChevron";const[Sne,Va]=Ki("Combobox component was not found in tree");function dE({onMouseDown:t,onClick:e,onClear:n,...r}){return a.jsx(Ar.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:i=>{i.preventDefault(),t==null||t(i)},onClick:i=>{n(),e==null||e(i)}})}dE.displayName="@mantine/core/ComboboxClearButton";const fE=Ie(t=>{const{classNames:e,styles:n,className:r,style:i,hidden:s,...o}=xe("ComboboxDropdown",null,t),l=Va();return a.jsx(Cn.Dropdown,{...o,role:"presentation","data-hidden":s||void 0,"data-floating-height":l.floatingHeight||void 0,...l.getStyles("dropdown",{className:r,style:i,classNames:e,styles:n})})});fE.classes=Ws;fE.displayName="@mantine/core/ComboboxDropdown";const jne={refProp:"ref"},zF=Ie(t=>{const{children:e,refProp:n,ref:r}=xe("ComboboxDropdownTarget",jne,t);if(Va(),!OO(e))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(Cn.Target,{ref:r,refProp:n,children:e})});zF.displayName="@mantine/core/ComboboxDropdownTarget";const pE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("ComboboxEmpty",null,t);return a.jsx(ve,{...Va().getStyles("empty",{className:n,classNames:e,styles:i,style:r}),...o})});pE.classes=Ws;pE.displayName="@mantine/core/ComboboxEmpty";function mE({onKeyDown:t,onClick:e,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:s,autoComplete:o}){const l=Va(),[c,h]=O.useState(null),f=v=>{if(t==null||t(v),!l.readOnly&&n){if(v.nativeEvent.isComposing)return;if(v.nativeEvent.code==="ArrowDown"&&(v.preventDefault(),l.store.dropdownOpened?h(l.store.selectNextOption()):(l.store.openDropdown("keyboard"),h(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),v.nativeEvent.code==="ArrowUp"&&(v.preventDefault(),l.store.dropdownOpened?h(l.store.selectPreviousOption()):(l.store.openDropdown("keyboard"),h(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),v.nativeEvent.code==="Enter"||v.nativeEvent.code==="NumpadEnter"){if(v.nativeEvent.keyCode===229)return;const y=l.store.getSelectedOptionIndex();l.store.dropdownOpened&&y!==-1?(v.preventDefault(),l.store.clickSelectedOption()):s==="button"&&(v.preventDefault(),l.store.openDropdown("keyboard"))}v.key==="Escape"&&l.store.closeDropdown("keyboard"),v.nativeEvent.code==="Space"&&s==="button"&&(v.preventDefault(),l.store.toggleDropdown("keyboard"))}};return{...r?{...i?{role:"combobox"}:{},"aria-haspopup":"listbox","aria-expanded":i?!!(l.store.listId&&l.store.dropdownOpened):void 0,"aria-controls":l.store.dropdownOpened&&l.store.listId?l.store.listId:void 0,"aria-activedescendant":l.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":l.store.dropdownOpened||void 0,"data-mantine-stop-propagation":l.store.dropdownOpened||void 0}:{},onKeyDown:f,onClick:v=>{s==="button"&&v.currentTarget.focus(),e==null||e(v)}}}const Cne={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},qF=Ie(t=>{const{children:e,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:s,targetType:o,autoComplete:l,ref:c,...h}=xe("ComboboxEventsTarget",Cne,t),f=bu(e);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=Va();return O.cloneElement(f,{...mE({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:s,onKeyDown:f.props.onKeyDown,onClick:f.props.onClick,autoComplete:l}),...h,[n]:En(c,p.store.targetRef,_w(f))})});qF.displayName="@mantine/core/ComboboxEventsTarget";const gE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("ComboboxFooter",null,t);return a.jsx(ve,{...Va().getStyles("footer",{className:n,classNames:e,style:r,styles:i}),...o,onMouseDown:l=>{l.preventDefault()}})});gE.classes=Ws;gE.displayName="@mantine/core/ComboboxFooter";const vE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,children:o,label:l,id:c,...h}=xe("ComboboxGroup",null,t),f=Va(),p=Ii(c);return a.jsxs(ve,{role:"group","aria-labelledby":l?p:void 0,...f.getStyles("group",{className:n,classNames:e,style:r,styles:i}),...h,children:[l&&a.jsx("div",{id:p,...f.getStyles("groupLabel",{classNames:e,styles:i}),children:l}),o]})});vE.classes=Ws;vE.displayName="@mantine/core/ComboboxGroup";const bE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("ComboboxHeader",null,t);return a.jsx(ve,{...Va().getStyles("header",{className:n,classNames:e,style:r,styles:i}),...o,onMouseDown:l=>{l.preventDefault()}})});bE.classes=Ws;bE.displayName="@mantine/core/ComboboxHeader";function QF({value:t,valuesDivider:e=",",...n}){return a.jsx("input",{type:"hidden",value:Array.isArray(t)?t.join(e):t?`${t}`:"",...n})}QF.displayName="@mantine/core/ComboboxHiddenInput";const yE=Ie(t=>{const e=xe("ComboboxOption",null,t),{classNames:n,className:r,style:i,styles:s,vars:o,onClick:l,id:c,active:h,onMouseDown:f,onMouseOver:p,disabled:m,selected:v,mod:y,...x}=e,S=Va(),w=O.useId(),A=c||w;return a.jsx(ve,{...S.getStyles("option",{className:r,classNames:n,styles:s,style:i}),...x,id:A,mod:["combobox-option",{"combobox-active":h,"combobox-disabled":m,"combobox-selected":v},y],role:"option",onClick:C=>{var j;m?C.preventDefault():((j=S.onOptionSubmit)==null||j.call(S,e.value,e),l==null||l(C))},onMouseDown:C=>{C.preventDefault(),f==null||f(C)},onMouseOver:C=>{S.resetSelectionOnOptionHover&&S.store.resetSelectedOption(),p==null||p(C)}})});yE.classes=Ws;yE.displayName="@mantine/core/ComboboxOption";const xE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,id:s,onMouseDown:o,labelledBy:l,...c}=xe("ComboboxOptions",null,t),h=Va(),f=Ii(s);return O.useEffect(()=>{h.store.setListId(f)},[f]),a.jsx(ve,{...h.getStyles("options",{className:n,style:r,classNames:e,styles:i}),...c,id:f,role:"listbox","aria-labelledby":l,onMouseDown:p=>{p.preventDefault(),o==null||o(p)}})});xE.classes=Ws;xE.displayName="@mantine/core/ComboboxOptions";const _ne={withAriaAttributes:!0,withKeyboardNavigation:!0},AE=Ie(t=>{const{classNames:e,styles:n,unstyled:r,vars:i,withAriaAttributes:s,onKeyDown:o,onClick:l,withKeyboardNavigation:c,size:h,ref:f,...p}=xe("ComboboxSearch",_ne,t),m=Va(),v=m.getStyles("search"),y=mE({targetType:"input",withAriaAttributes:s,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:l,autoComplete:"off"});return a.jsx(Ar,{ref:En(f,m.store.searchRef),classNames:[{input:v.className},e],styles:[{input:v.style},n],size:h||m.size,...y,...p,__staticSelector:"Combobox"})});AE.classes=Ws;AE.displayName="@mantine/core/ComboboxSearch";const Tne={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},UF=Ie(t=>{const{children:e,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:s,targetType:o,autoComplete:l,ref:c,...h}=xe("ComboboxTarget",Tne,t),f=bu(e);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=Va(),m=O.cloneElement(f,{...mE({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:s,onKeyDown:f.props.onKeyDown,onClick:f.props.onClick,autoComplete:l}),...h});return a.jsx(Cn.Target,{refProp:n,ref:En(c,p.store.targetRef),children:m})});UF.displayName="@mantine/core/ComboboxTarget";function kne(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 One(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 Ene(t){for(let e=0;e<t.length;e+=1)if(!t[e].hasAttribute("data-combobox-disabled"))return e;return-1}function Yw({defaultOpened:t,opened:e,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:i,loop:s=!0,scrollBehavior:o="instant"}={}){const[l,c]=si({value:e,defaultValue:t,finalValue:!1,onChange:n}),h=O.useRef(null),f=O.useRef(-1),p=O.useRef(null),m=O.useRef(null),v=O.useRef(-1),y=O.useRef(-1),x=O.useRef(-1),S=O.useCallback((B="unknown")=>{l||(c(!0),i==null||i(B))},[c,i,l]),w=O.useCallback((B="unknown")=>{l&&(c(!1),r==null||r(B))},[c,r,l]),A=O.useCallback((B="unknown")=>{l?w(B):S(B)},[w,S,l]),C=O.useCallback(()=>{const B=Hc(m.current),F=wx(`#${h.current} [data-combobox-selected]`,B);F==null||F.removeAttribute("data-combobox-selected"),F==null||F.removeAttribute("aria-selected")},[]),j=O.useCallback(B=>{const F=Hc(m.current),q=wx(`#${h.current}`,F),X=q?Yc("[data-combobox-option]",q):null;if(!X)return null;const Y=B>=X.length?0:B<0?X.length-1:B;return f.current=Y,X!=null&&X[Y]&&!X[Y].hasAttribute("data-combobox-disabled")?(C(),X[Y].setAttribute("data-combobox-selected","true"),X[Y].setAttribute("aria-selected","true"),X[Y].scrollIntoView({block:"nearest",behavior:o}),X[Y].id):null},[o,C]),_=O.useCallback(()=>{const B=Hc(m.current),F=wx(`#${h.current} [data-combobox-active]`,B);return j(F?Yc(`#${h.current} [data-combobox-option]`,B).findIndex(q=>q===F):0)},[j]),k=O.useCallback(()=>{const B=Hc(m.current),F=Yc(`#${h.current} [data-combobox-option]`,B);return j(One(f.current,F,s))},[j,s]),M=O.useCallback(()=>{const B=Hc(m.current),F=Yc(`#${h.current} [data-combobox-option]`,B);return j(kne(f.current,F,s))},[j,s]),R=O.useCallback(()=>{const B=Hc(m.current);return j(Ene(Yc(`#${h.current} [data-combobox-option]`,B)))},[j]),N=O.useCallback((B="selected",F)=>{var q;if(typeof B=="number"){f.current=B;const X=Hc(m.current),Y=Yc(`#${h.current} [data-combobox-option]`,X);F!=null&&F.scrollIntoView&&((q=Y[B])==null||q.scrollIntoView({block:"nearest",behavior:o}));return}x.current=window.setTimeout(()=>{var V;const X=Hc(m.current),Y=Yc(`#${h.current} [data-combobox-option]`,X),U=Y.findIndex(G=>G.hasAttribute(`data-combobox-${B}`));f.current=U,F!=null&&F.scrollIntoView&&((V=Y[U])==null||V.scrollIntoView({block:"nearest",behavior:o}))},0)},[]),I=O.useCallback(()=>{f.current=-1,C()},[C]),D=O.useCallback(()=>{var F,q;const B=Hc(m.current);(q=(F=Yc(`#${h.current} [data-combobox-option]`,B))==null?void 0:F[f.current])==null||q.click()},[]),L=O.useCallback(B=>{h.current=B},[]),z=O.useCallback(()=>{v.current=window.setTimeout(()=>{var B;return(B=p.current)==null?void 0:B.focus()},0)},[]),P=O.useCallback(()=>{y.current=window.setTimeout(()=>{var B;return(B=m.current)==null?void 0:B.focus()},0)},[]),H=O.useCallback(()=>f.current,[]);return O.useEffect(()=>()=>{window.clearTimeout(v.current),window.clearTimeout(y.current),window.clearTimeout(x.current)},[]),{dropdownOpened:l,openDropdown:S,closeDropdown:w,toggleDropdown:A,selectedOptionIndex:f.current,getSelectedOptionIndex:H,selectOption:j,selectFirstOption:R,selectActiveOption:_,selectNextOption:k,selectPreviousOption:M,resetSelectedOption:I,updateSelectedOptionIndex:N,listId:h.current,setListId:L,clickSelectedOption:D,searchRef:p,focusSearchInput:z,targetRef:m,focusTarget:P}}const Mne={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},WF=(t,{size:e,dropdownPadding:n})=>({options:{"--combobox-option-fz":Dr(e),"--combobox-option-padding":Gt(e,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:me(n),"--combobox-option-fz":Dr(e),"--combobox-option-padding":Gt(e,"combobox-option-padding")}}),ln=t=>{const e=xe("Combobox",Mne,t),{classNames:n,styles:r,unstyled:i,children:s,store:o,vars:l,onOptionSubmit:c,onClose:h,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:v,readOnly:y,attributes:x,floatingHeight:S,middlewares:w,...A}=e,C=S==="viewport"?{...w,flip:!1,size:{...typeof(w==null?void 0:w.size)=="object"?w.size:{},padding:typeof(w==null?void 0:w.size)=="object"&&w.size.padding!==void 0?w.size.padding:10,apply:({availableHeight:R,availableWidth:N,elements:I,...D})=>{I.floating.style.setProperty("--combobox-floating-max-height",`${R}px`);const L=w==null?void 0:w.size;typeof L=="object"&&L.apply?L.apply({availableHeight:R,availableWidth:N,elements:I,...D}):L&&Object.assign(I.floating.style,{maxWidth:`${N}px`,maxHeight:`${R}px`})}}}:w,j=Yw(),_=o||j,k=mt({name:v||"Combobox",classes:Ws,props:e,classNames:n,styles:r,unstyled:i,attributes:x,vars:l,varsResolver:WF}),M=()=>{h==null||h(),_.closeDropdown()};return a.jsx(Sne,{value:{getStyles:k,store:_,onOptionSubmit:c,size:f,resetSelectionOnOptionHover:m,readOnly:y,floatingHeight:S},children:a.jsx(Cn,{opened:_.dropdownOpened,...A,middlewares:C,onChange:R=>!R&&M(),withRoles:!1,unstyled:i,children:s})})},Rne=t=>t;ln.extend=Rne;ln.classes=Ws;ln.varsResolver=WF;ln.displayName="@mantine/core/Combobox";ln.Target=UF;ln.Dropdown=fE;ln.Options=xE;ln.Option=yE;ln.Search=AE;ln.Empty=pE;ln.Chevron=_b;ln.Footer=gE;ln.Header=bE;ln.EventsTarget=qF;ln.DropdownTarget=zF;ln.Group=vE;ln.ClearButton=dE;ln.HiddenInput=QF;function YF({children:t,role:e}){const n=O.use(If);return n?a.jsx("div",{role:e,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:t}):a.jsx(a.Fragment,{children:t})}const wE=O.createContext(null),Dne={hiddenInputValuesSeparator:","},SE=sd((t=>{const{value:e,defaultValue:n,onChange:r,size:i,wrapperProps:s,children:o,readOnly:l,name:c,hiddenInputValuesSeparator:h,hiddenInputProps:f,maxSelectedValues:p,disabled:m,...v}=xe("CheckboxGroup",Dne,t),[y,x]=si({value:e,defaultValue:n,finalValue:[],onChange:r}),S=C=>{const j=typeof C=="string"?C:C.currentTarget.value;if(l)return;const _=y.includes(j);!_&&p&&y.length>=p||x(_?y.filter(k=>k!==j):[...y,j])},w=C=>{if(m)return!0;if(!p)return!1;const j=y.includes(C),_=y.length>=p;return!j&&_},A=y.join(h);return a.jsx(wE,{value:{value:y,onChange:S,size:i,isDisabled:w},children:a.jsxs(Ar.Wrapper,{size:i,...s,...v,labelElement:"div",__staticSelector:"CheckboxGroup",children:[a.jsx(YF,{role:"group",children:o}),a.jsx("input",{type:"hidden",name:c,value:A,...f})]})})}));SE.classes=Ar.Wrapper.classes;SE.displayName="@mantine/core/CheckboxGroup";var VF={card:"m_26775b0a"};const GF=O.createContext(null),Nne={withBorder:!0},XF=(t,{radius:e})=>({card:{"--card-radius":rr(e)}}),Vw=Ie(t=>{const e=xe("CheckboxCard",Nne,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,checked:c,mod:h,withBorder:f,value:p,onClick:m,defaultChecked:v,onChange:y,attributes:x,...S}=e,w=mt({name:"CheckboxCard",classes:VF,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:x,vars:l,varsResolver:XF,rootSelector:"card"}),A=O.use(wE),[C,j]=si({value:typeof c=="boolean"?c:A?A.value.includes(p||""):void 0,defaultValue:v,finalValue:!1,onChange:y});return a.jsx(GF,{value:{checked:C},children:a.jsx(Nr,{mod:[{"with-border":f,checked:C},h],...w("card"),...S,role:"checkbox","aria-checked":C,onClick:_=>{m==null||m(_),A==null||A.onChange(p||""),j(!C)}})})});Vw.displayName="@mantine/core/CheckboxCard";Vw.classes=VF;Vw.varsResolver=XF;function Nm({size:t,style:e,...n}){return a.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t!==void 0?{width:me(t),height:me(t),...e}:e,"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 KF({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(Nm,{...e})}var ZF={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const Ine={icon:KF,variant:"filled",radius:"sm"},JF=(t,{radius:e,color:n,size:r,iconColor:i,variant:s,autoContrast:o})=>{const l=sc({color:n||t.primaryColor,theme:t}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--checkbox-size":Gt(r,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:rr(e),"--checkbox-color":s==="outline"?c:wr(n,t),"--checkbox-icon-color":i?wr(i,t):t0(o,t)?id({color:n,theme:t,autoContrast:o}):void 0}}},Gw=Ie(t=>{const e=xe("CheckboxIndicator",Ine,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,icon:c,indeterminate:h,radius:f,color:p,iconColor:m,autoContrast:v,checked:y,mod:x,variant:S,disabled:w,attributes:A,...C}=e,j=mt({name:"CheckboxIndicator",classes:ZF,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:A,vars:l,varsResolver:JF,rootSelector:"indicator"}),_=O.use(GF),k=typeof y=="boolean"||typeof h=="boolean"?y||h:(_==null?void 0:_.checked)||!1;return a.jsx(ve,{...j("indicator",{variant:S}),variant:S,mod:[{checked:k,disabled:w},x],...C,children:a.jsx(c,{indeterminate:h,...j("icon")})})});Gw.displayName="@mantine/core/CheckboxIndicator";Gw.classes=ZF;Gw.varsResolver=JF;var e$={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const t$=e$;function jE({__staticSelector:t,__stylesApiProps:e,className:n,classNames:r,styles:i,unstyled:s,children:o,label:l,description:c,id:h,disabled:f,error:p,size:m,labelPosition:v="left",bodyElement:y="div",labelElement:x="label",variant:S,style:w,vars:A,mod:C,attributes:j,..._}){const k=mt({name:t,props:e,className:n,style:w,classes:e$,classNames:r,styles:i,unstyled:s,attributes:j}),M=c?`${h}-description`:void 0,R=p&&typeof p!="boolean"?`${h}-error`:void 0;return a.jsx(ve,{...k("root"),__vars:{"--label-fz":Dr(m),"--label-lh":Gt(m,"label-lh")},mod:[{"label-position":v},C],variant:S,size:m,..._,children:a.jsxs(ve,{component:y,htmlFor:y==="label"?h:void 0,...k("body"),children:[o,a.jsxs("div",{...k("labelWrapper"),"data-disabled":f||void 0,children:[l&&a.jsx(ve,{component:x,htmlFor:x==="label"?h:void 0,...k("label"),"data-disabled":f||void 0,children:l}),c&&a.jsx(Ar.Description,{id:M,size:m,__inheritStyles:!1,...k("description"),children:c}),p&&typeof p!="boolean"&&a.jsx(Ar.Error,{id:R,size:m,__inheritStyles:!1,...k("error"),children:p})]})]})})}jE.displayName="@mantine/core/InlineInput";var n$={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const Lne={labelPosition:"right",icon:KF,withErrorStyles:!0,variant:"filled",radius:"sm"},r$=(t,{radius:e,color:n,size:r,iconColor:i,variant:s,autoContrast:o})=>{const l=sc({color:n||t.primaryColor,theme:t}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--checkbox-size":Gt(r,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:rr(e),"--checkbox-color":s==="outline"?c:wr(n,t),"--checkbox-icon-color":i?wr(i,t):t0(o,t)?id({color:n,theme:t,autoContrast:o}):void 0}}},Hs=Ie(t=>{var ke;const e=xe("Checkbox",Lne,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,color:c,label:h,id:f,size:p,radius:m,wrapperProps:v,checked:y,labelPosition:x,description:S,error:w,disabled:A,variant:C,indeterminate:j,icon:_,rootRef:k,iconColor:M,onChange:R,autoContrast:N,mod:I,attributes:D,readOnly:L,onClick:z,withErrorStyles:P,ref:H,...B}=e,F=O.useRef(null),q=O.use(wE),X=p||(q==null?void 0:q.size),Y=mt({name:"Checkbox",props:e,classes:n$,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:D,vars:l,varsResolver:r$}),{styleProps:U,rest:V}=gb(B),G=Ii(f),J=[S?`${G}-description`:void 0,w&&typeof w!="boolean"?`${G}-error`:void 0,V["aria-describedby"]].filter(Boolean).join(" ")||void 0,ne={checked:(q==null?void 0:q.value.includes(V.value))??y,onChange:Me=>{q==null||q.onChange(Me),R==null||R(Me)}},de=((ke=q==null?void 0:q.isDisabled)==null?void 0:ke.call(q,V.value))??!1,fe=A||de;return O.useEffect(()=>{F.current&&(F.current.indeterminate=j||!1,j?F.current.setAttribute("data-indeterminate","true"):F.current.removeAttribute("data-indeterminate"))},[j]),a.jsx(jE,{...Y("root"),__staticSelector:"Checkbox",__stylesApiProps:e,id:G,size:X,labelPosition:x,label:h,description:S,error:w,disabled:fe,classNames:n,styles:s,unstyled:o,"data-checked":ne.checked||y||void 0,variant:C,ref:k,mod:I,attributes:D,inert:V.inert,...U,...v,children:a.jsxs(ve,{...Y("inner"),mod:{"data-label-position":x},children:[a.jsx(ve,{component:"input",id:G,ref:En(F,H),mod:{error:!!w,"with-error-styles":P},...Y("input",{focusable:!0,variant:C}),...V,...ne,"aria-describedby":J,disabled:fe,inert:V.inert,type:"checkbox",onClick:Me=>{L&&Me.preventDefault(),z==null||z(Me)}}),a.jsx(_,{indeterminate:j,...Y("icon")})]})})});Hs.classes={...n$,...t$};Hs.varsResolver=r$;Hs.displayName="@mantine/core/Checkbox";Hs.Group=SE;Hs.Indicator=Gw;Hs.Card=Vw;function yv(t){return"group"in t}function i$({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;yv(o)&&i.push({group:o.group,items:i$({options:o.items,search:e,limit:n-i.length})}),yv(o)||o.label.toLowerCase().includes(r)&&i.push(o)}return i}function Bne(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 s$(t,e=new Set){if(Array.isArray(t))for(const n of t)if(yv(n))s$(n.items,e);else{if(typeof n.value>"u")throw new Error("[@mantine/core] Each option must have value property");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 Pne(t,e){return Array.isArray(t)?t.includes(e):t===e}function a$({data:t,withCheckIcon:e,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:s,renderOption:o}){if(!yv(t)){const c=Pne(r,t.value),h=e&&(c?a.jsx(Nm,{className:Ws.optionsDropdownCheckIcon}):n?a.jsx("div",{className:Ws.optionsDropdownCheckPlaceholder}):null),f=a.jsxs(a.Fragment,{children:[i==="left"&&h,a.jsx("span",{children:t.label}),i==="right"&&h]});return a.jsx(ln.Option,{value:t.value,disabled:t.disabled,className:$r({[Ws.optionsDropdownOption]:!s}),"data-reverse":i==="right"||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof o=="function"?o({option:t,checked:c}):f})}const l=t.items.map(c=>a.jsx(a$,{data:c,value:r,unstyled:s,withCheckIcon:e,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${c.value}`));return a.jsx(ln.Group,{label:t.group,children:l})}function o$({data:t,hidden:e,hiddenWhenEmpty:n,filter:r,search:i,limit:s,maxDropdownHeight:o,floatingHeight:l,withScrollArea:c=!0,filterOptions:h=!0,withCheckIcon:f=!1,withAlignedLabels:p=!1,value:m,checkIconPosition:v,nothingFoundMessage:y,unstyled:x,labelId:S,renderOption:w,scrollAreaProps:A,"aria-label":C}){const j=Va();s$(t);const _=typeof i=="string"?(r||i$)({options:t,search:h?i:"",limit:s??1/0}):t,k=Bne(_),M=_.map(R=>a.jsx(a$,{data:R,withCheckIcon:f,withAlignedLabels:p,value:m,checkIconPosition:v,unstyled:x,renderOption:w},yv(R)?R.group:`${R.value}`));return a.jsx(ln.Dropdown,{hidden:e||n&&k,"data-composed":!0,children:a.jsxs(ln.Options,{labelledBy:S,"aria-label":C,children:[c?a.jsx(ga.Autosize,{mah:(l??j.floatingHeight)==="viewport"?"var(--combobox-floating-options-max-height)":o??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...A,children:M}):M,k&&y&&a.jsx(ln.Empty,{children:y})]})})}const CE=Ie(t=>{const e=xe(["Input","InputWrapper","Autocomplete"],{size:"sm"},t),{classNames:n,styles:r,unstyled:i,vars:s,dropdownOpened:o,defaultDropdownOpened:l,onDropdownClose:c,onDropdownOpen:h,onFocus:f,onBlur:p,onClick:m,onChange:v,data:y,value:x,defaultValue:S,selectFirstOptionOnChange:w,selectFirstOptionOnDropdownOpen:A,onOptionSubmit:C,comboboxProps:j,readOnly:_,disabled:k,filter:M,limit:R,withScrollArea:N,maxDropdownHeight:I,floatingHeight:D,size:L,id:z,renderOption:P,autoComplete:H,scrollAreaProps:B,onClear:F,clearButtonProps:q,error:X,clearable:Y,clearSectionMode:U,rightSection:V,autoSelectOnBlur:G,openOnFocus:J=!0,attributes:ne,...de}=e,fe=Ii(z),ke=$F(y),Me=hE(ke),[Oe,Ye]=si({value:x,defaultValue:S,finalValue:"",onChange:v}),ie=Yw({opened:o,defaultOpened:l,onDropdownOpen:()=>{h==null||h(),A&&ie.selectFirstOption()},onDropdownClose:()=>{c==null||c(),setTimeout(ie.resetSelectedOption,0)}}),Se=Te=>{Ye(Te),ie.resetSelectedOption()},{resolvedClassNames:se,resolvedStyles:_e}=Ya({props:e,styles:r,classNames:n});O.useEffect(()=>{w&&ie.selectFirstOption()},[w,Oe]);const et=a.jsx(ln.ClearButton,{...q,onClear:()=>{Se(""),F==null||F()}});return a.jsxs(ln,{store:ie,__staticSelector:"Autocomplete",classNames:se,styles:_e,unstyled:i,readOnly:_,size:L,attributes:ne,floatingHeight:D,keepMounted:G,onOptionSubmit:Te=>{C==null||C(Te),Se(Me[Te].label),ie.closeDropdown()},...j,children:[a.jsx(ln.Target,{autoComplete:H,withExpandedAttribute:!0,children:a.jsx(Ds,{...de,size:L,__staticSelector:"Autocomplete",__clearSection:et,__clearable:Y&&!!Oe&&!k&&!_,__clearSectionMode:U,rightSection:V,disabled:k,readOnly:_,value:Oe,error:X,onChange:Te=>{Se(Te.currentTarget.value),ie.openDropdown(),w&&ie.selectFirstOption()},onFocus:Te=>{J&&ie.openDropdown(),f==null||f(Te)},onBlur:Te=>{G&&ie.clickSelectedOption(),ie.closeDropdown(),p==null||p(Te)},onClick:Te=>{ie.openDropdown(),m==null||m(Te)},classNames:se,styles:_e,unstyled:i,attributes:ne,id:fe})}),a.jsx(o$,{data:ke,hidden:_||k,filter:M,search:Oe,limit:R,hiddenWhenEmpty:!0,withScrollArea:N,maxDropdownHeight:I,unstyled:i,labelId:de.label?`${fe}-label`:void 0,"aria-label":de.label?void 0:de["aria-label"],renderOption:P,scrollAreaProps:B})]})});CE.classes={...Ds.classes,...ln.classes};CE.displayName="@mantine/core/Autocomplete";var l$={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const c$=(t,{radius:e,color:n,gradient:r,variant:i,size:s,autoContrast:o,circle:l})=>{const c=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:o});return{root:{"--badge-height":Gt(s,"badge-height"),"--badge-padding-x":Gt(s,"badge-padding-x"),"--badge-fz":Gt(s,"badge-fz"),"--badge-radius":l||e===void 0?void 0:rr(e),"--badge-bg":n||i?c.background:void 0,"--badge-color":n||i?c.color:void 0,"--badge-bd":n||i?c.border:void 0,"--badge-dot-color":i==="dot"?wr(n,t):void 0}}},Br=Zi(t=>{const e=xe("Badge",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,radius:c,color:h,gradient:f,leftSection:p,rightSection:m,children:v,variant:y,fullWidth:x,autoContrast:S,circle:w,mod:A,attributes:C,...j}=e,_=mt({name:"Badge",props:e,classes:l$,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:C,vars:l,varsResolver:c$});return a.jsxs(ve,{variant:y,mod:[{block:x,circle:w,"with-right-section":!!m,"with-left-section":!!p},A],..._("root",{variant:y}),...j,children:[p&&a.jsx("span",{..._("section"),"data-position":"left",children:p}),a.jsx("span",{..._("label"),children:v}),m&&a.jsx("span",{..._("section"),"data-position":"right",children:m})]})});Br.classes=l$;Br.varsResolver=c$;Br.displayName="@mantine/core/Badge";var u$={root:"m_fea6bf1a",burger:"m_d4fb9cad"};const h$=(t,{color:e,size:n,lineSize:r,transitionDuration:i,transitionTimingFunction:s})=>({root:{"--burger-color":e?wr(e,t):void 0,"--burger-size":Gt(n,"burger-size"),"--burger-line-size":r?me(r):void 0,"--burger-transition-duration":i===void 0?void 0:`${i}ms`,"--burger-transition-timing-function":s}}),Xw=Ie(t=>{const e=xe("Burger",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,opened:c,children:h,transitionDuration:f,transitionTimingFunction:p,lineSize:m,attributes:v,...y}=e,x=mt({name:"Burger",classes:u$,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:v,vars:l,varsResolver:h$});return a.jsxs(Nr,{...x("root"),...y,children:[a.jsx(ve,{mod:["reduce-motion",{opened:c}],...x("burger")}),h]})});Xw.classes=u$;Xw.varsResolver=h$;Xw.displayName="@mantine/core/Burger";var a0={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const n5={orientation:"horizontal"},d$=(t,{borderWidth:e})=>({group:{"--button-border-width":me(e)}}),Kw=Ie(t=>{const e=xe("ButtonGroup",n5,t),{className:n,style:r,classNames:i,styles:s,unstyled:o,orientation:l,vars:c,borderWidth:h,mod:f,attributes:p,...m}=xe("ButtonGroup",n5,t);return a.jsx(ve,{...mt({name:"ButtonGroup",props:e,classes:a0,className:n,style:r,classNames:i,styles:s,unstyled:o,attributes:p,vars:c,varsResolver:d$,rootSelector:"group"})("group"),mod:[{"data-orientation":l},f],role:"group",...m})});Kw.classes=a0;Kw.varsResolver=d$;Kw.displayName="@mantine/core/ButtonGroup";const f$=(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":Gt(o,"section-height"),"--section-padding-x":Gt(o,"section-padding-x"),"--section-fz":o!=null&&o.includes("compact")?Dr(o.replace("compact-","")):Dr(o),"--section-radius":e===void 0?void 0:rr(e),"--section-bg":n||i?l.background:void 0,"--section-color":l.color,"--section-bd":n||i?l.border:void 0}}},Zw=Ie(t=>{const e=xe("ButtonGroupSection",null,t),{className:n,style:r,classNames:i,styles:s,unstyled:o,vars:l,gradient:c,radius:h,autoContrast:f,attributes:p,...m}=e;return a.jsx(ve,{...mt({name:"ButtonGroupSection",props:e,classes:a0,className:n,style:r,classNames:i,styles:s,unstyled:o,attributes:p,vars:l,varsResolver:f$,rootSelector:"groupSection"})("groupSection"),...m})});Zw.classes=a0;Zw.varsResolver=f$;Zw.displayName="@mantine/core/ButtonGroupSection";const Fne={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${me(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},p$=(t,{radius:e,color:n,gradient:r,variant:i,size:s,justify:o,autoContrast:l})=>{const c=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:l});return{root:{"--button-justify":o,"--button-height":Gt(s,"button-height"),"--button-padding-x":Gt(s,"button-padding-x"),"--button-fz":s!=null&&s.includes("compact")?Dr(s.replace("compact-","")):Dr(s),"--button-radius":e===void 0?void 0:rr(e),"--button-bg":n||i?c.background:void 0,"--button-hover":n||i?c.hover:void 0,"--button-color":c.color,"--button-bd":n||i?c.border:void 0,"--button-hover-color":n||i?c.hoverColor:void 0}}},Ri=Zi(t=>{const e=xe("Button",null,t),{style:n,vars:r,className:i,color:s,disabled:o,children:l,leftSection:c,rightSection:h,fullWidth:f,variant:p,radius:m,loading:v,loaderProps:y,gradient:x,classNames:S,styles:w,unstyled:A,"data-disabled":C,autoContrast:j,mod:_,attributes:k,...M}=e,R=mt({name:"Button",props:e,classes:a0,className:i,style:n,classNames:S,styles:w,unstyled:A,attributes:k,vars:r,varsResolver:p$}),N=!!c,I=!!h;return a.jsxs(Nr,{...R("root",{active:!o&&!v&&!C}),unstyled:A,variant:p,disabled:o||v,mod:[{disabled:o||C,loading:v,block:f,"with-left-section":N,"with-right-section":I},_],...M,children:[typeof v=="boolean"&&a.jsx(ic,{mounted:v,transition:Fne,duration:150,children:D=>a.jsx(ve,{component:"span",...R("loader",{style:D}),"aria-hidden":!0,children:a.jsx(So,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...y})})}),a.jsxs("span",{...R("inner"),children:[c&&a.jsx(ve,{component:"span",...R("section"),mod:{position:"left"},children:c}),a.jsx(ve,{component:"span",mod:{loading:v},...R("label"),children:l}),h&&a.jsx(ve,{component:"span",...R("section"),mod:{position:"right"},children:h})]})]})});Ri.classes=a0;Ri.varsResolver=p$;Ri.displayName="@mantine/core/Button";Ri.Group=Kw;Ri.GroupSection=Zw;const[$ne,Hne]=Ki("Card component was not found in tree");var _E={root:"m_e615b15f",section:"m_599a2148"};const Jw=Zi(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,withBorder:o,inheritPadding:l,mod:c,...h}=xe("CardSection",null,t),f=Hne();return a.jsx(ve,{mod:[{"with-border":o,"inherit-padding":l},c],...f.getStyles("section",{className:n,style:r,styles:i,classNames:e}),...h})});Jw.classes=_E;Jw.displayName="@mantine/core/CardSection";const m$=(t,{padding:e})=>({root:{"--card-padding":Gi(e)}}),zne={orientation:"vertical"},Qr=Zi(t=>{const e=xe("Card",zne,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,children:c,padding:h,attributes:f,orientation:p,...m}=e,v=mt({name:"Card",props:e,classes:_E,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:f,vars:l,varsResolver:m$}),y=O.Children.toArray(c),x=y.map((S,w)=>{var A;return typeof S=="object"&&S&&"type"in S&&(S.type===Jw||((A=S.type)==null?void 0:A.displayName)==="@mantine/core/CardSection")?O.cloneElement(S,{"data-orientation":p,"data-first-section":w===0||void 0,"data-last-section":w===y.length-1||void 0}):S});return a.jsx($ne,{value:{getStyles:v},children:a.jsx(bb,{unstyled:o,"data-orientation":p,...v("root"),...m,children:x})})});Qr.classes=_E;Qr.varsResolver=m$;Qr.displayName="@mantine/core/Card";Qr.Section=Jw;var g$={root:"m_4451eb3a"};const xv=Zi(t=>{const e=xe("Center",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,inline:c,mod:h,attributes:f,...p}=e,m=mt({name:"Center",props:e,classes:g$,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:f,vars:l});return a.jsx(ve,{mod:[{inline:c},h],...m("root"),...p})});xv.classes=g$;xv.displayName="@mantine/core/Center";var v$={root:"m_b183c0a2"};const b$=(t,{color:e})=>({root:{"--code-bg":e?wr(e,t):void 0}}),e2=Ie(t=>{const e=xe("Code",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,color:c,block:h,mod:f,attributes:p,...m}=e,v=mt({name:"Code",props:e,classes:v$,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:p,vars:l,varsResolver:b$});return a.jsx(ve,{component:h?"pre":"code",mod:[{block:h},f],...v("root"),...m,dir:"ltr"})});e2.classes=v$;e2.varsResolver=b$;e2.displayName="@mantine/core/Code";const qne={timeout:1e3};function TE(t){const{children:e,timeout:n,value:r,...i}=xe("CopyButton",qne,t),s=EP({timeout:n}),o=()=>s.copy(r);return a.jsx(a.Fragment,{children:e({copy:o,copied:s.copied,...i})})}TE.displayName="@mantine/core/CopyButton";var y$={root:"m_3eebeb36",label:"m_9e365f20"};const Qne={orientation:"horizontal"},x$=(t,{color:e,variant:n,size:r})=>({root:{"--divider-color":e?wr(e,t):void 0,"--divider-border-style":n,"--divider-size":Gt(r,"divider-size")}}),o0=Ie(t=>{const e=xe("Divider",Qne,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,color:c,orientation:h,label:f,labelPosition:p,mod:m,attributes:v,...y}=e,x=mt({name:"Divider",classes:y$,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:v,vars:l,varsResolver:x$});return a.jsx(ve,{mod:[{orientation:h,withLabel:!!f},m],role:"separator",...x("root"),...y,children:f&&a.jsx(ve,{component:"span",mod:{position:p},...x("label"),children:f})})});o0.classes=y$;o0.varsResolver=x$;o0.displayName="@mantine/core/Divider";var A$={root:"m_e9408a47","root--default":"m_84c9523a","root--filled":"m_ef274e49","root--unstyled":"m_eda993d3",legend:"m_90794832","legend--unstyled":"m_74ca27fe"};const Une={variant:"default"},w$=(t,{radius:e})=>({root:{"--fieldset-radius":e===void 0?void 0:rr(e)}}),Gd=Ie(t=>{const e=xe("Fieldset",Une,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,legend:c,variant:h,children:f,attributes:p,...m}=e,v=mt({name:"Fieldset",classes:A$,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:p,vars:l,varsResolver:w$});return a.jsxs(ve,{component:"fieldset",variant:h,...v("root",{variant:h}),...m,children:[c&&a.jsx("legend",{...v("legend",{variant:h}),children:c}),f]})});Gd.classes=A$;Gd.varsResolver=w$;Gd.displayName="@mantine/core/Fieldset";function Wne(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=typeof e=="number"?e:e.x,i=typeof e=="number"?e:e.y,s=me(r),o=me(i),[l,c]=t.split("-");return l==="top"&&(n["--indicator-top"]=o,n["--indicator-translate-y"]="-50%"),l==="middle"&&(n["--indicator-top"]="50%",n["--indicator-translate-y"]="-50%"),l==="bottom"&&(n["--indicator-bottom"]=o,n["--indicator-translate-y"]="50%"),c==="start"&&(n["--indicator-left"]=s,n["--indicator-translate-x"]="-50%"),c==="center"&&(n["--indicator-left"]="50%",n["--indicator-translate-x"]="-50%"),c==="end"&&(n["--indicator-right"]=s,n["--indicator-translate-x"]="50%"),n}var S$={root:"m_e5262200",indicator:"m_760d1fb1",processing:"m_885901b1"};const Yne={position:"top-end",offset:0,showZero:!0},j$=(t,{color:e,position:n,offset:r,size:i,radius:s,zIndex:o,autoContrast:l})=>({root:{"--indicator-color":e?wr(e,t):void 0,"--indicator-text-color":t0(l,t)?id({color:e,theme:t,autoContrast:l}):void 0,"--indicator-size":me(i),"--indicator-radius":s===void 0?void 0:rr(s),"--indicator-z-index":o==null?void 0:o.toString(),...Wne(n,r)}}),t2=Ie(t=>{const e=xe("Indicator",Yne,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,children:c,position:h,offset:f,inline:p,label:m,radius:v,color:y,withBorder:x,disabled:S,processing:w,zIndex:A,autoContrast:C,maxValue:j,showZero:_,mod:k,attributes:M,...R}=e,N=mt({name:"Indicator",classes:S$,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:M,vars:l,varsResolver:j$}),I=!_&&(m===0||m==="0"),D=j!==void 0&&typeof m=="number"&&m>j?`${j}+`:m;return a.jsxs(ve,{...N("root"),mod:[{inline:p},k],...R,children:[!S&&!I&&a.jsx(ve,{mod:{"with-label":!!m,"with-border":x,processing:w},...N("indicator"),children:D}),c]})});t2.classes=S$;t2.varsResolver=j$;t2.displayName="@mantine/core/Indicator";const Vne=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],r5={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"};function i5(t){Object.keys(r5).forEach(e=>{t.style.setProperty(e,r5[e],"important")})}function Gne(t){const e=window.getComputedStyle(t);if(e===null)return null;const n={};for(const r of Vne)n[r]=e[r];return n.boxSizing===""?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}let qi=null;function Xne(t,e,n=1,r=1/0){qi||(qi=document.createElement("textarea"),qi.setAttribute("tabindex","-1"),qi.setAttribute("aria-hidden","true"),qi.setAttribute("aria-label","autosize measurement"),i5(qi)),qi.parentNode===null&&document.body.appendChild(qi);const{paddingSize:i,borderSize:s,sizingStyle:o}=t,{boxSizing:l}=o;Object.keys(o).forEach(m=>{qi.style[m]=o[m]}),i5(qi),qi.value=e;let c=l==="border-box"?qi.scrollHeight+s:qi.scrollHeight-i;qi.value=e,c=l==="border-box"?qi.scrollHeight+s:qi.scrollHeight-i,qi.value="x";const h=qi.scrollHeight-i;let f=h*n;l==="border-box"&&(f=f+i+s),c=Math.max(f,c);let p=h*r;return l==="border-box"&&(p=p+i+s),c=Math.min(p,c),[c,h]}function Kne({maxRows:t,minRows:e,onChange:n,ref:r,...i}){const s=i.value!==void 0,o=O.useRef(null),l=En(o,r),c=O.useRef(0),h=()=>{const p=o.current;if(!p)return;const m=Gne(p);if(!m)return;const[v]=Xne(m,p.value||p.placeholder||"x",e,t);c.current!==v&&(c.current=v,p.style.setProperty("height",`${v}px`,"important"))},f=p=>{s||h(),n==null||n(p)};return O.useLayoutEffect(h),O.useEffect(()=>{const p=()=>h();return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),O.useEffect(()=>{const p=()=>h();return document.fonts.addEventListener("loadingdone",p),()=>document.fonts.removeEventListener("loadingdone",p)},[]),O.useEffect(()=>{const p=m=>{var v;if(((v=o.current)==null?void 0:v.form)===m.target&&!s){const y=o.current.value;requestAnimationFrame(()=>{o.current&&y!==o.current.value&&h()})}};return document.body.addEventListener("reset",p),()=>document.body.removeEventListener("reset",p)},[s]),a.jsx("textarea",{...i,onChange:f,ref:l})}const kE=Ie(t=>{const{autosize:e,maxRows:n,minRows:r,__staticSelector:i,resize:s,bottomSection:o,bottomSectionProps:l,...c}=xe(["Input","InputWrapper","Textarea"],null,t),h=e&&BP()!=="test",f=h?{maxRows:n,minRows:r}:{};return a.jsx(Ds,{component:h?Kne:"textarea",...c,__staticSelector:i||"Textarea",__bottomSection:o,__bottomSectionProps:l,multiline:!0,"data-no-overflow":e&&n===void 0||void 0,__vars:{"--input-resize":s},...f})});kE.classes=Ds.classes;kE.displayName="@mantine/core/Textarea";const[Zne,Jne]=Ki("List component was not found in tree");var OE={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const EE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,icon:o,children:l,mod:c,...h}=xe("ListItem",null,t),f=Jne(),p=o||f.icon,m={classNames:e,styles:i};return a.jsx(ve,{...f.getStyles("item",{...m,className:n,style:r}),component:"li",mod:[{"with-icon":!!p,centered:f.center},c],...h,children:a.jsxs("div",{...f.getStyles("itemWrapper",m),children:[p&&a.jsx("span",{...f.getStyles("itemIcon",m),children:p}),a.jsx("span",{...f.getStyles("itemLabel",m),children:l})]})})});EE.classes=OE;EE.displayName="@mantine/core/ListItem";const ere={type:"unordered"},C$=(t,{size:e,spacing:n})=>({root:{"--list-fz":Dr(e),"--list-lh":OP(e),"--list-spacing":Gi(n)}}),tr=Ie(t=>{const e=xe("List",ere,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,children:c,type:h,withPadding:f,icon:p,spacing:m,center:v,listStyleType:y,mod:x,attributes:S,...w}=e,A=mt({name:"List",classes:OE,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:S,vars:l,varsResolver:C$});return a.jsx(Zne,{value:{center:v,icon:p,getStyles:A},children:a.jsx(ve,{...A("root",{style:{listStyleType:y}}),component:h==="unordered"?"ul":"ol",mod:[{"with-padding":f,type:p?"none":y},x],...w,children:c})})});tr.classes=OE;tr.varsResolver=C$;tr.displayName="@mantine/core/List";tr.Item=EE;var _$={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const s5={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:jo("overlay")},T$=(t,{zIndex:e})=>({root:{"--lo-z-index":e==null?void 0:e.toString()}}),n2=Ie(t=>{const e=xe("LoadingOverlay",s5,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,transitionProps:c,loaderProps:h,overlayProps:f,visible:p,zIndex:m,attributes:v,onEnter:y,onEntered:x,onExit:S,onExited:w,...A}=e,C=pi(),j=mt({name:"LoadingOverlay",classes:_$,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:v,vars:l,varsResolver:T$}),_={...s5.overlayProps,...f};return a.jsx(ic,{transition:"fade",...c,mounted:!!p,onEnter:y,onEntered:x,onExit:S,onExited:w,children:k=>a.jsxs(ve,{...j("root",{style:k}),...A,children:[a.jsx(So,{unstyled:o,...h,...j("loader",{className:h==null?void 0:h.className,style:h==null?void 0:h.style})}),a.jsx(Cf,{..._,...j("overlay",{className:_==null?void 0:_.className,style:_==null?void 0:_.style}),darkHidden:!0,unstyled:o,color:(f==null?void 0:f.color)||C.white}),a.jsx(Cf,{..._,...j("overlay",{className:_==null?void 0:_.className,style:_==null?void 0:_.style}),lightHidden:!0,unstyled:o,color:(f==null?void 0:f.color)||C.colors.dark[5]})]})})});n2.classes=_$;n2.varsResolver=T$;n2.displayName="@mantine/core/LoadingOverlay";const[tre,ya]=Ki("Menu component was not found in the tree"),k$=O.createContext(null);function O$(t){const{value:e,defaultValue:n,onChange:r,children:i}=xe("MenuCheckboxGroup",null,t),[s,o]=si({value:e,defaultValue:n,finalValue:[],onChange:r});return a.jsx(k$,{value:{values:s,onChange:O.useCallback(l=>{o(s.includes(l)?s.filter(c=>c!==l):[...s,l])},[s,o])},children:i})}O$.displayName="@mantine/core/MenuCheckboxGroup";const Im=O.createContext(null);function E$({role:t,checked:e,indicator:n,onSelect:r,color:i,closeMenuOnClick:s,rightSection:o,children:l,disabled:c,dataDisabled:h,className:f,style:p,styles:m,classNames:v,buttonRef:y,others:x}){const S=ya(),w=O.use(Im),A=pi(),{dir:C}=oc(),j=O.useRef(null),_=cr(x.onClick,()=>{h||(r(),s&&S.closeDropdownImmediately())}),k=cr(x.onMouseMove,()=>{var L;if(!S.hasSearch)return;const D=(L=j.current)==null?void 0:L.closest("[data-menu-dropdown]");D&&D.querySelectorAll("[data-menu-active]").forEach(z=>{z!==j.current&&z.closest("[data-menu-dropdown]")===D&&z.removeAttribute("data-menu-active")})}),M=cr(x.onKeyDown,D=>{D.key==="ArrowLeft"&&w&&(w.close(),w.focusParentItem())}),R=i?A.variantColorResolver({color:i,theme:A,variant:"light"}):void 0,N=i?sc({color:i,theme:A}):null,I=S.alignItemsLabels!=="none"||e;return a.jsxs(Nr,{onMouseDown:D=>D.preventDefault(),...x,unstyled:S.unstyled,tabIndex:S.menuItemTabIndex,...S.getStyles("item",{className:f,style:p,styles:m,classNames:v}),ref:En(j,y),role:t,"aria-checked":e,disabled:c,"data-menu-item":!0,"data-checked":e||void 0,"data-disabled":c||h||void 0,"data-mantine-stop-propagation":!0,onClick:_,onMouseMove:k,onKeyDown:hb({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:S.loop,dir:C,orientation:"vertical",onKeyDown:M}),__vars:{"--menu-item-color":N!=null&&N.isThemeColor&&(N==null?void 0:N.shade)===void 0?`var(--mantine-color-${N.color}-6)`:R==null?void 0:R.color,"--menu-item-hover":R==null?void 0:R.hover},children:[I&&a.jsx("div",{...S.getStyles("itemIndicator",{styles:m,classNames:v}),"data-checked":e||void 0,children:e?n:null}),l&&a.jsx("div",{...S.getStyles("itemLabel",{styles:m,classNames:v}),"data-menu-item-label":!0,children:l}),o&&a.jsx("div",{...S.getStyles("itemSection",{styles:m,classNames:v}),"data-position":"right",children:o})]})}var gl={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",search:"m_ef8769b6",itemLabel:"m_5476e0d3",itemIndicator:"m_8395186e",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const ME=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,color:o,closeMenuOnClick:l,rightSection:c,children:h,disabled:f,"data-disabled":p,value:m,checked:v,defaultChecked:y,onChange:x,checkIcon:S,ref:w,...A}=xe("MenuCheckboxItem",null,t),C=ya(),j=O.use(k$),_=j&&m!==void 0?j.values.includes(m):void 0,[k,M]=si({value:v??_,defaultValue:y,finalValue:!1,onChange:x});return a.jsx(E$,{role:"menuitemcheckbox",checked:k,indicator:S??C.checkIcon??a.jsx(Nm,{size:10}),onSelect:()=>{x?M(!k):j&&m!==void 0?j.onChange(m):M(!k)},color:o,closeMenuOnClick:l,rightSection:c,disabled:f,dataDisabled:p,className:n,style:r,styles:i,classNames:e,buttonRef:w,others:A,children:h})});ME.classes=gl;ME.displayName="@mantine/core/MenuCheckboxItem";function M$(t){const{children:e,disabled:n,longPressDelay:r}=xe("MenuContextMenu",null,t),i=bu(e);if(!i)throw new Error("Menu.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const s=ya(),o=$w();return O.cloneElement(i,z7({childProps:i.props,disabled:n||o.disabled,opened:s.opened,longPressDelay:r,setReference:o.reference,open:()=>s.openDropdown()}))}M$.displayName="@mantine/core/MenuContextMenu";const RE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("MenuDivider",null,t);return a.jsx(ve,{...ya().getStyles("divider",{className:n,style:r,styles:i,classNames:e}),...o})});RE.classes=gl;RE.displayName="@mantine/core/MenuDivider";const nre=500;function a5(t){return((t.querySelector("[data-menu-item-label]")??t).textContent??"").trim().toLowerCase()}function rre(t){return t.length>1&&t.split("").every(e=>e===t[0])}function R$({enabled:t,opened:e,getDropdown:n}){const r=O.useRef({buffer:"",timeoutId:null});return O.useEffect(()=>{if(e&&t)return;const i=r.current;i.timeoutId!==null&&(window.clearTimeout(i.timeoutId),i.timeoutId=null),i.buffer=""},[e,t]),O.useEffect(()=>()=>{const{timeoutId:i}=r.current;i!==null&&window.clearTimeout(i)},[]),i=>{if(!t||i.defaultPrevented||i.ctrlKey||i.metaKey||i.altKey||i.key.length!==1||i.key===" ")return;const s=i.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"||s.tagName==="SELECT"||s.isContentEditable))return;const o=n();if(!o)return;const l=Array.from(o.querySelectorAll("[data-menu-item]:not([data-disabled])")).filter(m=>m.closest("[data-menu-dropdown]")===o);if(l.length===0)return;const c=r.current;c.buffer=(c.buffer+i.key).toLowerCase(),c.timeoutId!==null&&window.clearTimeout(c.timeoutId),c.timeoutId=window.setTimeout(()=>{c.buffer="",c.timeoutId=null},nre);const h=document.activeElement,f=h?l.indexOf(h):-1;let p=null;if(c.buffer.length===1||rre(c.buffer)){const m=c.buffer[0],v=f+1;for(let y=0;y<l.length;y+=1){const x=(v+y)%l.length;if(a5(l[x]).startsWith(m)){p=l[x];break}}}else for(let m=0;m<l.length;m+=1)if(a5(l[m]).startsWith(c.buffer)){p=l[m];break}p&&(i.preventDefault(),p.focus())}}const DE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,onMouseEnter:o,onMouseLeave:l,onKeyDown:c,children:h,ref:f,...p}=xe("MenuDropdown",null,t),m=O.useRef(null),v=ya(),y=R$({enabled:!v.hasSearch,opened:v.opened,getDropdown:()=>m.current}),x=cr(c,A=>{var C,j;y(A),!(A.defaultPrevented||v.hasSearch)&&(A.key==="ArrowUp"||A.key==="ArrowDown")&&(A.preventDefault(),(j=(C=m.current)==null?void 0:C.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||j.focus())}),S=cr(o,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.openDropdown()),w=cr(l,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.closeDropdown());return a.jsxs(Cn.Dropdown,{...p,onMouseEnter:S,onMouseLeave:w,role:"menu","aria-orientation":"vertical",ref:En(f,m),...v.getStyles("dropdown",{className:n,style:r,styles:i,classNames:e,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:x,children:[v.withInitialFocusPlaceholder&&!v.hasSearch&&a.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),h]})});DE.classes=gl;DE.displayName="@mantine/core/MenuDropdown";const NE=Zi(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,color:o,closeMenuOnClick:l,leftSection:c,rightSection:h,children:f,disabled:p,"data-disabled":m,ref:v,...y}=xe("MenuItem",null,t),x=ya(),S=O.use(Im),w=pi(),{dir:A}=oc(),C=O.useRef(null),j=y,_=cr(j.onClick,()=>{m||(typeof l=="boolean"?l&&x.closeDropdownImmediately():x.closeOnItemClick&&x.closeDropdownImmediately())}),k=cr(j.onMouseMove,()=>{var D;if(!x.hasSearch)return;const I=(D=C.current)==null?void 0:D.closest("[data-menu-dropdown]");I&&I.querySelectorAll("[data-menu-active]").forEach(L=>{L!==C.current&&L.closest("[data-menu-dropdown]")===I&&L.removeAttribute("data-menu-active")})}),M=o?w.variantColorResolver({color:o,theme:w,variant:"light"}):void 0,R=o?sc({color:o,theme:w}):null,N=cr(j.onKeyDown,I=>{I.key==="ArrowLeft"&&S&&(S.close(),S.focusParentItem())});return a.jsxs(Nr,{onMouseDown:I=>I.preventDefault(),...y,unstyled:x.unstyled,tabIndex:x.menuItemTabIndex,...x.getStyles("item",{className:n,style:r,styles:i,classNames:e}),ref:En(C,v),role:"menuitem",disabled:p,"data-menu-item":!0,"data-disabled":p||m||void 0,"data-mantine-stop-propagation":!0,onClick:_,onMouseMove:k,onKeyDown:hb({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:x.loop,dir:A,orientation:"vertical",onKeyDown:N}),__vars:{"--menu-item-color":R!=null&&R.isThemeColor&&(R==null?void 0:R.shade)===void 0?`var(--mantine-color-${R.color}-6)`:M==null?void 0:M.color,"--menu-item-hover":M==null?void 0:M.hover},children:[x.alignItemsLabels==="all"&&a.jsx("div",{...x.getStyles("itemIndicator",{styles:i,classNames:e}),"data-placeholder":!0}),c&&a.jsx("div",{...x.getStyles("itemSection",{styles:i,classNames:e}),"data-position":"left",children:c}),f&&a.jsx("div",{...x.getStyles("itemLabel",{styles:i,classNames:e}),"data-menu-item-label":!0,children:f}),h&&a.jsx("div",{...x.getStyles("itemSection",{styles:i,classNames:e}),"data-position":"right",children:h})]})});NE.classes=gl;NE.displayName="@mantine/core/MenuItem";const IE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("MenuLabel",null,t);return a.jsx(ve,{...ya().getStyles("label",{className:n,style:r,styles:i,classNames:e}),...o})});IE.classes=gl;IE.displayName="@mantine/core/MenuLabel";const D$=O.createContext(null);function N$(t){const{value:e,defaultValue:n,onChange:r,children:i}=xe("MenuRadioGroup",null,t),[s,o]=si({value:e,defaultValue:n,finalValue:null,onChange:r});return a.jsx(D$,{value:{value:s,onChange:l=>o(l)},children:i})}N$.displayName="@mantine/core/MenuRadioGroup";function ire({size:t,style:e,...n}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:me(t),height:me(t),...e},"aria-hidden":!0,...n,children:a.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}const LE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,color:o,closeMenuOnClick:l,rightSection:c,children:h,disabled:f,"data-disabled":p,value:m,checked:v,onChange:y,checkIcon:x,ref:S,...w}=xe("MenuRadioItem",null,t),A=ya(),C=O.use(D$),j=v??(C?C.value===m:!1);return a.jsx(E$,{role:"menuitemradio",checked:j,indicator:x??A.checkIcon??a.jsx(ire,{size:5}),onSelect:()=>{j||(y?y(m):C&&C.onChange(m))},color:o,closeMenuOnClick:l,rightSection:c,disabled:f,dataDisabled:p,className:n,style:r,styles:i,classNames:e,buttonRef:S,others:w,children:h})});LE.classes=gl;LE.displayName="@mantine/core/MenuRadioItem";const sre="[data-menu-item]:not([data-disabled])",are="[data-menu-active]";function ZC(t){return t==null?void 0:t.closest("[data-menu-dropdown]")}function ore(t){return t?Array.from(t.querySelectorAll(sre)).filter(e=>e.closest("[data-menu-dropdown]")===t):[]}function g3(t){t&&t.querySelectorAll(are).forEach(e=>{e.closest("[data-menu-dropdown]")===t&&e.removeAttribute("data-menu-active")})}function T1(t,e){g3(e),t&&(t.setAttribute("data-menu-active","true"),t.scrollIntoView({block:"nearest"}))}function JC(t){return t.findIndex(e=>e.hasAttribute("data-menu-active"))}const lre={clearSearchOnClose:!0},BE=Ie(t=>{const{classNames:e,styles:n,onKeyDown:r,onChange:i,size:s,clearSearchOnClose:o,ref:l,...c}=xe("MenuSearch",lre,t),h=ya(),f=O.useRef(null),p=En(l,f),m=O.useRef(i);m.current=i,O.useEffect(()=>h.registerSearch(),[h.registerSearch]),O.useEffect(()=>{o?h.searchExitClearRef.current=()=>{var S;(S=m.current)==null||S.call(m,{currentTarget:{value:""}})}:h.searchExitClearRef.current=null},[o,h.searchExitClearRef]),O.useEffect(()=>{h.opened||g3(ZC(f.current))},[h.opened]);const v=cr(i,S=>{g3(ZC(S.currentTarget))}),y=cr(r,S=>{if(S.defaultPrevented)return;const w=ZC(S.currentTarget),A=ore(w);if(S.key==="ArrowDown"){if(S.preventDefault(),A.length===0)return;const C=JC(A);T1(A[C>=A.length-1?h.loop?0:C:C+1]??null,w)}else if(S.key==="ArrowUp"){if(S.preventDefault(),A.length===0)return;const C=JC(A);T1(A[C<=0?C===-1||h.loop?A.length-1:0:C-1]??null,w)}else if(S.key==="Home")S.preventDefault(),A.length>0&&T1(A[0],w);else if(S.key==="End")S.preventDefault(),A.length>0&&T1(A[A.length-1],w);else if(S.key==="Enter"){if(S.nativeEvent.isComposing||S.nativeEvent.keyCode===229)return;const C=A[JC(A)];C&&(S.preventDefault(),C.hasAttribute("data-sub-menu-item")?(C.focus(),C.dispatchEvent(new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:!0}))):C.click())}}),x=h.getStyles("search");return a.jsx(Ar,{"data-autofocus":!0,"data-mantine-stop-propagation":!0,type:"search",size:s,...c,ref:p,classNames:[{input:x.className},e],styles:[{input:x.style},n],onKeyDown:y,onChange:v,__staticSelector:"Menu"})});BE.classes=gl;BE.displayName="@mantine/core/MenuSearch";const PE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,onMouseEnter:o,onMouseLeave:l,onPointerEnter:c,onPointerLeave:h,onKeyDown:f,children:p,ref:m,...v}=xe("MenuSubDropdown",null,t),y=O.useRef(null),x=ya(),S=O.use(Im),w=R$({enabled:!x.hasSearch,opened:(S==null?void 0:S.opened)??!1,getDropdown:()=>y.current}),A=cr(f,j=>{w(j),!j.ctrlKey&&!j.metaKey&&!j.altKey&&j.key.length===1&&j.key!==" "&&j.stopPropagation()}),C=S==null?void 0:S.getFloatingProps({onMouseEnter:o,onMouseLeave:l,onPointerEnter:c,onPointerLeave:h});return a.jsx(Cn.Dropdown,{...v,...C,role:"menu","aria-orientation":"vertical",ref:En(m,y,S==null?void 0:S.setFloating),...x.getStyles("dropdown",{className:n,style:r,styles:i,classNames:e,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:A,children:p})});PE.classes=gl;PE.displayName="@mantine/core/MenuSubDropdown";const FE=Zi(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,color:o,leftSection:l,rightSection:c,children:h,disabled:f,"data-disabled":p,closeMenuOnClick:m,ref:v,...y}=xe("MenuSubItem",null,t),x=ya(),S=O.use(Im),w=pi(),{dir:A}=oc(),C=O.useRef(null),j=y,_=o?w.variantColorResolver({color:o,theme:w,variant:"light"}):void 0,k=o?sc({color:o,theme:w}):null,M=cr(j.onKeyDown,D=>{D.key==="ArrowRight"&&(S==null||S.open(),S==null||S.focusFirstItem()),D.key==="ArrowLeft"&&(S!=null&&S.parentContext)&&(S.parentContext.close(),S.parentContext.focusParentItem())}),R=cr(j.onClick,()=>{!p&&m&&x.closeDropdownImmediately()}),N=cr(j.onMouseMove,()=>{var L;if(!x.hasSearch)return;const D=(L=C.current)==null?void 0:L.closest("[data-menu-dropdown]");D&&D.querySelectorAll("[data-menu-active]").forEach(z=>{z!==C.current&&z.closest("[data-menu-dropdown]")===D&&z.removeAttribute("data-menu-active")})}),I=S==null?void 0:S.getReferenceProps({onMouseEnter:j.onMouseEnter,onMouseLeave:j.onMouseLeave,onPointerEnter:j.onPointerEnter,onPointerLeave:j.onPointerLeave});return a.jsxs(Nr,{onMouseDown:D=>D.preventDefault(),...y,...I,unstyled:x.unstyled,tabIndex:x.menuItemTabIndex,...x.getStyles("item",{className:n,style:r,styles:i,classNames:e}),ref:En(C,v,S==null?void 0:S.setReference),role:"menuitem",disabled:f,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":f||p||void 0,"data-mantine-stop-propagation":!0,onClick:R,onMouseMove:N,onKeyDown:hb({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:x.loop,dir:A,orientation:"vertical",onKeyDown:M}),__vars:{"--menu-item-color":k!=null&&k.isThemeColor&&(k==null?void 0:k.shade)===void 0?`var(--mantine-color-${k.color}-6)`:_==null?void 0:_.color,"--menu-item-hover":_==null?void 0:_.hover},children:[x.alignItemsLabels==="all"&&a.jsx("div",{...x.getStyles("itemIndicator",{styles:i,classNames:e}),"data-placeholder":!0}),l&&a.jsx("div",{...x.getStyles("itemSection",{styles:i,classNames:e}),"data-position":"left",children:l}),h&&a.jsx("div",{...x.getStyles("itemLabel",{styles:i,classNames:e}),"data-menu-item-label":!0,children:h}),a.jsx("div",{...x.getStyles("itemSection",{styles:i,classNames:e}),"data-position":"right",children:c||a.jsx(Dm,{...x.getStyles("chevron"),size:14})})]})});FE.classes=gl;FE.displayName="@mantine/core/MenuSubItem";function I$({children:t,refProp:e}){if(!OO(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 ya(),a.jsx(Cn.Target,{refProp:e,popupType:"menu",children:t})}I$.displayName="@mantine/core/MenuSubTarget";const cre={offset:0,position:"right-start",safeAreaPolygon:!0,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function l0(t){const{children:e,closeDelay:n,openDelay:r,position:i,safeAreaPolygon:s,opened:o,onChange:l,...c}=xe("MenuSub",cre,t),h=Ii(),[f,p]=si({value:o,finalValue:!1,onChange:l}),m=O.use(Im),v=ya(),{dir:y}=oc(),x=ZO(y,i),S=(m==null?void 0:m.registerOpenSub)??v.registerOpenSub,w=O.useRef(null),A=O.useCallback(L=>{const z=w.current;return z&&z!==L&&z(),w.current=L,()=>{w.current===L&&(w.current=null)}},[]),C=O.useRef(p);C.current=p;const j=O.useCallback(()=>C.current(!0),[]),_=O.useCallback(()=>C.current(!1),[]);O.useEffect(()=>{if(f)return S(_)},[f,S,_]);const{context:k,refs:M}=Fw({placement:x,open:f,onOpenChange:L=>{L?j():_()}}),{getReferenceProps:R,getFloatingProps:N}=E7([k7(k,{handleClose:s?$ee(typeof s=="object"?s:void 0):void 0,delay:{open:r,close:n}})]),I=()=>window.setTimeout(()=>{var L,z;(z=(L=document.getElementById(`${h}-dropdown`))==null?void 0:L.querySelectorAll("[data-menu-item]:not([data-disabled])")[0])==null||z.focus()},16),D=()=>window.setTimeout(()=>{var L;(L=document.getElementById(`${h}-target`))==null||L.focus()},16);return a.jsx(Im,{value:{opened:f,close:_,open:j,focusFirstItem:I,focusParentItem:D,parentContext:m,setReference:M.setReference,setFloating:M.setFloating,getReferenceProps:R,getFloatingProps:N,registerOpenSub:A},children:a.jsx(Cn,{opened:f,onChange:L=>L?j():_(),withinPortal:!1,withArrow:!1,id:h,position:i,...c,children:e})})}l0.extend=t=>t;l0.displayName="@mantine/core/MenuSub";l0.Target=I$;l0.Dropdown=PE;l0.Item=FE;const ure={refProp:"ref"};function L$(t){const{children:e,refProp:n,...r}=xe("MenuTarget",ure,t),i=bu(e);if(!i)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 s=ya(),o=i.props,l=cr(o.onClick,()=>{s.trigger==="click"?s.toggleDropdown():s.trigger==="click-hover"&&(s.setOpenedViaClick(!0),s.opened||s.openDropdown())}),c=cr(o.onMouseEnter,()=>(s.trigger==="hover"||s.trigger==="click-hover")&&s.openDropdown()),h=cr(o.onMouseLeave,()=>{(s.trigger==="hover"||s.trigger==="click-hover"&&!s.openedViaClick)&&s.closeDropdown()});return a.jsx(Cn.Target,{refProp:n,popupType:"menu",...r,children:O.cloneElement(i,{onClick:l,onMouseEnter:c,onMouseLeave:h,"data-expanded":s.opened?!0:void 0})})}L$.displayName="@mantine/core/MenuTarget";const hre={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1,alignItemsLabels:"with-indicators"},Ln=Ie(t=>{const e=xe("Menu",hre,t),{children:n,onOpen:r,onClose:i,opened:s,defaultOpened:o,trapFocus:l,onChange:c,closeOnItemClick:h,loop:f,closeOnEscape:p,trigger:m,openDelay:v,closeDelay:y,classNames:x,styles:S,unstyled:w,variant:A,vars:C,menuItemTabIndex:j,keepMounted:_,withInitialFocusPlaceholder:k,attributes:M,onExitTransitionEnd:R,alignItemsLabels:N,checkIcon:I,...D}=e,L=mt({name:"Menu",classes:gl,props:e,classNames:x,styles:S,unstyled:w,attributes:M}),[z,P]=si({value:s,defaultValue:o,finalValue:!1,onChange:c}),[H,B]=O.useState(!1),F=()=>{P(!1),B(!1),z&&(i==null||i())},q=()=>{P(!0),!z&&(r==null||r())},X=()=>{z?F():q()},{openDropdown:Y,closeDropdown:U}=Uee({open:q,close:F,closeDelay:y,openDelay:v}),V=O.useRef(null),G=O.useCallback(Se=>{const se=V.current;return se&&se!==Se&&se(),V.current=Se,()=>{V.current===Se&&(V.current=null)}},[]),J=O.useRef(0),[ne,de]=O.useState(!1),fe=O.useCallback(()=>(J.current+=1,J.current===1&&de(!0),()=>{J.current-=1,J.current===0&&de(!1)}),[]),ke=O.useRef(null),Me=()=>{var Se;(Se=ke.current)==null||Se.call(ke),R==null||R()},Oe=Se=>JX("[data-menu-item]","[data-menu-dropdown]",Se),{resolvedClassNames:Ye,resolvedStyles:ie}=Ya({classNames:x,styles:S,props:e});return a.jsx(tre,{value:{getStyles:L,opened:z,toggleDropdown:X,getItemIndex:Oe,openedViaClick:H,setOpenedViaClick:B,closeOnItemClick:h,closeDropdown:m==="click"?F:U,openDropdown:m==="click"?q:Y,closeDropdownImmediately:F,loop:f,trigger:m,unstyled:w,menuItemTabIndex:j,withInitialFocusPlaceholder:k,registerOpenSub:G,hasSearch:ne,registerSearch:fe,searchExitClearRef:ke,alignItemsLabels:N,checkIcon:I},children:a.jsx(Cn,{returnFocus:!0,...D,opened:z,onChange:X,defaultOpened:o,trapFocus:_?!1:l,closeOnEscape:p,__staticSelector:"Menu",classNames:Ye,styles:ie,unstyled:w,variant:A,keepMounted:_,onExitTransitionEnd:Me,children:n})})});Ln.displayName="@mantine/core/Menu";Ln.classes=gl;Ln.Item=NE;Ln.Label=IE;Ln.Dropdown=DE;Ln.Target=L$;Ln.Divider=RE;Ln.Search=BE;Ln.Sub=l0;Ln.CheckboxItem=ME;Ln.CheckboxGroup=O$;Ln.RadioItem=LE;Ln.RadioGroup=N$;Ln.ContextMenu=M$;const[dre,c0]=Ki("Modal component was not found in tree");var xu={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const r2=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("ModalBody",null,t);return a.jsx(mF,{...c0().getStyles("body",{classNames:e,style:r,styles:i,className:n}),...o})});r2.classes=xu;r2.displayName="@mantine/core/ModalBody";const i2=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("ModalCloseButton",null,t);return a.jsx(gF,{...c0().getStyles("close",{classNames:e,style:r,styles:i,className:n}),...o})});i2.classes=xu;i2.displayName="@mantine/core/ModalCloseButton";const s2=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,children:o,__hidden:l,...c}=xe("ModalContent",null,t),h=c0(),f=h.scrollAreaComponent||Xte;return a.jsx(vF,{...h.getStyles("content",{className:n,style:r,styles:i,classNames:e}),innerProps:h.getStyles("inner",{className:n,style:r,styles:i,classNames:e}),"data-full-screen":h.fullScreen||void 0,"data-modal-content":!0,"data-hidden":l||void 0,...c,children:a.jsx(f,{style:{maxHeight:h.fullScreen?"100dvh":`calc(100dvh - (${me(h.yOffset)} * 2))`},children:o})})});s2.classes=xu;s2.displayName="@mantine/core/ModalContent";const a2=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("ModalHeader",null,t);return a.jsx(bF,{...c0().getStyles("header",{classNames:e,style:r,styles:i,className:n}),...o})});a2.classes=xu;a2.displayName="@mantine/core/ModalHeader";const o2=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("ModalOverlay",null,t);return a.jsx(yF,{...c0().getStyles("overlay",{classNames:e,style:r,styles:i,className:n}),...o})});o2.classes=xu;o2.displayName="@mantine/core/ModalOverlay";const fre={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:jo("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},B$=(t,{radius:e,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":e===void 0?void 0:rr(e),"--modal-size":Gt(n,"modal-size"),"--modal-y-offset":me(r),"--modal-x-offset":me(i)}}),Tb=Ie(t=>{const e=xe("ModalRoot",fre,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,yOffset:c,scrollAreaComponent:h,radius:f,fullScreen:p,centered:m,xOffset:v,__staticSelector:y,attributes:x,...S}=e,w=mt({name:y,classes:xu,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:x,vars:l,varsResolver:B$});return a.jsx(dre,{value:{yOffset:c,scrollAreaComponent:h,getStyles:w,fullScreen:p},children:a.jsx(pF,{...w("root"),"data-full-screen":p||void 0,"data-centered":m||void 0,"data-offset-scrollbars":h===ga.Autosize||void 0,unstyled:o,...S})})});Tb.classes=xu;Tb.varsResolver=B$;Tb.displayName="@mantine/core/ModalRoot";const P$=O.createContext(null);function F$({children:t}){const[e,n]=O.useState([]),[r,i]=O.useState(jo("modal"));return a.jsx(P$,{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})}F$.displayName="@mantine/core/ModalStack";const l2=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("ModalTitle",null,t);return a.jsx(xF,{...c0().getStyles("title",{classNames:e,style:r,styles:i,className:n}),...o})});l2.classes=xu;l2.displayName="@mantine/core/ModalTitle";const pre={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:jo("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Ga=Ie(t=>{const{title:e,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:s,children:o,radius:l,opened:c,stackId:h,zIndex:f,...p}=xe("Modal",pre,t),m=O.use(P$),v=!!e||i,y=m&&h?{closeOnEscape:m.currentId===h,trapFocus:m.currentId===h,zIndex:m.getZIndex(h)}:{},x=n===!1?!1:h&&m?m.currentId===h:c;return O.useEffect(()=>{m&&h&&(c?m.addModal(h,f||jo("modal")):m.removeModal(h))},[c,h,f]),a.jsxs(Tb,{radius:l,opened:c,zIndex:m&&h?m.getZIndex(h):f,...p,...y,children:[n&&a.jsx(o2,{visible:x,transitionProps:m&&h?{duration:0}:void 0,...r}),a.jsxs(s2,{radius:l,__hidden:m&&h&&c?h!==m.currentId:!1,children:[v&&a.jsxs(a2,{children:[e&&a.jsx(l2,{children:e}),i&&a.jsx(i2,{...s})]}),a.jsx(r2,{children:o})]})]})});Ga.classes=xu;Ga.displayName="@mantine/core/Modal";Ga.Root=Tb;Ga.Overlay=o2;Ga.Content=s2;Ga.Body=r2;Ga.Header=a2;Ga.Title=l2;Ga.CloseButton=i2;Ga.Stack=F$;const c2=O.createContext(null);var u2={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const $$=O.createContext(null),H$=(t,{gap:e},{size:n})=>({group:{"--pg-gap":e!==void 0?Gt(e):Gt(n,"pg-gap")}}),h2=Ie(t=>{var y;const e=xe("PillGroup",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,size:c,disabled:h,attributes:f,...p}=e,m=((y=O.use(c2))==null?void 0:y.size)||c||void 0,v=mt({name:"PillGroup",classes:u2,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:f,vars:l,varsResolver:H$,stylesCtx:{size:m},rootSelector:"group"});return a.jsx($$,{value:{size:m,disabled:h},children:a.jsx(ve,{size:m,...v("group"),...p})})});h2.classes=u2;h2.varsResolver=H$;h2.displayName="@mantine/core/PillGroup";const mre={variant:"default"},z$=(t,{radius:e},{size:n})=>({root:{"--pill-fz":Gt(n,"pill-fz"),"--pill-height":Gt(n,"pill-height"),"--pill-radius":e===void 0?void 0:rr(e)}}),Wl=Ie(t=>{const e=xe("Pill",mre,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,variant:c,children:h,withRemoveButton:f,onRemove:p,removeButtonProps:m,radius:v,size:y,disabled:x,mod:S,attributes:w,...A}=e,C=O.use($$),j=O.use(c2),_=y||(C==null?void 0:C.size)||void 0,k=(j==null?void 0:j.variant)==="filled"?"contrast":c||"default",M=mt({name:"Pill",classes:u2,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:w,vars:l,varsResolver:z$,stylesCtx:{size:_}});return a.jsxs(ve,{component:"span",variant:k,size:_,...M("root",{variant:k}),mod:[{"with-remove":f&&!x,disabled:x||(C==null?void 0:C.disabled)},S],...A,children:[a.jsx("span",{...M("label"),children:h}),f&&a.jsx(ml,{variant:"transparent",radius:v,tabIndex:-1,"aria-hidden":!0,unstyled:o,...m,...M("remove",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),onMouseDown:R=>{var N;R.preventDefault(),R.stopPropagation(),(N=m==null?void 0:m.onMouseDown)==null||N.call(m,R)},onClick:R=>{var N;R.stopPropagation(),p==null||p(),(N=m==null?void 0:m.onClick)==null||N.call(m,R)}})]})});Wl.classes=u2;Wl.varsResolver=z$;Wl.displayName="@mantine/core/Pill";Wl.Group=h2;var q$={field:"m_45c4369d"};const gre={type:"visible"},$E=Ie(t=>{const e=xe("PillsInputField",gre,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,type:c,disabled:h,id:f,pointer:p,mod:m,attributes:v,ref:y,...x}=e,S=O.use(c2),w=O.use(If),A=mt({name:"PillsInputField",classes:q$,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:v,rootSelector:"field"}),C=h||(S==null?void 0:S.disabled);return a.jsx(ve,{component:"input",ref:En(y,S==null?void 0:S.fieldRef),"data-type":c,disabled:C,mod:[{disabled:C,pointer:p},m],...A("field"),...x,id:(w==null?void 0:w.inputId)||f,"aria-invalid":S==null?void 0:S.hasError,"aria-describedby":w==null?void 0:w.describedBy,type:"text",onMouseDown:j=>!p&&j.stopPropagation()})});$E.classes=q$;$E.displayName="@mantine/core/PillsInputField";const vre={size:"sm"},Yp=Ie(t=>{const{children:e,onMouseDown:n,onClick:r,size:i,disabled:s,__staticSelector:o,error:l,variant:c,...h}=xe(["Input","InputWrapper","PillsInput"],vre,t),f=O.useRef(null);return a.jsx(c2,{value:{fieldRef:f,size:i,disabled:s,hasError:!!l,variant:c},children:a.jsx(Ds,{size:i,error:l,variant:c,component:"div","data-no-overflow":!0,onMouseDown:p=>{var m;p.preventDefault(),n==null||n(p),(m=f.current)==null||m.focus()},onClick:p=>{var m,v;p.preventDefault(),(m=p.currentTarget.closest("fieldset"))!=null&&m.disabled||((v=f.current)==null||v.focus(),r==null||r(p))},...h,multiline:!0,disabled:s,__staticSelector:o||"PillsInput",withAria:!1,children:e})})});Yp.displayName="@mantine/core/PillsInput";Yp.classes=Ds.classes;Yp.Field=$E;var Q$={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const bre={withCloseButton:!0},U$=(t,{radius:e,color:n})=>({root:{"--notification-radius":e===void 0?void 0:rr(e),"--notification-color":n?wr(n,t):void 0}}),d2=Ie(t=>{const e=xe("Notification",bre,t),{className:n,color:r,radius:i,loading:s,withCloseButton:o,withBorder:l,title:c,icon:h,children:f,onClose:p,closeButtonProps:m,classNames:v,style:y,styles:x,unstyled:S,vars:w,mod:A,loaderProps:C,role:j,attributes:_,...k}=e,M=mt({name:"Notification",classes:Q$,props:e,className:n,style:y,classNames:v,styles:x,unstyled:S,attributes:_,vars:w,varsResolver:U$});return a.jsxs(ve,{...M("root"),mod:[{"data-with-icon":!!h||s,"data-with-border":l},A],role:j||"alert",...k,children:[h&&!s&&a.jsx("div",{...M("icon"),children:h}),s&&a.jsx(So,{size:28,color:r,...M("loader"),...C}),a.jsxs("div",{...M("body"),children:[c&&a.jsx("div",{...M("title"),children:c}),a.jsx(ve,{...M("description"),mod:{"data-with-title":!!c},children:f})]}),o&&a.jsx(ml,{iconSize:16,color:"gray",...m,unstyled:S,onClick:R=>{var N;(N=m==null?void 0:m.onClick)==null||N.call(m,R),p==null||p()},...M("closeButton")})]})});d2.classes=Q$;d2.varsResolver=U$;d2.displayName="@mantine/core/Notification";function W$(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 Lm;(function(t){t.event="event",t.props="prop"})(Lm||(Lm={}));function xh(){}function yre(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 Av(t){return!!(t||"").match(/\d/)}function Mh(t){return t==null}function xre(t){return typeof t=="number"&&isNaN(t)}function Y$(t){return Mh(t)||xre(t)||typeof t=="number"&&!isFinite(t)}function V$(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Are(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 wre(t,e,n){var r=Are(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 o5(t){var e=O.useRef(t);e.current=t;var n=O.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return e.current.apply(e,r)});return n.current}function HE(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 Sre(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 G$(t,e,n){for(var r="",i=n?"0":"",s=0;s<=e-1;s++)r+=t[s]||i;return r}function l5(t,e){return Array(e+1).join(t)}function X$(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."+l5("0",Math.abs(o))+i:o>=l?i=i+l5("0",o-l):i=(i.substring(0,o)||"0")+"."+i.substring(o),n+i}function c5(t,e,n){if(["","-"].indexOf(t)!==-1)return t;var r=(t.indexOf(".")!==-1||n)&&e,i=HE(t),s=i.beforeDecimal,o=i.afterDecimal,l=i.hasNegation,c=parseFloat("0."+(o||"0")),h=o.length<=e?"0."+o:c.toFixed(e),f=h.split("."),p=s;s&&Number(f[0])&&(p=s.split("").reverse().reduce(function(x,S,w){return x.length>w?(Number(x[0])+Number(S)).toString()+x.substring(1,x.length):S+x},f[0]));var m=G$(f[1]||"",e,n),v=l?"-":"",y=r?".":"";return""+v+p+y+m}function Qd(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 K$=yre(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}}}),jre=function(t,e){var n=Math.min(t.selectionStart,e);return{from:{start:n,end:t.selectionEnd},to:{start:n,end:e}}};function Cre(t,e,n){return Math.min(Math.max(t,e),n)}function e_(t){return Math.max(t.selectionStart,t.selectionEnd)}function _re(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Tre(t){return{from:{start:0,end:0},to:{start:0,end:t.length},lastValue:""}}function kre(t){var e=t.currentValue,n=t.formattedValue,r=t.currentValueIndex,i=t.formattedValueIndex;return e[r]===n[i]}function Ore(t,e,n,r,i,s,o){o===void 0&&(o=kre);var l=i.findIndex(function(j){return j}),c=t.slice(0,l);!e&&!n.startsWith(c)&&(e=c,n=c+n,r=r+c.length);for(var h=n.length,f=t.length,p={},m=new Array(h),v=0;v<h;v++){m[v]=-1;for(var y=0,x=f;y<x;y++){var S=o({currentValue:n,lastValue:e,formattedValue:t,currentValueIndex:v,formattedValueIndex:y});if(S&&p[y]!==!0){m[v]=y,p[y]=!0;break}}}for(var w=r;w<h&&(m[w]===-1||!s(n[w]));)w++;var A=w===h||m[w]===-1?f:m[w];for(w=r-1;w>0&&m[w]===-1;)w--;var C=w===-1||m[w]===-1?0:m[w]+1;return C>A?A:r-C<A-r?C:A}function u5(t,e,n,r){var i=t.length;if(e=Cre(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 Ere(t){for(var e=Array.from({length:t.length+1}).map(function(){return!0}),n=0,r=e.length;n<r;n++)e[n]=!!(Av(t[n])||Av(t[n-1]));return e}function Z$(t,e,n,r,i,s){s===void 0&&(s=xh);var o=o5(function(y,x){var S,w;return Y$(y)?(w="",S=""):typeof y=="number"||x?(w=typeof y=="number"?X$(y):y,S=r(w)):(w=i(y,void 0),S=r(w)),{formattedValue:S,numAsString:w}}),l=O.useState(function(){return o(Mh(t)?e:t,n)}),c=l[0],h=l[1],f=o5(function(y,x){y.formattedValue!==c.formattedValue&&h({formattedValue:y.formattedValue,numAsString:y.value}),s(y,x)}),p=t,m=n;Mh(t)&&(p=c.numAsString,m=!0);var v=o(p,m);return O.useMemo(function(){h(v)},[v.formattedValue]),O.useEffect(function(){if(!Mh(e)&&Mh(t)&&c.formattedValue!==""){var y=parseFloat(c.numAsString);f({formattedValue:c.formattedValue,value:c.numAsString,floatValue:isNaN(y)?void 0:y},{event:void 0,source:Lm.props})}},[]),[c,f]}function Mre(t){return t.replace(/[^0-9]/g,"")}function Rre(t){return t}function Dre(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=Rre);var l=t.removeFormatting;l===void 0&&(l=Mre);var c=t.defaultValue,h=t.valueIsNumericString,f=t.onValueChange,p=t.isAllowed,m=t.onChange;m===void 0&&(m=xh);var v=t.onKeyDown;v===void 0&&(v=xh);var y=t.onMouseUp;y===void 0&&(y=xh);var x=t.onFocus;x===void 0&&(x=xh);var S=t.onBlur;S===void 0&&(S=xh);var w=t.value,A=t.getCaretBoundary;A===void 0&&(A=Ere);var C=t.isValidInputCharacter;C===void 0&&(C=Av);var j=t.isCharacterSame,_=W$(t,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),k=Z$(w,c,!!h,o,l,f),M=k[0],R=M.formattedValue,N=M.numAsString,I=k[1],D=O.useRef(),L=O.useRef({formattedValue:R,numAsString:N}),z=function(Te,Xe){L.current={formattedValue:Te.formattedValue,numAsString:Te.value},I(Te,Xe)},P=O.useState(!1),H=P[0],B=P[1],F=O.useRef(null),q=O.useRef({setCaretTimeout:null,focusTimeout:null});O.useEffect(function(){return B(!0),function(){clearTimeout(q.current.setCaretTimeout),clearTimeout(q.current.focusTimeout)}},[]);var X=o,Y=function(Te,Xe){var at=parseFloat(Xe);return{formattedValue:Te,value:Xe,floatValue:isNaN(at)?void 0:at}},U=function(Te,Xe,at){Te.selectionStart===0&&Te.selectionEnd===Te.value.length||(Qd(Te,Xe),q.current.setCaretTimeout=setTimeout(function(){Te.value===at&&Te.selectionStart!==Xe&&Qd(Te,Xe)},0))},V=function(Te,Xe,at){return u5(Te,Xe,A(Te),at)},G=function(Te,Xe,at){var Ve=A(Xe),Ge=Ore(Xe,R,Te,at,Ve,C,j);return Ge=u5(Xe,Ge,Ve),Ge},J=function(Te){var Xe=Te.formattedValue;Xe===void 0&&(Xe="");var at=Te.input,Ve=Te.source,Ge=Te.event,ut=Te.numAsString,Ue;if(at){var De=Te.inputValue||at.value,Ce=e_(at);at.value=Xe,Ue=G(De,Xe,Ce),Ue!==void 0&&U(at,Ue,Xe)}Xe!==R&&z(Y(Xe,ut),{event:Ge,source:Ve})};O.useEffect(function(){var Te=L.current,Xe=Te.formattedValue,at=Te.numAsString;(R!==Xe||N!==at)&&z(Y(R,N),{event:void 0,source:Lm.props})},[R,N]);var ne=F.current?e_(F.current):void 0,de=typeof window<"u"?O.useLayoutEffect:O.useEffect;de(function(){var Te=F.current;if(R!==L.current.formattedValue&&Te){var Xe=G(L.current.formattedValue,R,ne);Te.value=R,U(Te,Xe,R)}},[R]);var fe=function(Te,Xe,at){var Ve=Xe.target,Ge=D.current?jre(D.current,Ve.selectionEnd):K$(R,Te),ut=Object.assign(Object.assign({},Ge),{lastValue:R}),Ue=l(Te,ut),De=X(Ue);if(Ue=l(De,void 0),p&&!p(Y(De,Ue))){var Ce=Xe.target,ze=e_(Ce),ht=G(Te,R,ze);return Ce.value=R,U(Ce,ht,R),!1}return J({formattedValue:De,numAsString:Ue,inputValue:Te,event:Xe,source:at,input:Xe.target}),!0},ke=function(Te,Xe){Xe===void 0&&(Xe=0);var at=Te.selectionStart,Ve=Te.selectionEnd;D.current={selectionStart:at,selectionEnd:Ve+Xe}},Me=function(Te){var Xe=Te.target,at=Xe.value,Ve=fe(at,Te,Lm.event);Ve&&m(Te),D.current=void 0},Oe=function(Te){var Xe=Te.target,at=Te.key,Ve=Xe.selectionStart,Ge=Xe.selectionEnd,ut=Xe.value;ut===void 0&&(ut="");var Ue;at==="ArrowLeft"||at==="Backspace"?Ue=Math.max(Ve-1,0):at==="ArrowRight"?Ue=Math.min(Ve+1,ut.length):at==="Delete"&&(Ue=Ve);var De=0;at==="Delete"&&Ve===Ge&&(De=1);var Ce=at==="ArrowLeft"||at==="ArrowRight";if(Ue===void 0||Ve!==Ge&&!Ce){v(Te),ke(Xe,De);return}var ze=Ue;if(Ce){var ht=at==="ArrowLeft"?"left":"right";ze=V(ut,Ue,ht),ze!==Ue&&Te.preventDefault()}else at==="Delete"&&!C(ut[Ue])?ze=V(ut,Ue,"right"):at==="Backspace"&&!C(ut[Ue])&&(ze=V(ut,Ue,"left"));ze!==Ue&&U(Xe,ze,ut),v(Te),ke(Xe,De)},Ye=function(Te){var Xe=Te.target,at=function(){var Ve=Xe.selectionStart,Ge=Xe.selectionEnd,ut=Xe.value;if(ut===void 0&&(ut=""),Ve===Ge){var Ue=V(ut,Ve);Ue!==Ve&&U(Xe,Ue,ut)}};at(),requestAnimationFrame(function(){at()}),y(Te),ke(Xe)},ie=function(Te){Te.persist&&Te.persist();var Xe=Te.target,at=Te.currentTarget;F.current=Xe,q.current.focusTimeout=setTimeout(function(){var Ve=Xe.selectionStart,Ge=Xe.selectionEnd,ut=Xe.value;ut===void 0&&(ut="");var Ue=V(ut,Ve);Ue!==Ve&&!(Ve===0&&Ge===ut.length)&&U(Xe,Ue,ut),x(Object.assign(Object.assign({},Te),{currentTarget:at}))},0)},Se=function(Te){F.current=null,clearTimeout(q.current.focusTimeout),clearTimeout(q.current.setCaretTimeout),S(Te)},se=H&&_re()?"numeric":void 0,_e=Object.assign({inputMode:se},_,{type:e,value:R,onChange:Me,onKeyDown:Oe,onMouseUp:Ye,onFocus:ie,onBlur:Se});if(n==="text")return i?zn.createElement(zn.Fragment,null,i(R,_)||null):zn.createElement("span",Object.assign({},_,{ref:s}),R);if(r){var et=r;return zn.createElement(et,Object.assign({},_e,{ref:s}))}return zn.createElement("input",Object.assign({},_e,{ref:s}))}function h5(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 c=f2(e),h=c.thousandSeparator,f=c.decimalSeparator,p=n!==0&&t.indexOf(".")!==-1||n&&r,m=HE(t,o),v=m.beforeDecimal,y=m.afterDecimal,x=m.addNegation;return n!==void 0&&(y=G$(y,n,!!r)),h&&(v=wre(v,h,l)),i&&(v=i+v),s&&(y=y+s),x&&(v="-"+v),t=v+(p&&f||"")+y,t}function f2(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 Nre(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 Ire(t,e){return new RegExp("(^-)|[0-9]|"+V$(t),"g")}function Lre(t,e,n){return t===""?!0:!(e!=null&&e.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof t=="string"&&!isNaN(Number(t))}function Bre(t,e,n){var r;e===void 0&&(e=Tre(t));var i=n.allowNegative,s=n.prefix;s===void 0&&(s="");var o=n.suffix;o===void 0&&(o="");var l=n.decimalScale,c=e.from,h=e.to,f=h.start,p=h.end,m=f2(n),v=m.allowedDecimalSeparators,y=m.decimalSeparator,x=t[p]===y;if(Av(t)&&(t===s||t===o)&&e.lastValue==="")return t;if(p-f===1&&v.indexOf(t[f])!==-1){var S=l===0?"":y;t=t.substring(0,f)+S+t.substring(f+1,t.length)}var w=function(F,q,X){var Y=!1,U=!1;s.startsWith("-")?Y=!1:F.startsWith("--")?(Y=!1,U=!0):o.startsWith("-")&&F.length===o.length?Y=!1:F[0]==="-"&&(Y=!0);var V=Y?1:0;return U&&(V=2),V&&(F=F.substring(V),q-=V,X-=V),{value:F,start:q,end:X,hasNegation:Y}},A=w(t,f,p),C=A.hasNegation;r=A,t=r.value,f=r.start,p=r.end;var j=w(e.lastValue,c.start,c.end),_=j.start,k=j.end,M=j.value,R=t.substring(f,p);t.length&&M.length&&(_>M.length-o.length||k<s.length)&&!(R&&o.startsWith(R))&&(t=M);var N=0;t.startsWith(s)?N+=s.length:f<s.length&&(N=f),t=t.substring(N),p-=N;var I=t.length,D=t.length-o.length;t.endsWith(o)?I=D:(p>D||p>t.length-o.length)&&(I=p),t=t.substring(0,I),t=Nre(C?"-"+t:t,i),t=(t.match(Ire(y))||[]).join("");var L=t.indexOf(y);t=t.replace(new RegExp(V$(y),"g"),function(F,q){return q===L?".":""});var z=HE(t,i),P=z.beforeDecimal,H=z.afterDecimal,B=z.addNegation;return h.end-h.start<c.end-c.start&&P===""&&x&&!parseFloat(H)&&(t=B?"-":""),t}function Pre(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,Math.min(n.length+(s?1:0),t.length));var o=t.length;return i.fill(!1,o-r.length+1,o+1),i}function Fre(t){var e=f2(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 $re(t){t=Fre(t),t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle;var e=t.suffix,n=t.allowNegative,r=t.allowLeadingZeros,i=t.onKeyDown;i===void 0&&(i=xh);var s=t.onBlur;s===void 0&&(s=xh);var o=t.thousandSeparator,l=t.decimalScale,c=t.fixedDecimalScale,h=t.prefix;h===void 0&&(h="");var f=t.defaultValue,p=t.value,m=t.valueIsNumericString,v=t.onValueChange,y=W$(t,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),x=f2(t),S=x.decimalSeparator,w=x.allowedDecimalSeparators,A=function(B){return h5(B,t)},C=function(B,F){return Bre(B,F,t)},j=Mh(p)?f:p,_=m??Lre(j,h,e);Mh(p)?Mh(f)||(_=_||typeof f=="number"):_=_||typeof p=="number";var k=function(B){return Y$(B)?B:(typeof B=="number"&&(B=X$(B)),_&&typeof l=="number"?c5(B,l,!!c):B)},M=Z$(k(p),k(f),!!_,A,C,v),R=M[0],N=R.numAsString,I=R.formattedValue,D=M[1],L=function(B){var F=B.target,q=B.key,X=F.selectionStart,Y=F.selectionEnd,U=F.value;if(U===void 0&&(U=""),(q==="Backspace"||q==="Delete")&&Y<h.length&&U!=="-"){B.preventDefault();return}if(X!==Y){i(B);return}q==="Backspace"&&U[0]==="-"&&X===h.length+1&&n&&Qd(F,1),l&&c&&(q==="Backspace"&&U[X-1]===S?(Qd(F,X-1),B.preventDefault()):q==="Delete"&&U[X]===S&&B.preventDefault()),w!=null&&w.includes(q)&&U[X]===S&&Qd(F,X+1);var V=o===!0?",":o;q==="Backspace"&&U[X-1]===V&&Qd(F,X-1),q==="Delete"&&U[X]===V&&Qd(F,X+1),i(B)},z=function(B){var F=N;if(F.match(/\d/g)||(F=""),r||(F=Sre(F)),c&&l&&(F=c5(F,l,c)),F!==N){var q=h5(F,t);D({formattedValue:q,value:F,floatValue:parseFloat(F)},{event:B,source:Lm.event})}s(B)},P=function(B){return B===S?!0:Av(B)},H=function(B){var F=B.currentValue,q=B.lastValue,X=B.formattedValue,Y=B.currentValueIndex,U=B.formattedValueIndex,V=F[Y],G=X[U],J=K$(q,F),ne=J.to,de=function(fe){return C(fe).indexOf(".")+h.length};return p===0&&c&&l&&F[ne.start]===S&&de(F)<Y&&de(X)>U?!1:Y>=ne.start&&Y<ne.end&&w&&w.includes(V)&&G===S?!0:V===G};return Object.assign(Object.assign({},y),{value:I,valueIsNumericString:!1,isValidInputCharacter:P,isCharacterSame:H,onValueChange:D,format:A,removeFormatting:C,getCaretBoundary:function(B){return Pre(B,t)},onKeyDown:L,onBlur:z})}function Hre(t){var e=$re(t);return zn.createElement(Dre,Object.assign({},e))}function d5({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"})})}var v3={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const zre=/^(0\.0*|-0(\.0*)?)$/,f5=/^-?0\d+(\.\d+)?\.?$/,qre=/\.\d*0$/,J$=/^-?\d+\.$/;function b3(t){return typeof t=="string"&&t!==""&&!Number.isNaN(Number(t))}function t_(t){return typeof t=="bigint"}function n_(t){return typeof t=="number"?t<Number.MAX_SAFE_INTEGER:t===""||b3(t)&&Number(t)<Number.MAX_SAFE_INTEGER}function eH(t,e){return t===""||t==="-"||!e&&t.startsWith("-")?!1:/^-?\d+$/.test(t)}function r_(t,e){return typeof t=="bigint"?!0:t===""||eH(t,e)}function Bg(t){if(!/^-?\d+$/.test(t))return null;try{return BigInt(t)}catch{return null}}function k1(t){if(typeof t=="bigint")return t;if(typeof t=="number"&&Number.isFinite(t)&&Number.isInteger(t))return BigInt(t)}function kx(t,e,n){return e!==void 0&&t<e?e:n!==void 0&&t>n?n:t}function Qre(t){return t.toString().replace(".","").length}function Ure(t,e){return(typeof t=="number"?t<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(t)))&&!Number.isNaN(t)&&Qre(e)<14&&e!==""}function Wre(t,e,n){return t===void 0?!0:(e===void 0||t>=e)&&(n===void 0||t<=n)}const i_={size:"sm",step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[".",","]},tH=(t,{size:e})=>({controls:{"--ni-chevron-size":Gt(e,"ni-chevron-size")}});function Yre(t,e,n){const r=t.toString(),i=J$.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=Lh(o,n,e);return i?`${l.toString().replace(/^0+(?=\d)/,"")}.`:l}function Vre(t,e){if(t===""||t==="-")return t;const n=Bg(t);return n===null?t:e.clampBehavior==="blur"?kx(n,e.min,e.max):n}const wv=sd(t=>{const e=xe(["Input","InputWrapper","NumberInput"],i_,t),{className:n,classNames:r,styles:i,unstyled:s,vars:o,onChange:l,onValueChange:c,value:h,defaultValue:f,max:p,min:m,step:v,hideControls:y,rightSection:x,isAllowed:S,clampBehavior:w,onBlur:A,allowDecimal:C,decimalScale:j,onKeyDown:_,onKeyDownCapture:k,handlersRef:M,startValue:R,disabled:N,rightSectionPointerEvents:I,allowNegative:D,readOnly:L,size:z,rightSectionWidth:P,stepHoldInterval:H,stepHoldDelay:B,allowLeadingZeros:F,withKeyboardEvents:q,trimLeadingZeroesOnBlur:X,allowedDecimalSeparators:Y,selectAllOnFocus:U,onMinReached:V,onMaxReached:G,onFocus:J,attributes:ne,ref:de,...fe}=e,ke=D??!0,Me=F??!0,Oe=mt({name:"NumberInput",classes:v3,props:e,classNames:r,styles:i,unstyled:s,attributes:ne,vars:o,varsResolver:tH}),{resolvedClassNames:Ye,resolvedStyles:ie}=Ya({classNames:r,styles:i,props:e}),Se=O.useRef(t_(h)||t_(f)?"bigint":"number");t_(h)?Se.current="bigint":typeof h=="number"&&(Se.current="number");const se=Se.current==="bigint",[_e,et]=si({value:h,defaultValue:f,finalValue:"",onChange:l}),Te=B!==void 0&&H!==void 0,Xe=O.useRef(null),at=O.useRef(null),Ve=O.useRef(0),Ge=typeof m=="number"?m:void 0,ut=typeof p=="number"?p:void 0,Ue=typeof v=="number"?v:i_.step,De=typeof R=="number"?R:i_.startValue,Ce=k1(m),ze=k1(p),ht=k1(v)??BigInt(1),Rt=k1(R)??BigInt(0),Tn=ye=>!eH(ye,ke)||Me&&f5.test(ye)?ye:Bg(ye)??ye,fn=ye=>{const We=Number(ye);return Number.isSafeInteger(We)?We:void 0},Zt=(ye,We)=>{We.source==="event"&&et(se?Tn(ye.value):Ure(ye.floatValue,ye.value)&&!zre.test(ye.value)&&!(Me&&f5.test(ye.value))&&!qre.test(ye.value)&&!J$.test(ye.value)?ye.floatValue:ye.value),c==null||c(ye,We)},lt=ye=>{const We=String(ye).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return We?Math.max(0,(We[1]?We[1].length:0)-(We[2]?+We[2]:0)):0},tn=ye=>{Xe.current&&typeof ye<"u"&&Xe.current.setSelectionRange(ye,ye)},Bt=O.useRef(cA);Bt.current=()=>{if(se){if(!r_(_e,ke))return;let nt;const _t=_e;if(typeof _t=="bigint"){const on=_t+ht;ze!==void 0&&on>ze&&(G==null||G()),nt=ze!==void 0&&on>ze?ze:on}else if(typeof _t=="string"&&_t!==""){const on=Bg(_t);if(on===null)return;const Vr=on+ht;ze!==void 0&&Vr>ze&&(G==null||G()),nt=ze!==void 0&&Vr>ze?ze:Vr}else nt=kx(Rt,Ce,ze);const Tt=nt.toString();et(nt),c==null||c({floatValue:fn(nt),formattedValue:Tt,value:Tt},{source:"increment"}),setTimeout(()=>{var on;return tn((on=Xe.current)==null?void 0:on.value.length)},0);return}if(!n_(_e))return;let ye;const We=lt(_e),qt=lt(Ue),Qt=Math.max(We,qt),tt=10**Qt;if(!b3(_e)&&(typeof _e!="number"||Number.isNaN(_e)))ye=Lh(De,Ge,ut);else if(ut!==void 0){const nt=(Math.round(Number(_e)*tt)+Math.round(Ue*tt))/tt;nt>ut&&(G==null||G()),ye=nt<=ut?nt:ut}else ye=(Math.round(Number(_e)*tt)+Math.round(Ue*tt))/tt;const Pe=ye.toFixed(Qt);et(parseFloat(Pe)),c==null||c({floatValue:parseFloat(Pe),formattedValue:Pe,value:Pe},{source:"increment"}),setTimeout(()=>{var nt;return tn((nt=Xe.current)==null?void 0:nt.value.length)},0)};const Lt=O.useRef(cA);Lt.current=()=>{if(se){if(!r_(_e,ke))return;let _t;const Tt=Ce!==void 0?Ce:ke?void 0:BigInt(0),on=_e;if(typeof on=="bigint"){const Gr=on-ht;Tt!==void 0&&Gr<Tt&&(V==null||V()),_t=Tt!==void 0&&Gr<Tt?Tt:Gr}else if(typeof on=="string"&&on!==""){const Gr=Bg(on);if(Gr===null)return;const _i=Gr-ht;Tt!==void 0&&_i<Tt&&(V==null||V()),_t=Tt!==void 0&&_i<Tt?Tt:_i}else _t=kx(Rt,Tt,ze);const Vr=_t.toString();et(_t),c==null||c({floatValue:fn(_t),formattedValue:Vr,value:Vr},{source:"decrement"}),setTimeout(()=>{var Gr;return tn((Gr=Xe.current)==null?void 0:Gr.value.length)},0);return}if(!n_(_e))return;let ye;const We=Ge!==void 0?Ge:ke?Number.MIN_SAFE_INTEGER:0,qt=lt(_e),Qt=lt(Ue),tt=Math.max(qt,Qt),Pe=10**tt;if(!b3(_e)&&typeof _e!="number"||Number.isNaN(_e))ye=Lh(De,We,ut);else{const _t=(Math.round(Number(_e)*Pe)-Math.round(Ue*Pe))/Pe;We!==void 0&&_t<We&&(V==null||V()),ye=We!==void 0&&_t<We?We:_t}const nt=ye.toFixed(tt);et(parseFloat(nt)),c==null||c({floatValue:parseFloat(nt),formattedValue:nt,value:nt},{source:"decrement"}),setTimeout(()=>{var _t;return tn((_t=Xe.current)==null?void 0:_t.value.length)},0)};const Wt=ye=>{var tt,Pe,nt;const We=ye.clipboardData.getData("text"),qt=fe.decimalSeparator||".",Qt=(Y||[".",","]).filter(_t=>_t!==qt);if(Qt.some(_t=>We.includes(_t))){ye.preventDefault();let _t=We;Qt.forEach(on=>{_t=_t.split(on).join(qt)});const Tt=Xe.current;if(Tt){const on=Tt.selectionStart??0,Vr=Tt.selectionEnd??0,Gr=Tt.value,_i=Gr.substring(0,on)+_t+Gr.substring(Vr);(Pe=(tt=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:tt.set)==null||Pe.call(Tt,_i),Tt.dispatchEvent(new Event("change",{bubbles:!0}));const jr=on+_t.length;setTimeout(()=>tn(jr),0)}}(nt=fe.onPaste)==null||nt.call(fe,ye)},jt=ye=>{var We,qt;_==null||_(ye),!(L||!q)&&(ye.key==="ArrowUp"&&(ye.preventDefault(),(We=Bt.current)==null||We.call(Bt)),ye.key==="ArrowDown"&&(ye.preventDefault(),(qt=Lt.current)==null||qt.call(Lt)))},Ht=ye=>{if(k==null||k(ye),ye.key==="Backspace"){const We=Xe.current;We&&We.selectionStart===0&&We.selectionStart===We.selectionEnd&&(ye.preventDefault(),window.setTimeout(()=>tn(0),0))}},cn=ye=>{U&&setTimeout(()=>ye.currentTarget.select(),0),J==null||J(ye)},qn=ye=>{let We=_e;se?(w==="blur"&&typeof We=="bigint"&&(We=kx(We,Ce,ze)),X&&typeof We=="string"&&(We=Vre(We,{min:Ce,max:ze,clampBehavior:w}))):(w==="blur"&&typeof We=="number"&&(We=Lh(We,Ge,ut)),X&&typeof We=="string"&&lt(We)<15&&(We=Yre(We,ut,Ge))),_e!==We&&et(We),A==null||A(ye)};hA(M,{increment:Bt.current,decrement:Lt.current});const bn=ye=>{var We,qt;ye?(We=Bt.current)==null||We.call(Bt):(qt=Lt.current)==null||qt.call(Lt),Ve.current+=1},un=ye=>{if(bn(ye),Te){const We=typeof H=="number"?H:H(Ve.current);at.current=window.setTimeout(()=>un(ye),We)}},ct=(ye,We)=>{var qt;ye.preventDefault(),(qt=Xe.current)==null||qt.focus(),bn(We),Te&&(at.current=window.setTimeout(()=>un(We),B))},re=()=>{at.current&&window.clearTimeout(at.current),at.current=null,Ve.current=0},Re=a.jsxs("div",{...Oe("controls"),children:[a.jsx(Nr,{...Oe("control"),tabIndex:-1,"aria-hidden":!0,disabled:N||typeof _e=="number"&&ut!==void 0&&_e>=ut||typeof _e=="bigint"&&ze!==void 0&&_e>=ze,mod:{direction:"up"},onMouseDown:ye=>ye.preventDefault(),onPointerDown:ye=>{ct(ye,!0)},onPointerUp:re,onPointerLeave:re,children:a.jsx(d5,{direction:"up"})}),a.jsx(Nr,{...Oe("control"),tabIndex:-1,"aria-hidden":!0,disabled:N||typeof _e=="number"&&Ge!==void 0&&_e<=Ge||typeof _e=="bigint"&&Ce!==void 0&&_e<=Ce,mod:{direction:"down"},onMouseDown:ye=>ye.preventDefault(),onPointerDown:ye=>{ct(ye,!1)},onPointerUp:re,onPointerLeave:re,children:a.jsx(d5,{direction:"down"})})]});return a.jsx(Ds,{component:Hre,allowNegative:D,className:$r(v3.root,n),size:z,...fe,inputMode:se?"numeric":"decimal",readOnly:L,disabled:N,value:typeof _e=="bigint"?_e.toString():_e,getInputRef:En(de,Xe),onValueChange:Zt,rightSection:y||L||!(se?r_(_e,ke):n_(_e))?x:x||Re,classNames:Ye,styles:ie,unstyled:s,__staticSelector:"NumberInput",decimalScale:se?0:C?j:0,onPaste:Wt,onFocus:cn,onKeyDown:jt,onKeyDownCapture:Ht,rightSectionPointerEvents:I??(N?"none":void 0),rightSectionWidth:P??`var(--ni-right-section-width-${z||"sm"})`,allowLeadingZeros:F,allowedDecimalSeparators:Y,onBlur:qn,attributes:ne,isAllowed:ye=>{if(!(!S||S(ye)))return!1;if(w!=="strict")return!0;if(!se)return Wre(ye.floatValue,Ge,ut);if(ye.value===""||ye.value==="-")return!0;const We=Bg(ye.value);return We===null?!0:(Ce===void 0||We>=Ce)&&(ze===void 0||We<=ze)}})});wv.classes={...Ds.classes,...v3};wv.varsResolver=tH;wv.displayName="@mantine/core/NumberInput";const[Gre,u0]=Ki("Pagination.Root component was not found in tree");var h0={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d",items:"m_105fdbed",label:"m_10817321"};const Xre={withPadding:!0},kb=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,active:o,disabled:l,withPadding:c,mod:h,...f}=xe("PaginationControl",Xre,t),p=u0(),m=l||p.disabled;return a.jsx(Nr,{disabled:m,mod:[{active:o,disabled:m,"with-padding":c},h],...p.getStyles("control",{className:n,style:r,classNames:e,styles:i,active:!m}),...f})});kb.classes=h0;kb.displayName="@mantine/core/PaginationControl";function Ob({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 Kre=t=>a.jsx(Ob,{...t,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),Zre=t=>a.jsx(Ob,{...t,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),Jre=t=>a.jsx(Ob,{...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"}),eie=t=>a.jsx(Ob,{...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"}),tie=t=>a.jsx(Ob,{...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"}),nie={icon:tie},p2=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,icon:o,...l}=xe("PaginationDots",nie,t);return a.jsx(ve,{...u0().getStyles("dots",{className:n,style:r,styles:i,classNames:e}),...l,children:a.jsx(o,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});p2.classes=h0;p2.displayName="@mantine/core/PaginationDots";function m2({icon:t,name:e,action:n,type:r}){const i={icon:t},s=o=>{const{icon:l,...c}=xe(e,i,o),h=u0(),f=r==="next"?h.active===h.total:h.active===1;return a.jsx(kb,{disabled:h.disabled||f,onClick:h[n],withPadding:!1,...c,children:a.jsx(l,{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}`,YP(s)}const nH=m2({icon:Kre,name:"PaginationNext",action:"onNext",type:"next"}),rH=m2({icon:Zre,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),iH=m2({icon:Jre,name:"PaginationFirst",action:"onFirst",type:"previous"}),sH=m2({icon:eie,name:"PaginationLast",action:"onLast",type:"next"});function bA({dotsIcon:t}){const e=u0();return a.jsx(a.Fragment,{children:e.range.map((n,r)=>{var i,s,o;return n==="dots"?a.jsx(p2,{icon:t},r):a.jsx(kb,{active:n===e.active,"aria-current":n===e.active?"page":void 0,onClick:()=>e.onChange(n),disabled:e.disabled,...(i=e.getItemProps)==null?void 0:i.call(e,n),children:((o=(s=e.getItemProps)==null?void 0:s.call(e,n))==null?void 0:o.children)??n},r)})})}bA.displayName="@mantine/core/PaginationItems";const rie={formatLabel:({page:t,totalPages:e})=>`Page ${t} of ${e}`},g2=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,formatLabel:o,...l}=xe("PaginationLabel",rie,t),c=u0();return a.jsx(ve,{...c.getStyles("label",{className:n,style:r,styles:i,classNames:e}),...l,children:o({page:c.active,totalPages:c.total})})});g2.classes=h0;g2.displayName="@mantine/core/PaginationLabel";const iie={siblings:1,boundaries:1},aH=(t,{size:e,radius:n,color:r,autoContrast:i})=>({root:{"--pagination-control-radius":n===void 0?void 0:rr(n),"--pagination-control-size":Gt(e,"pagination-control-size"),"--pagination-control-fz":Dr(e),"--pagination-active-bg":r?wr(r,t):void 0,"--pagination-active-color":t0(i,t)?id({color:r,theme:t,autoContrast:i}):void 0}}),Eb=Ie(t=>{const e=xe("PaginationRoot",iie,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,total:c,value:h,defaultValue:f,onChange:p,disabled:m,siblings:v,boundaries:y,color:x,radius:S,onNextPage:w,onPreviousPage:A,onFirstPage:C,onLastPage:j,getItemProps:_,autoContrast:k,startValue:M,layout:R,mod:N,attributes:I,...D}=e,L=mt({name:"Pagination",classes:h0,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:I,vars:l,varsResolver:aH}),{range:z,setPage:P,next:H,previous:B,active:F,first:q,last:X}=gK({page:h,initialPage:f,onChange:p,total:c,siblings:v,boundaries:y,startValue:M});return a.jsx(Gre,{value:{total:c,range:z,active:F,disabled:m,layout:R,getItemProps:_,onChange:P,onNext:cr(w,H),onPrevious:cr(A,B),onFirst:cr(C,q),onLast:cr(j,X),getStyles:L},children:a.jsx(ve,{...L("root"),mod:[{layout:R},N],...D})})});Eb.classes=h0;Eb.varsResolver=aH;Eb.displayName="@mantine/core/PaginationRoot";const sie={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8};function aie({children:t}){return a.jsx(ve,{...u0().getStyles("items"),children:t})}const Xa=Ie(t=>{const{withEdges:e,withControls:n,getControlProps:r,nextIcon:i,previousIcon:s,lastIcon:o,firstIcon:l,dotsIcon:c,total:h,gap:f,hideWithOnePage:p,withPages:m,layout:v,formatLabel:y,...x}=xe("Pagination",sie,t);if(h<=0||p&&h===1)return null;const S=m?v==="responsive"?a.jsxs(a.Fragment,{children:[a.jsx(aie,{children:a.jsx(bA,{dotsIcon:c})}),a.jsx(g2,{formatLabel:y})]}):a.jsx(bA,{dotsIcon:c}):null;return a.jsx(Eb,{total:h,layout:v,...x,children:a.jsxs(ft,{gap:f,children:[e&&a.jsx(iH,{icon:l,...r==null?void 0:r("first")}),n&&a.jsx(rH,{icon:s,...r==null?void 0:r("previous")}),S,n&&a.jsx(nH,{icon:i,...r==null?void 0:r("next")}),e&&a.jsx(sH,{icon:o,...r==null?void 0:r("last")})]})})});Xa.classes=h0;Xa.displayName="@mantine/core/Pagination";Xa.Root=Eb;Xa.Control=kb;Xa.Dots=p2;Xa.First=iH;Xa.Last=sH;Xa.Next=nH;Xa.Previous=rH;Xa.Items=bA;Xa.Label=g2;const[oie,oH]=Ki("Progress.Root component was not found in tree");var Mb={root:"m_db6d6462",section:"m_2242eb65","stripes-animation":"m_81a374bd","stripes-animation-vertical":"m_e0fb7a86",label:"m_91e40b74"};const zE=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,...o}=xe("ProgressLabel",null,t);return a.jsx(ve,{...oH().getStyles("label",{className:n,style:r,classNames:e,styles:i}),...o})});zE.classes=Mb;zE.displayName="@mantine/core/ProgressLabel";const lH=(t,{size:e,radius:n,transitionDuration:r})=>({root:{"--progress-size":Gt(e,"progress-size"),"--progress-radius":n===void 0?void 0:rr(n),"--progress-transition-duration":typeof r=="number"?`${r}ms`:void 0}}),Rb=Ie(t=>{const e=xe("ProgressRoot",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,autoContrast:c,transitionDuration:h,orientation:f,attributes:p,mod:m,...v}=e,y=mt({name:"Progress",classes:Mb,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:p,vars:l,varsResolver:lH});return a.jsx(oie,{value:{getStyles:y,autoContrast:c},children:a.jsx(ve,{mod:[{orientation:f},m],...y("root"),...v})})});Rb.classes=Mb;Rb.varsResolver=lH;Rb.displayName="@mantine/core/ProgressRoot";const lie={withAria:!0},v2=Ie(t=>{const{classNames:e,className:n,style:r,styles:i,vars:s,value:o,withAria:l,color:c,striped:h,animated:f,mod:p,...m}=xe("ProgressSection",lie,t),v=oH(),y=pi(),x=l?{role:"progressbar","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":o,"aria-valuetext":`${o}%`}:{};return a.jsx(ve,{...v.getStyles("section",{className:n,classNames:e,styles:i,style:r}),...m,...x,mod:[{striped:h||f,animated:f},p],__vars:{"--progress-section-size":`${o}%`,"--progress-section-color":wr(c,y),"--progress-label-color":t0(v.autoContrast,y)?id({color:c,theme:y,autoContrast:v.autoContrast}):void 0}})});v2.classes=Mb;v2.displayName="@mantine/core/ProgressSection";const d0=Ie(t=>{const e=xe("Progress",null,t),{value:n,classNames:r,styles:i,vars:s,color:o,striped:l,animated:c,"aria-label":h,...f}=e,{resolvedClassNames:p,resolvedStyles:m}=Ya({classNames:r,styles:i,props:e});return a.jsx(Rb,{classNames:p,styles:m,vars:s,...f,children:a.jsx(v2,{value:n,color:o,striped:l,animated:c,"aria-label":h})})});d0.classes=Mb;d0.displayName="@mantine/core/Progress";d0.Section=v2;d0.Root=Rb;d0.Label=zE;function cie({offset:t,position:e,defaultOpened:n}){const[r,i]=O.useState(n),s=O.useRef(null),{x:o,y:l,elements:c,refs:h,update:f,placement:p}=Fw({placement:e,middleware:[WO({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,y=O.useCallback(({clientX:x,clientY:S})=>{h.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x,y:S,left:x+m,top:S+v,right:x,bottom:S}}})},[c.reference]);return O.useEffect(()=>{if(h.floating.current){const x=s.current;x.addEventListener("mousemove",y);const S=iu(h.floating.current);return S.forEach(w=>{w.addEventListener("scroll",f)}),()=>{x.removeEventListener("mousemove",y),S.forEach(w=>{w.removeEventListener("scroll",f)})}}},[c.reference,h.floating.current,f,y,r]),{handleMouseMove:y,x:o,y:l,opened:r,setOpened:i,boundaryRef:s,floating:h.setFloating}}var b2={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const uie={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:jo("popover")},cH=(t,{radius:e,color:n})=>({tooltip:{"--tooltip-radius":e===void 0?void 0:rr(e),"--tooltip-bg":n?wr(n,t):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),y2=Ie(t=>{const e=xe("TooltipFloating",uie,t),{children:n,refProp:r,withinPortal:i,style:s,className:o,classNames:l,styles:c,unstyled:h,radius:f,color:p,label:m,offset:v,position:y,multiline:x,zIndex:S,disabled:w,defaultOpened:A,variant:C,vars:j,portalProps:_,attributes:k,ref:M,...R}=e,N=pi(),I=mt({name:"TooltipFloating",props:e,classes:b2,className:o,style:s,classNames:l,styles:c,unstyled:h,attributes:k,rootSelector:"tooltip",vars:j,varsResolver:cH}),{handleMouseMove:D,x:L,y:z,opened:P,boundaryRef:H,floating:B,setOpened:F}=cie({offset:v,position:y,defaultOpened:A}),q=bu(n);if(!q)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 X=En(H,_w(q),M),Y=q.props,U=G=>{var J;(J=Y.onMouseEnter)==null||J.call(Y,G),D(G),F(!0)},V=G=>{var J;(J=Y.onMouseLeave)==null||J.call(Y,G),F(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(zh,{..._,withinPortal:i,children:a.jsx(ve,{...R,...I("tooltip",{style:{...vv(s,N),zIndex:S,display:!w&&P?"block":"none",top:(z&&Math.round(z))??"",left:(L&&Math.round(L))??""}}),variant:C,ref:B,mod:{multiline:x},children:m})}),O.cloneElement(q,{...Y,[r]:X,onMouseEnter:U,onMouseLeave:V})]})});y2.classes=b2;y2.varsResolver=cH;y2.displayName="@mantine/core/TooltipFloating";const uH=O.createContext({withinGroup:!1}),hie={openDelay:0,closeDelay:0};function qE(t){const{openDelay:e,closeDelay:n,children:r}=xe("TooltipGroup",hie,t);return a.jsx(uH,{value:{withinGroup:!0},children:a.jsx(Oee,{delay:{open:e,close:n},children:r})})}qE.displayName="@mantine/core/TooltipGroup";qE.extend=t=>t;function die(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 fie(t){const e=die(t.middlewares),n=[j7(t.offset)];return e.shift&&n.push(WO(typeof e.shift=="boolean"?{padding:8}:{padding:8,...e.shift})),e.flip&&n.push(typeof e.flip=="boolean"?f3():f3(e.flip)),n.push(C7({element:t.arrowRef,padding:t.arrowOffset})),e.inline?n.push(typeof e.inline=="boolean"?tv():tv(e.inline)):t.inline&&n.push(tv()),n}function pie(t){var _,k,M;const[e,n]=O.useState(t.defaultOpened),r=typeof t.opened=="boolean"?t.opened:e,i=O.use(uH).withinGroup,s=Ii(),o=O.useCallback(R=>{n(R),R&&S(s)},[s]),{x:l,y:c,context:h,refs:f,placement:p,middlewareData:{arrow:{x:m,y:v}={}}}=Fw({strategy:t.strategy,placement:t.position,open:r,onOpenChange:o,middleware:fie(t),whileElementsMounted:d3}),{delay:y,currentId:x,setCurrentId:S}=Eee(h,{id:s}),{getReferenceProps:w,getFloatingProps:A}=E7([k7(h,{enabled:(_=t.events)==null?void 0:_.hover,delay:i?y:{open:t.openDelay,close:t.closeDelay},mouseOnly:!((k=t.events)!=null&&k.touch)}),Lee(h,{enabled:(M=t.events)==null?void 0:M.focus,visibleOnly:!0}),Pee(h,{role:"tooltip"}),Nee(h,{enabled:typeof t.opened>"u"})]),C=O.useRef(p);nc(()=>{var R;C.current!==p&&(C.current=p,(R=t.onPositionChange)==null||R.call(t,p))},[p]);const j=r&&x&&x!==s;return{x:l,y:c,arrowX:m,arrowY:v,reference:f.setReference,floating:f.setFloating,getFloatingProps:A,getReferenceProps:w,isGroupPhase:j,opened:r,placement:p}}const mie={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:jo("popover"),middlewares:{flip:!0,shift:!0,inline:!1}},hH=(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:rr(e),"--tooltip-bg":n?s.background:void 0,"--tooltip-color":n?s.color:void 0}}},qr=Ie(t=>{const e=xe("Tooltip",mie,t),{children:n,position:r,refProp:i,label:s,openDelay:o,closeDelay:l,onPositionChange:c,opened:h,defaultOpened:f,withinPortal:p,radius:m,color:v,classNames:y,styles:x,unstyled:S,style:w,className:A,withArrow:C,arrowSize:j,arrowOffset:_,arrowRadius:k,arrowPosition:M,offset:R,transitionProps:N,multiline:I,events:D,zIndex:L,disabled:z,onClick:P,onMouseEnter:H,onMouseLeave:B,inline:F,variant:q,keepMounted:X,vars:Y,portalProps:U,mod:V,floatingStrategy:G,middlewares:J,autoContrast:ne,attributes:de,target:fe,ref:ke,...Me}=e,{dir:Oe}=oc(),Ye=O.useRef(null),ie=pie({position:ZO(Oe,r),closeDelay:l,openDelay:o,onPositionChange:c,opened:h,defaultOpened:f,events:D,arrowRef:Ye,arrowOffset:_,offset:typeof R=="number"?R+(C?j/2:0):R,inline:F,strategy:G,middlewares:J});O.useEffect(()=>{const Ve=fe instanceof HTMLElement?fe:typeof fe=="string"?document.querySelector(fe):(fe==null?void 0:fe.current)||null;Ve&&ie.reference(Ve)},[fe,ie]);const Se=mt({name:"Tooltip",props:e,classes:b2,className:A,style:w,classNames:y,styles:x,unstyled:S,attributes:de,rootSelector:"tooltip",vars:Y,varsResolver:hH}),se=bu(n);if(!fe&&!se)throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const _e=Se("tooltip"),et=M==="merge"&&C?P7({position:ie.placement,dir:Oe}):void 0;if(fe){const Ve=G8(N,{duration:100,transition:"fade"});return a.jsx(a.Fragment,{children:a.jsx(zh,{...U,withinPortal:p,children:a.jsx(ic,{...Ve,keepMounted:X,mounted:!z&&!!ie.opened,duration:ie.isGroupPhase?10:Ve.duration,children:Ge=>a.jsxs(ve,{...Me,"data-fixed":G==="fixed"||void 0,variant:q,mod:[{multiline:I},V],..._e,...ie.getFloatingProps({ref:ie.floating,className:_e.className,style:{..._e.style,...Ge,...et,zIndex:L,top:ie.y??0,left:ie.x??0}}),children:[s,a.jsx(vA,{ref:Ye,arrowX:ie.arrowX,arrowY:ie.arrowY,visible:C,position:ie.placement,arrowSize:j,arrowOffset:_,arrowRadius:k,arrowPosition:M,...Se("arrow")})]})})})})}const Te=se.props,Xe=En(ie.reference,_w(se),ke),at=G8(N,{duration:100,transition:"fade"});return a.jsxs(a.Fragment,{children:[a.jsx(zh,{...U,withinPortal:p,children:a.jsx(ic,{...at,keepMounted:X,mounted:!z&&!!ie.opened,duration:ie.isGroupPhase?10:at.duration,children:Ve=>a.jsxs(ve,{...Me,"data-fixed":G==="fixed"||void 0,variant:q,mod:[{multiline:I},V],...ie.getFloatingProps({ref:ie.floating,className:Se("tooltip").className,style:{...Se("tooltip").style,...Ve,...et,zIndex:L,top:ie.y??0,left:ie.x??0}}),children:[s,a.jsx(vA,{ref:Ye,arrowX:ie.arrowX,arrowY:ie.arrowY,visible:C,position:ie.placement,arrowSize:j,arrowOffset:_,arrowRadius:k,arrowPosition:M,...Se("arrow")})]})})}),O.cloneElement(se,ie.getReferenceProps({onClick:P,onMouseEnter:H,onMouseLeave:B,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,...Te,className:$r(A,Te.className),[i]:Xe}))]})});qr.classes=b2;qr.varsResolver=hH;qr.displayName="@mantine/core/Tooltip";qr.Floating=y2;qr.Group=qE;function gie({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,c=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:c,strokeDashoffset:i?0:s||0}}function dH({size:t,value:e,offset:n,sum:r,thickness:i,root:s,color:o,lineRoundCaps:l,tooltip:c,getStyles:h,display:f,...p}){const m=pi();return a.jsx(qr.Floating,{disabled:!c,label:c,children:a.jsx(ve,{component:"circle",...p,...h("curve"),__vars:{"--curve-color":o?wr(o,m):void 0},fill:"none",strokeLinecap:l?"round":"butt",...gie({sum:r,size:t,thickness:i,value:e,offset:n,root:s})})})}dH.displayName="@mantine/core/Curve";function vie({size:t,thickness:e,sections:n,renderRoundedLineCaps:r,rootColor:i,sectionGap:s=0}){const o=n.reduce((m,v)=>m+v.value,0),l=Math.PI*((t*.9-e*2)/2)*2;let c=l;const h=[],f=[],p=s/360*100;for(let m=0;m<n.length;m+=1){const v=Math.max(0,n[m].value-p);h.push({sum:o,offset:c,data:{...n[m],value:v},root:!1}),c-=n[m].value/100*l}if(h.push({sum:o,offset:c,data:{color:i},root:!0}),f.push({...h[h.length-1],lineRoundCaps:!1}),h.length>2){f.push({...h[0],lineRoundCaps:r}),f.push({...h[h.length-2],lineRoundCaps:r});for(let m=1;m<=h.length-3;m+=1)f.push({...h[m],lineRoundCaps:!1})}else f.push({...h[0],lineRoundCaps:r});return f}var fH={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function bie(t,e){return Math.min(t||12,(e||120)/4)}const yie={size:120,thickness:12,startAngle:270},pH=(t,{size:e,thickness:n,transitionDuration:r,startAngle:i})=>({root:{"--rp-size":me(e),"--rp-label-offset":me(n*2),"--rp-transition-duration":r?`${r}ms`:void 0},svg:{"--rp-start-angle":`${i}deg`}}),Db=Ie(t=>{const e=xe("RingProgress",yie,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,label:c,sections:h,size:f,thickness:p,roundCaps:m,rootColor:v,transitionDuration:y,sectionGap:x,startAngle:S,attributes:w,...A}=e,C=mt({name:"RingProgress",classes:fH,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:w,vars:l,varsResolver:pH}),j=bie(p,f),_=vie({size:f,thickness:j,sections:h,renderRoundedLineCaps:m,rootColor:v,sectionGap:x}).map(({data:k,sum:M,root:R,lineRoundCaps:N,offset:I},D)=>O.createElement(dH,{...k,key:D,size:f,thickness:j,sum:M,offset:I,color:k==null?void 0:k.color,root:R,lineRoundCaps:N,getStyles:C}));return a.jsxs(ve,{...C("root"),size:f,...A,children:[a.jsx("svg",{...C("svg"),viewBox:`0 0 ${f} ${f}`,children:_}),c&&a.jsx("div",{...C("label"),children:c})]})});Db.classes=fH;Db.varsResolver=pH;Db.displayName="@mantine/core/RingProgress";var mH={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const xie={withItemsBorders:!0},gH=(t,{radius:e,color:n,transitionDuration:r,size:i,transitionTimingFunction:s})=>({root:{"--sc-radius":e===void 0?void 0:rr(e),"--sc-color":n?wr(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":Gt(i,"sc-padding"),"--sc-font-size":Dr(i)}}),f0=sd(t=>{var Me,Oe;const e=xe("SegmentedControl",xie,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,data:c,value:h,defaultValue:f,onChange:p,size:m,name:v,disabled:y,readOnly:x,fullWidth:S,orientation:w,radius:A,color:C,transitionDuration:j,transitionTimingFunction:_,variant:k,autoContrast:M,withItemsBorders:R,mod:N,attributes:I,ref:D,...L}=e,z=mt({name:"SegmentedControl",props:e,classes:mH,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:I,vars:l,varsResolver:gH}),P=pi(),H=c.map(Ye=>PK(Ye)?{label:`${Ye}`,value:Ye}:Ye),B=_K(),[F,q]=O.useState(Em()),[X,Y]=O.useState(null),[U,V]=O.useState({}),G=(Ye,ie)=>{U[ie]=Ye,V(U)},[J,ne]=si({value:h,defaultValue:f,finalValue:Array.isArray(c)?((Me=H.find(Ye=>!Ye.disabled))==null?void 0:Me.value)??((Oe=c[0])==null?void 0:Oe.value)??null:null,onChange:p}),de=Ii(v),fe=H.map(Ye=>O.createElement(ve,{...z("control"),mod:{active:J===Ye.value,orientation:w},key:`${Ye.value}`},O.createElement("input",{...z("input"),disabled:y||Ye.disabled,type:"radio",name:de,value:`${Ye.value}`,id:`${de}-${Ye.value}`,checked:J===Ye.value,onChange:()=>!x&&ne(Ye.value),"data-focus-ring":P.focusRing,key:`${Ye.value}-input`}),O.createElement(ve,{component:"label",...z("label"),mod:{active:J===Ye.value&&!(y||Ye.disabled),disabled:y||Ye.disabled,"read-only":x},htmlFor:`${de}-${Ye.value}`,ref:ie=>G(ie,`${Ye.value}`),__vars:{"--sc-label-color":C!==void 0?id({color:C,theme:P,autoContrast:M}):void 0},key:`${Ye.value}-label`},a.jsx("span",{...z("innerLabel"),children:Ye.label})))),ke=En(D,Y);return wK(()=>{q(Em())},[c.length]),c.length===0?null:a.jsxs(ve,{...z("root"),variant:k,size:m,ref:ke,mod:[{"full-width":S,orientation:w,initialized:B,"with-items-borders":R},N],...L,role:"radiogroup","data-disabled":y,children:[typeof J<"u"&&a.jsx(Ww,{target:U[`${J}`],parent:X,component:"span",transitionDuration:"var(--sc-transition-duration)",...z("indicator")},F),fe]})});f0.classes=mH;f0.varsResolver=gH;f0.displayName="@mantine/core/SegmentedControl";const Aie={size:"sm",withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left",openOnFocus:!0},p0=sd(t=>{const e=xe(["Input","InputWrapper","Select"],Aie,t),{classNames:n,styles:r,unstyled:i,vars:s,dropdownOpened:o,defaultDropdownOpened:l,onDropdownClose:c,onDropdownOpen:h,onFocus:f,onBlur:p,onClick:m,onChange:v,data:y,value:x,defaultValue:S,selectFirstOptionOnChange:w,selectFirstOptionOnDropdownOpen:A,onOptionSubmit:C,comboboxProps:j,readOnly:_,disabled:k,filter:M,limit:R,withScrollArea:N,maxDropdownHeight:I,floatingHeight:D,size:L,searchable:z,rightSection:P,checkIconPosition:H,withCheckIcon:B,withAlignedLabels:F,nothingFoundMessage:q,name:X,form:Y,searchValue:U,defaultSearchValue:V,onSearchChange:G,allowDeselect:J,error:ne,rightSectionPointerEvents:de,id:fe,clearable:ke,clearSectionMode:Me,clearButtonProps:Oe,hiddenInputProps:Ye,renderOption:ie,onClear:Se,autoComplete:se,scrollAreaProps:_e,__defaultRightSection:et,__clearSection:Te,__clearable:Xe,chevronColor:at,autoSelectOnBlur:Ve,openOnFocus:Ge,attributes:ut,...Ue}=e,De=O.useMemo(()=>$F(y),[y]),Ce=O.useRef({}),ze=O.useMemo(()=>hE(De),[De]),ht=Ii(fe),[Rt,Tn,fn]=si({value:x,defaultValue:S,finalValue:null,onChange:v}),Zt=Rt!=null?`${Rt}`in ze?ze[`${Rt}`]:Ce.current[`${Rt}`]:void 0,lt=jK(Zt),[tn,Bt,Lt]=si({value:U,defaultValue:V,finalValue:Zt?Zt.label:"",onChange:G}),Wt=Yw({opened:o,defaultOpened:l,onDropdownOpen:()=>{h==null||h(),A?Wt.selectFirstOption():Wt.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{c==null||c(),setTimeout(Wt.resetSelectedOption,0)}}),jt=un=>{Bt(un),Wt.resetSelectedOption()},{resolvedClassNames:Ht,resolvedStyles:cn}=Ya({props:e,styles:r,classNames:n});O.useEffect(()=>{w&&Wt.selectFirstOption()},[w,tn]),O.useEffect(()=>{x===null&&jt(""),x!=null&&Zt&&((lt==null?void 0:lt.value)!==Zt.value||(lt==null?void 0:lt.label)!==Zt.label)&&jt(Zt.label)},[x,Zt]),O.useEffect(()=>{var un,ct;!fn&&!Lt&&jt(Rt!=null?`${Rt}`in ze?(un=ze[`${Rt}`])==null?void 0:un.label:((ct=Ce.current[`${Rt}`])==null?void 0:ct.label)||"":"")},[ze,Rt]),O.useEffect(()=>{Rt&&`${Rt}`in ze&&(Ce.current[`${Rt}`]=ze[`${Rt}`])},[ze,Rt]);const qn=a.jsx(ln.ClearButton,{...Oe,onClear:()=>{Tn(null,null),jt(""),Se==null||Se()}}),bn=ke&&Rt!=null&&!k&&!_;return a.jsxs(a.Fragment,{children:[a.jsxs(ln,{store:Wt,__staticSelector:"Select",classNames:Ht,styles:cn,unstyled:i,readOnly:_,size:L,attributes:ut,floatingHeight:D,keepMounted:Ve,onOptionSubmit:un=>{C==null||C(un);const ct=J&&`${ze[un].value}`==`${Rt}`?null:ze[un],re=ct?ct.value:null;re!==Rt&&Tn(re,ct),!fn&&jt(re!=null&&(ct==null?void 0:ct.label)||""),Wt.closeDropdown()},...j,children:[a.jsx(ln.Target,{targetType:z?"input":"button",autoComplete:se,withExpandedAttribute:!0,children:a.jsx(Ds,{id:ht,__defaultRightSection:a.jsx(ln.Chevron,{size:L,error:ne,unstyled:i,color:at}),__clearSection:qn,__clearable:bn,__clearSectionMode:Me,rightSection:P,rightSectionPointerEvents:de||"none",...Ue,size:L,__staticSelector:"Select",disabled:k,readOnly:_||!z,value:tn,onChange:un=>{jt(un.currentTarget.value),Wt.openDropdown(),w&&Wt.selectFirstOption()},onFocus:un=>{Ge&&z&&Wt.openDropdown(),f==null||f(un)},onBlur:un=>{Ve&&Wt.clickSelectedOption(),z&&Wt.closeDropdown();const ct=Rt!=null&&(`${Rt}`in ze?ze[`${Rt}`]:Ce.current[`${Rt}`]);jt(ct&&ct.label||""),p==null||p(un)},onClick:un=>{z?Wt.openDropdown():Wt.toggleDropdown(),m==null||m(un)},classNames:Ht,styles:cn,unstyled:i,pointer:!z,error:ne,attributes:ut})}),a.jsx(o$,{data:De,hidden:_||k,filter:M,search:tn,limit:R,hiddenWhenEmpty:!q,withScrollArea:N,maxDropdownHeight:I,filterOptions:!!z&&(Zt==null?void 0:Zt.label)!==tn,value:Rt,checkIconPosition:H,withCheckIcon:B,withAlignedLabels:F,nothingFoundMessage:q,unstyled:i,labelId:Ue.label?`${ht}-label`:void 0,"aria-label":Ue.label?void 0:Ue["aria-label"],renderOption:ie,scrollAreaProps:_e})]}),a.jsx(ln.HiddenInput,{value:Rt,name:X,form:Y,disabled:k,...Ye})]})});p0.classes={...Ds.classes,...ln.classes};p0.displayName="@mantine/core/Select";function vH(t){if(t!==void 0)return typeof t=="number"?me(t):t}function wie({spacing:t,verticalSpacing:e,cols:n,minColWidth:r,autoRows:i,selector:s}){var p;const o=pi(),l=e===void 0?t:e,c=r!==void 0,h=ub({"--sg-spacing-x":Gi(Qp(t)),"--sg-spacing-y":Gi(Qp(l)),"--sg-auto-rows":i,...c?{"--sg-min-col-width":vH(r)}:{"--sg-cols":(p=Qp(n))==null?void 0:p.toString()}}),f=ri(o.breakpoints).reduce((m,v)=>(m[v]||(m[v]={}),typeof t=="object"&&t[v]!==void 0&&(m[v]["--sg-spacing-x"]=Gi(t[v])),typeof l=="object"&&l[v]!==void 0&&(m[v]["--sg-spacing-y"]=Gi(l[v])),!c&&typeof n=="object"&&n[v]!==void 0&&(m[v]["--sg-cols"]=n[v]),m),{});return a.jsx(Ew,{styles:h,media:t3(ri(f),o.breakpoints).filter(m=>ri(f[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:f[m.value]})),selector:s})}function s_(t){return typeof t=="object"&&t!==null?ri(t):[]}function Sie(t){return t.sort((e,n)=>pv(e)-pv(n))}function jie({spacing:t,verticalSpacing:e,cols:n,minColWidth:r}){return Sie(Array.from(new Set([...s_(t),...s_(e),...r!==void 0?[]:s_(n)])))}function Cie({spacing:t,verticalSpacing:e,cols:n,minColWidth:r,autoRows:i,selector:s}){var p;const o=e===void 0?t:e,l=r!==void 0,c=ub({"--sg-spacing-x":Gi(Qp(t)),"--sg-spacing-y":Gi(Qp(o)),"--sg-auto-rows":i,...l?{"--sg-min-col-width":vH(r)}:{"--sg-cols":(p=Qp(n))==null?void 0:p.toString()}}),h=jie({spacing:t,verticalSpacing:e,cols:n,minColWidth:r}),f=h.reduce((m,v)=>(m[v]||(m[v]={}),typeof t=="object"&&t[v]!==void 0&&(m[v]["--sg-spacing-x"]=Gi(t[v])),typeof o=="object"&&o[v]!==void 0&&(m[v]["--sg-spacing-y"]=Gi(o[v])),!l&&typeof n=="object"&&n[v]!==void 0&&(m[v]["--sg-cols"]=n[v]),m),{});return a.jsx(Ew,{styles:c,container:h.map(m=>({query:`simple-grid (min-width: ${m})`,styles:f[m]})),selector:s})}var bH={container:"m_925c2d2c",root:"m_2415a157"};const _ie={cols:1,spacing:"md",type:"media"},x2=Ie(t=>{const e=xe("SimpleGrid",_ie,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,cols:c,verticalSpacing:h,spacing:f,type:p,minColWidth:m,autoFlow:v,autoRows:y,attributes:x,...S}=e,w=mt({name:"SimpleGrid",classes:bH,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:x,vars:l}),A=WP(),C=m!==void 0?v||"auto-fill":void 0;return p==="container"?a.jsxs(a.Fragment,{children:[a.jsx(Cie,{...e,selector:`.${A}`}),a.jsx("div",{...w("container"),children:a.jsx(ve,{...w("root",{className:A}),...S,"data-auto-cols":C})})]}):a.jsxs(a.Fragment,{children:[a.jsx(wie,{...e,selector:`.${A}`}),a.jsx(ve,{...w("root",{className:A}),...S,"data-auto-cols":C})]})});x2.classes=bH;x2.displayName="@mantine/core/SimpleGrid";var yH={root:"m_18320242","skeleton-fade":"m_299c329c"};const Tie={visible:!0,animate:!0},xH=(t,{width:e,height:n,radius:r,circle:i})=>({root:{"--skeleton-height":me(n),"--skeleton-width":me(i?n:e),"--skeleton-radius":i?"1000px":r===void 0?void 0:rr(r)}}),Wa=Ie(t=>{const e=xe("Skeleton",Tie,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,width:c,height:h,circle:f,visible:p,radius:m,animate:v,mod:y,attributes:x,...S}=e;return a.jsx(ve,{...mt({name:"Skeleton",classes:yH,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:x,vars:l,varsResolver:xH})("root"),mod:[{visible:p,animate:v},y],...S})});Wa.classes=yH;Wa.varsResolver=xH;Wa.displayName="@mantine/core/Skeleton";const AH=Ie(t=>{const{w:e,h:n,miw:r,mih:i,...s}=xe("Space",null,t);return a.jsx(ve,{...s,w:e,miw:r??e,h:n,mih:i??n})});AH.displayName="@mantine/core/Space";var wH={root:"m_6d731127"};const kie={gap:"md",align:"stretch",justify:"flex-start"},SH=(t,{gap:e,align:n,justify:r})=>({root:{"--stack-gap":Gi(e),"--stack-align":n,"--stack-justify":r}}),_n=Ie(t=>{const e=xe("Stack",kie,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,align:c,justify:h,gap:f,variant:p,attributes:m,...v}=e;return a.jsx(ve,{...mt({name:"Stack",props:e,classes:wH,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:m,vars:l,varsResolver:SH})("root"),variant:p,...v})});_n.classes=wH;_n.varsResolver=SH;_n.displayName="@mantine/core/Stack";const jH=O.createContext(null),Oie={hiddenInputValuesSeparator:","},QE=sd((t=>{const{value:e,defaultValue:n,onChange:r,size:i,wrapperProps:s,children:o,readOnly:l,name:c,hiddenInputValuesSeparator:h,hiddenInputProps:f,maxSelectedValues:p,disabled:m,...v}=xe("SwitchGroup",Oie,t),[y,x]=si({value:e,defaultValue:n,finalValue:[],onChange:r}),S=C=>{const j=C.currentTarget.value;if(l)return;const _=y.includes(j);!_&&p&&y.length>=p||x(_?y.filter(k=>k!==j):[...y,j])},w=C=>{if(m)return!0;if(!p)return!1;const j=y.includes(C),_=y.length>=p;return!j&&_},A=y.join(h);return a.jsx(jH,{value:{value:y,onChange:S,size:i,isDisabled:w},children:a.jsxs(Ar.Wrapper,{size:i,...s,...v,labelElement:"div",__staticSelector:"SwitchGroup",children:[a.jsx(YF,{role:"group",children:o}),a.jsx("input",{type:"hidden",name:c,value:A,...f})]})})}));QE.classes=Ar.Wrapper.classes;QE.displayName="@mantine/core/SwitchGroup";var CH={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const Eie={labelPosition:"right",withThumbIndicator:!0},_H=(t,{radius:e,color:n,size:r})=>({root:{"--switch-radius":e===void 0?void 0:rr(e),"--switch-height":Gt(r,"switch-height"),"--switch-width":Gt(r,"switch-width"),"--switch-thumb-size":Gt(r,"switch-thumb-size"),"--switch-label-font-size":Gt(r,"switch-label-font-size"),"--switch-track-label-padding":Gt(r,"switch-track-label-padding"),"--switch-color":n?wr(n,t):void 0}}),Nb=Ie(t=>{var ne;const e=xe("Switch",Eie,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,color:c,label:h,offLabel:f,onLabel:p,id:m,size:v,radius:y,wrapperProps:x,thumbIcon:S,checked:w,defaultChecked:A,onChange:C,labelPosition:j,description:_,error:k,disabled:M,variant:R,rootRef:N,mod:I,withThumbIndicator:D,attributes:L,...z}=e,P=O.use(jH),H=v||(P==null?void 0:P.size),B=mt({name:"Switch",props:e,classes:CH,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:L,vars:l,varsResolver:_H}),{styleProps:F,rest:q}=gb(z),X=Ii(m),Y=[_?`${X}-description`:void 0,k&&typeof k!="boolean"?`${X}-error`:void 0,q["aria-describedby"]].filter(Boolean).join(" ")||void 0,U={checked:(P==null?void 0:P.value.includes(q.value))??w,onChange:de=>{P==null||P.onChange(de),C==null||C(de)}},V=M||((ne=P==null?void 0:P.isDisabled)==null?void 0:ne.call(P,q.value)),[G,J]=si({value:U.checked??w,defaultValue:A,finalValue:!1});return a.jsxs(jE,{...B("root"),__staticSelector:"Switch",__stylesApiProps:e,id:X,size:H,labelPosition:j,label:h,description:_,error:k,disabled:V,bodyElement:"label",labelElement:"span",classNames:n,styles:s,unstyled:o,"data-checked":U.checked,variant:R,ref:N,mod:I,attributes:L,inert:q.inert,...F,...x,children:[a.jsx("input",{...q,...U,disabled:V,checked:G,"data-checked":U.checked,onChange:de=>{var fe;(fe=U.onChange)==null||fe.call(U,de),J(de.currentTarget.checked)},id:X,type:"checkbox",role:"switch",inert:q.inert,"aria-describedby":Y,...B("input")}),a.jsxs(ve,{"aria-hidden":"true",component:"span",mod:{error:k,"label-position":j,"without-labels":!p&&!f},...B("track"),children:[a.jsx(ve,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":D&&!S},...B("thumb"),children:S}),a.jsx("span",{...B("trackLabel"),children:G?p:f})]})]})});Nb.classes={...CH,...t$};Nb.varsResolver=_H;Nb.displayName="@mantine/core/Switch";Nb.Group=QE;const[Mie,Rie]=Ki("Table component was not found in the tree");var Ib={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 Die(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 Lf(t,e){const n=`Table${t.charAt(0).toUpperCase()}${t.slice(1)}`,r=Ie(i=>{const s=xe(n,{},i),{classNames:o,className:l,style:c,styles:h,...f}=s,p=Rie();return a.jsx(ve,{component:t,...Die(p,e),...p.getStyles(t,{className:l,classNames:o,style:c,styles:h,props:s}),...f})});return r.displayName=`@mantine/core/${n}`,r.classes=Ib,r}const y3=Lf("th",{columnBorder:!0}),TH=Lf("td",{columnBorder:!0}),Ox=Lf("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),kH=Lf("thead",{stickyHeader:!0}),OH=Lf("tbody"),EH=Lf("tfoot"),MH=Lf("caption",{captionSide:!0}),Nie={type:"scrollarea"},RH=(t,{minWidth:e,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":me(e),"--table-max-height":me(n),"--table-overflow":r==="native"?"auto":void 0}}),A2=Ie(t=>{const e=xe("TableScrollContainer",Nie,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,children:c,minWidth:h,maxHeight:f,type:p,scrollAreaProps:m,attributes:v,...y}=e,x=mt({name:"TableScrollContainer",classes:Ib,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:v,vars:l,varsResolver:RH,rootSelector:"scrollContainer"});return a.jsx(ve,{component:p==="scrollarea"?ga:"div",...p==="scrollarea"?f?{offsetScrollbars:"xy",...m}:{offsetScrollbars:"x",...m}:{},...x("scrollContainer"),...y,children:a.jsx("div",{...x("scrollContainerInner"),children:c})})});A2.classes=Ib;A2.varsResolver=RH;A2.displayName="@mantine/core/TableScrollContainer";function UE({data:t}){return a.jsxs(a.Fragment,{children:[t.caption&&a.jsx(MH,{children:t.caption}),t.head&&a.jsx(kH,{children:a.jsx(Ox,{children:t.head.map((e,n)=>a.jsx(y3,{children:e},n))})}),t.body&&a.jsx(OH,{children:t.body.map((e,n)=>a.jsx(Ox,{children:e.map((r,i)=>a.jsx(TH,{children:r},i))},n))}),t.foot&&a.jsx(EH,{children:a.jsx(Ox,{children:t.foot.map((e,n)=>a.jsx(y3,{children:e},n))})})]})}UE.displayName="@mantine/core/TableDataRenderer";const Iie={withRowBorders:!0,verticalSpacing:7},DH=(t,{layout:e,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:s,stripedColor:o,highlightOnHoverColor:l,striped:c,highlightOnHover:h,stickyHeaderOffset:f,stickyHeader:p})=>({table:{"--table-layout":e,"--table-caption-side":n,"--table-horizontal-spacing":Gi(r),"--table-vertical-spacing":Gi(i),"--table-border-color":s?wr(s,t):void 0,"--table-striped-color":c&&o?wr(o,t):void 0,"--table-highlight-on-hover-color":h&&l?wr(l,t):void 0,"--table-sticky-header-offset":p?me(f):void 0}}),le=Ie(t=>{const e=xe("Table",Iie,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,horizontalSpacing:c,verticalSpacing:h,captionSide:f,stripedColor:p,highlightOnHoverColor:m,striped:v,highlightOnHover:y,withColumnBorders:x,withRowBorders:S,withTableBorder:w,borderColor:A,layout:C,data:j,children:_,stickyHeader:k,stickyHeaderOffset:M,mod:R,tabularNums:N,attributes:I,...D}=e,L=mt({name:"Table",props:e,className:r,style:i,classes:Ib,classNames:n,styles:s,unstyled:o,attributes:I,rootSelector:"table",vars:l,varsResolver:DH});return a.jsx(Mie,{value:{getStyles:L,stickyHeader:k,striped:v===!0?"odd":v||void 0,highlightOnHover:y,withColumnBorders:x,withRowBorders:S,captionSide:f||"bottom"},children:a.jsx(ve,{component:"table",mod:[{"data-with-table-border":w,"data-tabular-nums":N},R],...L("table"),...D,children:_||!!j&&a.jsx(UE,{data:j})})})});le.classes=Ib;le.varsResolver=DH;le.displayName="@mantine/core/Table";le.Td=TH;le.Th=y3;le.Tr=Ox;le.Thead=kH;le.Tbody=OH;le.Tfoot=EH;le.Caption=MH;le.ScrollContainer=A2;le.DataRenderer=UE;const[Lie,WE]=Ki("Tabs component was not found in the tree");var Lb={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 YE=Ie(t=>{const e=xe("TabsList",null,t),{children:n,className:r,grow:i,justify:s,classNames:o,styles:l,style:c,mod:h,...f}=e,p=WE();return a.jsx(ve,{...p.getStyles("list",{className:r,style:c,classNames:o,styles:l,props:e,variant:p.variant}),role:"tablist",variant:p.variant,mod:[{grow:i,orientation:p.orientation,placement:p.orientation==="vertical"&&p.placement,inverted:p.inverted},h],"aria-orientation":p.orientation,__vars:{"--tabs-justify":s},...f,children:n})});YE.classes=Lb;YE.displayName="@mantine/core/TabsList";const VE=Ie(t=>{const e=xe("TabsPanel",null,t),{children:n,className:r,value:i,classNames:s,styles:o,style:l,mod:c,keepMounted:h,...f}=e,p=mb(),m=WE(),v=m.value===i,y=m.keepMounted||h,x=m.keepMountedMode!=="display-none",S=y&&x&&p!=="test"?a.jsx(O.Activity,{mode:v?"visible":"hidden",children:n}):y||v?n:null;return a.jsx(ve,{...m.getStyles("panel",{className:r,classNames:s,styles:o,style:[l,v?void 0:{display:"none"}],props:e}),mod:[{orientation:m.orientation},c],role:"tabpanel",id:m.getPanelId(i),"aria-labelledby":m.getTabId(i),...f,children:S})});VE.classes=Lb;VE.displayName="@mantine/core/TabsPanel";const GE=Ie(t=>{const e=xe("TabsTab",null,t),{className:n,children:r,rightSection:i,leftSection:s,value:o,onClick:l,onKeyDown:c,disabled:h,color:f,style:p,classNames:m,styles:v,vars:y,mod:x,tabIndex:S,...w}=e,A=pi(),{dir:C}=oc(),j=WE(),_=o===j.value,k=R=>{j.onChange(j.allowTabDeactivation&&o===j.value?null:o),l==null||l(R)},M={classNames:m,styles:v,props:e};return a.jsxs(Nr,{...j.getStyles("tab",{className:n,style:p,variant:j.variant,...M}),disabled:h,unstyled:j.unstyled,variant:j.variant,mod:[{active:_,disabled:h,orientation:j.orientation,inverted:j.inverted,placement:j.orientation==="vertical"&&j.placement},x],role:"tab",id:j.getTabId(o),"aria-selected":_,tabIndex:S!==void 0?S:_||j.value===null?0:-1,"aria-controls":j.getPanelId(o),onClick:k,__vars:{"--tabs-color":f?wr(f,A):void 0},onKeyDown:hb({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:j.activateTabWithKeyboard,loop:j.loop,orientation:j.orientation||"horizontal",dir:C,onKeyDown:c}),...w,children:[s&&a.jsx("span",{...j.getStyles("tabSection",M),"data-position":"left",children:s}),r&&a.jsx("span",{...j.getStyles("tabLabel",M),children:r}),i&&a.jsx("span",{...j.getStyles("tabSection",M),"data-position":"right",children:i})]})});GE.classes=Lb;GE.displayName="@mantine/core/TabsTab";const p5="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",Bie={keepMounted:!0,keepMountedMode:"activity",orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},NH=(t,{radius:e,color:n,autoContrast:r})=>({root:{"--tabs-radius":rr(e),"--tabs-color":wr(n,t),"--tabs-text-color":t0(r,t)?id({color:n,theme:t,autoContrast:r}):void 0}}),la=Ie(t=>{const e=xe("Tabs",Bie,t),{defaultValue:n,value:r,onChange:i,orientation:s,children:o,loop:l,id:c,activateTabWithKeyboard:h,allowTabDeactivation:f,variant:p,color:m,radius:v,inverted:y,placement:x,keepMounted:S,keepMountedMode:w,classNames:A,styles:C,unstyled:j,className:_,style:k,vars:M,autoContrast:R,mod:N,attributes:I,...D}=e,L=Ii(c),[z,P]=si({value:r,defaultValue:n,finalValue:null,onChange:i}),H=mt({name:"Tabs",props:e,classes:Lb,className:_,style:k,classNames:A,styles:C,unstyled:j,attributes:I,vars:M,varsResolver:NH});return a.jsx(Lie,{value:{placement:x,value:z,orientation:s,id:L,loop:l,activateTabWithKeyboard:h,getTabId:oA(`${L}-tab`,p5),getPanelId:oA(`${L}-panel`,p5),onChange:P,allowTabDeactivation:f,variant:p,color:m,radius:v,inverted:y,keepMounted:S,keepMountedMode:w,unstyled:j,getStyles:H},children:a.jsx(ve,{id:L,variant:p,mod:[{orientation:s,inverted:s==="horizontal"&&y,placement:s==="vertical"&&x},N],...H("root"),...D,children:o})})});la.classes=Lb;la.varsResolver=NH;la.displayName="@mantine/core/Tabs";la.Tab=GE;la.Panel=VE;la.List=YE;const cc=Ie(t=>a.jsx(Ds,{component:"input",...xe(["Input","InputWrapper","TextInput"],null,t),__staticSelector:"TextInput"}));cc.classes=Ds.classes;cc.displayName="@mantine/core/TextInput";/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var Pie={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.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const kt=(t,e,n,r)=>{const i=O.forwardRef(({color:s="currentColor",size:o=24,stroke:l=2,title:c,className:h,children:f,...p},m)=>O.createElement("svg",{ref:m,...Pie[t],width:o,height:o,className:["tabler-icon",`tabler-icon-${e}`,h].join(" "),...t==="filled"?{fill:s}:{strokeWidth:l,stroke:s},...p},[c&&O.createElement("title",{key:"svg-title"},c),...r.map(([v,y])=>O.createElement(v,y)),...Array.isArray(f)?f:[f]]));return i.displayName=`${n}`,i};/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fie=[["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"}]],$ie=kt("outline","adjustments-horizontal","AdjustmentsHorizontal",Fie);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hie=[["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"}]],zie=kt("outline","alert-circle","AlertCircle",Hie);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const qie=[["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"}]],Di=kt("outline","alert-triangle","AlertTriangle",qie);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qie=[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l12 0",key:"svg-2"}]],Uie=kt("outline","align-justified","AlignJustified",Qie);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wie=[["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"}]],m5=kt("outline","arrow-down","ArrowDown",Wie);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yie=[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M5 12l6 6",key:"svg-1"}],["path",{d:"M5 12l6 -6",key:"svg-2"}]],Vie=kt("outline","arrow-left","ArrowLeft",Yie);/**
 * @license @tabler/icons-react v3.44.0 - 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:"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"}]],Xie=kt("outline","bell-off","BellOff",Gie);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kie=[["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"}]],XE=kt("outline","bell","Bell",Kie);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zie=[["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"}]],Jie=kt("outline","binary-tree","BinaryTree",Zie);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ese=[["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"}]],tse=kt("outline","book","Book",ese);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const nse=[["path",{d:"M4 19l16 0",key:"svg-0"}],["path",{d:"M4 15l4 -6l4 2l4 -5l4 4",key:"svg-1"}]],rse=kt("outline","chart-line","ChartLine",nse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ise=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],yA=kt("outline","check","Check",ise);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const sse=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],Sv=kt("outline","chevron-down","ChevronDown",sse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ase=[["path",{d:"M15 6l-6 6l6 6",key:"svg-0"}]],ose=kt("outline","chevron-left","ChevronLeft",ase);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const lse=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],IH=kt("outline","chevron-right","ChevronRight",lse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const cse=[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]],KE=kt("outline","chevron-up","ChevronUp",cse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const use=[["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"}]],hse=kt("outline","circle-minus","CircleMinus",use);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const dse=[["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"}]],fse=kt("outline","circle-plus","CirclePlus",dse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const pse=[["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"}]],mse=kt("outline","clock-pause","ClockPause",pse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const gse=[["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"}]],vse=kt("outline","clock-play","ClockPlay",gse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const bse=[["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"}]],yse=kt("outline","cloud-data-connection","CloudDataConnection",bse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const xse=[["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"}]],LH=kt("outline","code-plus","CodePlus",xse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ase=[["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"}]],ZE=kt("outline","copy","Copy",Ase);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const wse=[["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"}]],Sse=kt("outline","database","Database",wse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const jse=[["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"}]],Cse=kt("outline","device-desktop-analytics","DeviceDesktopAnalytics",jse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const _se=[["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"}]],Tse=kt("outline","dots-vertical","DotsVertical",_se);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const kse=[["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"}]],Ose=kt("outline","flag","Flag",kse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ese=[["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"}]],Mse=kt("outline","graph","Graph",Ese);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rse=[["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"}]],BH=kt("outline","heart-rate-monitor","HeartRateMonitor",Rse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dse=[["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"}]],x3=kt("outline","hourglass","Hourglass",Dse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nse=[["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"}]],nr=kt("outline","info-circle","InfoCircle",Nse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ise=[["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"}]],PH=kt("outline","layout-navbar-collapse","LayoutNavbarCollapse",Ise);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lse=[["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"}]],FH=kt("outline","layout-navbar-expand","LayoutNavbarExpand",Lse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bse=[["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"}]],Pse=kt("outline","message-exclamation","MessageExclamation",Bse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fse=[["path",{d:"M5 12l14 0",key:"svg-0"}]],$se=kt("outline","minus","Minus",Fse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hse=[["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"}]],zse=kt("outline","network-off","NetworkOff",Hse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const qse=[["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"}]],Qse=kt("outline","plug-connected-x","PlugConnectedX",qse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Use=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],$H=kt("outline","plus","Plus",Use);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wse=[["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"}]],A3=kt("outline","refresh","Refresh",Wse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yse=[["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"}]],HH=kt("outline","repeat","Repeat",Yse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vse=[["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"}]],zH=kt("outline","replace","Replace",Vse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gse=[["path",{d:"M11.007 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 17l5 1l.75 -1.5",key:"svg-1"}],["path",{d:"M15 21v-4l-4 -3l1 -6",key:"svg-2"}],["path",{d:"M7 12v-3l5 -1l3 3l3 1",key:"svg-3"}]],Xse=kt("outline","run","Run",Gse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kse=[["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"}]],od=kt("outline","search","Search",Kse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zse=[["path",{d:"M8 9l4 -4l4 4",key:"svg-0"}],["path",{d:"M16 15l-4 4l-4 -4",key:"svg-1"}]],Jse=kt("outline","selector","Selector",Zse);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const eae=[["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"}]],tae=kt("outline","server-cog","ServerCog",eae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const nae=[["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"}]],rae=kt("outline","server","Server",nae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const iae=[["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"}]],sae=kt("outline","settings","Settings",iae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const aae=[["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"}]],oae=kt("outline","spy","Spy",aae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const lae=[["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"}]],qH=kt("outline","table","Table",lae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const cae=[["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"}]],uae=kt("outline","tags","Tags",cae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const hae=[["path",{d:"M5 7l5 5l-5 5",key:"svg-0"}],["path",{d:"M12 19l7 0",key:"svg-1"}]],dae=kt("outline","terminal","Terminal",hae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const fae=[["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"}]],pae=kt("outline","timeline","Timeline",fae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const mae=[["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"}]],w3=kt("outline","trash","Trash",mae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const gae=[["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"}]],vae=kt("outline","wall","Wall",gae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const bae=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],yae=kt("outline","x","X",bae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const xae=[["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"}]],Aae=kt("outline","zoom-code","ZoomCode",xae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const wae=[["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"}]],Sae=kt("filled","bell-filled","BellFilled",wae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const jae=[["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"}]],Cae=kt("filled","brightness-filled","BrightnessFilled",jae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const _ae=[["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"}]],Tae=kt("filled","chart-area-filled","ChartAreaFilled",_ae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const kae=[["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"}]],Oae=kt("filled","moon-filled","MoonFilled",kae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Eae=[["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"}]],a_=kt("filled","point-filled","PointFilled",Eae);/**
 * @license @tabler/icons-react v3.44.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mae=[["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"}]],Rae=kt("filled","sun-filled","SunFilled",Mae);/**
 * react-router v7.17.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 g5="popstate";function v5(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function Dae(t={}){function e(r,i){var h;let s=(h=i.state)==null?void 0:h.masked,{pathname:o,search:l,hash:c}=s||r.location;return S3("",{pathname:o,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:jv(i)}return Iae(e,n,null,t)}function Fr(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function hl(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Nae(){return Math.random().toString(36).substring(2,10)}function b5(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function S3(t,e,n=null,r,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?m0(e):e,state:n,key:e&&e.key||r||Nae(),mask:i}}function jv({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 m0(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 Iae(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,l="POP",c=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 S=f(),w=S==null?null:S-h;h=S,c&&c({action:l,location:x.location,delta:w})}function m(S,w){l="PUSH";let A=v5(S)?S:S3(x.location,S,w);h=f()+1;let C=b5(A,h),j=x.createHref(A.mask||A);try{o.pushState(C,"",j)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;i.location.assign(j)}s&&c&&c({action:l,location:x.location,delta:1})}function v(S,w){l="REPLACE";let A=v5(S)?S:S3(x.location,S,w);h=f();let C=b5(A,h),j=x.createHref(A.mask||A);o.replaceState(C,"",j),s&&c&&c({action:l,location:x.location,delta:0})}function y(S){return Lae(i,S)}let x={get action(){return l},get location(){return t(i,o)},listen(S){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(g5,p),c=S,()=>{i.removeEventListener(g5,p),c=null}},createHref(S){return e(i,S)},createURL:y,encodeLocation(S){let w=y(S);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:m,replace:v,go(S){return o.go(S)}};return x}function Lae(t,e,n=!1){let r="http://localhost";t&&(r=t.location.origin!=="null"?t.location.origin:t.location.href),Fr(r,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:jv(e);return i=i.replace(/ $/,"%20"),!n&&i.startsWith("//")&&(i=r+i),new URL(i,r)}function QH(t,e,n="/"){return Bae(t,e,n,!1)}function Bae(t,e,n,r,i){let s=typeof e=="string"?m0(e):e,o=hu(s.pathname||"/",n);if(o==null)return null;let l=Pae(t),c=null,h=Xae(o);for(let f=0;c==null&&f<l.length;++f)c=Vae(l[f],h,r);return c}function Pae(t){let e=UH(t);return Fae(e),e}function UH(t,e=[],n=[],r="",i=!1){let s=(o,l,c=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)&&c)return;Fr(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=ol([r,f.relativePath]),m=n.concat(f);o.children&&o.children.length>0&&(Fr(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),UH(o.children,e,m,p,c)),!(o.path==null&&!o.index)&&e.push({path:p,score:Wae(p,o.index),routesMeta:m})};return t.forEach((o,l)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))s(o,l);else for(let h of WH(o.path))s(o,l,!0,h)}),e}function WH(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=WH(r.join("/")),l=[];return l.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&l.push(...o),l.map(c=>t.startsWith("/")&&c===""?"/":c)}function Fae(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:Yae(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var $ae=/^:[\w-]+$/,Hae=3,zae=2,qae=1,Qae=10,Uae=-2,y5=t=>t==="*";function Wae(t,e){let n=t.split("/"),r=n.length;return n.some(y5)&&(r+=Uae),e&&(r+=zae),n.filter(i=>!y5(i)).reduce((i,s)=>i+($ae.test(s)?Hae:s===""?qae:Qae),r)}function Yae(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 Vae(t,e,n=!1){let{routesMeta:r}=t,i={},s="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],h=l===r.length-1,f=s==="/"?e:e.slice(s.length)||"/",p=xA({path:c.relativePath,caseSensitive:c.caseSensitive,end:h},f),m=c.route;if(!p&&h&&n&&!r[r.length-1].route.index&&(p=xA({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},f)),!p)return null;Object.assign(i,p.params),o.push({params:i,pathname:ol([s,p.pathname]),pathnameBase:eoe(ol([s,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(s=ol([s,p.pathnameBase]))}return o}function xA(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=Gae(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 y=l[m]||"";o=s.slice(0,s.length-y.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 Gae(t,e=!1,n=!0){hl(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,c,h,f)=>{if(r.push({paramName:l,isOptional:c!=null}),c){let p=f.charAt(h+o.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).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 Xae(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return hl(!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 hu(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 Kae=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Zae(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?m0(t):t,s;return n?(n=YH(n),n.startsWith("/")?s=x5(n.substring(1),"/"):s=x5(n,e)):s=e,{pathname:s,search:toe(r),hash:noe(i)}}function x5(t,e){let n=AA(e).split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function o_(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 Jae(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function JE(t){let e=Jae(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function w2(t,e,n,r=!1){let i;typeof t=="string"?i=m0(t):(i={...t},Fr(!i.pathname||!i.pathname.includes("?"),o_("?","pathname","search",i)),Fr(!i.pathname||!i.pathname.includes("#"),o_("#","pathname","hash",i)),Fr(!i.search||!i.search.includes("#"),o_("#","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 c=Zae(i,l),h=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(h||f)&&(c.pathname+="/"),c}var YH=t=>t.replace(/\/\/+/g,"/"),ol=t=>YH(t.join("/")),AA=t=>t.replace(/\/+$/,""),eoe=t=>AA(t).replace(/^\/*/,"/"),toe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,noe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,roe=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 ioe(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function soe(t){let e=t.map(n=>n.route.path).filter(Boolean);return ol(e)||"/"}var VH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function GH(t,e){let n=t;if(typeof n!="string"||!Kae.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(VH)try{let s=new URL(window.location.href),o=n.startsWith("//")?new URL(s.protocol+n):new URL(n),l=hu(o.pathname,e);o.origin===s.origin&&l!=null?n=l+o.search+o.hash:i=!0}catch{hl(!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 XH=["POST","PUT","PATCH","DELETE"];new Set(XH);var aoe=["GET",...XH];new Set(aoe);var Bf=O.createContext(null);Bf.displayName="DataRouter";var S2=O.createContext(null);S2.displayName="DataRouterState";var KH=O.createContext(!1);function ooe(){return O.useContext(KH)}var ZH=O.createContext({isTransitioning:!1});ZH.displayName="ViewTransition";var loe=O.createContext(new Map);loe.displayName="Fetchers";var coe=O.createContext(null);coe.displayName="Await";var xa=O.createContext(null);xa.displayName="Navigation";var Bb=O.createContext(null);Bb.displayName="Location";var uc=O.createContext({outlet:null,matches:[],isDataRoute:!1});uc.displayName="Route";var e6=O.createContext(null);e6.displayName="RouteError";var JH="REACT_ROUTER_ERROR",uoe="REDIRECT",hoe="ROUTE_ERROR_RESPONSE";function doe(t){if(t.startsWith(`${JH}:${uoe}:{`))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 foe(t){if(t.startsWith(`${JH}:${hoe}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new roe(e.status,e.statusText,e.data)}catch{}}function poe(t,{relative:e}={}){Fr(g0(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=O.useContext(xa),{hash:i,pathname:s,search:o}=Pb(t,{relative:e}),l=s;return n!=="/"&&(l=s==="/"?n:ol([n,s])),r.createHref({pathname:l,search:o,hash:i})}function g0(){return O.useContext(Bb)!=null}function ko(){return Fr(g0(),"useLocation() may be used only in the context of a <Router> component."),O.useContext(Bb).location}var ez="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function tz(t){O.useContext(xa).static||O.useLayoutEffect(t)}function t6(){let{isDataRoute:t}=O.useContext(uc);return t?Toe():moe()}function moe(){Fr(g0(),"useNavigate() may be used only in the context of a <Router> component.");let t=O.useContext(Bf),{basename:e,navigator:n}=O.useContext(xa),{matches:r}=O.useContext(uc),{pathname:i}=ko(),s=JSON.stringify(JE(r)),o=O.useRef(!1);return tz(()=>{o.current=!0}),O.useCallback((c,h={})=>{if(hl(o.current,ez),!o.current)return;if(typeof c=="number"){n.go(c);return}let f=w2(c,JSON.parse(s),i,h.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:ol([e,f.pathname])),(h.replace?n.replace:n.push)(f,h.state,h)},[e,n,s,i,t])}O.createContext(null);function Pb(t,{relative:e}={}){let{matches:n}=O.useContext(uc),{pathname:r}=ko(),i=JSON.stringify(JE(n));return O.useMemo(()=>w2(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function goe(t,e){return nz(t,e)}function nz(t,e,n){var S;Fr(g0(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=O.useContext(xa),{matches:i}=O.useContext(uc),s=i[i.length-1],o=s?s.params:{},l=s?s.pathname:"/",c=s?s.pathnameBase:"/",h=s&&s.route;{let w=h&&h.path||"";iz(l,!h||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let f=ko(),p;if(e){let w=typeof e=="string"?m0(e):e;Fr(c==="/"||((S=w.pathname)==null?void 0:S.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${w.pathname}" was given in the \`location\` prop.`),p=w}else p=f;let m=p.pathname||"/",v=m;if(c!=="/"){let w=c.replace(/^\//,"").split("/");v="/"+m.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=n&&n.state.matches.length?n.state.matches.map(w=>Object.assign(w,{route:n.manifest[w.route.id]||w.route})):QH(t,{pathname:v});hl(h||y!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),hl(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=Aoe(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},o,w.params),pathname:ol([c,r.encodeLocation?r.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:ol([c,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),i,n);return e&&x?O.createElement(Bb.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},x):x}function voe(){let t=_oe(),e=ioe(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=O.createElement(O.Fragment,null,O.createElement("p",null,"💿 Hey developer 👋"),O.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",O.createElement("code",{style:s},"ErrorBoundary")," or"," ",O.createElement("code",{style:s},"errorElement")," prop on your route.")),O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},e),n?O.createElement("pre",{style:i},n):null,o)}var boe=O.createElement(voe,null),rz=class extends O.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=foe(t.digest);n&&(t=n)}let e=t!==void 0?O.createElement(uc.Provider,{value:this.props.routeContext},O.createElement(e6.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?O.createElement(yoe,{error:t},e):e}};rz.contextType=KH;var l_=new WeakMap;function yoe({children:t,error:e}){let{basename:n}=O.useContext(xa);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=doe(e.digest);if(r){let i=l_.get(e);if(i)throw i;let s=GH(r.location,n);if(VH&&!l_.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 l_.set(e,o),o}return O.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function xoe({routeContext:t,match:e,children:n}){let r=O.useContext(Bf);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),O.createElement(uc.Provider,{value:t},n)}function Aoe(t,e=[],n){let r=n==null?void 0:n.state;if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let i=t,s=r==null?void 0:r.errors;if(s!=null){let f=i.findIndex(p=>p.route.id&&(s==null?void 0:s[p.route.id])!==void 0);Fr(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,f+1))}let o=!1,l=-1;if(n&&r){o=r.renderFallback;for(let f=0;f<i.length;f++){let p=i[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(l=f),p.route.id){let{loaderData:m,errors:v}=r,y=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||y){n.isStatic&&(o=!0),l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}}let c=n==null?void 0:n.onError,h=r&&c?(f,p)=>{var m,v;c(f,{location:r.location,params:((v=(m=r.matches)==null?void 0:m[0])==null?void 0:v.params)??{},pattern:soe(r.matches),errorInfo:p})}:void 0;return i.reduceRight((f,p,m)=>{let v,y=!1,x=null,S=null;r&&(v=s&&p.route.id?s[p.route.id]:void 0,x=p.route.errorElement||boe,o&&(l<0&&m===0?(iz("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,S=null):l===m&&(y=!0,S=p.route.hydrateFallbackElement||null)));let w=e.concat(i.slice(0,m+1)),A=()=>{let C;return v?C=x:y?C=S:p.route.Component?C=O.createElement(p.route.Component,null):p.route.element?C=p.route.element:C=f,O.createElement(xoe,{match:p,routeContext:{outlet:f,matches:w,isDataRoute:r!=null},children:C})};return r&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?O.createElement(rz,{location:r.location,revalidation:r.revalidation,component:x,error:v,children:A(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:h}):A()},null)}function n6(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function woe(t){let e=O.useContext(Bf);return Fr(e,n6(t)),e}function Soe(t){let e=O.useContext(S2);return Fr(e,n6(t)),e}function joe(t){let e=O.useContext(uc);return Fr(e,n6(t)),e}function r6(t){let e=joe(t),n=e.matches[e.matches.length-1];return Fr(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function Coe(){return r6("useRouteId")}function _oe(){var r;let t=O.useContext(e6),e=Soe("useRouteError"),n=r6("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function Toe(){let{router:t}=woe("useNavigate"),e=r6("useNavigate"),n=O.useRef(!1);return tz(()=>{n.current=!0}),O.useCallback(async(i,s={})=>{hl(n.current,ez),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var A5={};function iz(t,e,n){!e&&!A5[t]&&(A5[t]=!0,hl(!1,n))}O.memo(koe);function koe({routes:t,manifest:e,future:n,state:r,isStatic:i,onError:s}){return nz(t,void 0,{manifest:e,state:r,isStatic:i,onError:s})}function Ooe({to:t,replace:e,state:n,relative:r}){Fr(g0(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=O.useContext(xa);hl(!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}=O.useContext(uc),{pathname:o}=ko(),l=t6(),c=w2(t,JE(s),o,r==="path"),h=JSON.stringify(c);return O.useEffect(()=>{l(JSON.parse(h),{replace:e,state:n,relative:r})},[l,h,r,e,n]),null}function lh(t){Fr(!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 Eoe({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,useTransitions:o}){Fr(!g0(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),c=O.useMemo(()=>({basename:l,navigator:i,static:s,useTransitions:o,future:{}}),[l,i,s,o]);typeof n=="string"&&(n=m0(n));let{pathname:h="/",search:f="",hash:p="",state:m=null,key:v="default",mask:y}=n,x=O.useMemo(()=>{let S=hu(h,l);return S==null?null:{location:{pathname:S,search:f,hash:p,state:m,key:v,mask:y},navigationType:r}},[l,h,f,p,m,v,r,y]);return hl(x!=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.`),x==null?null:O.createElement(xa.Provider,{value:c},O.createElement(Bb.Provider,{children:e,value:x}))}function w5({children:t,location:e}){return goe(j3(t),e)}function j3(t,e=[]){let n=[];return O.Children.forEach(t,(r,i)=>{if(!O.isValidElement(r))return;let s=[...e,i];if(r.type===O.Fragment){n.push.apply(n,j3(r.props.children,s));return}Fr(r.type===lh,`[${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>`),Fr(!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=j3(r.props.children,s)),n.push(o)}),n}var Ex="get",Mx="application/x-www-form-urlencoded";function j2(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Moe(t){return j2(t)&&t.tagName.toLowerCase()==="button"}function Roe(t){return j2(t)&&t.tagName.toLowerCase()==="form"}function Doe(t){return j2(t)&&t.tagName.toLowerCase()==="input"}function Noe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Ioe(t,e){return t.button===0&&(!e||e==="_self")&&!Noe(t)}var O1=null;function Loe(){if(O1===null)try{new FormData(document.createElement("form"),0),O1=!1}catch{O1=!0}return O1}var Boe=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function c_(t){return t!=null&&!Boe.has(t)?(hl(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Mx}"`),null):t}function Poe(t,e){let n,r,i,s,o;if(Roe(t)){let l=t.getAttribute("action");r=l?hu(l,e):null,n=t.getAttribute("method")||Ex,i=c_(t.getAttribute("enctype"))||Mx,s=new FormData(t)}else if(Moe(t)||Doe(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 c=t.getAttribute("formaction")||l.getAttribute("action");if(r=c?hu(c,e):null,n=t.getAttribute("formmethod")||l.getAttribute("method")||Ex,i=c_(t.getAttribute("formenctype"))||c_(l.getAttribute("enctype"))||Mx,s=new FormData(l,t),!Loe()){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(j2(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ex,r=null,i=Mx,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 i6(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function sz(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&&hu(i.pathname,e)==="/"?i.pathname=`${AA(e)}/_root.${r}`:i.pathname=`${AA(i.pathname)}.${r}`,i}async function Foe(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 $oe(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 Hoe(t,e,n){let r=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];if(s){let o=await Foe(s,n);return o.links?o.links():[]}return[]}));return Uoe(r.flat(1).filter($oe).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function S5(t,e,n,r,i,s){let o=(c,h)=>n[h]?c.route.id!==n[h].route.id:!0,l=(c,h)=>{var f;return n[h].pathname!==c.pathname||((f=n[h].route.path)==null?void 0:f.endsWith("*"))&&n[h].params["*"]!==c.params["*"]};return s==="assets"?e.filter((c,h)=>o(c,h)||l(c,h)):s==="data"?e.filter((c,h)=>{var p;let f=r.routes[c.route.id];if(!f||!f.hasLoader)return!1;if(o(c,h)||l(c,h))return!0;if(c.route.shouldRevalidate){let m=c.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:c.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function zoe(t,e,{includeHydrateFallback:n}={}){return qoe(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 qoe(t){return[...new Set(t)]}function Qoe(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function Uoe(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let s=JSON.stringify(Qoe(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function s6(){let t=O.useContext(Bf);return i6(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Woe(){let t=O.useContext(S2);return i6(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var a6=O.createContext(void 0);a6.displayName="FrameworkContext";function o6(){let t=O.useContext(a6);return i6(t,"You must render this element inside a <HydratedRouter> element"),t}function Yoe(t,e){let n=O.useContext(a6),[r,i]=O.useState(!1),[s,o]=O.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:h,onMouseLeave:f,onTouchStart:p}=e,m=O.useRef(null);O.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let x=w=>{w.forEach(A=>{o(A.isIntersecting)})},S=new IntersectionObserver(x,{threshold:.5});return m.current&&S.observe(m.current),()=>{S.disconnect()}}},[t]),O.useEffect(()=>{if(r){let x=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(x)}}},[r]);let v=()=>{i(!0)},y=()=>{i(!1),o(!1)};return n?t!=="intent"?[s,m,{}]:[s,m,{onFocus:yg(l,v),onBlur:yg(c,y),onMouseEnter:yg(h,v),onMouseLeave:yg(f,y),onTouchStart:yg(p,v)}]:[!1,m,{}]}function yg(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function Voe({page:t,...e}){let n=ooe(),{router:r}=s6(),i=O.useMemo(()=>QH(r.routes,t,r.basename),[r.routes,t,r.basename]);return i?n?O.createElement(Xoe,{page:t,matches:i,...e}):O.createElement(Koe,{page:t,matches:i,...e}):null}function Goe(t){let{manifest:e,routeModules:n}=o6(),[r,i]=O.useState([]);return O.useEffect(()=>{let s=!1;return Hoe(t,e,n).then(o=>{s||i(o)}),()=>{s=!0}},[t,e,n]),r}function Xoe({page:t,matches:e,...n}){let r=ko(),{future:i}=o6(),{basename:s}=s6(),o=O.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let l=sz(t,s,i.v8_trailingSlashAwareDataRequests,"rsc"),c=!1,h=[];for(let f of e)typeof f.route.shouldRevalidate=="function"?c=!0:h.push(f.route.id);return c&&h.length>0&&l.searchParams.set("_routes",h.join(",")),[l.pathname+l.search]},[s,i.v8_trailingSlashAwareDataRequests,t,r,e]);return O.createElement(O.Fragment,null,o.map(l=>O.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...n})))}function Koe({page:t,matches:e,...n}){let r=ko(),{future:i,manifest:s,routeModules:o}=o6(),{basename:l}=s6(),{loaderData:c,matches:h}=Woe(),f=O.useMemo(()=>S5(t,e,h,s,r,"data"),[t,e,h,s,r]),p=O.useMemo(()=>S5(t,e,h,s,r,"assets"),[t,e,h,s,r]),m=O.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let x=new Set,S=!1;if(e.forEach(A=>{var j;let C=s.routes[A.route.id];!C||!C.hasLoader||(!f.some(_=>_.route.id===A.route.id)&&A.route.id in c&&((j=o[A.route.id])!=null&&j.shouldRevalidate)||C.hasClientLoader?S=!0:x.add(A.route.id))}),x.size===0)return[];let w=sz(t,l,i.v8_trailingSlashAwareDataRequests,"data");return S&&x.size>0&&w.searchParams.set("_routes",e.filter(A=>x.has(A.route.id)).map(A=>A.route.id).join(",")),[w.pathname+w.search]},[l,i.v8_trailingSlashAwareDataRequests,c,r,s,f,e,t,o]),v=O.useMemo(()=>zoe(p,s),[p,s]),y=Goe(p);return O.createElement(O.Fragment,null,m.map(x=>O.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),v.map(x=>O.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),y.map(({key:x,link:S})=>O.createElement("link",{key:x,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function Zoe(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var Joe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Joe&&(window.__reactRouterVersion="7.17.0")}catch{}function ele({basename:t,children:e,useTransitions:n,window:r}){let i=O.useRef();i.current==null&&(i.current=Dae({window:r,v5Compat:!0}));let s=i.current,[o,l]=O.useState({action:s.action,location:s.location}),c=O.useCallback(h=>{n===!1?l(h):O.startTransition(()=>l(h))},[n]);return O.useLayoutEffect(()=>s.listen(c),[s,c]),O.createElement(Eoe,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:s,useTransitions:n})}var az=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,l6=O.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,mask:l,state:c,target:h,to:f,preventScrollReset:p,viewTransition:m,defaultShouldRevalidate:v,...y},x){let{basename:S,navigator:w,useTransitions:A}=O.useContext(xa),C=typeof f=="string"&&az.test(f),j=GH(f,S);f=j.to;let _=poe(f,{relative:i}),k=ko(),M=null;if(l){let H=w2(l,[],k.mask?k.mask.pathname:"/",!0);S!=="/"&&(H.pathname=H.pathname==="/"?S:ol([S,H.pathname])),M=w.createHref(H)}let[R,N,I]=Yoe(r,y),D=rle(f,{replace:o,mask:l,state:c,target:h,preventScrollReset:p,relative:i,viewTransition:m,defaultShouldRevalidate:v,useTransitions:A});function L(H){e&&e(H),H.defaultPrevented||D(H)}let z=!(j.isExternal||s),P=O.createElement("a",{...y,...I,href:(z?M:void 0)||j.absoluteURL||_,onClick:z?L:e,ref:Zoe(x,N),target:h,"data-discover":!C&&n==="render"?"true":void 0});return R&&!C?O.createElement(O.Fragment,null,P,O.createElement(Voe,{page:_})):P});l6.displayName="Link";var Pg=O.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:l,children:c,...h},f){let p=Pb(o,{relative:h.relative}),m=ko(),v=O.useContext(S2),{navigator:y,basename:x}=O.useContext(xa),S=v!=null&&lle(p)&&l===!0,w=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,A=m.pathname,C=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(A=A.toLowerCase(),C=C?C.toLowerCase():null,w=w.toLowerCase()),C&&x&&(C=hu(C,x)||C);const j=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let _=A===w||!i&&A.startsWith(w)&&A.charAt(j)==="/",k=C!=null&&(C===w||!i&&C.startsWith(w)&&C.charAt(w.length)==="/"),M={isActive:_,isPending:k,isTransitioning:S},R=_?e:void 0,N;typeof r=="function"?N=r(M):N=[r,_?"active":null,k?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let I=typeof s=="function"?s(M):s;return O.createElement(l6,{...h,"aria-current":R,className:N,ref:f,style:I,to:o,viewTransition:l},typeof c=="function"?c(M):c)});Pg.displayName="NavLink";var tle=O.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:s,method:o=Ex,action:l,onSubmit:c,relative:h,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...v},y)=>{let{useTransitions:x}=O.useContext(xa),S=ale(),w=ole(l,{relative:h}),A=o.toLowerCase()==="get"?"get":"post",C=typeof l=="string"&&az.test(l),j=_=>{if(c&&c(_),_.defaultPrevented)return;_.preventDefault();let k=_.nativeEvent.submitter,M=(k==null?void 0:k.getAttribute("formmethod"))||o,R=()=>S(k||_.currentTarget,{fetcherKey:e,method:M,navigate:n,replace:i,state:s,relative:h,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});x&&n!==!1?O.startTransition(()=>R()):R()};return O.createElement("form",{ref:y,method:A,action:w,onSubmit:r?c:j,...v,"data-discover":!C&&t==="render"?"true":void 0})});tle.displayName="Form";function nle(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function oz(t){let e=O.useContext(Bf);return Fr(e,nle(t)),e}function rle(t,{target:e,replace:n,mask:r,state:i,preventScrollReset:s,relative:o,viewTransition:l,defaultShouldRevalidate:c,useTransitions:h}={}){let f=t6(),p=ko(),m=Pb(t,{relative:o});return O.useCallback(v=>{if(Ioe(v,e)){v.preventDefault();let y=n!==void 0?n:jv(p)===jv(m),x=()=>f(t,{replace:y,mask:r,state:i,preventScrollReset:s,relative:o,viewTransition:l,defaultShouldRevalidate:c});h?O.startTransition(()=>x()):x()}},[p,f,m,n,r,i,e,t,s,o,l,c,h])}var ile=0,sle=()=>`__${String(++ile)}__`;function ale(){let{router:t}=oz("useSubmit"),{basename:e}=O.useContext(xa),n=Coe(),r=t.fetch,i=t.navigate;return O.useCallback(async(s,o={})=>{let{action:l,method:c,encType:h,formData:f,body:p}=Poe(s,e);if(o.navigate===!1){let m=o.fetcherKey||sle();await r(m,n,o.action||l,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||h,flushSync:o.flushSync})}else await i(o.action||l,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||h,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,e,n])}function ole(t,{relative:e}={}){let{basename:n}=O.useContext(xa),r=O.useContext(uc);Fr(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Pb(t||".",{relative:e})},o=ko();if(t==null){s.search=o.search;let l=new URLSearchParams(s.search),c=l.getAll("index");if(c.some(f=>f==="")){l.delete("index"),c.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:ol([n,s.pathname])),jv(s)}function lle(t,{relative:e}={}){let n=O.useContext(ZH);Fr(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=oz("useViewTransitionState"),i=Pb(t,{relative:e});if(!n.isTransitioning)return!1;let s=hu(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=hu(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xA(i.pathname,o)!=null||xA(i.pathname,s)!=null}var Fb=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(){}},nf,wh,hm,dP,cle=(dP=class extends Fb{constructor(){super();st(this,nf);st(this,wh);st(this,hm);Le(this,hm,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Q(this,wh)||this.setEventListener(Q(this,hm))}onUnsubscribe(){var e;this.hasListeners()||((e=Q(this,wh))==null||e.call(this),Le(this,wh,void 0))}setEventListener(e){var n;Le(this,hm,e),(n=Q(this,wh))==null||n.call(this),Le(this,wh,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){Q(this,nf)!==e&&(Le(this,nf,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof Q(this,nf)=="boolean"?Q(this,nf):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},nf=new WeakMap,wh=new WeakMap,hm=new WeakMap,dP),c6=new cle,ule={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Sh,TO,fP,hle=(fP=class{constructor(){st(this,Sh,ule);st(this,TO,!1)}setTimeoutProvider(t){Le(this,Sh,t)}setTimeout(t,e){return Q(this,Sh).setTimeout(t,e)}clearTimeout(t){Q(this,Sh).clearTimeout(t)}setInterval(t,e){return Q(this,Sh).setInterval(t,e)}clearInterval(t){Q(this,Sh).clearInterval(t)}},Sh=new WeakMap,TO=new WeakMap,fP),Xd=new hle;function dle(t){setTimeout(t,0)}var fle=typeof window>"u"||"Deno"in globalThis;function ca(){}function ple(t,e){return typeof t=="function"?t(e):t}function C3(t){return typeof t=="number"&&t>=0&&t!==1/0}function lz(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Bh(t,e){return typeof t=="function"?t(e):t}function $a(t,e){return typeof t=="function"?t(e):t}function j5(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==u6(o,e.options))return!1}else if(!_v(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||i&&i!==e.state.fetchStatus||s&&!s(e))}function C5(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Cv(e.options.mutationKey)!==Cv(s))return!1}else if(!_v(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function u6(t,e){return((e==null?void 0:e.queryKeyHashFn)||Cv)(t)}function Cv(t){return JSON.stringify(t,(e,n)=>T3(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function _v(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>_v(t[n],e[n])):!1}var mle=Object.prototype.hasOwnProperty;function cz(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=_5(t)&&_5(e);if(!r&&!(T3(t)&&T3(e)))return e;const s=(r?t:Object.keys(t)).length,o=r?e:Object.keys(e),l=o.length,c=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){c[p]=m,(r?f<s:mle.call(t,p))&&h++;continue}if(m===null||v===null||typeof m!="object"||typeof v!="object"){c[p]=v;continue}const y=cz(m,v,n+1);c[p]=y,y===m&&h++}return s===l&&h===s?t:c}function _3(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 _5(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function T3(t){if(!T5(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!T5(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function T5(t){return Object.prototype.toString.call(t)==="[object Object]"}function gle(t){return new Promise(e=>{Xd.setTimeout(e,t)})}function k3(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?cz(t,e):e}function vle(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function ble(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var h6=Symbol();function uz(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===h6?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function hz(t,e){return typeof t=="function"?t(...e):!!t}function yle(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 Tv=(()=>{let t=()=>fle;return{isServer(){return t()},setIsServer(e){t=e}}})();function O3(){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 xle=dle;function Ale(){let t=[],e=0,n=l=>{l()},r=l=>{l()},i=xle;const s=l=>{e?t.push(l):i(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;e++;try{c=l()}finally{e--,e||o()}return c},batchCalls:l=>(...c)=>{s(()=>{l(...c)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var hs=Ale(),dm,jh,fm,pP,wle=(pP=class extends Fb{constructor(){super();st(this,dm,!0);st(this,jh);st(this,fm);Le(this,fm,e=>{if(typeof window<"u"&&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(){Q(this,jh)||this.setEventListener(Q(this,fm))}onUnsubscribe(){var e;this.hasListeners()||((e=Q(this,jh))==null||e.call(this),Le(this,jh,void 0))}setEventListener(e){var n;Le(this,fm,e),(n=Q(this,jh))==null||n.call(this),Le(this,jh,e(this.setOnline.bind(this)))}setOnline(e){Q(this,dm)!==e&&(Le(this,dm,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return Q(this,dm)}},dm=new WeakMap,jh=new WeakMap,fm=new WeakMap,pP),wA=new wle;function Sle(t){return Math.min(1e3*2**t,3e4)}function dz(t){return(t??"online")==="online"?wA.isOnline():!0}var E3=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function fz(t){let e=!1,n=0,r;const i=O3(),s=()=>i.status!=="pending",o=x=>{var S;if(!s()){const w=new E3(x);m(w),(S=t.onCancel)==null||S.call(t,w)}},l=()=>{e=!0},c=()=>{e=!1},h=()=>c6.isFocused()&&(t.networkMode==="always"||wA.isOnline())&&t.canRun(),f=()=>dz(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 S;r=w=>{(s()||h())&&x(w)},(S=t.onPause)==null||S.call(t)}).then(()=>{var x;r=void 0,s()||(x=t.onContinue)==null||x.call(t)}),y=()=>{if(s())return;let x;const S=n===0?t.initialPromise:void 0;try{x=S??t.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(p).catch(w=>{var k;if(s())return;const A=t.retry??(Tv.isServer()?0:3),C=t.retryDelay??Sle,j=typeof C=="function"?C(n,w):C,_=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,w);if(e||!_){m(w);return}n++,(k=t.onFail)==null||k.call(t,n,w),gle(j).then(()=>h()?void 0:v()).then(()=>{e?m(w):y()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:c,canStart:f,start:()=>(f()?y():v().then(y),i)}}var rf,mP,pz=(mP=class{constructor(){st(this,rf)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),C3(this.gcTime)&&Le(this,rf,Xd.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Tv.isServer()?1/0:300*1e3))}clearGcTimeout(){Q(this,rf)!==void 0&&(Xd.clearTimeout(Q(this,rf)),Le(this,rf,void 0))}},rf=new WeakMap,mP);function jle(t){return{onFetch:(e,n)=>{var f,p,m,v,y;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=((y=e.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const h=async()=>{let x=!1;const S=C=>{yle(C,()=>e.signal,()=>x=!0)},w=uz(e.options,e.fetchOptions),A=async(C,j,_)=>{if(x)return Promise.reject(e.signal.reason);if(j==null&&C.pages.length)return Promise.resolve(C);const M=(()=>{const D={client:e.client,queryKey:e.queryKey,pageParam:j,direction:_?"backward":"forward",meta:e.options.meta};return S(D),D})(),R=await w(M),{maxPages:N}=e.options,I=_?ble:vle;return{pages:I(C.pages,R,N),pageParams:I(C.pageParams,j,N)}};if(i&&s.length){const C=i==="backward",j=C?Cle:k5,_={pages:s,pageParams:o},k=j(r,_);l=await A(_,k,C)}else{const C=t??s.length;do{const j=c===0?o[0]??r.initialPageParam:k5(r,l);if(c>0&&j==null)break;l=await A(l,j),c++}while(c<C)}return l};e.options.persister?e.fetchFn=()=>{var x,S;return(S=(x=e.options).persister)==null?void 0:S.call(x,h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=h}}}function k5(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 Cle(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 pm,sf,mm,fo,af,Ui,nb,of,Fa,mz,Vc,gP,_le=(gP=class extends pz{constructor(e){super();st(this,Fa);st(this,pm);st(this,sf);st(this,mm);st(this,fo);st(this,af);st(this,Ui);st(this,nb);st(this,of);Le(this,of,!1),Le(this,nb,e.defaultOptions),this.setOptions(e.options),this.observers=[],Le(this,af,e.client),Le(this,fo,Q(this,af).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Le(this,sf,E5(this.options)),this.state=e.state??Q(this,sf),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return Q(this,pm)}get promise(){var e;return(e=Q(this,Ui))==null?void 0:e.promise}setOptions(e){if(this.options={...Q(this,nb),...e},e!=null&&e._type&&Le(this,pm,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=E5(this.options);n.data!==void 0&&(this.setState(O5(n.data,n.dataUpdatedAt)),Le(this,sf,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Q(this,fo).remove(this)}setData(e,n){const r=k3(this.state.data,e,this.options);return qe(this,Fa,Vc).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){qe(this,Fa,Vc).call(this,{type:"setState",state:e})}cancel(e){var r,i;const n=(r=Q(this,Ui))==null?void 0:r.promise;return(i=Q(this,Ui))==null||i.cancel(e),n?n.then(ca).catch(ca):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Q(this,sf)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>$a(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===h6||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Bh(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:!lz(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=Q(this,Ui))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=Q(this,Ui))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Q(this,fo).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(Q(this,Ui)&&(Q(this,of)||qe(this,Fa,mz).call(this)?Q(this,Ui).cancel({revert:!0}):Q(this,Ui).cancelRetry()),this.scheduleGc()),Q(this,fo).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||qe(this,Fa,Vc).call(this,{type:"invalidate"})}async fetch(e,n){var h,f,p,m,v,y,x,S,w,A,C;if(this.state.fetchStatus!=="idle"&&((h=Q(this,Ui))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Q(this,Ui))return Q(this,Ui).continueRetry(),Q(this,Ui).promise}if(e&&this.setOptions(e),!this.options.queryFn){const j=this.observers.find(_=>_.options.queryFn);j&&this.setOptions(j.options)}const r=new AbortController,i=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(Le(this,of,!0),r.signal)})},s=()=>{const j=uz(this.options,n),k=(()=>{const M={client:Q(this,af),queryKey:this.queryKey,meta:this.meta};return i(M),M})();return Le(this,of,!1),this.options.persister?this.options.persister(j,k,this):j(k)},l=(()=>{const j={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Q(this,af),state:this.state,fetchFn:s};return i(j),j})(),c=Q(this,pm)==="infinite"?jle(this.options.pages):this.options.behavior;c==null||c.onFetch(l,this),Le(this,mm,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&qe(this,Fa,Vc).call(this,{type:"fetch",meta:(p=l.fetchOptions)==null?void 0:p.meta}),Le(this,Ui,fz({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:j=>{j instanceof E3&&j.revert&&this.setState({...Q(this,mm),fetchStatus:"idle"}),r.abort()},onFail:(j,_)=>{qe(this,Fa,Vc).call(this,{type:"failed",failureCount:j,error:_})},onPause:()=>{qe(this,Fa,Vc).call(this,{type:"pause"})},onContinue:()=>{qe(this,Fa,Vc).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const j=await Q(this,Ui).start();if(j===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(j),(v=(m=Q(this,fo).config).onSuccess)==null||v.call(m,j,this),(x=(y=Q(this,fo).config).onSettled)==null||x.call(y,j,this.state.error,this),j}catch(j){if(j instanceof E3){if(j.silent)return Q(this,Ui).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw qe(this,Fa,Vc).call(this,{type:"error",error:j}),(w=(S=Q(this,fo).config).onError)==null||w.call(S,j,this),(C=(A=Q(this,fo).config).onSettled)==null||C.call(A,this.state.data,j,this),j}finally{this.scheduleGc()}}},pm=new WeakMap,sf=new WeakMap,mm=new WeakMap,fo=new WeakMap,af=new WeakMap,Ui=new WeakMap,nb=new WeakMap,of=new WeakMap,Fa=new WeakSet,mz=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Vc=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,...gz(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...O5(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Le(this,mm,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),hs.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),Q(this,fo).notify({query:this,type:"updated",action:e})})},gP);function gz(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dz(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function O5(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function E5(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 oa,jn,rb,Ps,lf,gm,Kc,Ch,ib,vm,bm,cf,uf,_h,ym,Vn,Fg,M3,R3,D3,N3,I3,L3,B3,bz,vP,vz=(vP=class extends Fb{constructor(e,n){super();st(this,Vn);st(this,oa);st(this,jn);st(this,rb);st(this,Ps);st(this,lf);st(this,gm);st(this,Kc);st(this,Ch);st(this,ib);st(this,vm);st(this,bm);st(this,cf);st(this,uf);st(this,_h);st(this,ym,new Set);this.options=n,Le(this,oa,e),Le(this,Ch,null),Le(this,Kc,O3()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Q(this,jn).addObserver(this),M5(Q(this,jn),this.options)?qe(this,Vn,Fg).call(this):this.updateResult(),qe(this,Vn,N3).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return P3(Q(this,jn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return P3(Q(this,jn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,qe(this,Vn,I3).call(this),qe(this,Vn,L3).call(this),Q(this,jn).removeObserver(this)}setOptions(e){const n=this.options,r=Q(this,jn);if(this.options=Q(this,oa).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $a(this.options.enabled,Q(this,jn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");qe(this,Vn,B3).call(this),Q(this,jn).setOptions(this.options),n._defaulted&&!_3(this.options,n)&&Q(this,oa).getQueryCache().notify({type:"observerOptionsUpdated",query:Q(this,jn),observer:this});const i=this.hasListeners();i&&R5(Q(this,jn),r,this.options,n)&&qe(this,Vn,Fg).call(this),this.updateResult(),i&&(Q(this,jn)!==r||$a(this.options.enabled,Q(this,jn))!==$a(n.enabled,Q(this,jn))||Bh(this.options.staleTime,Q(this,jn))!==Bh(n.staleTime,Q(this,jn)))&&qe(this,Vn,M3).call(this);const s=qe(this,Vn,R3).call(this);i&&(Q(this,jn)!==r||$a(this.options.enabled,Q(this,jn))!==$a(n.enabled,Q(this,jn))||s!==Q(this,_h))&&qe(this,Vn,D3).call(this,s)}getOptimisticResult(e){const n=Q(this,oa).getQueryCache().build(Q(this,oa),e),r=this.createResult(n,e);return kle(this,r)&&(Le(this,Ps,r),Le(this,gm,this.options),Le(this,lf,Q(this,jn).state)),r}getCurrentResult(){return Q(this,Ps)}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&&Q(this,Kc).status==="pending"&&Q(this,Kc).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){Q(this,ym).add(e)}getCurrentQuery(){return Q(this,jn)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=Q(this,oa).defaultQueryOptions(e),r=Q(this,oa).getQueryCache().build(Q(this,oa),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return qe(this,Vn,Fg).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),Q(this,Ps)))}createResult(e,n){var N;const r=Q(this,jn),i=this.options,s=Q(this,Ps),o=Q(this,lf),l=Q(this,gm),h=e!==r?e.state:Q(this,rb),{state:f}=e;let p={...f},m=!1,v;if(n._optimisticResults){const I=this.hasListeners(),D=!I&&M5(e,n),L=I&&R5(e,r,n,i);(D||L)&&(p={...p,...gz(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:y,errorUpdatedAt:x,status:S}=p;v=p.data;let w=!1;if(n.placeholderData!==void 0&&v===void 0&&S==="pending"){let I;s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=s.data,w=!0):I=typeof n.placeholderData=="function"?n.placeholderData((N=Q(this,bm))==null?void 0:N.state.data,Q(this,bm)):n.placeholderData,I!==void 0&&(S="success",v=k3(s==null?void 0:s.data,I,n),m=!0)}if(n.select&&v!==void 0&&!w)if(s&&v===(o==null?void 0:o.data)&&n.select===Q(this,ib))v=Q(this,vm);else try{Le(this,ib,n.select),v=n.select(v),v=k3(s==null?void 0:s.data,v,n),Le(this,vm,v),Le(this,Ch,null)}catch(I){Le(this,Ch,I)}Q(this,Ch)&&(y=Q(this,Ch),v=Q(this,vm),x=Date.now(),S="error");const A=p.fetchStatus==="fetching",C=S==="pending",j=S==="error",_=C&&A,k=v!==void 0,R={status:S,fetchStatus:p.fetchStatus,isPending:C,isSuccess:S==="success",isError:j,isInitialLoading:_,isLoading:_,data:v,dataUpdatedAt:p.dataUpdatedAt,error:y,errorUpdatedAt:x,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>h.dataUpdateCount||p.errorUpdateCount>h.errorUpdateCount,isFetching:A,isRefetching:A&&!C,isLoadingError:j&&!k,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:j&&k,isStale:d6(e,n),refetch:this.refetch,promise:Q(this,Kc),isEnabled:$a(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const I=R.data!==void 0,D=R.status==="error"&&!I,L=H=>{D?H.reject(R.error):I&&H.resolve(R.data)},z=()=>{const H=Le(this,Kc,R.promise=O3());L(H)},P=Q(this,Kc);switch(P.status){case"pending":e.queryHash===r.queryHash&&L(P);break;case"fulfilled":(D||R.data!==P.value)&&z();break;case"rejected":(!D||R.error!==P.reason)&&z();break}}return R}updateResult(){const e=Q(this,Ps),n=this.createResult(Q(this,jn),this.options);if(Le(this,lf,Q(this,jn).state),Le(this,gm,this.options),Q(this,lf).data!==void 0&&Le(this,bm,Q(this,jn)),_3(n,e))return;Le(this,Ps,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!Q(this,ym).size)return!0;const o=new Set(s??Q(this,ym));return this.options.throwOnError&&o.add("error"),Object.keys(Q(this,Ps)).some(l=>{const c=l;return Q(this,Ps)[c]!==e[c]&&o.has(c)})};qe(this,Vn,bz).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&qe(this,Vn,N3).call(this)}},oa=new WeakMap,jn=new WeakMap,rb=new WeakMap,Ps=new WeakMap,lf=new WeakMap,gm=new WeakMap,Kc=new WeakMap,Ch=new WeakMap,ib=new WeakMap,vm=new WeakMap,bm=new WeakMap,cf=new WeakMap,uf=new WeakMap,_h=new WeakMap,ym=new WeakMap,Vn=new WeakSet,Fg=function(e){qe(this,Vn,B3).call(this);let n=Q(this,jn).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(ca)),n},M3=function(){qe(this,Vn,I3).call(this);const e=Bh(this.options.staleTime,Q(this,jn));if(Tv.isServer()||Q(this,Ps).isStale||!C3(e))return;const r=lz(Q(this,Ps).dataUpdatedAt,e)+1;Le(this,cf,Xd.setTimeout(()=>{Q(this,Ps).isStale||this.updateResult()},r))},R3=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Q(this,jn)):this.options.refetchInterval)??!1},D3=function(e){qe(this,Vn,L3).call(this),Le(this,_h,e),!(Tv.isServer()||$a(this.options.enabled,Q(this,jn))===!1||!C3(Q(this,_h))||Q(this,_h)===0)&&Le(this,uf,Xd.setInterval(()=>{(this.options.refetchIntervalInBackground||c6.isFocused())&&qe(this,Vn,Fg).call(this)},Q(this,_h)))},N3=function(){qe(this,Vn,M3).call(this),qe(this,Vn,D3).call(this,qe(this,Vn,R3).call(this))},I3=function(){Q(this,cf)!==void 0&&(Xd.clearTimeout(Q(this,cf)),Le(this,cf,void 0))},L3=function(){Q(this,uf)!==void 0&&(Xd.clearInterval(Q(this,uf)),Le(this,uf,void 0))},B3=function(){const e=Q(this,oa).getQueryCache().build(Q(this,oa),this.options);if(e===Q(this,jn))return;const n=Q(this,jn);Le(this,jn,e),Le(this,rb,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},bz=function(e){hs.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(Q(this,Ps))}),Q(this,oa).getQueryCache().notify({query:Q(this,jn),type:"observerResultsUpdated"})})},vP);function Tle(t,e){return $a(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&$a(e.retryOnMount,t)===!1)}function M5(t,e){return Tle(t,e)||t.state.data!==void 0&&P3(t,e,e.refetchOnMount)}function P3(t,e,n){if($a(e.enabled,t)!==!1&&Bh(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&d6(t,e)}return!1}function R5(t,e,n,r){return(t!==e||$a(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&d6(t,n)}function d6(t,e){return $a(e.enabled,t)!==!1&&t.isStaleByTime(Bh(e.staleTime,t))}function kle(t,e){return!_3(t.getCurrentResult(),e)}var sb,Bl,Ts,hf,Pl,ch,bP,Ole=(bP=class extends pz{constructor(e){super();st(this,Pl);st(this,sb);st(this,Bl);st(this,Ts);st(this,hf);Le(this,sb,e.client),this.mutationId=e.mutationId,Le(this,Ts,e.mutationCache),Le(this,Bl,[]),this.state=e.state||Ele(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){Q(this,Bl).includes(e)||(Q(this,Bl).push(e),this.clearGcTimeout(),Q(this,Ts).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Le(this,Bl,Q(this,Bl).filter(n=>n!==e)),this.scheduleGc(),Q(this,Ts).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Q(this,Bl).length||(this.state.status==="pending"?this.scheduleGc():Q(this,Ts).remove(this))}continue(){var e;return((e=Q(this,hf))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,l,c,h,f,p,m,v,y,x,S,w,A,C,j,_,k,M;const n=()=>{qe(this,Pl,ch).call(this,{type:"continue"})},r={client:Q(this,sb),meta:this.options.meta,mutationKey:this.options.mutationKey};Le(this,hf,fz({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,N)=>{qe(this,Pl,ch).call(this,{type:"failed",failureCount:R,error:N})},onPause:()=>{qe(this,Pl,ch).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Q(this,Ts).canRun(this)}));const i=this.state.status==="pending",s=!Q(this,hf).canStart();try{if(i)n();else{qe(this,Pl,ch).call(this,{type:"pending",variables:e,isPaused:s}),Q(this,Ts).config.onMutate&&await Q(this,Ts).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&&qe(this,Pl,ch).call(this,{type:"pending",context:N,variables:e,isPaused:s})}const R=await Q(this,hf).start();return await((h=(c=Q(this,Ts).config).onSuccess)==null?void 0:h.call(c,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=Q(this,Ts).config).onSettled)==null?void 0:v.call(m,R,null,this.state.variables,this.state.context,this,r)),await((x=(y=this.options).onSettled)==null?void 0:x.call(y,R,null,e,this.state.context,r)),qe(this,Pl,ch).call(this,{type:"success",data:R}),R}catch(R){try{await((w=(S=Q(this,Ts).config).onError)==null?void 0:w.call(S,R,e,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((C=(A=this.options).onError)==null?void 0:C.call(A,R,e,this.state.context,r))}catch(N){Promise.reject(N)}try{await((_=(j=Q(this,Ts).config).onSettled)==null?void 0:_.call(j,void 0,R,this.state.variables,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((M=(k=this.options).onSettled)==null?void 0:M.call(k,void 0,R,e,this.state.context,r))}catch(N){Promise.reject(N)}throw qe(this,Pl,ch).call(this,{type:"error",error:R}),R}finally{Q(this,Ts).runNext(this)}}},sb=new WeakMap,Bl=new WeakMap,Ts=new WeakMap,hf=new WeakMap,Pl=new WeakSet,ch=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),hs.batch(()=>{Q(this,Bl).forEach(r=>{r.onMutationUpdate(e)}),Q(this,Ts).notify({mutation:this,type:"updated",action:e})})},bP);function Ele(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Zc,zo,ab,yP,Mle=(yP=class extends Fb{constructor(e={}){super();st(this,Zc);st(this,zo);st(this,ab);this.config=e,Le(this,Zc,new Set),Le(this,zo,new Map),Le(this,ab,0)}build(e,n,r){const i=new Ole({client:e,mutationCache:this,mutationId:++Md(this,ab)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){Q(this,Zc).add(e);const n=E1(e);if(typeof n=="string"){const r=Q(this,zo).get(n);r?r.push(e):Q(this,zo).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(Q(this,Zc).delete(e)){const n=E1(e);if(typeof n=="string"){const r=Q(this,zo).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&Q(this,zo).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=E1(e);if(typeof n=="string"){const r=Q(this,zo).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=E1(e);if(typeof n=="string"){const i=(r=Q(this,zo).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(){hs.batch(()=>{Q(this,Zc).forEach(e=>{this.notify({type:"removed",mutation:e})}),Q(this,Zc).clear(),Q(this,zo).clear()})}getAll(){return Array.from(Q(this,Zc))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>C5(n,r))}findAll(e={}){return this.getAll().filter(n=>C5(e,n))}notify(e){hs.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return hs.batch(()=>Promise.all(e.map(n=>n.continue().catch(ca))))}},Zc=new WeakMap,zo=new WeakMap,ab=new WeakMap,yP);function E1(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Fl,xP,Rle=(xP=class extends Fb{constructor(e={}){super();st(this,Fl);this.config=e,Le(this,Fl,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??u6(i,n);let o=this.get(s);return o||(o=new _le({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){Q(this,Fl).has(e.queryHash)||(Q(this,Fl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=Q(this,Fl).get(e.queryHash);n&&(e.destroy(),n===e&&Q(this,Fl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){hs.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Q(this,Fl).get(e)}getAll(){return[...Q(this,Fl).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>j5(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>j5(e,r)):n}notify(e){hs.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){hs.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){hs.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Fl=new WeakMap,xP),ti,Th,kh,xm,Am,Oh,wm,Sm,AP,Dle=(AP=class{constructor(t={}){st(this,ti);st(this,Th);st(this,kh);st(this,xm);st(this,Am);st(this,Oh);st(this,wm);st(this,Sm);Le(this,ti,t.queryCache||new Rle),Le(this,Th,t.mutationCache||new Mle),Le(this,kh,t.defaultOptions||{}),Le(this,xm,new Map),Le(this,Am,new Map),Le(this,Oh,0)}mount(){Md(this,Oh)._++,Q(this,Oh)===1&&(Le(this,wm,c6.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,ti).onFocus())})),Le(this,Sm,wA.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,ti).onOnline())})))}unmount(){var t,e;Md(this,Oh)._--,Q(this,Oh)===0&&((t=Q(this,wm))==null||t.call(this),Le(this,wm,void 0),(e=Q(this,Sm))==null||e.call(this),Le(this,Sm,void 0))}isFetching(t){return Q(this,ti).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Q(this,Th).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=Q(this,ti).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=Q(this,ti).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Bh(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return Q(this,ti).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=Q(this,ti).get(r.queryHash),s=i==null?void 0:i.state.data,o=ple(e,s);if(o!==void 0)return Q(this,ti).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return hs.batch(()=>Q(this,ti).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=Q(this,ti).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=Q(this,ti);hs.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=Q(this,ti);return hs.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=hs.batch(()=>Q(this,ti).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(ca).catch(ca)}invalidateQueries(t,e={}){return hs.batch(()=>(Q(this,ti).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=hs.batch(()=>Q(this,ti).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(ca)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(ca)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=Q(this,ti).build(this,e);return n.isStaleByTime(Bh(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ca).catch(ca)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ca).catch(ca)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return wA.isOnline()?Q(this,Th).resumePausedMutations():Promise.resolve()}getQueryCache(){return Q(this,ti)}getMutationCache(){return Q(this,Th)}getDefaultOptions(){return Q(this,kh)}setDefaultOptions(t){Le(this,kh,t)}setQueryDefaults(t,e){Q(this,xm).set(Cv(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...Q(this,xm).values()],n={};return e.forEach(r=>{_v(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){Q(this,Am).set(Cv(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...Q(this,Am).values()],n={};return e.forEach(r=>{_v(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...Q(this,kh).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=u6(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===h6&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Q(this,kh).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Q(this,ti).clear(),Q(this,Th).clear()}},ti=new WeakMap,Th=new WeakMap,kh=new WeakMap,xm=new WeakMap,Am=new WeakMap,Oh=new WeakMap,wm=new WeakMap,Sm=new WeakMap,AP),yz=O.createContext(void 0),Nle=t=>{const e=O.useContext(yz);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Ile=({client:t,children:e})=>(O.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),a.jsx(yz.Provider,{value:t,children:e})),xz=O.createContext(!1),Lle=()=>O.useContext(xz);xz.Provider;function Ble(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Ple=O.createContext(Ble()),Fle=()=>O.useContext(Ple),$le=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?hz(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},Hle=t=>{O.useEffect(()=>{t.clearReset()},[t])},zle=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||hz(n,[t.error,r])),qle=(t,e)=>e.state.data===void 0,Qle=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))}},Ule=(t,e)=>t.isLoading&&t.isFetching&&!e,Wle=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,D5=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Az(t,e,n){var v,y,x,S;const r=Lle(),i=Fle(),s=Nle(),o=s.defaultQueryOptions(t);(y=(v=s.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||y.call(v,o);const l=s.getQueryCache().get(o.queryHash),c=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Qle(o),$le(o,i,l),Hle(i);const h=!s.getQueryCache().get(o.queryHash),[f]=O.useState(()=>new e(s,o)),p=f.getOptimisticResult(o),m=!r&&c;if(O.useSyncExternalStore(O.useCallback(w=>{const A=m?f.subscribe(hs.batchCalls(w)):ca;return f.updateResult(),A},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),O.useEffect(()=>{f.setOptions(o)},[o,f]),Wle(o,p))throw D5(o,f,i);if(zle({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw p.error;if((S=(x=s.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||S.call(x,o,p),o.experimental_prefetchInRender&&!Tv.isServer()&&Ule(p,r)){const w=h?D5(o,f,i):l==null?void 0:l.promise;w==null||w.catch(ca).finally(()=>{f.updateResult()})}return o.notifyOnChangeProps?p:f.trackResult(p)}function Yle(t,e){return Az(t,vz)}function wz(t,e){return Az({...t,enabled:!0,suspense:!0,throwOnError:qle,placeholderData:void 0},vz)}var u_={exports:{}},h_={};/**
 * @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 N5;function Vle(){if(N5)return h_;N5=1;var t=cb();function e(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&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 h_.useSyncExternalStoreWithSelector=function(c,h,f,p,m){var v=i(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=o(function(){function S(_){if(!w){if(w=!0,A=_,_=p(_),m!==void 0&&y.hasValue){var k=y.value;if(m(k,_))return C=k}return C=_}if(k=C,n(A,_))return k;var M=p(_);return m!==void 0&&m(k,M)?(A=_,k):(A=_,C=M)}var w=!1,A,C,j=f===void 0?null:f;return[function(){return S(h())},j===null?void 0:function(){return S(j())}]},[h,f,p,m]);var x=r(c,v[0],v[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},h_}var I5;function Gle(){return I5||(I5=1,u_.exports=Vle()),u_.exports}var Xle=Gle();function Kle(t){t()}function Zle(){let t=null,e=null;return{clear(){t=null,e=null},notify(){Kle(()=>{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 L5={notify(){},get:()=>[]};function Jle(t,e){let n,r=L5,i=0,s=!1;function o(x){f();const S=r.subscribe(x);let w=!1;return()=>{w||(w=!0,S(),p())}}function l(){r.notify()}function c(){y.onStateChange&&y.onStateChange()}function h(){return s}function f(){i++,n||(n=t.subscribe(c),r=Zle())}function p(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=L5)}function m(){s||(s=!0,f())}function v(){s&&(s=!1,p())}const y={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:h,trySubscribe:m,tryUnsubscribe:v,getListeners:()=>r};return y}var ece=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tce=ece(),nce=()=>typeof navigator<"u"&&navigator.product==="ReactNative",rce=nce(),ice=()=>tce||rce?O.useLayoutEffect:O.useEffect,sce=ice(),d_=Symbol.for("react-redux-context"),f_=typeof globalThis<"u"?globalThis:{};function ace(){if(!O.createContext)return{};const t=f_[d_]??(f_[d_]=new Map);let e=t.get(O.createContext);return e||(e=O.createContext(null),t.set(O.createContext,e)),e}var qh=ace();function oce(t){const{children:e,context:n,serverState:r,store:i}=t,s=O.useMemo(()=>{const c=Jle(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=O.useMemo(()=>i.getState(),[i]);sce(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,o]);const l=n||qh;return O.createElement(l.Provider,{value:s},e)}var lce=oce;function f6(t=qh){return function(){return O.useContext(t)}}var Sz=f6();function jz(t=qh){const e=t===qh?Sz:f6(t),n=()=>{const{store:r}=e();return r};return Object.assign(n,{withTypes:()=>n}),n}var cce=jz();function uce(t=qh){const e=t===qh?cce:jz(t),n=()=>e().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var hce=uce(),dce=(t,e)=>t===e;function fce(t=qh){const e=t===qh?Sz:f6(t),n=(r,i={})=>{const{equalityFn:s=dce}=typeof i=="function"?{equalityFn:i}:i,o=e(),{store:l,subscription:c,getServerState:h}=o;O.useRef(!0);const f=O.useCallback({[r.name](m){return r(m)}}[r.name],[r]),p=Xle.useSyncExternalStoreWithSelector(c.addNestedSub,l.getState,h||l.getState,f,s);return O.useDebugValue(p),p};return Object.assign(n,{withTypes:()=>n}),n}var pce=fce();const Au=hce.withTypes(),hc=pce.withTypes();function os(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 mce=typeof Symbol=="function"&&Symbol.observable||"@@observable",B5=mce,p_=()=>Math.random().toString(36).substring(7).split("").join("."),gce={INIT:`@@redux/INIT${p_()}`,REPLACE:`@@redux/REPLACE${p_()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${p_()}`},SA=gce;function p6(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 Cz(t,e,n){if(typeof t!="function")throw new Error(os(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(os(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(os(1));return n(Cz)(t,e)}let r=t,i=e,s=new Map,o=s,l=0,c=!1;function h(){o===s&&(o=new Map,s.forEach((S,w)=>{o.set(w,S)}))}function f(){if(c)throw new Error(os(3));return i}function p(S){if(typeof S!="function")throw new Error(os(4));if(c)throw new Error(os(5));let w=!0;h();const A=l++;return o.set(A,S),function(){if(w){if(c)throw new Error(os(6));w=!1,h(),o.delete(A),s=null}}}function m(S){if(!p6(S))throw new Error(os(7));if(typeof S.type>"u")throw new Error(os(8));if(typeof S.type!="string")throw new Error(os(17));if(c)throw new Error(os(9));try{c=!0,i=r(i,S)}finally{c=!1}return(s=o).forEach(A=>{A()}),S}function v(S){if(typeof S!="function")throw new Error(os(10));r=S,m({type:SA.REPLACE})}function y(){const S=p;return{subscribe(w){if(typeof w!="object"||w===null)throw new Error(os(11));function A(){const j=w;j.next&&j.next(f())}return A(),{unsubscribe:S(A)}},[B5](){return this}}}return m({type:SA.INIT}),{dispatch:m,subscribe:p,getState:f,replaceReducer:v,[B5]:y}}function vce(t){Object.keys(t).forEach(e=>{const n=t[e];if(typeof n(void 0,{type:SA.INIT})>"u")throw new Error(os(12));if(typeof n(void 0,{type:SA.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(os(13))})}function bce(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{vce(n)}catch(s){i=s}return function(o={},l){if(i)throw i;let c=!1;const h={};for(let f=0;f<r.length;f++){const p=r[f],m=n[p],v=o[p],y=m(v,l);if(typeof y>"u")throw l&&l.type,new Error(os(14));h[p]=y,c=c||y!==v}return c=c||r.length!==Object.keys(o).length,c?h:o}}function jA(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...r)=>e(n(...r)))}function yce(...t){return e=>(n,r)=>{const i=e(n,r);let s=()=>{throw new Error(os(15))};const o={getState:i.getState,dispatch:(c,...h)=>s(c,...h)},l=t.map(c=>c(o));return s=jA(...l)(i.dispatch),{...i,dispatch:s}}}function _z(t){return p6(t)&&"type"in t&&typeof t.type=="string"}var Tz=Symbol.for("immer-nothing"),P5=Symbol.for("immer-draftable"),Vs=Symbol.for("immer-state");function Zo(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var za=Object,Bm=za.getPrototypeOf,CA="constructor",C2="prototype",F3="configurable",_A="enumerable",Rx="writable",kv="value",du=t=>!!t&&!!t[Vs];function dl(t){var e;return t?kz(t)||T2(t)||!!t[P5]||!!((e=t[CA])!=null&&e[P5])||k2(t)||O2(t):!1}var xce=za[C2][CA].toString(),F5=new WeakMap;function kz(t){if(!t||!m6(t))return!1;const e=Bm(t);if(e===null||e===za[C2])return!0;const n=za.hasOwnProperty.call(e,CA)&&e[CA];if(n===Object)return!0;if(!Op(n))return!1;let r=F5.get(n);return r===void 0&&(r=Function.toString.call(n),F5.set(n,r)),r===xce}function _2(t,e,n=!0){$b(t)===0?(n?Reflect.ownKeys(t):za.keys(t)).forEach(i=>{e(i,t[i],t)}):t.forEach((r,i)=>e(i,r,t))}function $b(t){const e=t[Vs];return e?e.type_:T2(t)?1:k2(t)?2:O2(t)?3:0}var $5=(t,e,n=$b(t))=>n===2?t.has(e):za[C2].hasOwnProperty.call(t,e),$3=(t,e,n=$b(t))=>n===2?t.get(e):t[e],TA=(t,e,n,r=$b(t))=>{r===2?t.set(e,n):r===3?t.add(n):t[e]=n};function Ace(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var T2=Array.isArray,k2=t=>t instanceof Map,O2=t=>t instanceof Set,m6=t=>typeof t=="object",Op=t=>typeof t=="function",m_=t=>typeof t=="boolean";function wce(t){const e=+t;return Number.isInteger(e)&&String(e)===t}var Gc=t=>t.copy_||t.base_,g6=t=>t.modified_?t.copy_:t.base_;function H3(t,e){if(k2(t))return new Map(t);if(O2(t))return new Set(t);if(T2(t))return Array[C2].slice.call(t);const n=kz(t);if(e===!0||e==="class_only"&&!n){const r=za.getOwnPropertyDescriptors(t);delete r[Vs];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const o=i[s],l=r[o];l[Rx]===!1&&(l[Rx]=!0,l[F3]=!0),(l.get||l.set)&&(r[o]={[F3]:!0,[Rx]:!0,[_A]:l[_A],[kv]:t[o]})}return za.create(Bm(t),r)}else{const r=Bm(t);if(r!==null&&n)return{...t};const i=za.create(r);return za.assign(i,t)}}function v6(t,e=!1){return E2(t)||du(t)||!dl(t)||($b(t)>1&&za.defineProperties(t,{set:M1,add:M1,clear:M1,delete:M1}),za.freeze(t),e&&_2(t,(n,r)=>{v6(r,!0)},!1)),t}function Sce(){Zo(2)}var M1={[kv]:Sce};function E2(t){return t===null||!m6(t)?!0:za.isFrozen(t)}var kA="MapSet",z3="Patches",H5="ArrayMethods",Oz={};function Tf(t){const e=Oz[t];return e||Zo(0,t),e}var z5=t=>!!Oz[t],Ov,Ez=()=>Ov,jce=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:z5(kA)?Tf(kA):void 0,arrayMethodsPlugin_:z5(H5)?Tf(H5):void 0});function q5(t,e){e&&(t.patchPlugin_=Tf(z3),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function q3(t){Q3(t),t.drafts_.forEach(Cce),t.drafts_=null}function Q3(t){t===Ov&&(Ov=t.parent_)}var Q5=t=>Ov=jce(Ov,t);function Cce(t){const e=t[Vs];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function U5(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];if(t!==void 0&&t!==n){n[Vs].modified_&&(q3(e),Zo(4)),dl(t)&&(t=W5(e,t));const{patchPlugin_:i}=e;i&&i.generateReplacementPatches_(n[Vs].base_,t,e)}else t=W5(e,n);return _ce(e,t,!0),q3(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==Tz?t:void 0}function W5(t,e){if(E2(e))return e;const n=e[Vs];if(!n)return OA(e,t.handledSet_,t);if(!M2(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);Dz(n,t)}return n.copy_}function _ce(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&v6(e,n)}function Mz(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var M2=(t,e)=>t.scope_===e,Tce=[];function Rz(t,e,n,r){const i=Gc(t),s=t.type_;if(r!==void 0&&$3(i,r,s)===e){TA(i,r,n,s);return}if(!t.draftLocations_){const l=t.draftLocations_=new Map;_2(i,(c,h)=>{if(du(h)){const f=l.get(h)||[];f.push(c),l.set(h,f)}})}const o=t.draftLocations_.get(e)??Tce;for(const l of o)TA(i,l,n,s)}function kce(t,e,n){t.callbacks_.push(function(i){var l;const s=e;if(!s||!M2(s,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(s);const o=g6(s);Rz(t,s.draft_??s,o,n),Dz(s,i)})}function Dz(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)}Mz(t)}}function Oce(t,e,n){const{scope_:r}=t;if(du(n)){const i=n[Vs];M2(i,r)&&i.callbacks_.push(function(){Dx(t);const o=g6(i);Rz(t,n,o,e)})}else dl(n)&&t.callbacks_.push(function(){const s=Gc(t);t.type_===3?s.has(n)&&OA(n,r.handledSet_,r):$3(s,e,t.type_)===n&&r.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&OA($3(t.copy_,e,t.type_),r.handledSet_,r)})}function OA(t,e,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||du(t)||e.has(t)||!dl(t)||E2(t)||(e.add(t),_2(t,(r,i)=>{if(du(i)){const s=i[Vs];if(M2(s,n)){const o=g6(s);TA(t,r,o,t.type_),Mz(s)}}else dl(i)&&OA(i,e,n)})),t}function Ece(t,e){const n=T2(t),r={type_:n?1:0,scope_:e?e.scope_:Ez(),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=EA;n&&(i=[r],s=Ev);const{revoke:o,proxy:l}=Proxy.revocable(i,s);return r.draft_=l,r.revoke_=o,[l,r]}var EA={get(t,e){if(e===Vs)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=Gc(t);if(!$5(i,e,t.type_))return Mce(t,i,e);const s=i[e];if(t.finalized_||!dl(s)||r&&t.operationMethod&&(n!=null&&n.isMutatingArrayMethod(t.operationMethod))&&wce(e))return s;if(s===g_(t.base_,e)){Dx(t);const o=t.type_===1?+e:e,l=W3(t.scope_,s,t,o);return t.copy_[o]=l}return s},has(t,e){return e in Gc(t)},ownKeys(t){return Reflect.ownKeys(Gc(t))},set(t,e,n){const r=Nz(Gc(t),e);if(r!=null&&r.set)return r.set.call(t.draft_,n),!0;if(!t.modified_){const i=g_(Gc(t),e),s=i==null?void 0:i[Vs];if(s&&s.base_===n)return t.copy_[e]=n,t.assigned_.set(e,!1),!0;if(Ace(n,i)&&(n!==void 0||$5(t.base_,e,t.type_)))return!0;Dx(t),U3(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),Oce(t,e,n)),!0},deleteProperty(t,e){return Dx(t),g_(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),U3(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=Gc(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{[Rx]:!0,[F3]:t.type_!==1||e!=="length",[_A]:r[_A],[kv]:n[e]}},defineProperty(){Zo(11)},getPrototypeOf(t){return Bm(t.base_)},setPrototypeOf(){Zo(12)}},Ev={};for(let t in EA){let e=EA[t];Ev[t]=function(){const n=arguments;return n[0]=n[0][0],e.apply(this,n)}}Ev.deleteProperty=function(t,e){return Ev.set.call(this,t,e,void 0)};Ev.set=function(t,e,n){return EA.set.call(this,t[0],e,n,t[0])};function g_(t,e){const n=t[Vs];return(n?Gc(n):t)[e]}function Mce(t,e,n){var i;const r=Nz(e,n);return r?kv in r?r[kv]:(i=r.get)==null?void 0:i.call(t.draft_):void 0}function Nz(t,e){if(!(e in t))return;let n=Bm(t);for(;n;){const r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Bm(n)}}function U3(t){t.modified_||(t.modified_=!0,t.parent_&&U3(t.parent_))}function Dx(t){t.copy_||(t.assigned_=new Map,t.copy_=H3(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Rce=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,n,r)=>{if(Op(e)&&!Op(n)){const s=n;n=e;const o=this;return function(c=s,...h){return o.produce(c,f=>n.call(this,f,...h))}}Op(n)||Zo(6),r!==void 0&&!Op(r)&&Zo(7);let i;if(dl(e)){const s=Q5(this),o=W3(s,e,void 0);let l=!0;try{i=n(o),l=!1}finally{l?q3(s):Q3(s)}return q5(s,r),U5(i,s)}else if(!e||!m6(e)){if(i=n(e),i===void 0&&(i=e),i===Tz&&(i=void 0),this.autoFreeze_&&v6(i,!0),r){const s=[],o=[];Tf(z3).generateReplacementPatches_(e,i,{patches_:s,inversePatches_:o}),r(s,o)}return i}else Zo(1,e)},this.produceWithPatches=(e,n)=>{if(Op(e))return(o,...l)=>this.produceWithPatches(o,c=>e(c,...l));let r,i;return[this.produce(e,n,(o,l)=>{r=o,i=l}),r,i]},m_(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),m_(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),m_(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){dl(t)||Zo(8),du(t)&&(t=Dce(t));const e=Q5(this),n=W3(e,t,void 0);return n[Vs].isManual_=!0,Q3(e),n}finishDraft(t,e){const n=t&&t[Vs];(!n||!n.isManual_)&&Zo(9);const{scope_:r}=n;return q5(r,e),U5(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=Tf(z3).applyPatches_;return du(t)?r(t,e):this.produce(t,i=>r(i,e))}};function W3(t,e,n,r){const[i,s]=k2(e)?Tf(kA).proxyMap_(e,n):O2(e)?Tf(kA).proxySet_(e,n):Ece(e,n);return((n==null?void 0:n.scope_)??Ez()).drafts_.push(i),s.callbacks_=(n==null?void 0:n.callbacks_)??[],s.key_=r,n&&r!==void 0?kce(n,s,r):s.callbacks_.push(function(c){var f;(f=c.mapSetPlugin_)==null||f.fixSetContents(s);const{patchPlugin_:h}=c;s.modified_&&h&&h.generatePatches_(s,[],c)}),i}function Dce(t){return du(t)||Zo(10,t),Iz(t)}function Iz(t){if(!dl(t)||E2(t))return t;const e=t[Vs];let n,r=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=H3(t,e.scope_.immer_.useStrictShallowCopy_),r=e.scope_.immer_.shouldUseStrictIteration()}else n=H3(t,!0);return _2(n,(i,s)=>{TA(n,i,Iz(s))},r),e&&(e.finalized_=!1),n}var Nce=new Rce,Lz=Nce.produce;function Bz(t){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,t):i(s)}var Ice=Bz(),Lce=Bz,Bce=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?jA:jA.apply(null,arguments)};function Pm(t,e){function n(...r){if(e){let i=e(...r);if(!i)throw new Error(Qa(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=>_z(r)&&r.type===t,n}var Pz=class $g extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,$g.prototype)}static get[Symbol.species](){return $g}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new $g(...e[0].concat(this)):new $g(...e.concat(this))}};function Y5(t){return dl(t)?Lz(t,()=>{}):t}function R1(t,e,n){return t.has(e)?t.get(e):t.set(e,n(e)).get(e)}function Pce(t){return typeof t=="boolean"}var Fce=()=>function(e){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=e??{};let o=new Pz;return n&&(Pce(n)?o.push(Ice):o.push(Lce(n.extraArgument))),o},$ce="RTK_autoBatch",V5=t=>e=>{setTimeout(e,t)},Hce=(t,e)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(s),clearTimeout(o),n())},s=t(i),o=setTimeout(i,e)},zce=(t={type:"raf"})=>e=>(...n)=>{const r=e(...n);let i=!0,s=!1,o=!1;const l=new Set,c=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Hce(window.requestAnimationFrame,100):V5(10):t.type==="callback"?t.queueNotification:V5(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[$ce]),s=!i,s&&(o||(o=!0,c(h))),r.dispatch(f)}finally{i=!0}}})},qce=t=>function(n){const{autoBatch:r=!0}=n??{};let i=new Pz(t);return r&&i.push(zce(typeof r=="object"?r:void 0)),i};function Qce(t){const e=Fce(),{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(p6(n))l=bce(n);else throw new Error(Qa(1));let c;typeof r=="function"?c=r(e):c=e();let h=jA;i&&(h=Bce({trace:!1,...typeof i=="object"&&i}));const f=yce(...c),p=qce(f);let m=typeof o=="function"?o(p):p();const v=h(...m);return Cz(l,s,v)}function Fz(t){const e={},n=[];let r;const i={addCase(s,o){const l=typeof s=="string"?s:s.type;if(!l)throw new Error(Qa(28));if(l in e)throw new Error(Qa(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 Uce(t){return typeof t=="function"}function Wce(t,e){let[n,r,i]=Fz(e),s;if(Uce(t))s=()=>Y5(t());else{const l=Y5(t);s=()=>l}function o(l=s(),c){let h=[n[c.type],...r.filter(({matcher:f})=>f(c)).map(({reducer:f})=>f)];return h.filter(f=>!!f).length===0&&(h=[i]),h.reduce((f,p)=>{if(p)if(du(f)){const v=p(f,c);return v===void 0?f:v}else{if(dl(f))return Lz(f,m=>p(m,c));{const m=p(f,c);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 Yce="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Vce=(t=21)=>{let e="",n=t;for(;n--;)e+=Yce[Math.random()*64|0];return e},Gce=Symbol.for("rtk-slice-createasyncthunk");function Xce(t,e){return`${t}/${e}`}function Kce({creators:t}={}){var n;const e=(n=t==null?void 0:t.asyncThunk)==null?void 0:n[Gce];return function(i){const{name:s,reducerPath:o=s}=i;if(!s)throw new Error(Qa(11));const l=(typeof i.reducers=="function"?i.reducers(Jce()):i.reducers)||{},c=Object.keys(l),h={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(j,_){const k=typeof j=="string"?j:j.type;if(!k)throw new Error(Qa(12));if(k in h.sliceCaseReducersByType)throw new Error(Qa(13));return h.sliceCaseReducersByType[k]=_,f},addMatcher(j,_){return h.sliceMatchers.push({matcher:j,reducer:_}),f},exposeAction(j,_){return h.actionCreators[j]=_,f},exposeCaseReducer(j,_){return h.sliceCaseReducersByName[j]=_,f}};c.forEach(j=>{const _=l[j],k={reducerName:j,type:Xce(s,j),createNotation:typeof i.reducers=="function"};tue(_)?rue(k,_,f,e):eue(k,_,f)});function p(){const[j={},_=[],k=void 0]=typeof i.extraReducers=="function"?Fz(i.extraReducers):[i.extraReducers],M={...j,...h.sliceCaseReducersByType};return Wce(i.initialState,R=>{for(let N in M)R.addCase(N,M[N]);for(let N of h.sliceMatchers)R.addMatcher(N.matcher,N.reducer);for(let N of _)R.addMatcher(N.matcher,N.reducer);k&&R.addDefaultCase(k)})}const m=j=>j,v=new Map,y=new WeakMap;let x;function S(j,_){return x||(x=p()),x(j,_)}function w(){return x||(x=p()),x.getInitialState()}function A(j,_=!1){function k(R){let N=R[j];return typeof N>"u"&&_&&(N=R1(y,k,w)),N}function M(R=m){const N=R1(v,_,()=>new WeakMap);return R1(N,R,()=>{const I={};for(const[D,L]of Object.entries(i.selectors??{}))I[D]=Zce(L,R,()=>R1(y,R,w),_);return I})}return{reducerPath:j,getSelectors:M,get selectors(){return M(k)},selectSlice:k}}const C={name:s,reducer:S,actions:h.actionCreators,caseReducers:h.sliceCaseReducersByName,getInitialState:w,...A(o),injectInto(j,{reducerPath:_,...k}={}){const M=_??o;return j.inject({reducerPath:M,reducer:S},k),{...C,...A(M,!0)}}};return C}}function Zce(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 R2=Kce();function Jce(){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 eue({type:t,reducerName:e,createNotation:n},r,i){let s,o;if("reducer"in r){if(n&&!nue(r))throw new Error(Qa(17));s=r.reducer,o=r.prepare}else s=r;i.addCase(t,s).exposeCaseReducer(e,s).exposeAction(e,o?Pm(t,o):Pm(t))}function tue(t){return t._reducerDefinitionType==="asyncThunk"}function nue(t){return t._reducerDefinitionType==="reducerWithPrepare"}function rue({type:t,reducerName:e},n,r,i){if(!i)throw new Error(Qa(18));const{payloadCreator:s,fulfilled:o,pending:l,rejected:c,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),c&&r.addCase(p.rejected,c),h&&r.addMatcher(p.settled,h),r.exposeCaseReducer(e,{fulfilled:o||D1,pending:l||D1,rejected:c||D1,settled:h||D1})}function D1(){}var iue="task",$z="listener",Hz="completed",b6="cancelled",sue=`task-${b6}`,aue=`task-${Hz}`,Y3=`${$z}-${b6}`,oue=`${$z}-${Hz}`,D2=class{constructor(t){vr(this,"code");vr(this,"name","TaskAbortError");vr(this,"message");this.code=t,this.message=`${iue} ${b6} (reason: ${t})`}},y6=(t,e)=>{if(typeof t!="function")throw new TypeError(Qa(32))},MA=()=>{},zz=(t,e=MA)=>(t.catch(e),t),qz=(t,e)=>(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)),vf=t=>{if(t.aborted)throw new D2(t.reason)};function Qz(t,e){let n=MA;return new Promise((r,i)=>{const s=()=>i(new D2(t.reason));if(t.aborted){s();return}n=qz(t,s),e.finally(()=>n()).then(r,i)}).finally(()=>{n=MA})}var lue=async(t,e)=>{try{return await Promise.resolve(),{status:"ok",value:await t()}}catch(n){return{status:n instanceof D2?"cancelled":"rejected",error:n}}finally{e==null||e()}},RA=t=>e=>zz(Qz(t,e).then(n=>(vf(t),n))),Uz=t=>{const e=RA(t);return n=>e(new Promise(r=>setTimeout(r,n)))},{assign:Vp}=Object,G5={},N2="listenerMiddleware",cue=(t,e)=>{const n=r=>qz(t,()=>r.abort(t.reason));return(r,i)=>{y6(r);const s=new AbortController;n(s);const o=lue(async()=>{vf(t),vf(s.signal);const l=await r({pause:RA(s.signal),delay:Uz(s.signal),signal:s.signal});return vf(s.signal),l},()=>s.abort(aue));return i!=null&&i.autoJoin&&e.push(o.catch(MA)),{result:RA(t)(o),cancel(){s.abort(sue)}}}},uue=(t,e)=>{const n=async(r,i)=>{vf(e);let s=()=>{};const l=[new Promise((c,h)=>{let f=t({predicate:r,effect:(p,m)=>{m.unsubscribe(),c([p,m.getState(),m.getOriginalState()])}});s=()=>{f(),h()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await Qz(e,Promise.race(l));return vf(e),c}finally{s()}};return((r,i)=>zz(n(r,i)))},Wz=t=>{let{type:e,actionCreator:n,matcher:r,predicate:i,effect:s}=t;if(e)i=Pm(e).match;else if(n)e=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Qa(21));return y6(s),{predicate:i,type:e,effect:s}},Yz=Vp(t=>{const{type:e,predicate:n,effect:r}=Wz(t);return{id:Vce(),effect:r,type:e,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Qa(22))}}},{withTypes:()=>Yz}),X5=(t,e)=>{const{type:n,effect:r,predicate:i}=Wz(e);return Array.from(t.values()).find(s=>(typeof n=="string"?s.type===n:s.predicate===i)&&s.effect===r)},V3=t=>{t.pending.forEach(e=>{e.abort(Y3)})},hue=(t,e)=>()=>{for(const n of e.keys())V3(n);t.clear()},K5=(t,e,n)=>{try{t(e,n)}catch(r){setTimeout(()=>{throw r},0)}},Vz=Vp(Pm(`${N2}/add`),{withTypes:()=>Vz}),due=Pm(`${N2}/removeAll`),Gz=Vp(Pm(`${N2}/remove`),{withTypes:()=>Gz}),fue=(...t)=>{console.error(`${N2}/error`,...t)},pue=(t={})=>{const e=new Map,n=new Map,r=v=>{const y=n.get(v)??0;n.set(v,y+1)},i=v=>{const y=n.get(v)??1;y===1?n.delete(v):n.set(v,y-1)},{extra:s,onError:o=fue}=t;y6(o);const l=v=>(v.unsubscribe=()=>e.delete(v.id),e.set(v.id,v),y=>{v.unsubscribe(),y!=null&&y.cancelActive&&V3(v)}),c=(v=>{const y=X5(e,v)??Yz(v);return l(y)});Vp(c,{withTypes:()=>c});const h=v=>{const y=X5(e,v);return y&&(y.unsubscribe(),v.cancelActive&&V3(y)),!!y};Vp(h,{withTypes:()=>h});const f=async(v,y,x,S)=>{const w=new AbortController,A=uue(c,w.signal),C=[];try{v.pending.add(w),r(v),await Promise.resolve(v.effect(y,Vp({},x,{getOriginalState:S,condition:(j,_)=>A(j,_).then(Boolean),take:A,delay:Uz(w.signal),pause:RA(w.signal),extra:s,signal:w.signal,fork:cue(w.signal,C),unsubscribe:v.unsubscribe,subscribe:()=>{e.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((j,_,k)=>{j!==w&&(j.abort(Y3),k.delete(j))})},cancel:()=>{w.abort(Y3),v.pending.delete(w)},throwIfCancelled:()=>{vf(w.signal)}})))}catch(j){j instanceof D2||K5(o,j,{raisedBy:"effect"})}finally{await Promise.all(C),w.abort(oue),i(v),v.pending.delete(w)}},p=hue(e,n);return{middleware:v=>y=>x=>{if(!_z(x))return y(x);if(Vz.match(x))return c(x.payload);if(due.match(x)){p();return}if(Gz.match(x))return h(x.payload);let S=v.getState();const w=()=>{if(S===G5)throw new Error(Qa(23));return S};let A;try{if(A=y(x),e.size>0){const C=v.getState(),j=Array.from(e.values());for(const _ of j){let k=!1;try{k=_.predicate(x,C,S)}catch(M){k=!1,K5(o,M,{raisedBy:"predicate"})}k&&f(_,x,v,w)}}}finally{S=G5}return A},startListening:c,stopListening:h,clearListeners:p}};function Qa(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 Nx={exports:{}},mue=Nx.exports,Z5;function Xz(){return Z5||(Z5=1,(function(t,e){(function(n,r){t.exports=r()})(mue,(function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",l="minute",c="hour",h="day",f="week",p="month",m="quarter",v="year",y="date",x="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|YYYY|YY|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,A={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(P){var H=["th","st","nd","rd"],B=P%100;return"["+P+(H[(B-20)%10]||H[B]||H[0])+"]"}},C=function(P,H,B){var F=String(P);return!F||F.length>=H?P:""+Array(H+1-F.length).join(B)+P},j={s:C,z:function(P){var H=-P.utcOffset(),B=Math.abs(H),F=Math.floor(B/60),q=B%60;return(H<=0?"+":"-")+C(F,2,"0")+":"+C(q,2,"0")},m:function P(H,B){if(H.date()<B.date())return-P(B,H);var F=12*(B.year()-H.year())+(B.month()-H.month()),q=H.clone().add(F,p),X=B-q<0,Y=H.clone().add(F+(X?-1:1),p);return+(-(F+(B-q)/(X?q-Y:Y-q))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:p,y:v,w:f,d:h,D:y,h:c,m:l,s:o,ms:s,Q:m}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},_="en",k={};k[_]=A;var M="$isDayjsObject",R=function(P){return P instanceof L||!(!P||!P[M])},N=function P(H,B,F){var q;if(!H)return _;if(typeof H=="string"){var X=H.toLowerCase();k[X]&&(q=X),B&&(k[X]=B,q=X);var Y=H.split("-");if(!q&&Y.length>1)return P(Y[0])}else{var U=H.name;k[U]=H,q=U}return!F&&q&&(_=q),q||!F&&_},I=function(P,H){if(R(P))return P.clone();var B=typeof H=="object"?H:{};return B.date=P,B.args=arguments,new L(B)},D=j;D.l=N,D.i=R,D.w=function(P,H){return I(P,{locale:H.$L,utc:H.$u,x:H.$x,$offset:H.$offset})};var L=(function(){function P(B){this.$L=N(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[M]=!0}var H=P.prototype;return H.parse=function(B){this.$d=(function(F){var q=F.date,X=F.utc;if(q===null)return new Date(NaN);if(D.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var Y=q.match(S);if(Y){var U=Y[2]-1||0,V=(Y[7]||"0").substring(0,3);return X?new Date(Date.UTC(Y[1],U,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,V)):new Date(Y[1],U,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,V)}}return new Date(q)})(B),this.init()},H.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},H.$utils=function(){return D},H.isValid=function(){return this.$d.toString()!==x},H.isSame=function(B,F){var q=I(B);return this.startOf(F)<=q&&q<=this.endOf(F)},H.isAfter=function(B,F){return I(B)<this.startOf(F)},H.isBefore=function(B,F){return this.endOf(F)<I(B)},H.$g=function(B,F,q){return D.u(B)?this[F]:this.set(q,B)},H.unix=function(){return Math.floor(this.valueOf()/1e3)},H.valueOf=function(){return this.$d.getTime()},H.startOf=function(B,F){var q=this,X=!!D.u(F)||F,Y=D.p(B),U=function(Me,Oe){var Ye=D.w(q.$u?Date.UTC(q.$y,Oe,Me):new Date(q.$y,Oe,Me),q);return X?Ye:Ye.endOf(h)},V=function(Me,Oe){return D.w(q.toDate()[Me].apply(q.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(Oe)),q)},G=this.$W,J=this.$M,ne=this.$D,de="set"+(this.$u?"UTC":"");switch(Y){case v:return X?U(1,0):U(31,11);case p:return X?U(1,J):U(0,J+1);case f:var fe=this.$locale().weekStart||0,ke=(G<fe?G+7:G)-fe;return U(X?ne-ke:ne+(6-ke),J);case h:case y:return V(de+"Hours",0);case c:return V(de+"Minutes",1);case l:return V(de+"Seconds",2);case o:return V(de+"Milliseconds",3);default:return this.clone()}},H.endOf=function(B){return this.startOf(B,!1)},H.$set=function(B,F){var q,X=D.p(B),Y="set"+(this.$u?"UTC":""),U=(q={},q[h]=Y+"Date",q[y]=Y+"Date",q[p]=Y+"Month",q[v]=Y+"FullYear",q[c]=Y+"Hours",q[l]=Y+"Minutes",q[o]=Y+"Seconds",q[s]=Y+"Milliseconds",q)[X],V=X===h?this.$D+(F-this.$W):F;if(X===p||X===v){var G=this.clone().set(y,1);G.$d[U](V),G.init(),this.$d=G.set(y,Math.min(this.$D,G.daysInMonth())).$d}else U&&this.$d[U](V);return this.init(),this},H.set=function(B,F){return this.clone().$set(B,F)},H.get=function(B){return this[D.p(B)]()},H.add=function(B,F){var q,X=this;B=Number(B);var Y=D.p(F),U=function(J){var ne=I(X);return D.w(ne.date(ne.date()+Math.round(J*B)),X)};if(Y===p)return this.set(p,this.$M+B);if(Y===v)return this.set(v,this.$y+B);if(Y===h)return U(1);if(Y===f)return U(7);var V=(q={},q[l]=r,q[c]=i,q[o]=n,q)[Y]||1,G=this.$d.getTime()+B*V;return D.w(G,this)},H.subtract=function(B,F){return this.add(-1*B,F)},H.format=function(B){var F=this,q=this.$locale();if(!this.isValid())return q.invalidDate||x;var X=B||"YYYY-MM-DDTHH:mm:ssZ",Y=D.z(this),U=this.$H,V=this.$m,G=this.$M,J=q.weekdays,ne=q.months,de=q.meridiem,fe=function(Oe,Ye,ie,Se){return Oe&&(Oe[Ye]||Oe(F,X))||ie[Ye].slice(0,Se)},ke=function(Oe){return D.s(U%12||12,Oe,"0")},Me=de||function(Oe,Ye,ie){var Se=Oe<12?"AM":"PM";return ie?Se.toLowerCase():Se};return X.replace(w,(function(Oe,Ye){return Ye||(function(ie){switch(ie){case"YY":return String(F.$y).slice(-2);case"YYYY":return D.s(F.$y,4,"0");case"M":return G+1;case"MM":return D.s(G+1,2,"0");case"MMM":return fe(q.monthsShort,G,ne,3);case"MMMM":return fe(ne,G);case"D":return F.$D;case"DD":return D.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return fe(q.weekdaysMin,F.$W,J,2);case"ddd":return fe(q.weekdaysShort,F.$W,J,3);case"dddd":return J[F.$W];case"H":return String(U);case"HH":return D.s(U,2,"0");case"h":return ke(1);case"hh":return ke(2);case"a":return Me(U,V,!0);case"A":return Me(U,V,!1);case"m":return String(V);case"mm":return D.s(V,2,"0");case"s":return String(F.$s);case"ss":return D.s(F.$s,2,"0");case"SSS":return D.s(F.$ms,3,"0");case"Z":return Y}return null})(Oe)||Y.replace(":","")}))},H.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},H.diff=function(B,F,q){var X,Y=this,U=D.p(F),V=I(B),G=(V.utcOffset()-this.utcOffset())*r,J=this-V,ne=function(){return D.m(Y,V)};switch(U){case v:X=ne()/12;break;case p:X=ne();break;case m:X=ne()/3;break;case f:X=(J-G)/6048e5;break;case h:X=(J-G)/864e5;break;case c:X=J/i;break;case l:X=J/r;break;case o:X=J/n;break;default:X=J}return q?X:D.a(X)},H.daysInMonth=function(){return this.endOf(p).$D},H.$locale=function(){return k[this.$L]},H.locale=function(B,F){if(!B)return this.$L;var q=this.clone(),X=N(B,F,!0);return X&&(q.$L=X),q},H.clone=function(){return D.w(this.$d,this)},H.toDate=function(){return new Date(this.valueOf())},H.toJSON=function(){return this.isValid()?this.toISOString():null},H.toISOString=function(){return this.$d.toISOString()},H.toString=function(){return this.$d.toUTCString()},P})(),z=L.prototype;return I.prototype=z,[["$ms",s],["$s",o],["$m",l],["$H",c],["$W",h],["$M",p],["$y",v],["$D",y]].forEach((function(P){z[P[1]]=function(H){return this.$g(H,P[0],P[1])}})),I.extend=function(P,H){return P.$i||(P(H,L,I),P.$i=!0),I},I.locale=N,I.isDayjs=R,I.unix=function(P){return I(1e3*P)},I.en=k[_],I.Ls=k,I.p={},I}))})(Nx)),Nx.exports}var gue=Xz();const $e=pl(gue);var Ix={exports:{}},vue=Ix.exports,J5;function bue(){return J5||(J5=1,(function(t,e){(function(n,r){t.exports=r()})(vue,(function(){var n,r,i=1e3,s=6e4,o=36e5,l=864e5,c=31536e6,h=2628e6,f=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,p=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,m={years:c,months:h,days:l,hours:o,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},v=function(k){return k instanceof j},y=function(k,M,R){return new j(k,R,M.$l)},x=function(k){return r.p(k)+"s"},S=function(k){return k<0},w=function(k){return S(k)?Math.ceil(k):Math.floor(k)},A=function(k){return Math.abs(k)},C=function(k,M){return k?S(k)?{negative:!0,format:""+A(k)+M}:{negative:!1,format:""+k+M}:{negative:!1,format:""}},j=(function(){function k(R,N,I){var D=this;if(this.$d={},this.$l=I,R===void 0&&(this.$ms=0,this.parseFromMilliseconds()),N)return y(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(P){D.$d[x(P)]=R[P]})),this.calMilliseconds(),this;if(typeof R=="string"){var L=R.match(f);if(L){var z=L.slice(2).map((function(P){return P!=null?Number(P):0}));return this.$d.years=z[0],this.$d.months=z[1],this.$d.weeks=z[2],this.$d.days=z[3],this.$d.hours=z[4],this.$d.minutes=z[5],this.$d.seconds=z[6],this.calMilliseconds(),this}}return this}var M=k.prototype;return M.calMilliseconds=function(){var R=this;this.$ms=Object.keys(this.$d).reduce((function(N,I){return N+(R.$d[I]||0)*m[I]}),0)},M.parseFromMilliseconds=function(){var R=this.$ms;this.$d.years=w(R/c),R%=c,this.$d.months=w(R/h),R%=h,this.$d.days=w(R/l),R%=l,this.$d.hours=w(R/o),R%=o,this.$d.minutes=w(R/s),R%=s,this.$d.seconds=w(R/i),R%=i,this.$d.milliseconds=R},M.toISOString=function(){var R=C(this.$d.years,"Y"),N=C(this.$d.months,"M"),I=+this.$d.days||0;this.$d.weeks&&(I+=7*this.$d.weeks);var D=C(I,"D"),L=C(this.$d.hours,"H"),z=C(this.$d.minutes,"M"),P=this.$d.seconds||0;this.$d.milliseconds&&(P+=this.$d.milliseconds/1e3,P=Math.round(1e3*P)/1e3);var H=C(P,"S"),B=R.negative||N.negative||D.negative||L.negative||z.negative||H.negative,F=L.format||z.format||H.format?"T":"",q=(B?"-":"")+"P"+R.format+N.format+D.format+F+L.format+z.format+H.format;return q==="P"||q==="-P"?"P0D":q},M.toJSON=function(){return this.toISOString()},M.format=function(R){var N=R||"YYYY-MM-DDTHH:mm:ss",I={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(p,(function(D,L){return L||String(I[D])}))},M.as=function(R){return this.$ms/m[x(R)]},M.get=function(R){var N=this.$ms,I=x(R);return I==="milliseconds"?N%=1e3:N=I==="weeks"?w(N/m[I]):this.$d[I],N||0},M.add=function(R,N,I){var D;return D=N?R*m[x(N)]:v(R)?R.$ms:y(R,this).$ms,y(this.$ms+D*(I?-1:1),this)},M.subtract=function(R,N){return this.add(R,N,!0)},M.locale=function(R){var N=this.clone();return N.$l=R,N},M.clone=function(){return y(this.$ms,this)},M.humanize=function(R){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!R)},M.valueOf=function(){return this.asMilliseconds()},M.milliseconds=function(){return this.get("milliseconds")},M.asMilliseconds=function(){return this.as("milliseconds")},M.seconds=function(){return this.get("seconds")},M.asSeconds=function(){return this.as("seconds")},M.minutes=function(){return this.get("minutes")},M.asMinutes=function(){return this.as("minutes")},M.hours=function(){return this.get("hours")},M.asHours=function(){return this.as("hours")},M.days=function(){return this.get("days")},M.asDays=function(){return this.as("days")},M.weeks=function(){return this.get("weeks")},M.asWeeks=function(){return this.as("weeks")},M.months=function(){return this.get("months")},M.asMonths=function(){return this.as("months")},M.years=function(){return this.get("years")},M.asYears=function(){return this.as("years")},k})(),_=function(k,M,R){return k.add(M.years()*R,"y").add(M.months()*R,"M").add(M.days()*R,"d").add(M.hours()*R,"h").add(M.minutes()*R,"m").add(M.seconds()*R,"s").add(M.milliseconds()*R,"ms")};return function(k,M,R){n=R,r=R().$utils(),R.duration=function(D,L){var z=R.locale();return y(D,{$l:z},L)},R.isDuration=v;var N=M.prototype.add,I=M.prototype.subtract;M.prototype.add=function(D,L){return v(D)?_(this,D,1):N.bind(this)(D,L)},M.prototype.subtract=function(D,L){return v(D)?_(this,D,-1):I.bind(this)(D,L)}}}))})(Ix)),Ix.exports}var yue=bue();const xue=pl(yue);var Lx={exports:{}},Aue=Lx.exports,eN;function wue(){return eN||(eN=1,(function(t,e){(function(n,r){t.exports=r()})(Aue,(function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(s,o,l){var c=o.prototype;l.utc=function(x){var S={date:x,utc:!0,args:arguments};return new o(S)},c.utc=function(x){var S=l(this.toDate(),{locale:this.$L,utc:!0});return x?S.add(this.utcOffset(),n):S},c.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var h=c.parse;c.parse=function(x){x.utc&&(this.$u=!0),this.$utils().u(x.$offset)||(this.$offset=x.$offset),h.call(this,x)};var f=c.init;c.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=c.utcOffset;c.utcOffset=function(x,S){var w=this.$utils().u;if(w(x))return this.$u?0:w(this.$offset)?p.call(this):this.$offset;if(typeof x=="string"&&(x=(function(_){_===void 0&&(_="");var k=_.match(r);if(!k)return null;var M=(""+k[0]).match(i)||["-",0,0],R=M[0],N=60*+M[1]+ +M[2];return N===0?0:R==="+"?N:-N})(x),x===null))return this;var A=Math.abs(x)<=16?60*x:x;if(A===0)return this.utc(S);var C=this.clone();if(S)return C.$offset=A,C.$u=!1,C;var j=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(C=this.local().add(A+j,n)).$offset=A,C.$x.$localOffset=j,C};var m=c.format;c.format=function(x){var S=x||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return m.call(this,S)},c.valueOf=function(){var x=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*x},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var v=c.toDate;c.toDate=function(x){return x==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var y=c.diff;c.diff=function(x,S,w){if(x&&this.$u===x.$u)return y.call(this,x,S,w);var A=this.local(),C=l(x).local();return y.call(A,C,S,w)}}}))})(Lx)),Lx.exports}var Sue=wue();const Kz=pl(Sue);$e.extend(xue);$e.extend(Kz);const x6=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},Zz=(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:c}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(c&&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||"")},Yn=t=>Zz(t);function jue(t){return $e.utc(t).valueOf()}const DA=()=>$e().valueOf(),Gp=t=>Zz(t," ",!0),NA=(t,e,n=" ago")=>{const r=jue(t);return r<0?"never":Gp(e-r)+n},bf=(t,e)=>e?$e.unix(t).tz($e.tz.guess()).format():$e.unix(t).utc().format();function tN(t){return $e.utc(t).valueOf()}const Cue=t=>{const e=new URLSearchParams(t),n=[];for(let r=0;e.has(`g${r}.expr`);r++){const i=I2(),s=(o,l)=>{const c=`g${r}.${o}`;e.has(c)&&l(e.get(c))};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"?Fm.Stacked:Fm.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=x6(o)||i.visualizer.range}),s("end_input",o=>{i.visualizer.endTime=tN(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=tN(o)}),n.push(i)}return n};function nN(t){return $e.utc(t).format("YYYY-MM-DD HH:mm:ss")}const _ue=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",nN(r.visualizer.endTime)),n(i,"moment_input",nN(r.visualizer.endTime))),n(i,"range_input",Yn(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},Ra=(t,e)=>{const n=localStorage.getItem(t);return n===null?e:JSON.parse(n)},Jz="queryPage.queryHistory";var Fm=(t=>(t.Lines="lines",t.Stacked="stacked",t.Heatmap="heatmap",t))(Fm||{});const Bx=(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}},I2=()=>({id:Em(),expr:"",showTree:!1,showMetricsExplorer:!1,visualizer:{activeTab:"table",endTime:null,range:3600*1e3,resolution:{type:"auto",density:"medium"},displayMode:"lines",showExemplars:!1,yAxisMin:null}}),Tue={panels:[I2()],queryHistory:Ra(Jz,[])},wp=t=>{const e="?"+_ue(t).toString();window.history.pushState({},"",e)},eq=R2({name:"queryPage",initialState:Tue,reducers:{setPanels:(t,{payload:e})=>{t.panels=e},addPanel:t=>{t.panels.push(I2()),wp(t.panels)},duplicatePanel:(t,{payload:e})=>{const n={...t.panels[e.idx],id:Em(),expr:e.expr};t.panels.splice(e.idx+1,0,n),wp(t.panels)},removePanel:(t,{payload:e})=>{t.panels.splice(e,1),wp(t.panels)},setExpr:(t,{payload:e})=>{t.panels[e.idx].expr=e.expr,wp(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,wp(t.panels)},setVisualizer:(t,{payload:e})=>{t.panels[e.idx].visualizer=e.visualizer,wp(t.panels)}}}),{setPanels:rN,addPanel:kue,removePanel:Oue,duplicatePanel:Eue,setExpr:Mue,addQueryToHistory:tq,setShowTree:v_,setVisualizer:uh}=eq.actions,Rue=eq.reducer;function Due({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 nq({controlsRef:t,direction:e,levelIndex:n,rowIndex:r,cellIndex:i,size:s}){var c,h,f;const o=Due({direction:e,size:s,rowIndex:r,cellIndex:i,levelIndex:n});if(!o)return;const l=(f=(h=(c=t.current)==null?void 0:c[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")?nq({controlsRef:t,direction:e,levelIndex:o.levelIndex,cellIndex:o.cellIndex,rowIndex:o.rowIndex,size:s}):l.focus())}function Nue(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function Iue(t){var e;return(e=t.current)==null?void 0:e.map(n=>n.map(r=>r.length))}function A6({controlsRef:t,levelIndex:e,rowIndex:n,cellIndex:r,event:i}){const s=Nue(i.key);s&&(i.preventDefault(),nq({controlsRef:t,direction:s,levelIndex:e,rowIndex:n,cellIndex:r,size:Iue(t)}))}function Sp(t,e){let n=t?$e(t):$e();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 Ms(t){return t==null||t===""?t:$e(t).format("YYYY-MM-DD")}function Pp(t){return t==null||t===""?t:$e(t).format("YYYY-MM-DD HH:mm:ss")}function Lue({minDate:t,maxDate:e}){const n=$e();return!t&&!e?Ms(n):t&&$e(n).isBefore(t)?Ms(t):e&&$e(n).isAfter(e)?Ms(e):Ms(n)}function Xp(t,e,n){return!t&&!e?Pp(n):t&&$e(n).isBefore(t)?Pp(t):e&&$e(n).isAfter(e)?Pp(e):Pp(n)}const Bue={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},Pue=O.createContext(Bue);function wu(){const t=O.use(Pue),e=O.useCallback(s=>s||t.locale,[t.locale]),n=O.useCallback(s=>typeof s=="number"?s:t.firstDayOfWeek,[t.firstDayOfWeek]),r=O.useCallback(s=>Array.isArray(s)?s:t.weekendDays,[t.weekendDays]),i=O.useCallback(s=>typeof s=="string"?s:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:n,getWeekendDays:r,getLabelSeparator:i}}function Fue({value:t,type:e,withTime:n}){const r=n?Pp:Ms;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 rq({value:t,type:e,name:n,form:r,withTime:i=!1}){return a.jsx("input",{type:"hidden",value:Fue({value:t,type:e,withTime:i}),name:n,form:r})}rq.displayName="@mantine/dates/HiddenDatesInput";function fs(t){return t<10?`0${t}`:`${t}`}function IA(t){const[e=null,n=null,r=null]=t.split(":").map(Number);return{hours:e,minutes:n,seconds:r}}function $ue(t,e){return`${t.getHours()}:${t.getMinutes()}${e?`:${t.getSeconds()}`:""}`}function Hue({value:t,format:e,amPmLabels:n,withSeconds:r}){const i=IA(typeof t=="string"?t:$ue(t,r));if(i.hours===null||i.minutes===null)return null;if(e==="24h")return`${fs(i.hours)}:${fs(i.minutes)}${r?`:${fs(i.seconds||0)}`:""}`;const s=i.hours>=12;return`${i.hours%12===0?12:i.hours%12}:${fs(i.minutes)}${r?`:${fs(i.seconds||0)}`:""} ${s?n.pm:n.am}`}function iq({value:t,format:e="24h",amPmLabels:n={am:"AM",pm:"PM"},withSeconds:r=!1}){return a.jsx(a.Fragment,{children:Hue({value:t,format:e,amPmLabels:n,withSeconds:r})})}iq.displayName="@mantine/dates/TimeValue";const zue=t=>Number(t.toFixed(0)[0]);function Px({value:t,min:e,max:n,onChange:r,focusable:i,step:s,onNextInput:o,onPreviousInput:l,onFocus:c,readOnly:h,allowTemporaryZero:f=!1,placeholder:p="--",disableAutoAdvance:m=!1,...v}){const y=zue(n),x=n+1-s,S=A=>{if(h)return;const C=A.replace(/\D/g,"");if(C!==""){const j=parseInt(C,10),_=f&&j===0&&e>0?0:Lh(j,e,n);r(_),!m&&(_>y||A.startsWith("00"))&&(o==null||o())}},w=A=>{h||((A.key==="0"||A.key==="Num0")&&t===0&&(A.preventDefault(),o==null||o()),A.key==="Home"&&(A.preventDefault(),r(e)),A.key==="End"&&(A.preventDefault(),r(n)),(A.key==="Backspace"||A.key==="Delete")&&(A.preventDefault(),t!==null?r(null):l==null||l()),A.key==="ArrowRight"&&(A.preventDefault(),o==null||o()),A.key==="ArrowLeft"&&(A.preventDefault(),l==null||l()),A.key==="ArrowUp"&&(A.preventDefault(),r(t===null?e:Lh(t+s,e,x))),A.key==="ArrowDown"&&(A.preventDefault(),r(t===null?x:Lh(t-s,e,x))))};return a.jsx("input",{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?"":fs(t),onChange:A=>S(A.currentTarget.value),onKeyDown:w,onFocus:A=>{A.currentTarget.select(),c==null||c(A)},onClick:A=>{A.stopPropagation(),A.currentTarget.select()},onMouseDown:A=>A.stopPropagation(),...v})}Px.displayName="@mantine/dates/SpinInput";const[que,Pf]=Ki("TimeInput component was not found in the component tree");function sq({labels:t,value:e,onChange:n,className:r,style:i,onPreviousInput:s,readOnly:o,onMouseDown:l,onTouchStart:c,inputType:h,...f}){const p=Pf(),m=v=>{o||(v.key==="Home"&&(v.preventDefault(),n(t.am)),v.key==="End"&&(v.preventDefault(),n(t.pm)),(v.key==="Backspace"||v.key==="Delete")&&(v.preventDefault(),e===null?s==null||s():n(null)),v.key==="ArrowLeft"&&(v.preventDefault(),s==null||s()),(v.key==="ArrowUp"||v.key==="ArrowDown")&&(v.preventDefault(),n(e===t.am?t.pm:t.am)),v.code==="KeyA"&&(v.preventDefault(),n(t.am)),v.code==="KeyP"&&(v.preventDefault(),n(t.pm)))};if(h==="input"){const v=e||"--",y=v.length+1;return a.jsx("input",{...p.getStyles("field",{className:r,style:i}),value:v,size:y,onChange:x=>!o&&n(x.target.value||null),onClick:(x=>x.stopPropagation()),onKeyDown:m,onMouseDown:x=>{x.stopPropagation(),l==null||l(x)},"data-am-pm":!0,...f})}return a.jsxs("select",{...p.getStyles("field",{className:r,style:i}),value:e||"",onChange:v=>!o&&n(v.target.value||null),onClick:v=>v.stopPropagation(),onKeyDown:m,onMouseDown:v=>{v.stopPropagation(),l==null||l(v)},"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})]})}sq.displayName="@mantine/dates/AmPmInput";function w6({value:t,active:e,onSelect:n}){const r=Pf();return a.jsx(Nr,{mod:{active:e},onClick:()=>n(t),onMouseDown:i=>i.preventDefault(),"data-value":t,tabIndex:-1,...r.getStyles("control"),children:typeof t=="number"?fs(t):t})}w6.displayName="@mantine/dates/TimeControl";function aq({labels:t,value:e,onSelect:n}){const r=Pf(),i=[t.am,t.pm].map(s=>a.jsx(w6,{value:s,active:e===s,onSelect:n},s));return a.jsx("div",{...r.getStyles("controlsList"),children:i})}aq.displayName="@mantine/dates/AmPmControlsList";function Que(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 Uue(t,e,n){const r=[];for(let i=t;i<=e;i+=n)r.push(i);return r}function Fx({min:t,max:e,step:n,value:r,onSelect:i,reversed:s}){const o=Pf(),l=O.useRef(null),c=Uue(t,e,n),h=(s?c.reverse():c).map(f=>a.jsx(w6,{value:f,active:r===f,onSelect:i},f));return O.useEffect(()=>{r!==null&&requestAnimationFrame(()=>{var m;const p=(m=l.current)==null?void 0:m.querySelector(`[data-value="${r}"]`);Que(p,l.current)||p==null||p.scrollIntoView({block:"nearest"})})},[r]),a.jsx(ga,{h:o.maxDropdownContentHeight,type:"never",viewportRef:l,...o.getStyles("scrollarea"),...o.scrollAreaProps,children:a.jsx("div",{...o.getStyles("controlsList"),children:h})})}Fx.displayName="@mantine/dates/TimeControlsList";function oq({time:t,compare:e,withSeconds:n}){const r=IA(t),i=IA(e);return n?r.hours===i.hours&&r.minutes===i.minutes&&r.seconds===i.seconds:r.hours===i.hours&&r.minutes===i.minutes}function S6({value:t,active:e,onChange:n,format:r,amPmLabels:i,withSeconds:s}){const o=Pf();return a.jsx(Nr,{mod:{active:e},onClick:()=>n(t),...o.getStyles("presetControl"),children:a.jsx(iq,{withSeconds:s,value:t,format:r,amPmLabels:i})})}S6.displayName="@mantine/dates/TimePresetControl";function lq({value:t,data:e,onChange:n,format:r,amPmLabels:i,withSeconds:s}){const o=Pf(),l=e.values.map(c=>a.jsx(S6,{value:c,format:r,amPmLabels:i,withSeconds:s,active:oq({time:c,compare:t,withSeconds:s}),onChange:n},c));return a.jsxs("div",{...o.getStyles("presetsGroup"),children:[a.jsx("div",{...o.getStyles("presetsGroupLabel"),children:e.label}),a.jsx(x2,{cols:s?2:3,spacing:4,children:l})]})}lq.displayName="@mantine/dates/TimePresetGroup";function cq({presets:t,format:e,amPmLabels:n,withSeconds:r,value:i,onChange:s}){const o=Pf();if(t.length===0)return null;if(typeof t[0]=="string"){const c=t.map(h=>a.jsx(S6,{value:h,format:e,amPmLabels:n,withSeconds:r,active:oq({time:h,compare:i,withSeconds:r}),onChange:s},h));return a.jsx(ga.Autosize,{mah:o.maxDropdownContentHeight,type:"never",...o.getStyles("scrollarea"),...o.scrollAreaProps,children:a.jsx("div",{...o.getStyles("presetsRoot"),children:a.jsx(x2,{cols:r?2:3,spacing:4,children:c})})})}const l=t.map((c,h)=>a.jsx(lq,{data:c,value:i,format:e,amPmLabels:n,withSeconds:r,onChange:s},h));return a.jsx(ga.Autosize,{mah:o.maxDropdownContentHeight,type:"never",...o.getStyles("scrollarea"),...o.scrollAreaProps,children:a.jsx("div",{...o.getStyles("presetsRoot"),children:l})})}cq.displayName="@mantine/dates/TimePresets";function b_(t){const[e=0,n=0,r=0]=t.split(":").map(Number);return e*3600+n*60+r}function Wue(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60),r=t%60;return{timeString:`${fs(e)}:${fs(n)}:${fs(r)}`,hours:e,minutes:n,seconds:r}}function uq(t,e,n){const r=b_(t),i=e?b_(e):-1/0,s=n?b_(n):1/0;return Wue(Math.max(i,Math.min(r,s)))}function Yue({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 Hg({time:t,format:e,amPmLabels:n}){if(t==="")return{hours:null,minutes:null,seconds:null,amPm:null};const{hours:r,minutes:i,seconds:s}=IA(t),o={hours:r,minutes:i,seconds:s};return e==="12h"?Yue({...o,amPmLabels:n}):{...o,amPm:null}}function Vue({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),`${fs(o)}:${fs(e)}${s?`:${fs(n||0)}`:""}`}function Ep({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:`${fs(t)}:${fs(e)}${i?`:${fs(n)}`:""}`}:s===null?{valid:!1,value:""}:{valid:!0,value:Vue({hours:t,minutes:e,seconds:n,amPm:s,amPmLabels:o,withSeconds:i})}}function Gue({value:t,defaultValue:e,onChange:n,format:r,amPmLabels:i,withSeconds:s=!1,min:o,max:l,clearable:c,readOnly:h,disabled:f,pasteSplit:p,type:m}){const v=Hg({time:t||e||"",amPmLabels:i,format:r}),y=Ep({hours:v.hours,minutes:v.minutes,seconds:v.seconds,format:r,withSeconds:s,amPm:v.amPm,amPmLabels:i}),x=O.useRef(!0),S=O.useRef(!y.valid),[w,A]=O.useState(v.hours),[C,j]=O.useState(v.minutes),[_,k]=O.useState(v.seconds),[M,R]=O.useState(v.amPm),N=c&&!h&&!f&&(w!==null||C!==null||_!==null||M!==null),I=O.useRef(null),D=O.useRef(null),L=O.useRef(null),z=O.useRef(null),P=J=>{var ne,de,fe,ke;J==="hours"&&((ne=I.current)==null||ne.focus()),J==="minutes"&&((de=D.current)==null||de.focus()),J==="seconds"&&((fe=L.current)==null||fe.focus()),J==="amPm"&&((ke=z.current)==null||ke.focus())},H=(J,ne)=>{const de=Ep({hours:J==="hours"?ne:w,minutes:J==="minutes"?ne:C,seconds:J==="seconds"?ne:_,amPm:J==="amPm"?ne:M,format:r,withSeconds:s,amPmLabels:i});de.valid?(x.current=!1,S.current=!1,J==="hours"&&A(ne),J==="minutes"&&j(ne),J==="seconds"&&k(ne),J==="amPm"&&R(ne),n==null||n(de.value)):(x.current=!1,S.current||(n==null||n(""),S.current=!0))},B=J=>{x.current=!1;const ne=Hg({time:J,amPmLabels:i,format:r});A(ne.hours),j(ne.minutes),k(ne.seconds),R(ne.amPm),S.current=!Ep({...ne,format:r,withSeconds:s,amPmLabels:i}).valid,n==null||n(J)},F=J=>{let ne=J;r==="12h"&&typeof J=="number"&&J>12&&(ne=(J-1)%12+1),A(ne),H("hours",ne),P("hours")},q=J=>{j(J),H("minutes",J),P("minutes")},X=J=>{k(J),H("seconds",J),P("seconds")},Y=J=>{R(J),H("amPm",J),P("amPm")},U=()=>{x.current=!1,A(null),j(null),k(null),R(null),n==null||n(""),S.current=!0,P("hours")},V=J=>{J.preventDefault();const ne=J.clipboardData.getData("text"),de=(p||Hg)({time:ne,format:r,amPmLabels:i}),fe=Ep({...de,format:r,withSeconds:s,amPmLabels:i});if(fe.valid){x.current=!1;const ke=m==="duration"?"9999:59:59":"23:59:59",Me=uq(fe.value,o||"00:00:00",l||ke);n==null||n(Me.timeString),A(de.hours),j(de.minutes),k(de.seconds),R(de.amPm)}},G=Ep({hours:w,minutes:C,seconds:_,format:r,withSeconds:s,amPm:M,amPmLabels:i});return vu(()=>{if(t===""){x.current=!1,A(null),j(null),k(null),R(null),x.current=!0;return}if(x.current&&typeof t=="string"){const J=Hg({time:t||"",amPmLabels:i,format:r});A(J.hours),j(J.minutes),k(J.seconds),R(J.amPm)}x.current=!0},[t]),{refs:{hours:I,minutes:D,seconds:L,amPm:z},values:{hours:w,minutes:C,seconds:_,amPm:M},setHours:F,setMinutes:q,setSeconds:X,setAmPm:Y,focus:P,clear:U,onPaste:V,setTimeString:B,isClearable:N,hiddenInputValue:G.value}}var hq={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"};const Xue={type:"time",hoursStep:1,minutesStep:1,secondsStep:1,format:"24h",amPmLabels:{am:"AM",pm:"PM"},pasteSplit:Hg,maxDropdownContentHeight:200,hoursPlaceholder:"--",minutesPlaceholder:"--",secondsPlaceholder:"--",minHoursDigits:2},dq=(t,{size:e})=>({dropdown:{"--control-font-size":Dr(e)}}),Kp=Ie(t=>{const e=xe(["Input","InputWrapper","TimePicker"],Xue,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,onClick:c,type:h,format:f,value:p,defaultValue:m,onChange:v,hoursStep:y,minutesStep:x,secondsStep:S,withSeconds:w,hoursInputLabel:A,minutesInputLabel:C,secondsInputLabel:j,amPmInputLabel:_,amPmLabels:k,clearable:M,clearSectionMode:R,onMouseDown:N,onFocusCapture:I,onBlurCapture:D,min:L,max:z,popoverProps:P,withDropdown:H,rightSection:B,onFocus:F,onBlur:q,clearButtonProps:X,hoursInputProps:Y,minutesInputProps:U,secondsInputProps:V,amPmSelectProps:G,readOnly:J,disabled:ne,size:de,name:fe,form:ke,hiddenInputProps:Me,labelProps:Oe,pasteSplit:Ye,hoursRef:ie,minutesRef:Se,secondsRef:se,amPmRef:_e,presets:et,maxDropdownContentHeight:Te,scrollAreaProps:Xe,attributes:at,reverseTimeControlsList:Ve,hoursPlaceholder:Ge,minutesPlaceholder:ut,secondsPlaceholder:Ue,minHoursDigits:De,...Ce}=e,ze=h==="duration",ht=ze?"24h":f,Rt=ze&&Ge==="--"?"-".repeat(De):Ge,{resolvedClassNames:Tn,resolvedStyles:fn}=Ya({classNames:n,styles:s,props:e}),Zt=mt({name:"TimePicker",classes:hq,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:at,vars:l,varsResolver:dq}),lt=Gue({value:p,defaultValue:m,onChange:v,format:ht,amPmLabels:k,withSeconds:w,min:L,max:z,clearable:M,disabled:ne,readOnly:J,pasteSplit:Ye,type:h}),tn=En(lt.refs.hours,ie),Bt=En(lt.refs.minutes,Se),Lt=En(lt.refs.seconds,se),Wt=En(lt.refs.amPm,_e),jt=Ii(),Ht=O.useRef(!1),[cn,qn]=O.useState(!1),bn=ct=>{Ht.current||(Ht.current=!0,F==null||F(ct))},un=ct=>{if(!ct.currentTarget.contains(ct.relatedTarget)){const re=lt.values,Re=Ep({...re,format:ht,amPmLabels:k,withSeconds:!!w});if(Re.valid&&(L||z)){const ye=uq(Re.value,L,z);ye.timeString!==Re.value&&lt.setTimeString(ye.timeString)}Ht.current=!1,q==null||q(ct)}};return a.jsx(que,{value:{getStyles:Zt,scrollAreaProps:Xe,maxDropdownContentHeight:Te},children:a.jsxs(Cn,{opened:cn,transitionProps:{duration:0},position:"bottom-start",withRoles:!1,disabled:ne||J||!H||ze,...P,children:[a.jsx(Cn.Target,{children:a.jsxs(Ds,{component:"div",size:de,disabled:ne,onClick:ct=>{c==null||c(ct),lt.focus("hours")},onMouseDown:ct=>{ct.preventDefault(),N==null||N(ct)},onFocusCapture:ct=>{qn(!0),I==null||I(ct)},onBlurCapture:ct=>{qn(!1),D==null||D(ct)},rightSection:B,__clearSection:a.jsx(ml,{...X,size:de,onClick:ct=>{var re;lt.clear(),(re=X==null?void 0:X.onClick)==null||re.call(X,ct)},onMouseDown:ct=>{var re;ct.preventDefault(),(re=X==null?void 0:X.onMouseDown)==null||re.call(X,ct)}}),__clearable:lt.isClearable,__clearSectionMode:R,labelProps:{htmlFor:jt,...Oe},style:i,className:r,classNames:Tn,styles:fn,attributes:at,__staticSelector:"TimePicker",...Ce,children:[a.jsx("div",{...Zt("fieldsRoot"),dir:"ltr",children:a.jsxs("div",{...Zt("fieldsGroup"),onBlur:un,children:[a.jsx(Px,{id:jt,...Y,...Zt("field",{className:Y==null?void 0:Y.className,style:ze?{width:`calc(${Math.max(De,fs(lt.values.hours??0).length)}ch + 0.3em)`,...Y==null?void 0:Y.style}:Y==null?void 0:Y.style}),value:lt.values.hours,onChange:lt.setHours,onNextInput:()=>lt.focus("minutes"),min:ht==="12h"?1:0,max:ze?9999:ht==="12h"?12:23,allowTemporaryZero:ht==="12h",disableAutoAdvance:ze,focusable:!0,step:y,ref:tn,"aria-label":A,readOnly:J,disabled:ne,onPaste:lt.onPaste,onFocus:ct=>{var re;bn(ct),(re=Y==null?void 0:Y.onFocus)==null||re.call(Y,ct)},onBlur:ct=>{var Re;const re=ct.currentTarget.value;ht==="12h"&&(re?parseInt(re,10):null)===0&&lt.setHours(12),(Re=Y==null?void 0:Y.onBlur)==null||Re.call(Y,ct)},placeholder:Rt}),a.jsx("span",{children:":"}),a.jsx(Px,{...U,...Zt("field",{className:U==null?void 0:U.className,style:U==null?void 0:U.style}),value:lt.values.minutes,onChange:lt.setMinutes,min:0,max:59,focusable:!0,step:x,ref:Bt,onPreviousInput:()=>lt.focus("hours"),onNextInput:()=>w?lt.focus("seconds"):lt.focus("amPm"),"aria-label":C,tabIndex:-1,readOnly:J,disabled:ne,onPaste:lt.onPaste,onFocus:ct=>{var re;bn(ct),(re=U==null?void 0:U.onFocus)==null||re.call(U,ct)},placeholder:ut}),w&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:":"}),a.jsx(Px,{...V,...Zt("field",{className:V==null?void 0:V.className,style:V==null?void 0:V.style}),value:lt.values.seconds,onChange:lt.setSeconds,min:0,max:59,focusable:!0,step:S,ref:Lt,onPreviousInput:()=>lt.focus("minutes"),onNextInput:()=>lt.focus("amPm"),"aria-label":j,tabIndex:-1,readOnly:J,disabled:ne,onPaste:lt.onPaste,onFocus:ct=>{var re;bn(ct),(re=V==null?void 0:V.onFocus)==null||re.call(V,ct)},placeholder:Ue})]}),ht==="12h"&&!ze&&a.jsx(sq,{...G,inputType:H?"input":"select",labels:k,value:lt.values.amPm,onChange:lt.setAmPm,ref:Wt,"aria-label":_,onPreviousInput:()=>w?lt.focus("seconds"):lt.focus("minutes"),readOnly:J,disabled:ne,tabIndex:-1,onPaste:lt.onPaste,onFocus:ct=>{var re;bn(ct),(re=G==null?void 0:G.onFocus)==null||re.call(G,ct)}})]})}),a.jsx("input",{type:"hidden",name:fe,form:ke,value:lt.hiddenInputValue,...Me})]})}),a.jsx(Cn.Dropdown,{...Zt("dropdown"),onMouseDown:ct=>ct.preventDefault(),children:et?a.jsx(cq,{value:lt.hiddenInputValue,onChange:lt.setTimeString,format:ht,presets:et,amPmLabels:k,withSeconds:w||!1}):a.jsxs("div",{...Zt("controlsListGroup"),children:[a.jsx(Fx,{min:ht==="12h"?1:0,max:ht==="12h"?12:23,step:y,value:lt.values.hours,onSelect:lt.setHours,reversed:Ve}),a.jsx(Fx,{min:0,max:59,step:x,value:lt.values.minutes,onSelect:lt.setMinutes,reversed:Ve}),w&&a.jsx(Fx,{min:0,max:59,step:S,value:lt.values.seconds,onSelect:lt.setSeconds,reversed:Ve}),ht==="12h"&&a.jsx(aq,{labels:k,value:lt.values.amPm,onSelect:lt.setAmPm})]})})]})})});Kp.displayName="@mantine/dates/TimePicker";Kp.classes=hq;Kp.varsResolver=dq;var fq={day:"m_396ce5cb"};const pq=(t,{size:e})=>({day:{"--day-size":Gt(e,"day-size")}}),L2=Ie(t=>{const e=xe("Day",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,date:c,disabled:h,__staticSelector:f,weekend:p,outside:m,selected:v,renderDay:y,inRange:x,firstInRange:S,lastInRange:w,hidden:A,static:C,highlightToday:j,fullWidth:_,attributes:k,...M}=e;return a.jsx(Nr,{...mt({name:f||"Day",classes:fq,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:k,vars:l,varsResolver:pq,rootSelector:"day"})("day",{style:A?{display:"none"}:void 0}),component:C?"div":"button",disabled:h,"data-today":$e(c).isSame(new Date,"day")||void 0,"data-hidden":A||void 0,"data-highlight-today":j||void 0,"data-disabled":h||void 0,"data-weekend":!h&&!m&&p||void 0,"data-outside":!h&&m||void 0,"data-selected":!h&&v||void 0,"data-in-range":x&&!h||void 0,"data-first-in-range":S&&!h||void 0,"data-last-in-range":w&&!h||void 0,"data-static":C||void 0,"data-full-width":_||void 0,unstyled:o,...M,children:(y==null?void 0:y(c))||$e(c).date()})});L2.classes=fq;L2.varsResolver=pq;L2.displayName="@mantine/dates/Day";function Kue({locale:t,format:e="dd",firstDayOfWeek:n=1}){const r=$e().day(n),i=[];for(let s=0;s<7;s+=1)typeof e=="string"?i.push($e(r).add(s,"days").locale(t).format(e)):i.push(e($e(r).add(s,"days").format("YYYY-MM-DD")));return i}var mq={weekday:"m_18a3eca"};const gq=(t,{size:e})=>({weekdaysRow:{"--wr-fz":Dr(e),"--wr-spacing":Gi(e)}}),B2=Ie(t=>{const e=xe("WeekdaysRow",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,locale:c,firstDayOfWeek:h,weekdayFormat:f,cellComponent:p="th",__staticSelector:m,withWeekNumbers:v,attributes:y,...x}=e,S=mt({name:m||"WeekdaysRow",classes:mq,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:y,vars:l,varsResolver:gq,rootSelector:"weekdaysRow"}),w=wu(),A=Kue({locale:w.getLocale(c),format:f,firstDayOfWeek:w.getFirstDayOfWeek(h)}).map((C,j)=>a.jsx(p,{...S("weekday"),children:C},j));return a.jsxs(ve,{component:"tr",...S("weekdaysRow"),...x,children:[v&&a.jsx(p,{...S("weekday"),children:"#"}),A]})});B2.classes=mq;B2.varsResolver=gq;B2.displayName="@mantine/dates/WeekdaysRow";function Zue(t,e=1){let n=$e(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 Jue(t,e=1){let n=$e(t);for(;n.day()!==e;)n=n.subtract(1,"day");return n.format("YYYY-MM-DD")}function ehe({month:t,firstDayOfWeek:e=1,consistentWeeks:n}){const r=$e($e(t).subtract($e(t).date()-1,"day").format("YYYY-M-D")),i=r.format("YYYY-MM-DD"),s=Zue(r.add(+r.daysInMonth()-1,"day").format("YYYY-MM-DD"),e),o=[];let l=$e(Jue(i,e));for(;$e(l).isBefore(s,"day");){const c=[];for(let h=0;h<7;h+=1)c.push(l.format("YYYY-MM-DD")),l=l.add(1,"day");o.push(c)}if(n&&o.length<6){const c=o[o.length-1],h=c[c.length-1];let f=$e(h).add(1,"day");for(;o.length<6;){const p=[];for(let m=0;m<7;m+=1)p.push(f.format("YYYY-MM-DD")),f=f.add(1,"day");o.push(p)}}return o}function j6(t,e){return $e(t).format("YYYY-MM")===$e(e).format("YYYY-MM")}function vq(t,e){return e?$e(t).isAfter($e(e).subtract(1,"day"),"day"):!0}function bq(t,e){return e?$e(t).isBefore($e(e).add(1,"day"),"day"):!0}function the({dates:t,minDate:e,maxDate:n,getDayProps:r,excludeDate:i,hideOutsideDates:s,month:o}){const l=t.flat().filter(f=>{var p;return bq(f,n)&&vq(f,e)&&!(i!=null&&i(f))&&!((p=r==null?void 0:r(f))!=null&&p.disabled)&&(!s||j6(f,o))}),c=l.find(f=>{var p;return(p=r==null?void 0:r(f))==null?void 0:p.selected});if(c)return c;const h=l.find(f=>$e().isSame(f,"date"));return h||l[0]}var $x={exports:{}},nhe=$x.exports,iN;function rhe(){return iN||(iN=1,(function(t,e){(function(n,r){t.exports=r()})(nhe,(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,y=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 y.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 c=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"):c.bind(this)(h,f)}}}))})($x)),$x.exports}var ihe=rhe();const she=pl(ihe);$e.extend(she);function ahe(t){return $e(t.find(e=>$e(e).day()===1)).isoWeek()}var yq={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const ohe={withCellSpacing:!0},xq=(t,{size:e})=>({weekNumber:{"--wn-fz":Dr(e),"--wn-size":Gt(e,"wn-size")}}),Hb=Ie(t=>{const e=xe("Month",ohe,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,__staticSelector:c,locale:h,firstDayOfWeek:f,weekdayFormat:p,month:m,weekendDays:v,getDayProps:y,excludeDate:x,minDate:S,maxDate:w,renderDay:A,hideOutsideDates:C,hideWeekdays:j,getDayAriaLabel:_,static:k,__getDayRef:M,__onDayKeyDown:R,__onDayClick:N,__onDayMouseEnter:I,__preventFocus:D,__stopPropagation:L,withCellSpacing:z,size:P,highlightToday:H,withWeekNumbers:B,fullWidth:F,attributes:q,...X}=e,Y=mt({name:c||"Month",classes:yq,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:q,vars:l,varsResolver:xq,rootSelector:"month"}),U=wu(),V=ehe({month:m,firstDayOfWeek:U.getFirstDayOfWeek(f),consistentWeeks:U.consistentWeeks}),G=the({dates:V,minDate:Ms(S),maxDate:Ms(w),getDayProps:y,excludeDate:x,hideOutsideDates:C,month:m}),{resolvedClassNames:J,resolvedStyles:ne}=Ya({classNames:n,styles:s,props:e}),de=V.map((fe,ke)=>{const Me=fe.map((Oe,Ye)=>{const ie=!j6(Oe,m),Se=(_==null?void 0:_(Oe))||$e(Oe).locale(h||U.locale).format("D MMMM YYYY"),se=y==null?void 0:y(Oe),_e=$e(Oe).isSame(G,"date");return a.jsx("td",{...Y("monthCell"),"data-with-spacing":z||void 0,children:a.jsx(L2,{__staticSelector:c||"Month",classNames:J,styles:ne,attributes:q,unstyled:o,"data-mantine-stop-propagation":L||void 0,highlightToday:H,renderDay:A,date:Oe,size:P,weekend:U.getWeekendDays(v).includes($e(Oe).get("day")),outside:ie,hidden:C?ie:!1,"aria-label":Se,static:k,fullWidth:F,disabled:(x==null?void 0:x(Oe))||!bq(Oe,Ms(w))||!vq(Oe,Ms(S)),ref:et=>{et&&(M==null||M(ke,Ye,et))},...se,onKeyDown:et=>{var Te;(Te=se==null?void 0:se.onKeyDown)==null||Te.call(se,et),R==null||R(et,{rowIndex:ke,cellIndex:Ye,date:Oe})},onMouseEnter:et=>{var Te;(Te=se==null?void 0:se.onMouseEnter)==null||Te.call(se,et),I==null||I(et,Oe)},onClick:et=>{var Te;(Te=se==null?void 0:se.onClick)==null||Te.call(se,et),N==null||N(et,Oe)},onMouseDown:et=>{var Te;(Te=se==null?void 0:se.onMouseDown)==null||Te.call(se,et),D&&et.preventDefault()},tabIndex:D||!_e?-1:0})},Oe.toString())});return a.jsxs("tr",{...Y("monthRow"),children:[B&&a.jsx("td",{...Y("weekNumber"),children:ahe(fe)}),Me]},ke)});return a.jsxs(ve,{component:"table",...Y("month"),size:P,"data-full-width":F||void 0,...X,children:[!j&&a.jsx("thead",{...Y("monthThead"),children:a.jsx(B2,{__staticSelector:c||"Month",locale:h,firstDayOfWeek:f,weekdayFormat:p,withWeekNumbers:B,size:P,classNames:J,styles:ne,unstyled:o,attributes:q})}),a.jsx("tbody",{...Y("monthTbody"),children:de})]})});Hb.classes=yq;Hb.varsResolver=xq;Hb.displayName="@mantine/dates/Month";var Aq={pickerControl:"m_dc6a3c71"};const wq=(t,{size:e})=>({pickerControl:{"--dpc-fz":Dr(e),"--dpc-size":Gt(e,"dpc-size")}}),zb=Ie(t=>{const e=xe("PickerControl",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,firstInRange:c,lastInRange:h,inRange:f,__staticSelector:p,selected:m,disabled:v,fullWidth:y,attributes:x,...S}=e;return a.jsx(Nr,{...mt({name:p||"PickerControl",classes:Aq,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:x,vars:l,varsResolver:wq,rootSelector:"pickerControl"})("pickerControl"),unstyled:o,"data-picker-control":!0,"data-full-width":y||void 0,"data-selected":m&&!v||void 0,"data-disabled":v||void 0,"data-in-range":f&&!v&&!m||void 0,"data-first-in-range":c&&!v||void 0,"data-last-in-range":h&&!v||void 0,disabled:v,...S})});zb.classes=Aq;zb.varsResolver=wq;zb.displayName="@mantine/dates/PickerControl";function Sq({year:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&$e(t).isBefore(e,"year")||n&&$e(t).isAfter(n,"year"))}function lhe({years:t,minDate:e,maxDate:n,getYearControlProps:r}){const i=t.flat().filter(l=>{var c;return!Sq({year:l,minDate:e,maxDate:n})&&!((c=r==null?void 0:r(l))!=null&&c.disabled)}),s=i.find(l=>{var c;return(c=r==null?void 0:r(l))==null?void 0:c.selected});if(s)return s;const o=i.find(l=>$e().isSame(l,"year"));return o||i[0]}function jq(t){const e=$e(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($e(new Date(n+r,0)).format("YYYY-MM-DD")),r+=1}return i}var Cq={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const che={yearsListFormat:"YYYY",withCellSpacing:!0},P2=Ie(t=>{const e=xe("YearsList",che,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,decade:c,yearsListFormat:h,locale:f,minDate:p,maxDate:m,getYearControlProps:v,__staticSelector:y,__getControlRef:x,__onControlKeyDown:S,__onControlClick:w,__onControlMouseEnter:A,__preventFocus:C,__stopPropagation:j,withCellSpacing:_,fullWidth:k,size:M,attributes:R,...N}=e,I=mt({name:y||"YearsList",classes:Cq,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:R,vars:l,rootSelector:"yearsList"}),D=wu(),L=jq(c),z=lhe({years:L,minDate:p,maxDate:m,getYearControlProps:v}),P=L.map((H,B)=>{const F=H.map((q,X)=>{const Y=v==null?void 0:v(q),U=$e(q).isSame(z,"year");return a.jsx("td",{...I("yearsListCell"),"data-with-spacing":_||void 0,children:a.jsx(zb,{...I("yearsListControl"),size:M,unstyled:o,fullWidth:k,"data-mantine-stop-propagation":j||void 0,disabled:Sq({year:q,minDate:p,maxDate:m}),ref:V=>{V&&(x==null||x(B,X,V))},...Y,onKeyDown:V=>{var G;(G=Y==null?void 0:Y.onKeyDown)==null||G.call(Y,V),S==null||S(V,{rowIndex:B,cellIndex:X,date:q})},onClick:V=>{var G;(G=Y==null?void 0:Y.onClick)==null||G.call(Y,V),w==null||w(V,q)},onMouseEnter:V=>{var G;(G=Y==null?void 0:Y.onMouseEnter)==null||G.call(Y,V),A==null||A(V,q)},onMouseDown:V=>{var G;(G=Y==null?void 0:Y.onMouseDown)==null||G.call(Y,V),C&&V.preventDefault()},tabIndex:C||!U?-1:0,children:(Y==null?void 0:Y.children)??$e(q).locale(D.getLocale(f)).format(h)})},X)});return a.jsx("tr",{...I("yearsListRow"),children:F},B)});return a.jsx(ve,{component:"table",size:M,...I("yearsList"),"data-full-width":k||void 0,...N,children:a.jsx("tbody",{children:P})})});P2.classes=Cq;P2.displayName="@mantine/dates/YearsList";function _q({month:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&$e(t).isBefore(e,"month")||n&&$e(t).isAfter(n,"month"))}function uhe({months:t,minDate:e,maxDate:n,getMonthControlProps:r}){const i=t.flat().filter(l=>{var c;return!_q({month:l,minDate:e,maxDate:n})&&!((c=r==null?void 0:r(l))!=null&&c.disabled)}),s=i.find(l=>{var c;return(c=r==null?void 0:r(l))==null?void 0:c.selected});if(s)return s;const o=i.find(l=>$e().isSame(l,"month"));return o||i[0]}function hhe(t){const e=$e(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($e(e).add(r,"months").format("YYYY-MM-DD")),r+=1;return n}var Tq={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const dhe={monthsListFormat:"MMM",withCellSpacing:!0},F2=Ie(t=>{const e=xe("MonthsList",dhe,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,__staticSelector:c,year:h,monthsListFormat:f,locale:p,minDate:m,maxDate:v,getMonthControlProps:y,__getControlRef:x,__onControlKeyDown:S,__onControlClick:w,__onControlMouseEnter:A,__preventFocus:C,__stopPropagation:j,withCellSpacing:_,fullWidth:k,size:M,attributes:R,...N}=e,I=mt({name:c||"MonthsList",classes:Tq,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:R,vars:l,rootSelector:"monthsList"}),D=wu(),L=hhe(h),z=uhe({months:L,minDate:Ms(m),maxDate:Ms(v),getMonthControlProps:y}),P=L.map((H,B)=>{const F=H.map((q,X)=>{const Y=y==null?void 0:y(q),U=$e(q).isSame(z,"month");return a.jsx("td",{...I("monthsListCell"),"data-with-spacing":_||void 0,children:a.jsx(zb,{...I("monthsListControl"),size:M,unstyled:o,fullWidth:k,__staticSelector:c||"MonthsList","data-mantine-stop-propagation":j||void 0,disabled:_q({month:q,minDate:Ms(m),maxDate:Ms(v)}),ref:V=>{V&&(x==null||x(B,X,V))},...Y,onKeyDown:V=>{var G;(G=Y==null?void 0:Y.onKeyDown)==null||G.call(Y,V),S==null||S(V,{rowIndex:B,cellIndex:X,date:q})},onClick:V=>{var G;(G=Y==null?void 0:Y.onClick)==null||G.call(Y,V),w==null||w(V,q)},onMouseEnter:V=>{var G;(G=Y==null?void 0:Y.onMouseEnter)==null||G.call(Y,V),A==null||A(V,q)},onMouseDown:V=>{var G;(G=Y==null?void 0:Y.onMouseDown)==null||G.call(Y,V),C&&V.preventDefault()},tabIndex:C||!U?-1:0,children:(Y==null?void 0:Y.children)??$e(q).locale(D.getLocale(p)).format(f)})},X)});return a.jsx("tr",{...I("monthsListRow"),children:F},B)});return a.jsx(ve,{component:"table",size:M,...I("monthsList"),"data-full-width":k||void 0,...N,children:a.jsx("tbody",{children:P})})});F2.classes=Tq;F2.displayName="@mantine/dates/MonthsList";var kq={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const fhe={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},Oq=(t,{size:e})=>({calendarHeader:{"--dch-control-size":Gt(e,"dch-control-size"),"--dch-fz":Dr(e)}}),Su=Ie(t=>{const e=xe("CalendarHeader",fhe,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,nextIcon:c,previousIcon:h,nextLabel:f,previousLabel:p,onNext:m,onPrevious:v,onLevelClick:y,label:x,nextDisabled:S,previousDisabled:w,hasNextLevel:A,levelControlAriaLabel:C,withNext:j,withPrevious:_,headerControlsOrder:k,fullWidth:M,__staticSelector:R,__preventFocus:N,__stopPropagation:I,attributes:D,...L}=e,z=mt({name:R||"CalendarHeader",classes:kq,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:D,vars:l,varsResolver:Oq,rootSelector:"calendarHeader"}),P=N?X=>X.preventDefault():void 0,H=_&&O.createElement(Nr,{...z("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":p,onClick:v,unstyled:o,onMouseDown:P,disabled:w,"data-disabled":w||void 0,tabIndex:N||w?-1:0,"data-mantine-stop-propagation":I||void 0},h||a.jsx(Dm,{...z("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),B=O.createElement(Nr,{component:A?"button":"div",...z("calendarHeaderLevel"),key:"level",onClick:A?y:void 0,unstyled:o,onMouseDown:A?P:void 0,disabled:!A,"data-static":!A||void 0,"aria-label":C,tabIndex:N||!A?-1:0,"data-mantine-stop-propagation":I||void 0},x),F=j&&O.createElement(Nr,{...z("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":f,onClick:m,unstyled:o,onMouseDown:P,disabled:S,"data-disabled":S||void 0,tabIndex:N||S?-1:0,"data-mantine-stop-propagation":I||void 0},c||a.jsx(Dm,{...z("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),q=k.map(X=>X==="previous"?H:X==="level"?B:X==="next"?F:null);return a.jsx(ve,{...z("calendarHeader"),"data-full-width":M||void 0,...L,children:q})});Su.classes=kq;Su.varsResolver=Oq;Su.displayName="@mantine/dates/CalendarHeader";function phe(t){const e=jq(t);return[e[0][0],e[3][0]]}const mhe={decadeLabelFormat:"YYYY"},$2=Ie(t=>{const{decade:e,locale:n,minDate:r,maxDate:i,yearsListFormat:s,getYearControlProps:o,__getControlRef:l,__onControlKeyDown:c,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:p,__preventFocus:m,nextIcon:v,previousIcon:y,nextLabel:x,previousLabel:S,onNext:w,onPrevious:A,nextDisabled:C,previousDisabled:j,levelControlAriaLabel:_,withNext:k,withPrevious:M,headerControlsOrder:R,decadeLabelFormat:N,classNames:I,styles:D,unstyled:L,__staticSelector:z,__stopPropagation:P,size:H,fullWidth:B,attributes:F,...q}=xe("DecadeLevel",mhe,t),X=wu(),[Y,U]=phe(e),V={__staticSelector:z||"DecadeLevel",classNames:I,styles:D,unstyled:L,size:H,attributes:F},G=typeof C=="boolean"?C:i?!$e(U).endOf("year").isBefore(i):!1,J=typeof j=="boolean"?j:r?!$e(Y).startOf("year").isAfter(r):!1,ne=(de,fe)=>$e(de).locale(n||X.locale).format(fe);return a.jsxs(ve,{"data-decade-level":!0,size:H,...q,children:[a.jsx(Su,{label:typeof N=="function"?N(Y,U):`${ne(Y,N)} – ${ne(U,N)}`,__preventFocus:m,__stopPropagation:P,nextIcon:v,previousIcon:y,nextLabel:x,previousLabel:S,onNext:w,onPrevious:A,nextDisabled:G,previousDisabled:J,hasNextLevel:!1,levelControlAriaLabel:_,withNext:k,withPrevious:M,headerControlsOrder:R,fullWidth:B,...V}),a.jsx(P2,{decade:e,locale:n,minDate:r,maxDate:i,yearsListFormat:s,getYearControlProps:o,__getControlRef:l,__onControlKeyDown:c,__onControlClick:h,__onControlMouseEnter:f,__preventFocus:m,__stopPropagation:P,withCellSpacing:p,fullWidth:B,...V})]})});$2.classes={...P2.classes,...Su.classes};$2.displayName="@mantine/dates/DecadeLevel";const ghe={yearLabelFormat:"YYYY"},H2=Ie(t=>{const{year:e,locale:n,minDate:r,maxDate:i,monthsListFormat:s,getMonthControlProps:o,__getControlRef:l,__onControlKeyDown:c,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:p,__preventFocus:m,nextIcon:v,previousIcon:y,nextLabel:x,previousLabel:S,onNext:w,onPrevious:A,onLevelClick:C,nextDisabled:j,previousDisabled:_,hasNextLevel:k,levelControlAriaLabel:M,withNext:R,withPrevious:N,headerControlsOrder:I,yearLabelFormat:D,__staticSelector:L,__stopPropagation:z,size:P,classNames:H,styles:B,unstyled:F,fullWidth:q,attributes:X,...Y}=xe("YearLevel",ghe,t),U=wu(),V={__staticSelector:L||"YearLevel",classNames:H,styles:B,unstyled:F,size:P,attributes:X},G=typeof j=="boolean"?j:i?!$e(e).endOf("year").isBefore(i):!1,J=typeof _=="boolean"?_:r?!$e(e).startOf("year").isAfter(r):!1;return a.jsxs(ve,{"data-year-level":!0,size:P,...Y,children:[a.jsx(Su,{label:typeof D=="function"?D(e):$e(e).locale(n||U.locale).format(D),__preventFocus:m,__stopPropagation:z,nextIcon:v,previousIcon:y,nextLabel:x,previousLabel:S,onNext:w,onPrevious:A,onLevelClick:C,nextDisabled:G,previousDisabled:J,hasNextLevel:k,levelControlAriaLabel:M,withNext:R,withPrevious:N,headerControlsOrder:I,fullWidth:q,...V}),a.jsx(F2,{year:e,locale:n,minDate:r,maxDate:i,monthsListFormat:s,getMonthControlProps:o,__getControlRef:l,__onControlKeyDown:c,__onControlClick:h,__onControlMouseEnter:f,__preventFocus:m,__stopPropagation:z,withCellSpacing:p,fullWidth:q,...V})]})});H2.classes={...Su.classes,...F2.classes};H2.displayName="@mantine/dates/YearLevel";const vhe={monthLabelFormat:"MMMM YYYY"},z2=Ie(t=>{const{month:e,locale:n,firstDayOfWeek:r,weekdayFormat:i,weekendDays:s,getDayProps:o,excludeDate:l,minDate:c,maxDate:h,renderDay:f,hideOutsideDates:p,hideWeekdays:m,getDayAriaLabel:v,__getDayRef:y,__onDayKeyDown:x,__onDayClick:S,__onDayMouseEnter:w,withCellSpacing:A,highlightToday:C,withWeekNumbers:j,__preventFocus:_,__stopPropagation:k,nextIcon:M,previousIcon:R,nextLabel:N,previousLabel:I,onNext:D,onPrevious:L,onLevelClick:z,nextDisabled:P,previousDisabled:H,hasNextLevel:B,levelControlAriaLabel:F,withNext:q,withPrevious:X,headerControlsOrder:Y,monthLabelFormat:U,classNames:V,styles:G,unstyled:J,__staticSelector:ne,size:de,static:fe,fullWidth:ke,attributes:Me,...Oe}=xe("MonthLevel",vhe,t),Ye=wu(),ie={__staticSelector:ne||"MonthLevel",classNames:V,styles:G,unstyled:J,size:de,attributes:Me},Se=typeof P=="boolean"?P:h?!$e(e).endOf("month").isBefore(h):!1,se=typeof H=="boolean"?H:c?!$e(e).startOf("month").isAfter(c):!1;return a.jsxs(ve,{"data-month-level":!0,size:de,...Oe,children:[a.jsx(Su,{label:typeof U=="function"?U(e):$e(e).locale(n||Ye.locale).format(U),__preventFocus:_,__stopPropagation:k,nextIcon:M,previousIcon:R,nextLabel:N,previousLabel:I,onNext:D,onPrevious:L,onLevelClick:z,nextDisabled:Se,previousDisabled:se,hasNextLevel:B,levelControlAriaLabel:F,withNext:q,withPrevious:X,headerControlsOrder:Y,fullWidth:ke,...ie}),a.jsx(Hb,{month:e,locale:n,firstDayOfWeek:r,weekdayFormat:i,weekendDays:s,getDayProps:o,excludeDate:l,minDate:c,maxDate:h,renderDay:f,hideOutsideDates:p,hideWeekdays:m,getDayAriaLabel:v,__getDayRef:y,__onDayKeyDown:x,__onDayClick:S,__onDayMouseEnter:w,__preventFocus:_,__stopPropagation:k,static:fe,withCellSpacing:A,highlightToday:C,withWeekNumbers:j,fullWidth:ke,...ie})]})});z2.classes={...Hb.classes,...Su.classes};z2.displayName="@mantine/dates/MonthLevel";var Eq={levelsGroup:"m_30b26e33"};const ld=Ie(t=>{const e=xe("LevelsGroup",null,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,__staticSelector:c,fullWidth:h,attributes:f,...p}=e;return a.jsx(ve,{...mt({name:c||"LevelsGroup",classes:Eq,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:f,vars:l,rootSelector:"levelsGroup"})("levelsGroup"),"data-full-width":h||void 0,...p})});ld.classes=Eq;ld.displayName="@mantine/dates/LevelsGroup";const bhe={numberOfColumns:1},q2=Ie(t=>{const{decade:e,locale:n,minDate:r,maxDate:i,yearsListFormat:s,getYearControlProps:o,__onControlClick:l,__onControlMouseEnter:c,withCellSpacing:h,__preventFocus:f,nextIcon:p,previousIcon:m,nextLabel:v,previousLabel:y,onNext:x,onPrevious:S,nextDisabled:w,previousDisabled:A,headerControlsOrder:C,classNames:j,styles:_,unstyled:k,__staticSelector:M,__stopPropagation:R,numberOfColumns:N,levelControlAriaLabel:I,decadeLabelFormat:D,size:L,fullWidth:z,vars:P,attributes:H,...B}=xe("DecadeLevelGroup",bhe,t),F=O.useRef([]),q=Array(N).fill(0).map((X,Y)=>{const U=$e(e).add(Y*10,"years").format("YYYY-MM-DD");return a.jsx($2,{size:L,yearsListFormat:s,decade:U,withNext:Y===N-1,withPrevious:Y===0,decadeLabelFormat:D,__onControlClick:l,__onControlMouseEnter:c,__onControlKeyDown:(V,G)=>A6({levelIndex:Y,rowIndex:G.rowIndex,cellIndex:G.cellIndex,event:V,controlsRef:F}),__getControlRef:(V,G,J)=>{Array.isArray(F.current[Y])||(F.current[Y]=[]),Array.isArray(F.current[Y][V])||(F.current[Y][V]=[]),F.current[Y][V][G]=J},levelControlAriaLabel:typeof I=="function"?I(U):I,locale:n,minDate:r,maxDate:i,__preventFocus:f,__stopPropagation:R,nextIcon:p,previousIcon:m,nextLabel:v,previousLabel:y,onNext:x,onPrevious:S,nextDisabled:w,previousDisabled:A,getYearControlProps:o,__staticSelector:M||"DecadeLevelGroup",classNames:j,styles:_,unstyled:k,withCellSpacing:h,headerControlsOrder:C,fullWidth:z,attributes:H},Y)});return a.jsx(ld,{classNames:j,styles:_,__staticSelector:M||"DecadeLevelGroup",size:L,unstyled:k,fullWidth:z,attributes:H,...B,children:q})});q2.classes={...ld.classes,...$2.classes};q2.displayName="@mantine/dates/DecadeLevelGroup";const yhe={numberOfColumns:1},Q2=Ie(t=>{const{year:e,locale:n,minDate:r,maxDate:i,monthsListFormat:s,getMonthControlProps:o,__onControlClick:l,__onControlMouseEnter:c,withCellSpacing:h,__preventFocus:f,nextIcon:p,previousIcon:m,nextLabel:v,previousLabel:y,onNext:x,onPrevious:S,onLevelClick:w,nextDisabled:A,previousDisabled:C,hasNextLevel:j,headerControlsOrder:_,classNames:k,styles:M,unstyled:R,__staticSelector:N,__stopPropagation:I,numberOfColumns:D,levelControlAriaLabel:L,yearLabelFormat:z,size:P,fullWidth:H,vars:B,attributes:F,...q}=xe("YearLevelGroup",yhe,t),X=O.useRef([]),Y=Array(D).fill(0).map((U,V)=>{const G=$e(e).add(V,"years").format("YYYY-MM-DD");return a.jsx(H2,{size:P,monthsListFormat:s,year:G,withNext:V===D-1,withPrevious:V===0,yearLabelFormat:z,__stopPropagation:I,__onControlClick:l,__onControlMouseEnter:c,__onControlKeyDown:(J,ne)=>A6({levelIndex:V,rowIndex:ne.rowIndex,cellIndex:ne.cellIndex,event:J,controlsRef:X}),__getControlRef:(J,ne,de)=>{Array.isArray(X.current[V])||(X.current[V]=[]),Array.isArray(X.current[V][J])||(X.current[V][J]=[]),X.current[V][J][ne]=de},levelControlAriaLabel:typeof L=="function"?L(G):L,locale:n,minDate:r,maxDate:i,__preventFocus:f,nextIcon:p,previousIcon:m,nextLabel:v,previousLabel:y,onNext:x,onPrevious:S,onLevelClick:w,nextDisabled:A,previousDisabled:C,hasNextLevel:j,getMonthControlProps:o,classNames:k,styles:M,unstyled:R,__staticSelector:N||"YearLevelGroup",withCellSpacing:h,headerControlsOrder:_,fullWidth:H,attributes:F},V)});return a.jsx(ld,{classNames:k,styles:M,__staticSelector:N||"YearLevelGroup",size:P,unstyled:R,fullWidth:H,attributes:F,...q,children:Y})});Q2.classes={...H2.classes,...ld.classes};Q2.displayName="@mantine/dates/YearLevelGroup";const xhe={numberOfColumns:1},U2=Ie(t=>{const{month:e,locale:n,firstDayOfWeek:r,weekdayFormat:i,weekendDays:s,getDayProps:o,excludeDate:l,minDate:c,maxDate:h,renderDay:f,hideOutsideDates:p,hideWeekdays:m,getDayAriaLabel:v,__onDayClick:y,__onDayMouseEnter:x,withCellSpacing:S,highlightToday:w,withWeekNumbers:A,__preventFocus:C,nextIcon:j,previousIcon:_,nextLabel:k,previousLabel:M,onNext:R,onPrevious:N,onLevelClick:I,nextDisabled:D,previousDisabled:L,hasNextLevel:z,headerControlsOrder:P,classNames:H,styles:B,unstyled:F,numberOfColumns:q,levelControlAriaLabel:X,monthLabelFormat:Y,__staticSelector:U,__stopPropagation:V,size:G,static:J,fullWidth:ne,vars:de,attributes:fe,...ke}=xe("MonthLevelGroup",xhe,t),Me=O.useRef([]),Oe=Array(q).fill(0).map((Ye,ie)=>{const Se=$e(e).add(ie,"months").format("YYYY-MM-DD");return a.jsx(z2,{month:Se,withNext:ie===q-1,withPrevious:ie===0,monthLabelFormat:Y,__stopPropagation:V,__onDayClick:y,__onDayMouseEnter:x,__onDayKeyDown:(se,_e)=>A6({levelIndex:ie,rowIndex:_e.rowIndex,cellIndex:_e.cellIndex,event:se,controlsRef:Me}),__getDayRef:(se,_e,et)=>{Array.isArray(Me.current[ie])||(Me.current[ie]=[]),Array.isArray(Me.current[ie][se])||(Me.current[ie][se]=[]),Me.current[ie][se][_e]=et},levelControlAriaLabel:typeof X=="function"?X(Se):X,locale:n,firstDayOfWeek:r,weekdayFormat:i,weekendDays:s,getDayProps:o,excludeDate:l,minDate:c,maxDate:h,renderDay:f,hideOutsideDates:p,hideWeekdays:m,getDayAriaLabel:v,__preventFocus:C,nextIcon:j,previousIcon:_,nextLabel:k,previousLabel:M,onNext:R,onPrevious:N,onLevelClick:I,nextDisabled:D,previousDisabled:L,hasNextLevel:z,classNames:H,styles:B,unstyled:F,__staticSelector:U||"MonthLevelGroup",size:G,static:J,withCellSpacing:S,highlightToday:w,withWeekNumbers:A,headerControlsOrder:P,fullWidth:ne,attributes:fe},ie)});return a.jsx(ld,{classNames:H,styles:B,__staticSelector:U||"MonthLevelGroup",size:G,fullWidth:ne,attributes:fe,...ke,children:Oe})});U2.classes={...ld.classes,...z2.classes};U2.displayName="@mantine/dates/MonthLevelGroup";var Mq={input:"m_6fa5e2aa"};const W2=Ie(t=>{const{inputProps:e,wrapperProps:n,placeholder:r,classNames:i,styles:s,unstyled:o,popoverProps:l,modalProps:c,dropdownType:h,children:f,formattedValue:p,dropdownHandlers:m,dropdownOpened:v,onClick:y,clearable:x,clearSectionMode:S,onClear:w,clearButtonProps:A,rightSection:C,shouldClear:j,readOnly:_,disabled:k,value:M,name:R,form:N,type:I,onDropdownClose:D,withTime:L,...z}=kF("PickerInputBase",{size:"sm"},t),P=a.jsx(Ar.ClearButton,{onClick:w,unstyled:o,...A}),H=()=>{I==="range"&&Array.isArray(M)&&M[0]&&!M[1]&&w(),m.close()};return a.jsxs(a.Fragment,{children:[h==="modal"&&!_&&a.jsx(Ga,{opened:v,onClose:H,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:o,...c,children:f}),a.jsx(Ar.Wrapper,{...n,children:a.jsxs(Cn,{position:"bottom-start",opened:v,trapFocus:!0,returnFocus:!1,unstyled:o,onClose:D,...l,disabled:(l==null?void 0:l.disabled)||h==="modal"||_,onChange:B=>{var F;B||((F=l==null?void 0:l.onClose)==null||F.call(l),H())},children:[a.jsx(Cn.Target,{children:a.jsx(Ar,{"data-dates-input":!0,"data-read-only":_||void 0,disabled:k,component:"button",type:"button",multiline:!0,onClick:B=>{y==null||y(B),m.toggle()},__clearSection:P,__clearable:x&&j&&!_&&!k,__clearSectionMode:S,rightSection:C,...e,classNames:{...i,input:$r(Mq.input,i==null?void 0:i.input)},...z,children:p||a.jsx(Ar.Placeholder,{error:e.error,unstyled:o,classNames:i,styles:s,__staticSelector:e.__staticSelector,children:r})})}),a.jsx(Cn.Dropdown,{"data-dates-dropdown":!0,children:f})]})}),a.jsx(rq,{value:M,name:R,form:N,type:I,withTime:L})]})});W2.classes=Mq;W2.displayName="@mantine/dates/PickerInputBase";const sN=t=>t==="range"?[null,null]:t==="multiple"?[]:null,aN=(t,e)=>{const n=e?Pp:Ms;return Array.isArray(t)?t.map(n):n(t)};function Y2({type:t,value:e,defaultValue:n,onChange:r,withTime:i=!1}){const s=O.useRef(t),[o,l,c]=si({value:aN(e,i),defaultValue:aN(n,i),finalValue:sN(t),onChange:r});let h=o;return s.current!==t&&(s.current=t,e===void 0&&(h=n!==void 0?n:sN(t),l(h))),[h,l,c]}function y_(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function Ahe(t){return t===0?"month":t===1?"year":"decade"}function xg(t,e,n){return Ahe(Lh(y_(t,0),y_(e,0),y_(n,2)))}const whe={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},V2=Ie(t=>{const e=xe("Calendar",whe,t),{vars:n,maxLevel:r,minLevel:i,defaultLevel:s,level:o,onLevelChange:l,date:c,defaultDate:h,onDateChange:f,numberOfColumns:p,columnsToScroll:m,ariaLabels:v,nextLabel:y,previousLabel:x,onYearSelect:S,onMonthSelect:w,onYearMouseEnter:A,onMonthMouseEnter:C,headerControlsOrder:j,__updateDateOnYearSelect:_,__updateDateOnMonthSelect:k,__setDateRef:M,__setLevelRef:R,firstDayOfWeek:N,weekdayFormat:I,weekendDays:D,getDayProps:L,excludeDate:z,renderDay:P,hideOutsideDates:H,hideWeekdays:B,getDayAriaLabel:F,monthLabelFormat:q,nextIcon:X,previousIcon:Y,__onDayClick:U,__onDayMouseEnter:V,withCellSpacing:G,highlightToday:J,withWeekNumbers:ne,monthsListFormat:de,getMonthControlProps:fe,yearLabelFormat:ke,yearsListFormat:Me,getYearControlProps:Oe,decadeLabelFormat:Ye,classNames:ie,styles:Se,unstyled:se,minDate:_e,maxDate:et,locale:Te,__staticSelector:Xe,size:at,__preventFocus:Ve,__stopPropagation:Ge,onNextDecade:ut,onPreviousDecade:Ue,onNextYear:De,onPreviousYear:Ce,onNextMonth:ze,onPreviousMonth:ht,static:Rt,enableKeyboardNavigation:Tn,fullWidth:fn,attributes:Zt,ref:lt,...tn}=e,{resolvedClassNames:Bt,resolvedStyles:Lt}=Ya({classNames:ie,styles:Se,props:e}),[Wt,jt]=si({value:o?xg(o,i,r):void 0,defaultValue:s?xg(s,i,r):void 0,finalValue:xg(void 0,i,r),onChange:l}),[Ht,cn]=Y2({type:"default",value:Ms(c),defaultValue:Ms(h),onChange:f});O.useImperativeHandle(M,()=>Pe=>{cn(Pe)}),O.useImperativeHandle(R,()=>Pe=>{jt(Pe)});const qn={__staticSelector:Xe||"Calendar",styles:Lt,classNames:Bt,unstyled:se,size:at,attributes:Zt},bn=m||p||1,un=O.useRef(null);if(un.current===null){const Pe=new Date;un.current=_e&&$e(Pe).isAfter(_e)?_e:$e(Pe).format("YYYY-MM-DD")}const ct=Ht||un.current,re=()=>{const Pe=$e(ct).add(bn,"month").format("YYYY-MM-DD");ze==null||ze(Pe),cn(Pe)},Re=()=>{const Pe=$e(ct).subtract(bn,"month").format("YYYY-MM-DD");ht==null||ht(Pe),cn(Pe)},ye=()=>{const Pe=$e(ct).add(bn,"year").format("YYYY-MM-DD");De==null||De(Pe),cn(Pe)},We=()=>{const Pe=$e(ct).subtract(bn,"year").format("YYYY-MM-DD");Ce==null||Ce(Pe),cn(Pe)},qt=()=>{const Pe=$e(ct).add(10*bn,"year").format("YYYY-MM-DD");ut==null||ut(Pe),cn(Pe)},Qt=()=>{const Pe=$e(ct).subtract(10*bn,"year").format("YYYY-MM-DD");Ue==null||Ue(Pe),cn(Pe)},tt=O.useRef(null);return O.useEffect(()=>{if(!Tn||Rt)return;const Pe=nt=>{var on;if(!((on=tt.current)!=null&&on.contains(document.activeElement)))return;const _t=nt.ctrlKey||nt.metaKey,Tt=nt.shiftKey;switch(nt.key){case"ArrowUp":_t&&Tt?(nt.preventDefault(),Qt()):_t&&(nt.preventDefault(),We());break;case"ArrowDown":_t&&Tt?(nt.preventDefault(),qt()):_t&&(nt.preventDefault(),ye());break;case"y":case"Y":Wt==="month"&&(nt.preventDefault(),jt("year"));break}};return document.addEventListener("keydown",Pe),()=>{document.removeEventListener("keydown",Pe)}},[Tn,Rt,Wt,ye,We,qt,Qt]),a.jsxs(ve,{ref:En(tt,lt),size:at,"data-calendar":!0,"data-full-width":fn||void 0,...tn,children:[Wt==="month"&&a.jsx(U2,{month:ct,minDate:_e,maxDate:et,firstDayOfWeek:N,weekdayFormat:I,weekendDays:D,getDayProps:L,excludeDate:z,renderDay:P,hideOutsideDates:H,hideWeekdays:B,getDayAriaLabel:F,onNext:re,onPrevious:Re,hasNextLevel:r!=="month",onLevelClick:()=>jt("year"),numberOfColumns:p,locale:Te,levelControlAriaLabel:v==null?void 0:v.monthLevelControl,nextLabel:(v==null?void 0:v.nextMonth)??y,nextIcon:X,previousLabel:(v==null?void 0:v.previousMonth)??x,previousIcon:Y,monthLabelFormat:q,__onDayClick:U,__onDayMouseEnter:V,__preventFocus:Ve,__stopPropagation:Ge,static:Rt,withCellSpacing:G,highlightToday:J,withWeekNumbers:ne,headerControlsOrder:j,fullWidth:fn,...qn}),Wt==="year"&&a.jsx(Q2,{year:ct,numberOfColumns:p,minDate:_e,maxDate:et,monthsListFormat:de,getMonthControlProps:fe,locale:Te,onNext:ye,onPrevious:We,hasNextLevel:r!=="month"&&r!=="year",onLevelClick:()=>jt("decade"),levelControlAriaLabel:v==null?void 0:v.yearLevelControl,nextLabel:(v==null?void 0:v.nextYear)??y,nextIcon:X,previousLabel:(v==null?void 0:v.previousYear)??x,previousIcon:Y,yearLabelFormat:ke,__onControlMouseEnter:C,__onControlClick:(Pe,nt)=>{k&&cn(nt),jt(xg("month",i,r)),w==null||w(nt)},__preventFocus:Ve,__stopPropagation:Ge,withCellSpacing:G,headerControlsOrder:j,fullWidth:fn,...qn}),Wt==="decade"&&a.jsx(q2,{decade:ct,minDate:_e,maxDate:et,yearsListFormat:Me,getYearControlProps:Oe,locale:Te,onNext:qt,onPrevious:Qt,numberOfColumns:p,nextLabel:(v==null?void 0:v.nextDecade)??y,nextIcon:X,previousLabel:(v==null?void 0:v.previousDecade)??x,previousIcon:Y,decadeLabelFormat:Ye,__onControlMouseEnter:A,__onControlClick:(Pe,nt)=>{_&&cn(nt),jt(xg("year",i,r)),S==null||S(nt)},__preventFocus:Ve,__stopPropagation:Ge,withCellSpacing:G,headerControlsOrder:j,fullWidth:fn,...qn})]})});V2.classes={...q2.classes,...Q2.classes,...U2.classes};V2.displayName="@mantine/dates/Calendar";function C6(t){const{maxLevel:e,minLevel:n,defaultLevel:r,level:i,onLevelChange:s,nextIcon:o,previousIcon:l,date:c,defaultDate:h,onDateChange:f,numberOfColumns:p,columnsToScroll:m,ariaLabels:v,nextLabel:y,previousLabel:x,onYearSelect:S,onMonthSelect:w,onYearMouseEnter:A,onMonthMouseEnter:C,onNextMonth:j,onPreviousMonth:_,onNextYear:k,onPreviousYear:M,onNextDecade:R,onPreviousDecade:N,withCellSpacing:I,highlightToday:D,__updateDateOnYearSelect:L,__updateDateOnMonthSelect:z,__setDateRef:P,__setLevelRef:H,withWeekNumbers:B,headerControlsOrder:F,firstDayOfWeek:q,weekdayFormat:X,weekendDays:Y,getDayProps:U,excludeDate:V,renderDay:G,hideOutsideDates:J,hideWeekdays:ne,getDayAriaLabel:de,monthLabelFormat:fe,monthsListFormat:ke,getMonthControlProps:Me,yearLabelFormat:Oe,yearsListFormat:Ye,getYearControlProps:ie,decadeLabelFormat:Se,allowSingleDateInRange:se,allowDeselect:_e,minDate:et,maxDate:Te,locale:Xe,...at}=t;return{calendarProps:{maxLevel:e,minLevel:n,defaultLevel:r,level:i,onLevelChange:s,nextIcon:o,previousIcon:l,date:c,defaultDate:h,onDateChange:f,numberOfColumns:p,columnsToScroll:m,ariaLabels:v,nextLabel:y,previousLabel:x,onYearSelect:S,onMonthSelect:w,onYearMouseEnter:A,onMonthMouseEnter:C,onNextMonth:j,onPreviousMonth:_,onNextYear:k,onPreviousYear:M,onNextDecade:R,onPreviousDecade:N,withCellSpacing:I,highlightToday:D,__updateDateOnYearSelect:L,__updateDateOnMonthSelect:z,__setDateRef:P,withWeekNumbers:B,headerControlsOrder:F,firstDayOfWeek:q,weekdayFormat:X,weekendDays:Y,getDayProps:U,excludeDate:V,renderDay:G,hideOutsideDates:J,hideWeekdays:ne,getDayAriaLabel:de,monthLabelFormat:fe,monthsListFormat:ke,getMonthControlProps:Me,yearLabelFormat:Oe,yearsListFormat:Ye,getYearControlProps:ie,decadeLabelFormat:Se,allowSingleDateInRange:se,allowDeselect:_e,minDate:et,maxDate:Te,locale:Xe},others:at}}function oN(t,e){const n=[...e].sort((r,i)=>$e(r).isAfter($e(i))?1:-1);return $e(n[0]).startOf("day").subtract(1,"ms").isBefore(t)&&$e(n[1]).endOf("day").add(1,"ms").isAfter(t)}function She({type:t,level:e,value:n,defaultValue:r,onChange:i,allowSingleDateInRange:s,allowDeselect:o,onMouseLeave:l}){const[c,h]=Y2({type:t,value:n,defaultValue:r,onChange:i}),[f,p]=O.useState(t==="range"&&c[0]&&!c[1]?c[0]:null),[m,v]=O.useState(null),y=_=>{if(t==="range"){if(f&&!c[1]){if($e(_).isSame(f,e)&&!s){p(null),v(null),h([null,null]);return}const k=[_,f];k.sort((M,R)=>$e(M).isAfter($e(R))?1:-1),h(k),v(null),p(null);return}if(c[0]&&!c[1]&&$e(_).isSame(c[0],e)&&!s){p(null),v(null),h([null,null]);return}h([_,null]),v(null),p(_);return}if(t==="multiple"){c.some(k=>$e(k).isSame(_,e))?h(c.filter(k=>!$e(k).isSame(_,e))):h([...c,_]);return}c&&o&&$e(_).isSame(c,e)?h(null):h(_)},x=_=>f&&m?oN(_,[m,f]):c[0]&&c[1]?oN(_,c):!1,S=t==="range"?_=>{l==null||l(_),v(null)}:l,w=_=>c[0]&&$e(_).isSame(c[0],e)?!(m&&$e(m).isBefore(c[0])):!1,A=_=>c[1]?$e(_).isSame(c[1],e):!c[0]||!m?!1:$e(m).isBefore(c[0])&&$e(_).isSame(c[0],e),C=_=>{if(t==="range")return{selected:c.some(M=>M&&$e(M).isSame(_,e)),inRange:x(_),firstInRange:w(_),lastInRange:A(_),"data-autofocus":!!c[0]&&$e(c[0]).isSame(_,e)||void 0};if(t==="multiple")return{selected:c.some(M=>M&&$e(M).isSame(_,e)),"data-autofocus":!!c[0]&&$e(c[0]).isSame(_,e)||void 0};const k=$e(c).isSame(_,e);return{selected:k,"data-autofocus":k||void 0}},j=t==="range"&&f?v:()=>{};return O.useEffect(()=>{if(t==="range")if(c[0]&&!c[1])p(c[0]);else{const _=c[0]==null&&c[1]==null,k=c[0]!=null&&c[1]!=null;(_||k)&&(p(null),v(null))}},[c]),{onDateChange:y,onRootMouseLeave:S,onHoveredDateChange:j,getControlProps:C,_value:c,setValue:h}}var jhe={datePickerRoot:"m_765a40cf",presetsList:"m_d6a681e1",presetButton:"m_acd30b22"};const Rq=(t,{size:e})=>({datePickerRoot:{"--preset-font-size":Dr(e)}}),Che={type:"default",defaultLevel:"month",numberOfColumns:1,size:"sm"},qb=Ie(t=>{const e=xe("DatePicker",Che,t),{allowDeselect:n,allowSingleDateInRange:r,value:i,defaultValue:s,onChange:o,onMouseLeave:l,classNames:c,styles:h,__staticSelector:f,__onDayClick:p,__onDayMouseEnter:m,__onPresetSelect:v,__stopPropagation:y,presets:x,className:S,style:w,unstyled:A,size:C,vars:j,attributes:_,...k}=e,{calendarProps:M,others:R}=C6(k),N=O.useRef(null),I=O.useRef(null),D=mt({name:f||"DatePicker",classes:jhe,props:e,className:S,style:w,classNames:c,styles:h,unstyled:A,attributes:_,rootSelector:x?"datePickerRoot":void 0,varsResolver:Rq,vars:j}),{onDateChange:L,onRootMouseLeave:z,onHoveredDateChange:P,getControlProps:H,_value:B,setValue:F}=She({type:R.type,level:"day",allowDeselect:n,allowSingleDateInRange:r,value:i,defaultValue:s,onChange:o,onMouseLeave:l}),{resolvedClassNames:q,resolvedStyles:X}=Ya({classNames:c,styles:h,props:e}),Y=a.jsx(V2,{classNames:q,styles:X,__staticSelector:f||"DatePicker",onMouseLeave:z,size:C,...M,...x?{}:R,__stopPropagation:y,__setDateRef:N,__setLevelRef:I,minLevel:M.minLevel||"month",__onDayMouseEnter:(G,J)=>{P(J),m==null||m(G,J)},__onDayClick:(G,J)=>{L(J),p==null||p(G,J)},getDayProps:G=>{var J;return{...H(G),...(J=M.getDayProps)==null?void 0:J.call(M,G)}},getMonthControlProps:G=>{var J;return{selected:typeof B=="string"?j6(G,B):!1,...(J=M.getMonthControlProps)==null?void 0:J.call(M,G)}},getYearControlProps:G=>{var J;return{selected:typeof B=="string"?$e(G).isSame(B,"year"):!1,...(J=M.getYearControlProps)==null?void 0:J.call(M,G)}},hideOutsideDates:M.hideOutsideDates??M.numberOfColumns!==1,attributes:_,...x?{}:{className:S,style:w}});if(!x)return Y;const U=G=>{var ne,de;const J=Array.isArray(G)?G[0]:G;J!==void 0&&((ne=N.current)==null||ne.call(N,J),(de=I.current)==null||de.call(I,"month"),v?v(J):F(G))},V=x.map((G,J)=>a.jsx(Nr,{...D("presetButton"),onClick:()=>U(G.value),onMouseDown:ne=>ne.preventDefault(),"data-mantine-stop-propagation":y||void 0,children:G.label},J));return a.jsxs(ve,{...D("datePickerRoot"),size:C,...R,children:[a.jsx("div",{...D("presetsList"),children:V}),Y]})});qb.classes=V2.classes;qb.varsResolver=Rq;qb.displayName="@mantine/dates/DatePicker";function x_({minDate:t,value:e}){const n=t?$e(t).format("HH:mm:ss"):null;return e&&t&&e===t?n??void 0:void 0}function A_({maxDate:t,value:e}){const n=t?$e(t).format("HH:mm:ss"):null;return e&&t&&e===t?n??void 0:void 0}var Dq={timeWrapper:"m_43bf4edb",timeInput:"m_49f1412",rangeInfo:"m_d6d672a0",rangeTimeWrapper:"m_80eb36d4",rangeTimeInput:"m_5566a64b"};const _he={type:"default",size:"sm"},G2=sd(t=>{const e=xe("InlineDateTimePicker",_he,t),{value:n,defaultValue:r,onChange:i,valueFormat:s,locale:o,classNames:l,styles:c,unstyled:h,timePickerProps:f,endTimePickerProps:p,submitButtonProps:m,withSeconds:v,level:y,defaultLevel:x,size:S,variant:w,vars:A,minDate:C,maxDate:j,defaultDate:_,defaultTimeValue:k,presets:M,attributes:R,onSubmit:N,labelSeparator:I,type:D,className:L,style:z,__stopPropagation:P,__staticSelector:H,__onEnter:B,__onPresetSelect:F,fullWidth:q,...X}=e,Y=H||"InlineDateTimePicker",U=mt({name:Y,classes:Dq,props:e,classNames:l,styles:c,unstyled:h,attributes:R,vars:A}),{resolvedClassNames:V,resolvedStyles:G}=Ya({classNames:l,styles:c,props:e}),J=wu(),ne=s||(v?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),de=J.getLabelSeparator(I),fe=D==="range",ke=O.useRef(null),Me=En(ke,f==null?void 0:f.hoursRef),Oe=En(O.useRef(null),p==null?void 0:p.hoursRef),{calendarProps:{allowSingleDateInRange:Ye,...ie},others:Se}=C6(X),[se,_e]=Y2({type:D,value:n,defaultValue:r,onChange:i,withTime:!0}),et=jt=>jt?$e(jt).format(v?"HH:mm:ss":"HH:mm"):"",Te=()=>k||(fe?Array.isArray(se)?et(se[0]):"":et(se)),Xe=()=>k||(fe&&Array.isArray(se)?et(se[1]):""),[at,Ve]=O.useState(Te),[Ge,ut]=O.useState(Xe),[Ue,De]=O.useState(y||x||"month"),Ce=fe?(Array.isArray(se)?se[0]:null)||_:se||_,ze=jt=>{var Ht;jt&&_e(Sp(Xp(C,j,jt),at||k||"")),(Ht=ke.current)==null||Ht.focus()},ht=jt=>{var qn;const[Ht,cn]=jt;_e([Ht?Sp(Xp(C,j,Ht),at||k||""):null,cn?Sp(Xp(C,j,cn),Ge||k||""):null]),Ht&&cn&&((qn=ke.current)==null||qn.focus())},Rt=jt=>{fe?ht(jt):ze(jt)},Tn=jt=>{var Ht;(Ht=f==null?void 0:f.onChange)==null||Ht.call(f,jt),Ve(jt),jt&&(fe&&Array.isArray(se)?se[0]&&_e([Sp(se[0],jt),se[1]]):_e(Sp(se,jt)))},fn=jt=>{var Ht;if((Ht=p==null?void 0:p.onChange)==null||Ht.call(p,jt),ut(jt),jt&&fe&&Array.isArray(se)&&se[1]){const cn=Sp(se[1],jt);_e([se[0],cn])}},Zt=jt=>{jt.key==="Enter"&&(jt.preventDefault(),B==null||B())},lt=()=>{if(!fe||!Array.isArray(se))return"";const jt=qn=>qn?typeof ne=="function"?ne(qn):$e(qn).locale(J.getLocale(o)).format(ne):"",Ht=jt(se[0]),cn=jt(se[1]);return Ht&&cn?`${Ht} ${de} ${cn}`:Ht?`${Ht} ${de} ...`:""};vu(()=>{fe&&Array.isArray(se)?(Ve(et(se[0])),ut(et(se[1]))):Ve(et(se))},[se]);const tn=x_(fe?{minDate:C,value:Array.isArray(se)?se[0]:null}:{minDate:C,value:se}),Bt=A_(fe?{maxDate:j,value:Array.isArray(se)?se[0]:null}:{maxDate:j,value:se}),Lt=fe?x_({minDate:C,value:Array.isArray(se)?se[1]:null}):void 0,Wt=fe?A_({maxDate:j,value:Array.isArray(se)?se[1]:null}):void 0;return a.jsxs(ve,{...U("root",{className:L,style:z}),...Se,ref:e.ref,children:[a.jsx(qb,{fullWidth:q??!0,...ie,maxDate:j,minDate:C,size:S,variant:w,type:D,value:se,defaultDate:Ce||Lue({maxDate:j,minDate:C}),onChange:Rt,locale:o,classNames:V,styles:G,unstyled:h,__staticSelector:Y,__stopPropagation:P,level:y,defaultLevel:x,onLevelChange:jt=>{var Ht;De(jt),(Ht=ie.onLevelChange)==null||Ht.call(ie,jt)},presets:M,allowSingleDateInRange:Ye,__onPresetSelect:F,attributes:R}),Ue==="month"&&!fe&&a.jsxs("div",{...U("timeWrapper"),children:[a.jsx(Kp,{value:at,withSeconds:v,unstyled:h,min:tn,max:Bt,...f,...U("timeInput",{className:f==null?void 0:f.className,style:f==null?void 0:f.style}),onChange:Tn,onKeyDown:Zt,size:S,"data-mantine-stop-propagation":P||void 0,hoursRef:Me}),a.jsx(Sr,{variant:"default",size:`input-${S||"sm"}`,...U("submitButton",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),unstyled:h,"data-mantine-stop-propagation":P||void 0,children:a.jsx(Nm,{size:"30%"}),...m,onClick:jt=>{var Ht;(Ht=m==null?void 0:m.onClick)==null||Ht.call(m,jt),N==null||N()}})]}),Ue==="month"&&fe&&a.jsxs(a.Fragment,{children:[a.jsx(pt,{...U("rangeInfo"),children:lt()}),a.jsxs("div",{...U("rangeTimeWrapper"),children:[a.jsx(Kp,{value:at,withSeconds:v,unstyled:h,min:tn,max:Bt,...f,...U("rangeTimeInput",{className:f==null?void 0:f.className,style:f==null?void 0:f.style}),onChange:Tn,onKeyDown:Zt,size:S,"data-mantine-stop-propagation":P||void 0,hoursRef:Me}),a.jsx(Kp,{value:Ge,withSeconds:v,unstyled:h,min:Lt,max:Wt,...p,...U("rangeTimeInput",{className:p==null?void 0:p.className,style:p==null?void 0:p.style}),onChange:fn,onKeyDown:Zt,size:S,"data-mantine-stop-propagation":P||void 0,hoursRef:Oe}),a.jsx(Sr,{variant:"default",size:`input-${S||"sm"}`,...U("submitButton",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),unstyled:h,"data-mantine-stop-propagation":P||void 0,children:a.jsx(Nm,{size:"30%"}),...m,onClick:jt=>{var Ht;(Ht=m==null?void 0:m.onClick)==null||Ht.call(m,jt),N==null||N()}})]})]})]})});G2.classes={...Dq,...qb.classes};G2.displayName="@mantine/dates/InlineDateTimePicker";var Nq={timeWrapper:"m_208d2562",timeInput:"m_62ee059",rangeInfo:"m_d8663ee7",rangeTimeWrapper:"m_afb15cad",rangeTimeInput:"m_8afe6e64"};const The={type:"default",dropdownType:"popover",size:"sm"},Mv=sd(t=>{const e=xe(["Input","InputWrapper","DateTimePicker"],The,t),{value:n,defaultValue:r,onChange:i,valueFormat:s,locale:o,classNames:l,styles:c,unstyled:h,timePickerProps:f,endTimePickerProps:p,submitButtonProps:m,withSeconds:v,level:y,defaultLevel:x,size:S,variant:w,dropdownType:A,vars:C,minDate:j,maxDate:_,defaultDate:k,defaultTimeValue:M,presets:R,attributes:N,onDropdownClose:I,type:D,labelSeparator:L,allowSingleDateInRange:z,...P}=e,H=D==="range";mt({name:"DateTimePicker",classes:Nq,props:e,classNames:l,styles:c,unstyled:h,attributes:N,vars:C});const{resolvedClassNames:B,resolvedStyles:F}=Ya({classNames:l,styles:c,props:e}),q=v||(f==null?void 0:f.withSeconds),X=s||(q?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),{calendarProps:{allowSingleDateInRange:Y,...U},others:V}=C6(P),G=wu(),J=G.getLabelSeparator(L),[ne,de]=Y2({type:D,value:n,defaultValue:r,onChange:i,withTime:!0}),[fe,ke]=Cw(!1),[Me,Oe]=O.useState(0),Ye=Ge=>Ge?typeof X=="function"?X(Ge):$e(Ge).locale(G.getLocale(o)).format(X):"",Se=(()=>{if(H&&Array.isArray(ne)){const Ge=Ye(ne[0]),ut=Ye(ne[1]);return Ge&&ut?`${Ge} ${J} ${ut}`:Ge?`${Ge} ${J} ...`:""}return Ye(ne)})();vu(()=>{fe&&Oe(Ge=>Ge+1)},[fe]);const se=A==="popover",_e=()=>{H&&Array.isArray(ne)&&ne[0]&&!ne[1]&&de([null,null])},et=()=>{if(_e(),H&&Array.isArray(ne)){const Ge=ne[0]?Xp(j,_,ne[0]):null,ut=ne[1]?Xp(j,_,ne[1]):null;(ne[0]&&ne[0]!==Ge||ne[1]&&ne[1]!==ut)&&de([Ge,ut])}else if(ne){const Ge=Xp(j,_,ne);ne!==Ge&&de(Ge)}I==null||I()},Te=()=>{et(),ke.close()},Xe=()=>{de(H?[null,null]:null)},at=H?Array.isArray(ne)&&!!ne[0]:!!ne,Ve=H?void 0:Ge=>{de(Ge)};return a.jsx(W2,{formattedValue:Se,dropdownOpened:P.disabled?!1:fe,dropdownHandlers:ke,classNames:B,styles:F,unstyled:h,onClear:Xe,shouldClear:at,value:ne,size:S,variant:w,dropdownType:A,...V,type:D,__staticSelector:"DateTimePicker",onDropdownClose:et,withTime:!0,attributes:N,children:a.jsx(G2,{...U,fullWidth:!1,type:D,value:ne,onChange:de,maxDate:_,minDate:j,size:S,variant:w,locale:o,classNames:B,styles:F,unstyled:h,level:y,defaultLevel:x,defaultDate:k,defaultTimeValue:M,presets:R,allowSingleDateInRange:z,timePickerProps:f,endTimePickerProps:p,submitButtonProps:m,withSeconds:v,valueFormat:s,labelSeparator:L,attributes:N,onSubmit:Te,__stopPropagation:se,__staticSelector:"DateTimePicker",__onEnter:Te,__onPresetSelect:Ve},Me)})});Mv.classes={...Nq,...W2.classes,...G2.classes};Mv.displayName="@mantine/dates/DateTimePicker";const khe="settings.useLocalTime",Ohe="settings.enableQueryHistory",Ehe="settings.enableAutocomplete",Mhe="settings.enableSyntaxHighlighting",Rhe="settings.enableLinter",Dhe="settings.showAnnotations",Nhe="settings.showQueryWarnings",Ihe="settings.showQueryInfoNotices",Lhe="settings.ruleGroupsPerPage",Bhe="settings.alertGroupsPerPage",Phe=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)},Fhe={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:Phe(window.location.pathname),useLocalTime:Ra(khe,!1),enableQueryHistory:Ra(Ohe,!1),enableAutocomplete:Ra(Ehe,!0),enableSyntaxHighlighting:Ra(Mhe,!0),enableLinter:Ra(Rhe,!0),showAnnotations:Ra(Dhe,!1),showQueryWarnings:Ra(Nhe,!0),showQueryInfoNotices:Ra(Ihe,!0),ruleGroupsPerPage:Ra(Lhe,10),alertGroupsPerPage:Ra(Bhe,10)},Iq=R2({name:"settings",initialState:Fhe,reducers:{updateSettings:(t,{payload:e})=>{Object.assign(t,e)}}}),{updateSettings:ho}=Iq.actions,fi=()=>hc(t=>t.settings),$he=Iq.reducer,lN={width:"0.9rem",height:"0.9rem"},Lq=({time:t,range:e,description:n,onChangeTime:r})=>{const i=()=>t!==null?t:Date.now().valueOf(),{useLocalTime:s}=fi(),o=s?$e(t).format():$e(t).subtract($e().utcOffset(),"minutes").format();return a.jsx(ft,{gap:5,children:a.jsx(Mv,{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():$e.utc(l).valueOf():null),"aria-label":n,placeholder:n,onClick:()=>{t===null&&r(i())},leftSection:a.jsx(Sr,{size:"lg",color:"gray",variant:"transparent",title:"Decrease time","aria-label":"Decrease time",onClick:()=>r(i()-e/2),children:a.jsx(ose,{style:lN})}),styles:{section:{width:"unset"}},rightSection:a.jsxs(a.Fragment,{children:[t&&a.jsx(ml,{variant:"transparent",color:"gray",onMouseDown:l=>l.preventDefault(),tabIndex:-1,onClick:()=>{r(null)},size:"xs"}),a.jsx(Sr,{size:"lg",color:"gray",variant:"transparent",title:"Increase time","aria-label":"Increase time",onClick:()=>r(i()+e/2),children:a.jsx(IH,{style:lN})})]})})})},cN={width:"0.9rem",height:"0.9rem"},uN=[1,10,60,300,900,1800,3600,7200,360*60,720*60,1440*60,2880*60,10080*60,336*60*60,672*60*60,1344*60*60,2688*60*60,4368*60*60,365*24*60*60,730*24*60*60].map(t=>t*1e3),Hhe=({range:t,onChangeRange:e})=>{const[n,r]=O.useState(Yn(t));O.useEffect(()=>{r(Yn(t))},[t]);const i=l=>{const c=x6(l);c===null?r(Yn(t)):e(c)},s=()=>{for(const l of uN)if(t<l){r(Yn(l)),e(l);return}},o=()=>{for(const l of uN.slice().reverse())if(t>l){r(Yn(l)),e(l);return}};return a.jsx(ft,{gap:5,children:a.jsx(cc,{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(Sr,{size:"lg",variant:"transparent",color:"gray","aria-label":"Decrease range",onClick:o,children:a.jsx($se,{style:cN})}),rightSection:a.jsx(Sr,{size:"lg",variant:"transparent",color:"gray","aria-label":"Increase range",onClick:s,children:a.jsx($H,{style:cN})}),leftSectionPointerEvents:"all",rightSectionPointerEvents:"all"})})},Bq=1024;let zhe=0,w_=class{constructor(e,n){this.from=e,this.to=n}};class dn{constructor(e={}){this.id=zhe++,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=va.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}dn.closedBy=new dn({deserialize:t=>t.split(" ")});dn.openedBy=new dn({deserialize:t=>t.split(" ")});dn.group=new dn({deserialize:t=>t.split(" ")});dn.isolate=new dn({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});dn.contextHash=new dn({perNode:!0});dn.lookAhead=new dn({perNode:!0});dn.mounted=new dn({perNode:!0});class nv{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[dn.mounted.id]}}const qhe=Object.create(null);class va{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):qhe,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new va(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(dn.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(dn.group),s=-1;s<(i?i.length:0);s++){let o=n[s<0?r.name:i[s]];if(o)return o}}}}va.none=new va("",Object.create(null),0,8);class _6{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],c=o[0];c.combine&&c.id in i&&(l=c.combine(i[c.id],l)),i[c.id]=l}}n.push(i?new va(r.name,i,r.id,r.flags):r)}return new _6(n)}}const N1=new WeakMap,hN=new WeakMap;var ni;(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"})(ni||(ni={}));class di{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=nv.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 X3(this.topNode,e)}cursorAt(e,n=0,r=0){let i=N1.get(this)||this.topNode,s=new X3(i);return s.moveTo(e,n),N1.set(this,s._tree),s}get topNode(){return new Uh(this,0,0,null)}resolve(e,n=0){let r=Rv(N1.get(this)||this.topNode,e,n,!1);return N1.set(this,r),r}resolveInner(e,n=0){let r=Rv(hN.get(this)||this.topNode,e,n,!0);return hN.set(this,r),r}resolveStack(e,n=0){return Whe(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,l=(o&ni.IncludeAnonymous)>0;for(let c=this.cursor(o|ni.IncludeAnonymous);;){let h=!1;if(c.from<=s&&c.to>=i&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;h=!0}for(;h&&r&&(l||!c.type.isAnonymous)&&r(c),!c.nextSibling();){if(!c.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:O6(va.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new di(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new di(va.none,n,r,i)))}static build(e){return Yhe(e)}}di.empty=new di(va.none,[],[],0);class T6{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 T6(this.buffer,this.index)}}class Qh{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return va.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 c=e;c!=n&&!(Pq(s,i,o[c+1],o[c+2])&&(l=c,r>0));c=o[c+3]);return l}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),o=0;for(let l=e,c=0;l<n;){s[c++]=i[l++],s[c++]=i[l++]-r;let h=s[c++]=i[l++]-r;s[c++]=i[l++]-e,o=Math.max(o,h)}return new Qh(s,o,this.set)}}function Pq(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 Uh&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=r?0:ni.IgnoreOverlays;if(r)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof Uh&&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 Fq{cursor(e=0){return new X3(this,e)}getChild(e,n=null,r=null){let i=dN(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return dN(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 G3(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 Uh=class Hx extends Fq{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:c}=o._tree,h=n>0?l.length:-1;e!=h;e+=n){let f=l[e],p=c[e]+o.from,m;if(!(!(s&ni.EnterBracketed&&f instanceof di&&(m=nv.get(f))&&!m.overlay&&m.bracketed&&r>=p&&r<=p+f.length)&&!Pq(i,r,p,p+f.length))){if(f instanceof Qh){if(s&ni.ExcludeBuffers)continue;let v=f.findChild(0,f.buffer.length,n,r-p,i);if(v>-1)return new Rh(new Qhe(o,f,e,p),null,v)}else if(s&ni.IncludeAnonymous||!f.type.isAnonymous||k6(f)){let v;if(!(s&ni.IgnoreMounts)&&(v=nv.get(f))&&!v.overlay)return new Hx(v.tree,p,e,o);let y=new Hx(f,p,e,o);return s&ni.IncludeAnonymous||!y.type.isAnonymous?y:y.nextChild(n<0?f.children.length-1:0,n,r,i,s)}}}if(s&ni.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&ni.IgnoreOverlays)&&(i=nv.get(this._tree))&&i.overlay){let s=e-this.from,o=r&ni.EnterBracketed&&i.bracketed;for(let{from:l,to:c}of i.overlay)if((n>0||o?l<=s:l<s)&&(n<0||o?c>=s:c>s))return new Hx(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 dN(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 G3(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 Qhe{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Rh extends Fq{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 Rh(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&ni.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 Rh(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 Rh(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 Rh(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 di(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function $q(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 Uh&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new Uhe(i,n)}class Uhe{constructor(e,n){this.heads=e,this.node=n}get next(){return $q(this.heads)}}function Whe(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof Uh?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=nv.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new Uh(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Rv(l,e,n,!1))}}return i?$q(i):r}class X3{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&~ni.EnterBracketed,e instanceof Uh)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 Uh?(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&ni.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ni.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ni.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&ni.IncludeAnonymous||l instanceof Qh||!l.type.isAnonymous||k6(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 Rh(this.buffer,n,this.stack[i]);return this.bufferNode=new Rh(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 G3(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 G3(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 k6(t){return t.children.some(e=>e instanceof Qh||!e.type.isAnonymous||k6(e))}function Yhe(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=Bq,reused:s=[],minRepeatType:o=r.types.length}=t,l=Array.isArray(n)?new T6(n,n.length):n,c=r.types,h=0,f=0;function p(_,k,M,R,N,I){let{id:D,start:L,end:z,size:P}=l,H=f,B=h;if(P<0)if(l.next(),P==-1){let U=s[D];M.push(U),R.push(L-_);return}else if(P==-3){h=D;return}else if(P==-4){f=D;return}else throw new RangeError(`Unrecognized record size: ${P}`);let F=c[D],q,X,Y=L-_;if(z-L<=i&&(X=S(l.pos-k,N))){let U=new Uint16Array(X.size-X.skip),V=l.pos-X.size,G=U.length;for(;l.pos>V;)G=w(X.start,U,G);q=new Qh(U,z-X.start,r),Y=X.start-_}else{let U=l.pos-P;l.next();let V=[],G=[],J=D>=o?D:-1,ne=0,de=z;for(;l.pos>U;)J>=0&&l.id==J&&l.size>=0?(l.end<=de-i&&(y(V,G,L,ne,l.end,de,J,H,B),ne=V.length,de=l.end),l.next()):I>2500?m(L,U,V,G):p(L,U,V,G,J,I+1);if(J>=0&&ne>0&&ne<V.length&&y(V,G,L,ne,L,de,J,H,B),V.reverse(),G.reverse(),J>-1&&ne>0){let fe=v(F,B);q=O6(F,V,G,0,V.length,0,z-L,fe,fe)}else q=x(F,V,G,z-L,H-z,B)}M.push(q),R.push(Y)}function m(_,k,M,R){let N=[],I=0,D=-1;for(;l.pos>k;){let{id:L,start:z,end:P,size:H}=l;if(H>4)l.next();else{if(D>-1&&z<D)break;D<0&&(D=P-i),N.push(L,z,P),I++,l.next()}}if(I){let L=new Uint16Array(I*4),z=N[N.length-2];for(let P=N.length-3,H=0;P>=0;P-=3)L[H++]=N[P],L[H++]=N[P+1]-z,L[H++]=N[P+2]-z,L[H++]=H;M.push(new Qh(L,N[2]-z,r)),R.push(z-_)}}function v(_,k){return(M,R,N)=>{let I=0,D=M.length-1,L,z;if(D>=0&&(L=M[D])instanceof di){if(!D&&L.type==_&&L.length==N)return L;(z=L.prop(dn.lookAhead))&&(I=R[D]+L.length+z)}return x(_,M,R,N,I,k)}}function y(_,k,M,R,N,I,D,L,z){let P=[],H=[];for(;_.length>R;)P.push(_.pop()),H.push(k.pop()+M-N);_.push(x(r.types[D],P,H,I-N,L-I,z)),k.push(N-M)}function x(_,k,M,R,N,I,D){if(I){let L=[dn.contextHash,I];D=D?[L].concat(D):[L]}if(N>25){let L=[dn.lookAhead,N];D=D?[L].concat(D):[L]}return new di(_,k,M,R,D)}function S(_,k){let M=l.fork(),R=0,N=0,I=0,D=M.end-i,L={size:0,start:0,skip:0};e:for(let z=M.pos-_;M.pos>z;){let P=M.size;if(M.id==k&&P>=0){L.size=R,L.start=N,L.skip=I,I+=4,R+=4,M.next();continue}let H=M.pos-P;if(P<0||H<z||M.start<D)break;let B=M.id>=o?4:0,F=M.start;for(M.next();M.pos>H;){if(M.size<0)if(M.size==-3||M.size==-4)B+=4;else break e;else M.id>=o&&(B+=4);M.next()}N=F,R+=P,I+=B}return(k<0||R==_)&&(L.size=R,L.start=N,L.skip=I),L.size>4?L:void 0}function w(_,k,M){let{id:R,start:N,end:I,size:D}=l;if(l.next(),D>=0&&R<o){let L=M;if(D>4){let z=l.pos-(D-4);for(;l.pos>z;)M=w(_,k,M)}k[--M]=L,k[--M]=I-_,k[--M]=N-_,k[--M]=R}else D==-3?h=R:D==-4&&(f=R);return M}let A=[],C=[];for(;l.pos>0;)p(t.start||0,t.bufferStart||0,A,C,-1,0);let j=(e=t.length)!==null&&e!==void 0?e:A.length?C[0]+A[0].length:0;return new di(c[t.topID],A.reverse(),C.reverse(),j)}const fN=new WeakMap;function zx(t,e){if(!t.isAnonymous||e instanceof Qh||e.type!=t)return 1;let n=fN.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof di)){n=1;break}n+=zx(t,r)}fN.set(e,n)}return n}function O6(t,e,n,r,i,s,o,l,c){let h=0;for(let y=r;y<i;y++)h+=zx(t,e[y]);let f=Math.ceil(h*1.5/8),p=[],m=[];function v(y,x,S,w,A){for(let C=S;C<w;){let j=C,_=x[C],k=zx(t,y[C]);for(C++;C<w;C++){let M=zx(t,y[C]);if(k+M>=f)break;k+=M}if(C==j+1){if(k>f){let M=y[j];v(M.children,M.positions,0,M.children.length,x[j]+A);continue}p.push(y[j])}else{let M=x[C-1]+y[C-1].length-_;p.push(O6(t,y,x,j,C,_,M,null,c))}m.push(_+A-s)}}return v(e,n,r,i,0),(l||c)(p,m,o)}class yf{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 yf(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,c=0,h=0;;l++){let f=l<n.length?n[l]:null,p=f?f.fromA:1e9;if(p-c>=r)for(;o&&o.from<p;){let m=o;if(c>=m.from||p<=m.to||h){let v=Math.max(m.from,c)-h,y=Math.min(m.to,p)-h;m=v>=y?null:new yf(v,y,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;c=f.toA,h=f.toA-f.toB}return i}}let Hq=class{startParse(e,n,r){return typeof e=="string"&&(e=new Vhe(e)),r=r?r.length?r.map(i=>new w_(i.from,i.to)):[new w_(0,0)]:[new w_(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 Vhe{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 dn({perNode:!0});var pN={};class LA{constructor(e,n,r,i,s,o,l,c,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=c,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 LA(e,[],n,r,r,0,[],0,i?new mN(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){i<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),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 c=this.stack.length-(r-1)*3-(e&262144?6:0),h=c?this.stack[c-2]:this.p.ranges[0].from;i<s.minRepeatTerm&&h==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let 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=c?this.stack[c-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[c];else{let v=this.stack[c-3];this.state=s.getGoto(v,i,!0)}for(;this.stack.length>c;)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.buffer.length;if(o>0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==r)return;if(this.buffer[o-2]>=n){this.buffer[o-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 c=o;c>0&&this.buffer[c-2]>r;c-=4)if(this.buffer[c-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&&e.buffer[n-4]==0&&(n-=4);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 LA(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 Ghe(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,c)=>c&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 c=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],c,!1)>=0)return l<<19|65536|c}}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 mN(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 mN{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Ghe{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 BA{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 BA(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 BA(this.stack,this.pos,this.index)}}function I1(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 c=o-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class qx{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const gN=new qx;class Xhe{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=gN,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=gN,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 Zp{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;Khe(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Zp.prototype.contextual=Zp.prototype.fallback=Zp.prototype.extend=!1;Zp.prototype.fallback=Zp.prototype.extend=!1;function Khe(t,e,n,r,i,s){let o=0,l=1<<r,{dialect:c}=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 y=t[v];if(c.allows(y)&&(e.token.value==-1||e.token.value==y||Zhe(y,e.token.value,i,s))){e.acceptToken(y);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,y=h+v+(v<<1),x=t[y],S=t[y+1]||65536;if(f<x)m=v;else if(f>=S)p=v+1;else{o=t[y+2],e.advance();continue e}}break}}function vN(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function Zhe(t,e,n,r){let i=vN(n,r,e);return i<0||vN(n,r,t)<i}const Oa=typeof process<"u"&&pN&&/\bparse\b/.test(pN.LOG);let S_=null;function bN(t,e,n){let r=t.cursor(ni.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 Jhe{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?bN(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?bN(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 di){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let c=s.prop(dn.lookAhead);if(!c||l+c<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 ede{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new qx)}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,c=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&&(c=Math.max(p.lookAhead,c)),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 c&&e.setLookAhead(c),!r&&e.pos==this.stream.end&&(r=new qx,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 qx,{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 c=0;c<2;c++)for(let h=o.stateSlot(s,c?2:1);;h+=3){if(l[h]==65535)if(l[h+1]==1)h=Xc(l,h+2);else{i==0&&l[h+1]==2&&(i=this.putAction(Xc(l,h+2),n,r,i));break}l[h]==n&&(i=this.putAction(Xc(l,h+1),n,r,i))}return i}}class tde{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 Xhe(n,i),this.tokens=new ede(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[LA.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.bufferLength*4?new Jhe(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 c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!r.length){let o=i&&rde(i);if(o)return Oa&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Oa&&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 Oa&&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,c)=>c.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 c=o+1;c<r.length;c++){let h=r[c];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(c--,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=Oa?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(dn.contextHash)||0)==f))return e.useNode(p,m),Oa&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(p.type.id)})`),!0;if(!(p instanceof di)||p.children.length==0||p.positions[0]>0)break;let v=p.children[0];if(v instanceof di&&p.positions[0]==0)p=v;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Oa&&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 c=this.tokens.getActions(e);for(let h=0;h<c.length;){let f=c[h++],p=c[h++],m=c[h++],v=h==c.length||!r,y=v?e:e.split(),x=this.tokens.mainToken;if(y.apply(f,p,x?x.start:y.pos,m),Oa&&console.log(o+this.stackID(y)+` (via ${(f&65536)==0?"shift":`reduce of ${s.getName(f&65535)}`} for ${s.getName(p)} @ ${i}${y==e?"":", split"})`),v)return!0;y.pos>i?n.push(y):r.push(y)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return yN(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],c=n[o<<1],h=n[(o<<1)+1],f=Oa?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Oa&&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()&&(Oa&&console.log(m+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,r));v++)Oa&&(m=this.stackID(p)+" -> ");for(let v of l.recoverByInsert(c))Oa&&console.log(f+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,r);this.stream.end>l.pos?(h==l.pos&&(h++,c=0),l.recoverByDelete(c,h),Oa&&console.log(f+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),yN(l,r)):(!i||i.score<p.score)&&(i=p)}return i}stackToTree(e){return e.close(),di.build({buffer:BA.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=(S_||(S_=new WeakMap)).get(e);return n||S_.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function yN(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 nde{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}class PA extends Hq{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,c,h){i[l].push([c,c.deserialize(String(h))])}if(e.nodeProps)for(let l of e.nodeProps){let c=l[0];typeof c=="string"&&(c=dn[c]);for(let h=1;h<l.length;){let f=l[h++];if(f>=0)s(f,c,l[h++]);else{let p=l[h+-f];for(let m=-f;m>0;m--)s(l[h++],c,p);h++}}}this.nodeSet=new _6(n.map((l,c)=>va.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:i[c],top:r.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Bq;let o=I1(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(xN),this.states=I1(e.states,Uint32Array),this.data=I1(e.stateData),this.goto=I1(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Zp(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 tde(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,c=i[s++];if(l&&r)return c;for(let h=s+(o>>1);s<h;s++)if(i[s]==e)return c;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=Xc(r,s+2)];else{if(r[s+1]==2)return Xc(r,s+2);break}if(o==n||o==0)return Xc(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=Xc(this.data,s+2);else break;i=n(Xc(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=Xc(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(PA.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]=xN(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 nde(e,r,i)}static deserialize(e){return new PA(e)}}function Xc(t,e){return t[e]|t[e+1]<<16}function rde(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 xN(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}let ide=0;class go{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=ide++}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 go&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new go(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 FA(e);return r=>r.modified.indexOf(n)>-1?r:FA.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let sde=0;class FA{constructor(e){this.name=e,this.instances=[],this.id=sde++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(l=>l.base==e&&ade(n,l.modified));if(r)return r;let i=[],s=new go(e.name,i,e,n);for(let l of n)l.instances.push(s);let o=ode(n);for(let l of e.set)if(!l.modified.length)for(let c of o)i.push(FA.get(l,c));return s}}function ade(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function ode(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 zq(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 c=s.length-1,h=s[c];if(!h)throw new RangeError("Invalid path: "+i);let f=new Dv(r,o,c>0?s.slice(0,c):null);e[h]=f.sort(e[h])}}return qq.add(e)}const qq=new dn({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 Dv(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class Dv{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}}Dv.empty=new Dv([],2,null);function Qq(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 c of l.set){let h=n[c.id];if(h){o=o?o+" "+h:h;break}}return o},scope:r}}function lde(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function cde(t,e,n,r=0,i=t.length){let s=new ude(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class ude{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:c}=e;if(l>=r||c<=n)return;o.isTop&&(s=this.highlighters.filter(v=>!v.scope||v.scope(o)));let h=i,f=hde(e)||Dv.empty,p=lde(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(dn.mounted);if(m&&m.overlay){let v=e.node.enter(m.overlay[0].from+l,1),y=this.highlighters.filter(S=>!S.scope||S.scope(m.tree.type)),x=e.firstChild();for(let S=0,w=l;;S++){let A=S<m.overlay.length?m.overlay[S]:null,C=A?A.from+l:c,j=Math.max(n,w),_=Math.min(r,C);if(j<_&&x)for(;e.from<_&&(this.highlightRange(e,j,_,i,s),this.startSpan(Math.min(_,e.to),h),!(e.to>=C||!e.nextSibling())););if(!A||C>r)break;w=A.to+l,w>n&&(this.highlightRange(v.cursor(),Math.max(n,A.from+l),Math.min(r,w),"",y),this.startSpan(Math.min(r,w),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 hde(t){let e=t.type.prop(qq);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const dt=go.define,L1=dt(),gh=dt(),AN=dt(gh),wN=dt(gh),vh=dt(),B1=dt(vh),j_=dt(vh),Il=dt(),Nd=dt(Il),El=dt(),Ml=dt(),K3=dt(),Ag=dt(K3),P1=dt(),ge={comment:L1,lineComment:dt(L1),blockComment:dt(L1),docComment:dt(L1),name:gh,variableName:dt(gh),typeName:AN,tagName:dt(AN),propertyName:wN,attributeName:dt(wN),className:dt(gh),labelName:dt(gh),namespace:dt(gh),macroName:dt(gh),literal:vh,string:B1,docString:dt(B1),character:dt(B1),attributeValue:dt(B1),number:j_,integer:dt(j_),float:dt(j_),bool:dt(vh),regexp:dt(vh),escape:dt(vh),color:dt(vh),url:dt(vh),keyword:El,self:dt(El),null:dt(El),atom:dt(El),unit:dt(El),modifier:dt(El),operatorKeyword:dt(El),controlKeyword:dt(El),definitionKeyword:dt(El),moduleKeyword:dt(El),operator:Ml,derefOperator:dt(Ml),arithmeticOperator:dt(Ml),logicOperator:dt(Ml),bitwiseOperator:dt(Ml),compareOperator:dt(Ml),updateOperator:dt(Ml),definitionOperator:dt(Ml),typeOperator:dt(Ml),controlOperator:dt(Ml),punctuation:K3,separator:dt(K3),bracket:Ag,angleBracket:dt(Ag),squareBracket:dt(Ag),paren:dt(Ag),brace:dt(Ag),content:Il,heading:Nd,heading1:dt(Nd),heading2:dt(Nd),heading3:dt(Nd),heading4:dt(Nd),heading5:dt(Nd),heading6:dt(Nd),contentSeparator:dt(Il),list:dt(Il),quote:dt(Il),emphasis:dt(Il),strong:dt(Il),link:dt(Il),monospace:dt(Il),strikethrough:dt(Il),inserted:dt(),deleted:dt(),changed:dt(),invalid:dt(),meta:P1,documentMeta:dt(P1),annotation:dt(P1),processingInstruction:dt(P1),definition:go.defineModifier("definition"),constant:go.defineModifier("constant"),function:go.defineModifier("function"),standard:go.defineModifier("standard"),local:go.defineModifier("local"),special:go.defineModifier("special")};for(let t in ge){let e=ge[t];e instanceof go&&(e.name=t)}Qq([{tag:ge.link,class:"tok-link"},{tag:ge.heading,class:"tok-heading"},{tag:ge.emphasis,class:"tok-emphasis"},{tag:ge.strong,class:"tok-strong"},{tag:ge.keyword,class:"tok-keyword"},{tag:ge.atom,class:"tok-atom"},{tag:ge.bool,class:"tok-bool"},{tag:ge.url,class:"tok-url"},{tag:ge.labelName,class:"tok-labelName"},{tag:ge.inserted,class:"tok-inserted"},{tag:ge.deleted,class:"tok-deleted"},{tag:ge.literal,class:"tok-literal"},{tag:ge.string,class:"tok-string"},{tag:ge.number,class:"tok-number"},{tag:[ge.regexp,ge.escape,ge.special(ge.string)],class:"tok-string2"},{tag:ge.variableName,class:"tok-variableName"},{tag:ge.local(ge.variableName),class:"tok-variableName tok-local"},{tag:ge.definition(ge.variableName),class:"tok-variableName tok-definition"},{tag:ge.special(ge.variableName),class:"tok-variableName2"},{tag:ge.definition(ge.propertyName),class:"tok-propertyName tok-definition"},{tag:ge.typeName,class:"tok-typeName"},{tag:ge.namespace,class:"tok-namespace"},{tag:ge.className,class:"tok-className"},{tag:ge.macroName,class:"tok-macroName"},{tag:ge.propertyName,class:"tok-propertyName"},{tag:ge.operator,class:"tok-operator"},{tag:ge.comment,class:"tok-comment"},{tag:ge.meta,class:"tok-meta"},{tag:ge.invalid,class:"tok-invalid"},{tag:ge.punctuation,class:"tok-punctuation"}]);const dde=181,fde=182,pde=1,mde=2,gde=3,vde=4,bde=5,yde=6,xde=7,Ade=8,wde=9,Sde=10,jde=11,Cde=12,_de=13,Tde=14,kde=15,Ode=16,Ede=17,Mde=18,Rde=19,Dde=20,Nde=21,Ide=22,Lde=23,Bde=24,Pde=25,Fde=26,SN=27,jN=28,CN=29,_N=30,$de=31,Hde=32,zde=33,qde=34,Qde=35,Ude={inf:dde,nan:fde,bool:pde,ignoring:mde,on:gde,group_left:vde,group_right:bde,offset:yde},TN=(t,e)=>Ude[t.toLowerCase()]||-1,Wde={avg:Ade,atan2:xde,bottomk:wde,count:Sde,count_values:jde,group:Cde,max:_de,min:Tde,quantile:kde,limitk:Ode,limit_ratio:Ede,stddev:Mde,stdvar:Rde,sum:Dde,topk:Nde,by:Ide,without:Lde,and:Bde,or:Pde,unless:Fde,smoothed:$de,anchored:Hde,fill:zde,fill_left:qde,fill_right:Qde},kN=(t,e)=>{if(t==="start"&&e.canShift(SN))return SN;if(t==="end"&&e.canShift(jN))return jN;if(t.toLowerCase()==="start"&&e.canShift(CN))return CN;if(t.toLowerCase()==="end"&&e.canShift(_N))return _N;const n=Wde[t.toLowerCase()];return n!==void 0&&e.canShift(n)?n:-1},Yde=zq({LineComment:ge.comment,LabelName:ge.labelName,StringLiteral:ge.string,NumberDurationLiteral:ge.number,NumberDurationLiteralInDurationContext:ge.number,Identifier:ge.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 EndFn 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 Range Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc SortByLabel SortByLabelDesc Sqrt StartFn Step StddevOverTime StdvarOverTime SumOverTime Tan Tanh Time Timestamp Vector Year":ge.function(ge.variableName),"Avg Bottomk Count Count_values Group LimitK LimitRatio Max Min Quantile Stddev Stdvar Sum Topk":ge.operatorKeyword,"AtModifierPreprocessors By Without Bool On Ignoring GroupLeft GroupRight Offset Smoothed Anchored":ge.modifier,"And Unless Or":ge.logicOperator,"Sub Add Mul Mod Div Atan2 Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow At":ge.operator,UnaryOp:ge.arithmeticOperator,"( )":ge.paren,"[ ]":ge.squareBracket,"{ }":ge.brace,"⚠":ge.invalid}),Vde={__proto__:null,absent_over_time:387,absent:389,abs:391,acos:393,acosh:395,asin:397,asinh:399,atan:401,atanh:403,avg_over_time:405,ceil:407,changes:409,clamp:411,clamp_max:413,clamp_min:415,cos:417,cosh:419,count_over_time:421,days_in_month:423,day_of_month:425,day_of_week:427,day_of_year:429,deg:431,delta:433,deriv:435,exp:437,first_over_time:439,floor:441,histogram_count:443,histogram_fraction:445,histogram_quantile:447,histogram_quantiles:449,histogram_stddev:451,histogram_stdvar:453,histogram_sum:455,histogram_avg:457,double_exponential_smoothing:459,hour:461,idelta:463,increase:465,info:467,irate:469,label_replace:471,label_join:473,last_over_time:475,ln:477,log10:479,log2:481,mad_over_time:483,max_over_time:485,min_over_time:487,ts_of_first_over_time:489,ts_of_max_over_time:491,ts_of_min_over_time:493,ts_of_last_over_time:495,minute:497,month:499,pi:501,predict_linear:503,present_over_time:505,quantile_over_time:507,rad:509,rate:511,resets:513,round:515,scalar:517,sgn:519,sin:521,sinh:523,sort:525,sort_desc:527,sort_by_label:529,sort_by_label_desc:531,range:533,step:535,sqrt:537,stddev_over_time:539,stdvar_over_time:541,sum_over_time:543,tan:545,tanh:547,timestamp:549,time:551,vector:553,year:555},Gde=PA.deserialize({version:14,states:"=WOYQPOOO(dQPOOOOQO'#DT'#DTO(iQPO'#DSOOQO'#Db'#DbO(tQPO'#FvQ0XQQOOOOQO'#Ds'#DsO(oQPO'#DrOYQPO'#FsOYQPO'#FuO1rQSO'#FxO1}QQO'#FwOOQO'#Fw'#FwOOQO'#G]'#G]OOQO'#Dt'#DtOOQO'#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'#FfOOQO'#Fg'#FgOOQO'#Fh'#FhOOQO'#Fi'#FiOOQO'#Fj'#FjOOQO'#Fk'#FkOOQO'#Fl'#FlOOQO'#Fm'#FmQOQPOOO3tQPO'#DUO3yQPO'#DZO(oQPO,59nO4QQQO,59nOOQO,59|,59|O5zQPO,59vO5zQPO,59vO5zQPO,59vO5zQPO,59vO5zQPO,59vO=hQPO,5<YO=hQPO,5<[OOQO,5<],5<]OOQO,5<^,5<^O>[QPO,5<kOOQO,5:^,5:^O>fQQO,5<_O>mQQO,5<aOOQO'#DX'#DXO@aQPO'#FyO@oQPO,5<dOOQO,5<d,5<dO@{QPO,5<dOOQO,5<c,5<cOATQSO'#DVOOQO,59p,59pOOQO,59u,59uOA`QQO,59uOOQO1G/Y1G/YOOQO'#D^'#D^O3tQPO'#D_OAjQPO'#DaOAoQPO'#DcOAtQPO'#DdOOQO'#D`'#D`OITQPO'#D`OI[QPO'#D`OOQO'#Ga'#GaOIcQPO'#GaO!!vQPO'#GaOYQPO1G/bOYQPO1G/bOYQPO1G/bOYQPO1G/bOYQPO1G/bOOQO'#Fo'#FoO!#QQPO'#FoO!#]QSO1G1tOOQO1G1v1G1vO!#eQPO'#DbOOQO'#GR'#GROOQO1G2V1G2VO!#pQPO1G2VOOQO1G1y1G1yOOQO'#Fz'#FzO!#uQPO,5<eO!#zQPO,5<jO!$PQSO1G2OO!$[QPO1G2OOOQO1G2O1G2OOOQO,59q,59qO!$dQPO,59qOYQPO'#GUO!$lQPO1G/aOOQO1G/a1G/aO!$tQPO,59yO=yQPO,59{O=yQPO,59}O=yQPO,5:OOOQO,59z,59zOOQO,5<{,5<{O!,_QPO,5<{O!5YQQO7+$|O!5jQQO7+$|O!7UQQO7+$|O!7rQQO7+$|O!9gQQO7+$|OOQO,5<Z,5<ZOOQO7+'`7+'`O!:WQPO7+'fO!:_QPO7+'qOOQO1G2P1G2POOQO1G2U1G2UO!:dQPO,5<qOOQO,5<q,5<qOOQO7+'j7+'jO!:xQSO7+'jOOQO-E:T-E:TO!;TQSO1G/]O!;`QPO1G/]OOQO1G/]1G/]O!;hQQO,5<pOOQO-E:S-E:SOOQO7+${7+${O!;rQPO1G/eO!CVQPO1G/gO!C[QPO1G/iO!CaQPO1G/jOOQO1G2g1G2gOOQO<<KQ<<KQO!CfQPO<<KQOOQO<<K]<<K]OOQO<<KU<<KUP!CkQSO'#GVOOQO,5<o,5<oOOQO7+$w7+$wO!CsQSO7+$wOOQO-E:R-E:ROOQO7+%P7+%POOQO7+%R7+%ROOQO7+%T7+%TOOQO7+%U7+%UOOQOAN@lAN@lOOQO<<Hc<<HcP!DOQSO'#GT",stateData:"!DW~O%OOStOS~OWQOXQOYQOZQO[QO]QO^QO_QO`QOaQObQOcQOdQOeQOkVOlVO|^O!i[O${SO$|SO%QXO%UTO%VTO%WSO%X_O%Y`O%ZaO%[bO%]cO%^dO%_eO%`fO%agO%bhO%ciO%djO%ekO%flO%gmO%hnO%ioO%jpO%kqO%lrO%msO%ntO%ouO%pvO%qwO%rxO%syO%tzO%u{O%v|O%w}O%x!OO%y!PO%z!QO%{!RO%|!SO%}!TO&O!UO&P!VO&Q!WO&R!XO&S!YO&T!ZO&U![O&V!]O&W!^O&X!_O&Y!`O&Z!aO&[!bO&]!cO&^!dO&_!eO&`!fO&a!gO&b!hO&c!iO&d!jO&e!kO&f!lO&g!mO&h!nO&i!oO&j!pO&k!qO&l!rO&m!sO&n!tO&o!uO&p!vO&q!wO&r!xO&s!yO&t!zO&u!{O&v!|O&w!}O&x#OO&y#PO&z#QO&{#RO&|#SO&}#TO'O#UO'P#VO'TZO~O!i#WO~Of#XOg#XO%Q#YO~O${#]O$|#]O%W#]OW$jXX$jXY$jXZ$jX[$jX]$jX^$jX_$jX`$jXa$jXb$jXc$jXd$jXe$jXk$jXl$jX|$jX!i$jX${$jX$|$jX%Q$jX%U$jX%V$jX%W$jX%X$jX%Y$jX%Z$jX%[$jX%]$jX%^$jX%_$jX%`$jX%a$jX%b$jX%c$jX%d$jX%e$jX%f$jX%g$jX%h$jX%i$jX%j$jX%k$jX%l$jX%m$jX%n$jX%o$jX%p$jX%q$jX%r$jX%s$jX%t$jX%u$jX%v$jX%w$jX%x$jX%y$jX%z$jX%{$jX%|$jX%}$jX&O$jX&P$jX&Q$jX&R$jX&S$jX&T$jX&U$jX&V$jX&W$jX&X$jX&Y$jX&Z$jX&[$jX&]$jX&^$jX&_$jX&`$jX&a$jX&b$jX&c$jX&d$jX&e$jX&f$jX&g$jX&h$jX&i$jX&j$jX&k$jX&l$jX&m$jX&n$jX&o$jX&p$jX&q$jX&r$jX&s$jX&t$jX&u$jX&v$jX&w$jX&x$jX&y$jX&z$jX&{$jX&|$jX&}$jX'O$jX'P$jX'T$jX~OU#dOV#^Oh#aOi#bOj#aOo#fOp#eO!P#^O!X#^O!Y#^O!Z#^O![#_O!]#_O!^#`O!_#`O!`#`O!a#`O!b#`O!c#`O!d#`O!e#`O$t#gO'Q#cO~Oz#lO|#kO'U#nO~O'TZOU$kXV$kXh$kXi$kXj$kXo$kXp$kX!P$kX!X$kX!Y$kX!Z$kX![$kX!]$kX!^$kX!_$kX!`$kX!a$kX!b$kX!c$kX!d$kX!e$kX$t$kX$z$kX'Q$kX%S$kX%R$kX~O%Q#qO~O%S#sO~PYOf#XOg#XOUvaVvahvaivajvaovapva!Pva!Xva!Yva!Zva![va!]va!^va!_va!`va!ava!bva!cva!dva!eva$tva$zva'Qva%Sva%Rva~OP#vOQ#wOR#wOq#xOr#yOs#zOW%TPX%TPY%TPZ%TP[%TP]%TP^%TP_%TP`%TPa%TPb%TPc%TPd%TPe%TPk%TPl%TP|%TP!i%TP${%TP$|%TP%Q%TP%U%TP%V%TP%W%TP%X%TP%Y%TP%Z%TP%[%TP%]%TP%^%TP%_%TP%`%TP%a%TP%b%TP%c%TP%d%TP%e%TP%f%TP%g%TP%h%TP%i%TP%j%TP%k%TP%l%TP%m%TP%n%TP%o%TP%p%TP%q%TP%r%TP%s%TP%t%TP%u%TP%v%TP%w%TP%x%TP%y%TP%z%TP%{%TP%|%TP%}%TP&O%TP&P%TP&Q%TP&R%TP&S%TP&T%TP&U%TP&V%TP&W%TP&X%TP&Y%TP&Z%TP&[%TP&]%TP&^%TP&_%TP&`%TP&a%TP&b%TP&c%TP&d%TP&e%TP&f%TP&g%TP&h%TP&i%TP&j%TP&k%TP&l%TP&m%TP&n%TP&o%TP&p%TP&q%TP&r%TP&s%TP&t%TP&u%TP&v%TP&w%TP&x%TP&y%TP&z%TP&{%TP&|%TP&}%TP'O%TP'P%TP'T%TP~O${$WO$|$WO%U$XO%V$XO%W$WO~O${SO$|SO%U$[O%V$[O%WSO~Om$]On$]O~P=yO%S$`O~P0XO!P#^OU$iaV$iah$iai$iaj$iao$iap$ia!X$ia!Y$ia!Z$ia![$ia!]$ia!^$ia!_$ia!`$ia!a$ia!b$ia!c$ia!d$ia!e$ia$t$ia$z$ia'Q$ia%S$ia%R$ia~O!e$aO$o$aO$p$aO$q$aO~O!e$aO$o$aO$p$aO$q$aO%R$dO'U$fO~Oz$hO|#kO%S$gO~O%R$iO%S$kO~P0XO%Q$mO~O%Q$nO~O%Q$oO~OW!SXX!SXY!SXZ!SX[!SX]!SX^!SX_!SX`!SXa!SXb!SXc!SXd!SXe!SXk!SXl!SX|!SX!i!SX${!SX$|!SX%Q!SX%U!SX%V!SX%W!SX%X!SX%Y!SX%Z!SX%[!SX%]!SX%^!SX%_!SX%`!SX%a!SX%b!SX%c!SX%d!SX%e!SX%f!SX%g!SX%h!SX%i!SX%j!SX%k!SX%l!SX%m!SX%n!SX%o!SX%p!SX%q!SX%r!SX%s!SX%t!SX%u!SX%v!SX%w!SX%x!SX%y!SX%z!SX%{!SX%|!SX%}!SX&O!SX&P!SX&Q!SX&R!SX&S!SX&T!SX&U!SX&V!SX&W!SX&X!SX&Y!SX&Z!SX&[!SX&]!SX&^!SX&_!SX&`!SX&a!SX&b!SX&c!SX&d!SX&e!SX&f!SX&g!SX&h!SX&i!SX&j!SX&k!SX&l!SX&m!SX&n!SX&o!SX&p!SX&q!SX&r!SX&s!SX&t!SX&u!SX&v!SX&w!SX&x!SX&y!SX&z!SX&{!SX&|!SX&}!SX'O!SX'P!SX'T!SX~Os#zO~PAyOr#yO~PAyOq#xOr#yOs#zOW%TXX%TXY%TXZ%TX[%TX]%TX^%TX_%TX`%TXa%TXb%TXc%TXd%TXe%TXk%TXl%TX|%TX!i%TX${%TX$|%TX%Q%TX%U%TX%V%TX%W%TX%X%TX%Y%TX%Z%TX%[%TX%]%TX%^%TX%_%TX%`%TX%a%TX%b%TX%c%TX%d%TX%e%TX%f%TX%g%TX%h%TX%i%TX%j%TX%k%TX%l%TX%m%TX%n%TX%o%TX%p%TX%q%TX%r%TX%s%TX%t%TX%u%TX%v%TX%w%TX%x%TX%y%TX%z%TX%{%TX%|%TX%}%TX&O%TX&P%TX&Q%TX&R%TX&S%TX&T%TX&U%TX&V%TX&W%TX&X%TX&Y%TX&Z%TX&[%TX&]%TX&^%TX&_%TX&`%TX&a%TX&b%TX&c%TX&d%TX&e%TX&f%TX&g%TX&h%TX&i%TX&j%TX&k%TX&l%TX&m%TX&n%TX&o%TX&p%TX&q%TX&r%TX&s%TX&t%TX&u%TX&v%TX&w%TX&x%TX&y%TX&z%TX&{%TX&|%TX&}%TX'O%TX'P%TX'T%TX~OQ#wOR#wO~PIcO${$xO$|$xO%W$xO~O'R$yO'S$zO~O${#]O$|#]O%W#]O~O%Q${O~O|$|O~O|$}O~Oz#lO|#kO'U%QO~O%R%RO'U%QO~O%R%TO%S%VO~O%R$iO%S%YO~OS%ZOT%ZOW!RaX!RaY!RaZ!Ra[!Ra]!Ra^!Ra_!Ra`!Raa!Rab!Rac!Rad!Rae!Rak!Ral!Raq!Rar!Ras!Ra|!Ra!i!Ra${!Ra$|!Ra%Q!Ra%U!Ra%V!Ra%W!Ra%X!Ra%Y!Ra%Z!Ra%[!Ra%]!Ra%^!Ra%_!Ra%`!Ra%a!Ra%b!Ra%c!Ra%d!Ra%e!Ra%f!Ra%g!Ra%h!Ra%i!Ra%j!Ra%k!Ra%l!Ra%m!Ra%n!Ra%o!Ra%p!Ra%q!Ra%r!Ra%s!Ra%t!Ra%u!Ra%v!Ra%w!Ra%x!Ra%y!Ra%z!Ra%{!Ra%|!Ra%}!Ra&O!Ra&P!Ra&Q!Ra&R!Ra&S!Ra&T!Ra&U!Ra&V!Ra&W!Ra&X!Ra&Y!Ra&Z!Ra&[!Ra&]!Ra&^!Ra&_!Ra&`!Ra&a!Ra&b!Ra&c!Ra&d!Ra&e!Ra&f!Ra&g!Ra&h!Ra&i!Ra&j!Ra&k!Ra&l!Ra&m!Ra&n!Ra&o!Ra&p!Ra&q!Ra&r!Ra&s!Ra&t!Ra&u!Ra&v!Ra&w!Ra&x!Ra&y!Ra&z!Ra&{!Ra&|!Ra&}!Ra'O!Ra'P!Ra'T!Ra~Oq#xOr#yOs#zOW%TaX%TaY%TaZ%Ta[%Ta]%Ta^%Ta_%Ta`%Taa%Tab%Tac%Tad%Tae%Tak%Tal%Ta|%Ta!i%Ta${%Ta$|%Ta%Q%Ta%U%Ta%V%Ta%W%Ta%X%Ta%Y%Ta%Z%Ta%[%Ta%]%Ta%^%Ta%_%Ta%`%Ta%a%Ta%b%Ta%c%Ta%d%Ta%e%Ta%f%Ta%g%Ta%h%Ta%i%Ta%j%Ta%k%Ta%l%Ta%m%Ta%n%Ta%o%Ta%p%Ta%q%Ta%r%Ta%s%Ta%t%Ta%u%Ta%v%Ta%w%Ta%x%Ta%y%Ta%z%Ta%{%Ta%|%Ta%}%Ta&O%Ta&P%Ta&Q%Ta&R%Ta&S%Ta&T%Ta&U%Ta&V%Ta&W%Ta&X%Ta&Y%Ta&Z%Ta&[%Ta&]%Ta&^%Ta&_%Ta&`%Ta&a%Ta&b%Ta&c%Ta&d%Ta&e%Ta&f%Ta&g%Ta&h%Ta&i%Ta&j%Ta&k%Ta&l%Ta&m%Ta&n%Ta&o%Ta&p%Ta&q%Ta&r%Ta&s%Ta&t%Ta&u%Ta&v%Ta&w%Ta&x%Ta&y%Ta&z%Ta&{%Ta&|%Ta&}%Ta'O%Ta'P%Ta'T%Ta~O!P#^OU!Oqh!Oqi!Oqj!Oqo!Oqp!Oq![!Oq!]!Oq!^!Oq!_!Oq!`!Oq!a!Oq!b!Oq!c!Oq!d!Oq!e!Oq$t!Oq$z!Oq'Q!Oq%S!Oq%R!Oq~OV!Oq!X!Oq!Y!Oq!Z!Oq~P!3rOV#^O!X#^O!Y#^O!Z#^O~P!3rOV#^O!P#^O!X#^O!Y#^O!Z#^O![#_O!]#_OU!Oqh!Oqi!Oqj!Oqo!Oqp!Oq$t!Oq$z!Oq'Q!Oq%S!Oq%R!Oq~O!^!Oq!_!Oq!`!Oq!a!Oq!b!Oq!c!Oq!d!Oq!e!Oq~P!5zO!^#`O!_#`O!`#`O!a#`O!b#`O!c#`O!d#`O!e#`O~P!5zOV#^Oh#aOj#aO!P#^O!X#^O!Y#^O!Z#^O![#_O!]#_O!^#`O!_#`O!`#`O!a#`O!b#`O!c#`O!d#`O!e#`O~OU!Oqi!Oqo!Oqp!Oq$t!Oq$z!Oq'Q!Oq%S!Oq%R!Oq~P!8`O'R%`O~P=hO%S%bO~O!e$aO$o$aO$p$aO$q$aO%R$ya'U$ya~Oz#lO|#kO'U%cO~Oz%eO|#kO%S%fO~O%R%gO%S%fO~O%R$xa%S$xa~P0XO%Q#qOW!RiX!RiY!RiZ!Ri[!Ri]!Ri^!Ri_!Ri`!Ria!Rib!Ric!Rid!Rie!Rik!Ril!Riq!Rir!Ris!Ri|!Ri!i!Ri${!Ri$|!Ri%U!Ri%V!Ri%W!Ri%X!Ri%Y!Ri%Z!Ri%[!Ri%]!Ri%^!Ri%_!Ri%`!Ri%a!Ri%b!Ri%c!Ri%d!Ri%e!Ri%f!Ri%g!Ri%h!Ri%i!Ri%j!Ri%k!Ri%l!Ri%m!Ri%n!Ri%o!Ri%p!Ri%q!Ri%r!Ri%s!Ri%t!Ri%u!Ri%v!Ri%w!Ri%x!Ri%y!Ri%z!Ri%{!Ri%|!Ri%}!Ri&O!Ri&P!Ri&Q!Ri&R!Ri&S!Ri&T!Ri&U!Ri&V!Ri&W!Ri&X!Ri&Y!Ri&Z!Ri&[!Ri&]!Ri&^!Ri&_!Ri&`!Ri&a!Ri&b!Ri&c!Ri&d!Ri&e!Ri&f!Ri&g!Ri&h!Ri&i!Ri&j!Ri&k!Ri&l!Ri&m!Ri&n!Ri&o!Ri&p!Ri&q!Ri&r!Ri&s!Ri&t!Ri&u!Ri&v!Ri&w!Ri&x!Ri&y!Ri&z!Ri&{!Ri&|!Ri&}!Ri'O!Ri'P!Ri'T!Ri~O%S%jO~O%S%kO~O%S%lO~O'R%mO~Oz#lO|#kO~Oz%eO|#kO%S%nO~Oz%eO|#kO~O",goto:"+l%UPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP%V%c%o%uP&OP&`%VP&i&p&z'Y'd'|(ZPPPPPPPPPPPPP%V(h(tP(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t%V)Q%V%V%V%V%V%V)Z%V)g)v*OPPP)v%VP*VP*Y*`*fPPPPP*mPPP+]e^OXY#Y$R$S$T$U$V$ieROXY#Y$R$S$T$U$V$iQ#ZRR#u#[Q#r#XQ$l#wR%i%ZQ#mZQ$h#qU%O$d%R%dV%e%T%g%oQ#[RQ#hWR#u#ZZ$Q#^#_#`#a#bY$P#^#_#`#a#bR$r$QY$O#^#_#`#a#bS$q$P$QR%_$ra#{#^#_#`#a#b$P$Q$rd^OXY#Y$R$S$T$U$V$iQ$^#gQ%[$mQ%]$nR%^$o`#|#^#_#`#a#b$P$Q$rR$p#}`#}#^#_#`#a#b$P$Q$rR$p#|eWOXY#Y$R$S$T$U$V$ieVOXY#Y$R$S$T$U$V$iQ$Y#cQ$Z#dR%a$zeYOXY#Y$R$S$T$U$V$id]OXY#Y$R$S$T$U$V$iR#p[Q#oZV%P$d%R%dQ$b#lT$c#m%OR$_#gQ%U$hR%h%UQ$j#tR%X$jS$e#m#oR%S$eQUOQ#iXQ#jYQ#t#YQ$s$RQ$t$SQ$u$TQ$v$UQ$w$VR%W$iQ$R#^Q$S#_Q$T#`Q$U#aR$V#b",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 StartFn EndFn AtStart AtEnd 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 TrimUpper TrimLower 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 HistogramQuantiles 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 Range Step 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:282,nodeProps:[["group",-14,38,44,46,52,68,156,158,159,160,161,162,163,165,173,"Expr"]],propSources:[Yde],skippedNodes:[0,36],repeatNodeCount:3,tokenData:"4{~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!_!`2a!`!a2v!b!c3]!c!}3b!}#O3x#P#Q3}#Q#R4S#R#S3b#S#T4X#T#o3b#o#p4q#q#r4v#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%O~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!e~~$tO$q~~$yW|~OY$tZr$trs%cs#O$t#O#P%h#P;'S$t;'S;=`&f<%lO$t~%hO|~~%kRO;'S$t;'S;=`%t;=`O$t~%yX|~OY$tZr$trs%cs#O$t#O#P%h#P;'S$t;'S;=`&f;=`<%l$t<%lO$t~&iP;=`<%l$t~&qSt~OY&lZ;'S&l;'S;=`&}<%lO&l~'QP;=`<%l&l~'YO!Z~~'_W|~OY'YZw'Ywx%cx#O'Y#O#P'w#P;'S'Y;'S;=`(u<%lO'Y~'zRO;'S'Y;'S;=`(T;=`O'Y~(YX|~OY'YZw'Ywx%cx#O'Y#O#P'w#P;'S'Y;'S;=`(u;=`<%l'Y<%lO'Y~(xP;=`<%l'Y~)QO%Q~~)VO%S~~)[O!X~R)cO%VP![Q~)hO%R~R)oO%UP!]Q~)rP!Q![)u~)zS%W~!Q![)u!g!h*W#R#S)o#X#Y*W~*ZR{|*d}!O*d!Q![*j~*gP!Q![*j~*oQ%W~!Q![*j#R#S*d~*zO!Y~~+P[%W~!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%W~!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%W~!O!P)o!Q![,s!g!h*W#R#S,m#X#Y*W~-^P%W~!Q![-a~-dS!Q![-a#[#]-p#a#b.U#g#h.x~-uP%W~!Q![-x~-{R!Q![-x#a#b.U#g#h.x~.ZQ%W~!Q![.a#g#h.s~.dR!Q![.a#a#b.m#g#h.x~.pP#g#h.s~.xO%W~~.}P%W~!Q![/Q~/TQ!Q![/Q#a#b.m~/`P%W~!Q![/c~/fT!Q![/c#W#X-X#[#]-p#a#b.U#g#h.x~/zP%W~!Q![/}~0QU!Q![/}#W#X-X#[#]-p#a#b.U#g#h.x#k#l/Z~0gR!Q![0p!c!i0p#T#Z0p~0uR%W~!Q![0p!c!i0p#T#Z0pV1VT'SS!iR!Q![1f![!]1f!c!}1f#R#S1f#T#o1fR1kT!iR!Q![1f![!]1f!c!}1f#R#S1f#T#o1f~2PQ!d~!P!Q2V!_!`2[~2[O!a~~2aO!c~~2fQ$oP!_!`2l#r#s2qQ2qO!^Q~2vO$p~~2{Q!`~!P!Q3R!_!`3W~3WO!b~~3]O!_~~3bO$t~V3iT!iRzS!Q![3b![!]1f!c!}3b#R#S3b#T#o3b~3}O'Q~~4SO'R~~4XO!P~~4[TO#S4X#S#T%c#T;'S4X;'S;=`4k<%lO4X~4nP;=`<%l4X~4vO'T~~4{O'U~",tokenizers:[0,1,2],topRules:{PromQL:[0,37],MetricName:[1,176]},specialized:[{term:71,get:(t,e)=>TN(t)<<1,external:TN},{term:71,get:(t,e)=>kN(t,e)<<1|1,external:kN,extend:!0},{term:71,get:t=>Vde[t]||-1}],tokenPrec:0}),Xde=3,Kde=4,Zde=5,Uq=9,Wq=11,Jde=15,Yq=16,Vq=17,Gq=21,E6=24,M6=25,R6=26,efe=27,tfe=28,nfe=37,Nv=38,rfe=39,ife=40,Jp=41,Iv=42,Lv=43,$m=44,su=45,em=46,sfe=47,Xq=48,afe=49,ofe=50,lfe=51,X2=52,cfe=53,ufe=54,hfe=55,dfe=56,ffe=57,pfe=58,mfe=59,Z3=60,J3=61,ek=62,Kq=63,Zq=64,tk=65,nk=66,Bv=67,rk=68,gfe=70,$A=71,vfe=72,bfe=73,yfe=74,xfe=75,Afe=76,wfe=77,Sfe=78,jfe=79,Cfe=80,_fe=81,Jq=82,Tfe=83,kfe=84,Ofe=85,Efe=86,Mfe=87,Rfe=88,Dfe=89,Nfe=90,Ife=91,Lfe=92,Bfe=93,ik=94,Pfe=95,Ffe=96,$fe=97,Hfe=98,zfe=99,qfe=100,Qfe=101,Ufe=102,Wfe=103,Yfe=104,Vfe=105,Gfe=106,Xfe=107,Kfe=108,Zfe=109,sk=110,Jfe=111,epe=112,tpe=113,npe=114,rpe=115,ipe=116,spe=117,ape=118,ope=119,lpe=120,cpe=121,upe=122,hpe=123,dpe=124,fpe=125,ppe=126,mpe=127,gpe=128,vpe=129,bpe=130,ype=131,xpe=132,ak=133,eQ=134,Ape=135,wpe=136,Spe=137,jpe=138,Cpe=139,_pe=140,Tpe=141,kpe=142,Ope=143,Epe=144,Mpe=145,Rpe=146,Dpe=147,Npe=148,Ipe=149,Lpe=150,Bpe=151,Ppe=152,Fpe=153,$pe=154,Hpe=155,Hm=156,HA=157,Pv=158,tQ=159,nQ=160,rQ=161,kf=162,iQ=163,Qb=165,tm=166,Dh=167,zA=168,Ub=169,sQ=170,aQ=171,xf=172,D6=173;var ae;(function(t){t.none="none",t.vector="vector",t.scalar="scalar",t.matrix="matrix",t.string="string"})(ae||(ae={}));const zpe={[bfe]:{name:"abs",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[vfe]:{name:"absent",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[gfe]:{name:"absent_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[yfe]:{name:"acos",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[xfe]:{name:"acosh",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Afe]:{name:"asin",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[wfe]:{name:"asinh",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Sfe]:{name:"atan",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[jfe]:{name:"atanh",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Cfe]:{name:"avg_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[_fe]:{name:"ceil",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Jq]:{name:"changes",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[Tfe]:{name:"clamp",argTypes:[ae.vector,ae.scalar,ae.scalar],variadic:0,returnType:ae.vector},[kfe]:{name:"clamp_max",argTypes:[ae.vector,ae.scalar],variadic:0,returnType:ae.vector},[Ofe]:{name:"clamp_min",argTypes:[ae.vector,ae.scalar],variadic:0,returnType:ae.vector},[Efe]:{name:"cos",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Mfe]:{name:"Cosh",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Rfe]:{name:"count_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[Dfe]:{name:"days_in_month",argTypes:[ae.vector],variadic:1,returnType:ae.vector},[Nfe]:{name:"day_of_month",argTypes:[ae.vector],variadic:1,returnType:ae.vector},[Ife]:{name:"day_of_week",argTypes:[ae.vector],variadic:1,returnType:ae.vector},[Lfe]:{name:"day_of_year",argTypes:[ae.vector],variadic:1,returnType:ae.vector},[Bfe]:{name:"deg",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[ik]:{name:"delta",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[Pfe]:{name:"deriv",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[tfe]:{name:"end",argTypes:[],variadic:0,returnType:ae.scalar},[Ffe]:{name:"exp",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[$fe]:{name:"first_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[Hfe]:{name:"floor",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Gfe]:{name:"histogram_avg",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[zfe]:{name:"histogram_count",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[qfe]:{name:"histogram_fraction",argTypes:[ae.scalar,ae.scalar,ae.vector],variadic:0,returnType:ae.vector},[Qfe]:{name:"histogram_quantile",argTypes:[ae.scalar,ae.vector],variadic:0,returnType:ae.vector},[Ufe]:{name:"histogram_quantiles",argTypes:[ae.vector,ae.string,ae.scalar,ae.scalar],variadic:10,returnType:ae.vector},[Wfe]:{name:"histogram_stddev",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Yfe]:{name:"histogram_stdvar",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Vfe]:{name:"histogram_sum",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Xfe]:{name:"double_exponential_smoothing",argTypes:[ae.matrix,ae.scalar,ae.scalar],variadic:0,returnType:ae.vector},[Kfe]:{name:"hour",argTypes:[ae.vector],variadic:1,returnType:ae.vector},[Zfe]:{name:"idelta",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[sk]:{name:"increase",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[Jfe]:{name:"info",argTypes:[ae.vector,ae.vector],variadic:1,returnType:ae.vector},[epe]:{name:"irate",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[tpe]:{name:"label_replace",argTypes:[ae.vector,ae.string,ae.string,ae.string,ae.string],variadic:0,returnType:ae.vector},[npe]:{name:"label_join",argTypes:[ae.vector,ae.string,ae.string,ae.string],variadic:-1,returnType:ae.vector},[rpe]:{name:"last_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[ipe]:{name:"ln",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[spe]:{name:"log10",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[ape]:{name:"log2",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[ope]:{name:"mad_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[lpe]:{name:"max_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[cpe]:{name:"min_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[upe]:{name:"ts_of_first_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[hpe]:{name:"ts_of_max_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[dpe]:{name:"ts_of_min_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[fpe]:{name:"ts_of_last_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[ppe]:{name:"minute",argTypes:[ae.vector],variadic:1,returnType:ae.vector},[mpe]:{name:"month",argTypes:[ae.vector],variadic:1,returnType:ae.vector},[gpe]:{name:"pi",argTypes:[],variadic:0,returnType:ae.vector},[vpe]:{name:"predict_linear",argTypes:[ae.matrix,ae.scalar],variadic:0,returnType:ae.vector},[bpe]:{name:"present_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[ype]:{name:"quantile_over_time",argTypes:[ae.scalar,ae.matrix],variadic:0,returnType:ae.vector},[xpe]:{name:"rad",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Epe]:{name:"range",argTypes:[],variadic:0,returnType:ae.scalar},[ak]:{name:"rate",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[eQ]:{name:"resets",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[Ape]:{name:"round",argTypes:[ae.vector,ae.scalar],variadic:1,returnType:ae.vector},[wpe]:{name:"scalar",argTypes:[ae.vector],variadic:0,returnType:ae.scalar},[Spe]:{name:"sgn",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[jpe]:{name:"sin",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Cpe]:{name:"Sinh",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[_pe]:{name:"sort",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Tpe]:{name:"sort_desc",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[kpe]:{name:"sort_by_label",argTypes:[ae.vector,ae.string],variadic:-1,returnType:ae.vector},[Ope]:{name:"sort_by_label_desc",argTypes:[ae.vector,ae.string],variadic:-1,returnType:ae.vector},[Rpe]:{name:"sqrt",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[efe]:{name:"start",argTypes:[],variadic:0,returnType:ae.scalar},[Mpe]:{name:"step",argTypes:[],variadic:0,returnType:ae.scalar},[Dpe]:{name:"stddev_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[Npe]:{name:"stdvar_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[Ipe]:{name:"sum_over_time",argTypes:[ae.matrix],variadic:0,returnType:ae.vector},[Lpe]:{name:"tan",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Bpe]:{name:"tanh",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[Fpe]:{name:"time",argTypes:[],variadic:0,returnType:ae.scalar},[Ppe]:{name:"timestamp",argTypes:[ae.vector],variadic:0,returnType:ae.vector},[$pe]:{name:"vector",argTypes:[ae.scalar],variadic:0,returnType:ae.vector},[Hpe]:{name:"year",argTypes:[ae.vector],variadic:1,returnType:ae.vector}};function oQ(t){return zpe[t]}class lQ{constructor(e,n,r){this.type=e,this.name=n,this.value=r}matchesEmpty(){switch(this.type){case Ub:return this.value==="";case Bv:return this.value!=="";default:return!1}}}var zl;(function(t){t.CardOneToOne="one-to-one",t.CardManyToOne="many-to-one",t.CardOneToMany="one-to-many",t.CardManyToMany="many-to-many"})(zl||(zl={}));function qpe(t,e){const n=new lQ(0,"",""),r=t.cursor();switch(r.type.id){case xf:if(!r.next())return n;do switch(r.type.id){case Lv:n.name=e.sliceDoc(r.from,r.to).slice(1,-1);break;case zA:{const i=r.node.firstChild;i&&(n.type=i.type.id);break}case $m:n.value=e.sliceDoc(r.from,r.to).slice(1,-1);break}while(r.nextSibling());break;case Dh:if(!r.next())return n;do switch(r.type.id){case Iv:n.name=e.sliceDoc(r.from,r.to);break;case zA:{const i=r.node.firstChild;i&&(n.type=i.type.id);break}case $m:n.value=e.sliceDoc(r.from,r.to).slice(1,-1);break}while(r.nextSibling());break;case Lv:n.name="__name__",n.value=e.sliceDoc(r.from,r.to).slice(1,-1),n.type=Ub;break}return n}function cQ(t,e){const n=[];return t.forEach(r=>{n.push(qpe(r,e))}),n}function C_(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 Ub:s="=";break;case Bv:s="!=";break;case aQ:s="!~";break;case sQ:s="=~";break;default:s="="}const o=`${i.name}${s}"${i.value}"`;r===""?r=o:r=`${r},${o}`}return`${t}{${r}}`}function N6(t,e){for(;;){if(!t||t.type.id===e)return t;t=t.parent}return null}function eu(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 qA(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 Ll(t){var e;if(!t)return ae.none;switch(t.type.id){case Nv:return ae.vector;case Qb:return ae.vector;case Pv:return Ll(t.firstChild);case $m:return ae.string;case X2:return ae.scalar;case Hm:return ae.matrix;case kf:return ae.matrix;case nQ:return Ll(t.firstChild);case tQ:return Ll(t.firstChild);case rQ:return Ll(t.getChild("Expr"));case iQ:return Ll(t.getChild("Expr"));case em:{const n=Ll(t.firstChild),r=Ll(t.lastChild);return n===ae.scalar&&r===ae.scalar?ae.scalar:ae.vector}case rk:{const n=(e=t.firstChild)===null||e===void 0?void 0:e.firstChild;return n?oQ(n.type.id).returnType:ae.none}case D6:return Ll(t.getChild("Expr"));default:return ae.none}}let ok=[],uQ=[];(()=>{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?uQ:ok).push(n=n+t[e])})();function Qpe(t){if(t<768)return!1;for(let e=0,n=ok.length;;){let r=e+n>>1;if(t<ok[r])n=r;else if(t>=uQ[r])e=r+1;else return!0;if(e==n)return!1}}function ON(t){return t>=127462&&t<=127487}const EN=8205;function Upe(t,e,n=!0,r=!0){return(n?hQ:Wpe)(t,e,r)}function hQ(t,e,n){if(e==t.length)return e;e&&dQ(t.charCodeAt(e))&&fQ(t.charCodeAt(e-1))&&e--;let r=__(t,e);for(e+=MN(r);e<t.length;){let i=__(t,e);if(r==EN||i==EN||n&&Qpe(i))e+=MN(i),r=i;else if(ON(i)){let s=0,o=e-2;for(;o>=0&&ON(__(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function Wpe(t,e,n){for(;e>0;){let r=hQ(t,e-2,n);if(r<e)return r;e--}return 0}function __(t,e){let n=t.charCodeAt(e);if(!fQ(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return dQ(r)?(n-55296<<10)+(r-56320)+65536:n}function dQ(t){return t>=56320&&t<57344}function fQ(t){return t>=55296&&t<56320}function MN(t){return t<65536?1:2}class On{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]=zm(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),ql.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]=zm(this,e,n);let r=[];return this.decompose(e,n,r,0),ql.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 rv(this),s=new rv(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 rv(this,e)}iterRange(e,n=this.length){return new pQ(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]?On.empty:e.length<=32?new hi(e):ql.from(hi.split(e,[]))}}class hi extends On{constructor(e,n=Ype(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 Vpe(i,l,r,o);i=l+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new hi(RN(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),l=Qx(s.text,o.text.slice(),0,s.length);if(l.length<=32)r.push(new hi(l,o.length+s.length));else{let c=l.length>>1;r.push(new hi(l.slice(0,c)),new hi(l.slice(c)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof hi))return super.replace(e,n,r);[e,n]=zm(this,e,n);let i=Qx(this.text,Qx(r.text,RN(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new hi(i,s):ql.from(hi.split(i,[]),s)}sliceString(e,n=this.length,r=`
`){[e,n]=zm(this,e,n);let i="";for(let s=0,o=0;s<=n&&o<this.text.length;o++){let l=this.text[o],c=s+l.length;s>e&&o&&(i+=r),e<c&&n>s&&(i+=l.slice(Math.max(0,e-s),n-s)),s=c+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 hi(r,i)),r=[],i=-1);return i>-1&&n.push(new hi(r,i)),n}}class ql extends On{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,c=r+o.lines-1;if((n?c:l)>=e)return o.lineInner(e,n,r,i);i=l+1,r=c+1}}decompose(e,n,r,i){for(let s=0,o=0;o<=n&&s<this.children.length;s++){let l=this.children[s],c=o+l.length;if(e<=c&&n>=o){let h=i&((o<=e?1:0)|(c>=n?2:0));o>=e&&c<=n&&!h?r.push(l):l.decompose(e-o,n-o,r,h)}o=c+1}}replace(e,n,r){if([e,n]=zm(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 c=o.replace(e-s,n-s,r),h=this.lines-o.lines+c.lines;if(c.lines<h>>4&&c.lines>h>>6){let f=this.children.slice();return f[i]=c,new ql(f,this.length-(n-e)+r.length)}return super.replace(s,l,c)}s=l+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
`){[e,n]=zm(this,e,n);let i="";for(let s=0,o=0;s<this.children.length&&o<=n;s++){let l=this.children[s],c=o+l.length;o>e&&s&&(i+=r),e<c&&n>o&&(i+=l.sliceString(e-o,n-o,r)),o=c+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof ql))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 c=this.children[i],h=e.children[s];if(c!=h)return r+c.scanIdentical(h,n);r+=c.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 y of e)y.flatten(v);return new hi(v,n)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,l=[],c=0,h=-1,f=[];function p(v){let y;if(v.lines>s&&v instanceof ql)for(let x of v.children)p(x);else v.lines>o&&(c>o||!c)?(m(),l.push(v)):v instanceof hi&&c&&(y=f[f.length-1])instanceof hi&&v.lines+y.lines<=32?(c+=v.lines,h+=v.length+1,f[f.length-1]=new hi(y.text.concat(v.text),y.length+1+v.length)):(c+v.lines>i&&m(),c+=v.lines,h+=v.length+1,f.push(v))}function m(){c!=0&&(l.push(f.length==1?f[0]:ql.from(f,h)),h=-1,c=f.length=0)}for(let v of e)p(v);return m(),l.length==1?l[0]:new ql(l,n)}}On.empty=new hi([""],0);function Ype(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Qx(t,e,n=0,r=1e9){for(let i=0,s=0,o=!0;s<t.length&&i<=r;s++){let l=t[s],c=i+l.length;c>=n&&(c>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=c+1}return e}function RN(t,e,n){return Qx(t,[""],e,n)}class rv{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 hi?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 hi?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 hi){let c=i.text[o+(n<0?-1:0)];if(this.offsets[r]+=n,c.length>Math.max(0,e))return this.value=e==0?c:n>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=i.children[o+(n<0?-1:0)];e>c.length?(e-=c.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof hi?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class pQ{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new rv(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"&&(On.prototype[Symbol.iterator]=function(){return this.iter()},rv.prototype[Symbol.iterator]=pQ.prototype[Symbol.iterator]=mQ.prototype[Symbol.iterator]=function(){return this});class Vpe{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 zm(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Xi(t,e,n=!0,r=!0){return Upe(t,e,n,r)}function Gpe(t){return t>=56320&&t<57344}function Xpe(t){return t>=55296&&t<56320}function ua(t,e){let n=t.charCodeAt(e);if(!Xpe(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Gpe(r)?(n-55296<<10)+(r-56320)+65536:n}function I6(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Ql(t){return t<65536?1:2}const lk=/\r\n?|\n/;var ps=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(ps||(ps={}));class ec{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){ck(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 ec(e)}composeDesc(e){return this.empty?e:e.empty?this:gQ(this,e)}mapDesc(e,n=!1){return e.empty?this:uk(this,e,n)}mapPos(e,n=-1,r=ps.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],c=this.sections[o++],h=i+l;if(c<0){if(h>e)return s+(e-i);s+=l}else{if(r!=ps.Simple&&h>=e&&(r==ps.TrackDel&&i<e&&h>e||r==ps.TrackBefore&&i<e||r==ps.TrackAfter&&h>e))return null;if(h>e||h==e&&n<0&&!l)return e==i||n<0?s:s+c;s+=c}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 ec(e)}static create(e){return new ec(e)}}class Mi extends ec{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 ck(this,(n,r,i,s,o)=>e=e.replace(i,i+(r-n),o),!1),e}mapDesc(e,n=!1){return uk(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 c=i>>1;for(;r.length<c;)r.push(On.empty);r.push(o?e.slice(s,s+o):On.empty)}s+=o}return new Mi(n,r)}compose(e){return this.empty?e:e.empty?this:gQ(this,e,!0)}map(e,n=!1){return e.empty?this:uk(this,e,n,!0)}iterChanges(e,n=!1){ck(this,e,n)}get desc(){return ec.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new Fv(this);e:for(let o=0,l=0;;){let c=o==e.length?1e9:e[o++];for(;l<c||l==c&&s.len==0;){if(s.done)break e;let f=Math.min(s.len,c-l);Os(i,f,-1);let p=s.ins==-1?-1:s.off==0?s.ins:0;Os(n,f,p),p>0&&Nh(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);Os(n,f,-1),Os(i,f,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(f),l+=f}}return{changes:new Mi(n,r),filtered:ec.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 c(f=!1){if(!f&&!i.length)return;o<n&&Os(i,n-o,-1);let p=new Mi(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 Mi){if(f.length!=n)throw new RangeError(`Mismatched change set length (got ${f.length}, expected ${n})`);c(),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 y=v?typeof v=="string"?On.of(v.split(r||lk)):v:On.empty,x=y.length;if(p==m&&x==0)return;p<o&&c(),p>o&&Os(i,p-o,-1),Os(i,m-p,x),Nh(s,i,y),o=m}}return h(e),c(!l),l}static empty(e){return new Mi(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(On.empty);r[i]=On.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new Mi(n,r)}static createSet(e,n){return new Mi(e,n)}}function Os(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 Nh(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(On.empty);t.push(n)}}function ck(t,e,n){let r=t.inserted;for(let i=0,s=0,o=0;o<t.sections.length;){let l=t.sections[o++],c=t.sections[o++];if(c<0)i+=l,s+=l;else{let h=i,f=s,p=On.empty;for(;h+=l,f+=c,c&&r&&(p=p.append(r[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],c=t.sections[o++];e(i,h,s,f,p),i=h,s=f}}}function uk(t,e,n,r=!1){let i=[],s=r?[]:null,o=new Fv(t),l=new Fv(e);for(let c=-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);Os(i,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!n))){let h=l.len;for(Os(i,l.ins,-1);h;){let f=Math.min(o.len,h);o.ins>=0&&c<o.i&&o.len<=f&&(Os(i,0,o.ins),s&&Nh(s,i,o.text),c=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;Os(i,h,c<o.i?o.ins:0),s&&c<o.i&&Nh(s,i,o.text),c=o.i,o.forward(o.len-f)}else{if(o.done&&l.done)return s?Mi.createSet(i,s):ec.create(i);throw new Error("Mismatched change set lengths")}}}function gQ(t,e,n=!1){let r=[],i=n?[]:null,s=new Fv(t),o=new Fv(e);for(let l=!1;;){if(s.done&&o.done)return i?Mi.createSet(r,i):ec.create(r);if(s.ins==0)Os(r,s.len,0,l),s.next();else if(o.len==0&&!o.done)Os(r,0,o.ins,l),i&&Nh(i,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let c=Math.min(s.len2,o.len),h=r.length;if(s.ins==-1){let f=o.ins==-1?-1:o.off?0:o.ins;Os(r,c,f,l),i&&f&&Nh(i,r,o.text)}else o.ins==-1?(Os(r,s.off?0:s.len,c,l),i&&Nh(i,r,s.textBit(c))):(Os(r,s.off?0:s.len,o.off?0:o.ins,l),i&&!o.off&&Nh(i,r,o.text));l=(s.ins>c||o.ins>=0&&o.len>c)&&(l||r.length>h),s.forward2(c),o.forward(c)}}}}class Fv{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?On.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?On.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 Kd{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 Kd(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return Be.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Be.range(this.anchor,i,void 0,void 0,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 Be.range(e.anchor,e.head)}static create(e,n,r){return new Kd(e,n,r)}}class Be{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Be.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 Be([this.main],0)}addRange(e,n=!0){return Be.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,Be.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 Be(e.ranges.map(n=>Kd.fromJSON(n)),e.main)}static single(e,n=e){return new Be([Be.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 Be.normalized(e.slice(),n);r=s.to}return new Be(e,n)}static cursor(e,n=0,r,i){return Kd.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,s){let o=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!s&&e!=n&&(s=n<e?1:-1),n<e?Kd.create(n,e,48|o):Kd.create(e,n,(s?s<0?8:16:0)|o)}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,c=Math.max(s.to,o.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.head?Be.range(c,l):Be.range(l,c))}}return new Be(e,n)}}function vQ(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let L6=0;class vt{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=L6++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new vt(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:B6),!!e.static,e.enables)}of(e){return new Ux([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ux(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ux(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function B6(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Ux{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=L6++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,c=!1,h=!1,f=[];for(let p of this.dependencies)p=="doc"?c=!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(c&&m.docChanged||h&&(m.docChanged||m.selection)||hk(p,f)){let v=r(p);if(l?!DN(v,p.values[o],i):!i(v,p.values[o]))return p.values[o]=v,1}return 0},reconfigure:(p,m)=>{let v,y=m.config.address[s];if(y!=null){let x=UA(m,y);if(this.dependencies.every(S=>S instanceof vt?m.facet(S)===p.facet(S):S instanceof gs?m.field(S,!1)==p.field(S,!1):!0)||(l?DN(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 DN(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 hk(t,e){let n=!1;for(let r of e)iv(t,r)&1&&(n=!0);return n}function Kpe(t,e,n){let r=n.map(c=>t[c.id]),i=n.map(c=>c.type),s=r.filter(c=>!(c&1)),o=t[e.id]>>1;function l(c){let h=[];for(let f=0;f<r.length;f++){let p=UA(c,r[f]);if(i[f]==2)for(let m of p)h.push(m);else h.push(p)}return e.combine(h)}return{create(c){for(let h of r)iv(c,h);return c.values[o]=l(c),1},update(c,h){if(!hk(c,s))return 0;let f=l(c);return e.compare(f,c.values[o])?0:(c.values[o]=f,1)},reconfigure(c,h){let f=hk(c,r),p=h.config.facets[e.id],m=h.facet(e);if(p&&!f&&B6(n,p))return c.values[o]=m,0;let v=l(c);return e.compare(v,m)?(c.values[o]=m,0):(c.values[o]=v,1)}}}const F1=vt.define({static:!0});class gs{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 gs(L6++,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(F1).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(F1),o=i.facet(F1),l;return(l=s.find(c=>c.field==this))&&l!=o.find(c=>c.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,F1.of({field:this,create:e})]}get extension(){return this}}const Ud={lowest:4,low:3,default:2,high:1,highest:0};function wg(t){return e=>new bQ(e,t)}const ju={highest:wg(Ud.highest),high:wg(Ud.high),default:wg(Ud.default),low:wg(Ud.low),lowest:wg(Ud.lowest)};class bQ{constructor(e,n){this.inner=e,this.prec=n}}class K2{of(e){return new dk(this,e)}reconfigure(e){return K2.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class dk{constructor(e,n){this.compartment=e,this.inner=n}}class QA{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 Zpe(e,n,o))m instanceof gs?i.push(m):(s[m.facet.id]||(s[m.facet.id]=[])).push(m);let l=Object.create(null),c=[],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],y=v[0].facet,x=f&&f[m]||[];if(v.every(S=>S.type==0))if(l[y.id]=c.length<<1|1,B6(x,v))c.push(r.facet(y));else{let S=y.combine(v.map(w=>w.value));c.push(r&&y.compare(S,r.facet(y))?r.facet(y):S)}else{for(let S of v)S.type==0?(l[S.id]=c.length<<1|1,c.push(S.value)):(l[S.id]=h.length<<1,h.push(w=>S.dynamicSlot(w)));l[y.id]=h.length<<1,h.push(S=>Kpe(S,y,v))}}let p=h.map(m=>m(l));return new QA(e,o,p,l,c,s)}}function Zpe(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(o,l){let c=i.get(o);if(c!=null){if(c<=l)return;let h=r[c].indexOf(o);h>-1&&r[c].splice(h,1),o instanceof dk&&n.delete(o.compartment)}if(i.set(o,l),Array.isArray(o))for(let h of o)s(h,l);else if(o instanceof dk){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 bQ)s(o.inner,o.prec);else if(o instanceof gs)r[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Ux)r[l].push(o),o.facet.extensions&&s(o.facet.extensions,Ud.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,Ud.default),r.reduce((o,l)=>o.concat(l))}function iv(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 UA(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const yQ=vt.define(),fk=vt.define({combine:t=>t.some(e=>e),static:!0}),xQ=vt.define({combine:t=>t.length?t[0]:void 0,static:!0}),AQ=vt.define(),wQ=vt.define(),SQ=vt.define(),jQ=vt.define({combine:t=>t.length?t[0]:!1});class dc{constructor(e,n){this.type=e,this.value=n}static define(){return new Jpe}}class Jpe{of(e){return new dc(this,e)}}class eme{constructor(e){this.map=e}of(e){return new Vt(this,e)}}class Vt{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 Vt(this.type,n)}is(e){return this.type==e}static define(e={}){return new eme(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}}Vt.reconfigure=Vt.define();Vt.appendConfig=Vt.define();class ji{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&&vQ(r,n.newLength),s.some(l=>l.type==ji.time)||(this.annotations=s.concat(ji.time.of(Date.now())))}static create(e,n,r,i,s,o){return new ji(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(ji.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}ji.time=dc.define();ji.userEvent=dc.define();ji.addToHistory=dc.define();ji.remote=dc.define();function tme(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 CQ(t,e,n){var r;let i,s,o;return n?(i=e.changes,s=Mi.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:Vt.mapEffects(t.effects,i).concat(Vt.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function pk(t,e,n){let r=e.selection,i=nm(e.annotations);return e.userEvent&&(i=i.concat(ji.userEvent.of(e.userEvent))),{changes:e.changes instanceof Mi?e.changes:Mi.of(e.changes||[],n,t.facet(xQ)),selection:r&&(r instanceof Be?r:Be.single(r.anchor,r.head)),effects:nm(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function _Q(t,e,n){let r=pk(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=CQ(r,pk(t,e[s],o?r.changes.newLength:t.doc.length),o)}let i=ji.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return rme(n?nme(i):i)}function nme(t){let e=t.startState,n=!0;for(let i of e.facet(AQ)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:tme(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=Mi.empty(e.doc.length);else{let o=t.changes.filter(n);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=ji.create(e,i,t.selection&&t.selection.map(s),Vt.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(wQ);for(let i=r.length-1;i>=0;i--){let s=r[i](t);s instanceof ji?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof ji?t=s[0]:t=_Q(e,nm(s),!1)}return t}function rme(t){let e=t.startState,n=e.facet(SQ),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=CQ(r,pk(e,s,t.changes.newLength),!0))}return r==t?t:ji.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const ime=[];function nm(t){return t==null?ime:Array.isArray(t)?t:[t]}var Pr=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Pr||(Pr={}));const sme=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let mk;try{mk=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function ame(t){if(mk)return mk.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||sme.test(n)))return!0}return!1}function ome(t){return e=>{if(!/\S/.test(e))return Pr.Space;if(ame(e))return Pr.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Pr.Word;return Pr.Other}}class wn{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++)iv(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 iv(this,r),UA(this,r)}update(...e){return _Q(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let l of e.effects)l.is(K2.reconfigure)?(n&&(i=new Map,n.compartments.forEach((c,h)=>i.set(h,c)),n=null),i.set(l.value.compartment,l.value.extension)):l.is(Vt.reconfigure)?(n=null,r=l.value):l.is(Vt.appendConfig)&&(n=null,r=nm(r).concat(l.value));let s;n?s=e.startState.values.slice():(n=QA.resolve(r,i,this),s=new wn(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,h)=>h.reconfigure(c,this),null).values);let o=e.startState.facet(fk)?e.newSelection:e.newSelection.asSingle();new wn(n,e.newDoc,o,s,(l,c)=>c.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:Be.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=nm(r.effects);for(let l=1;l<n.ranges.length;l++){let c=e(n.ranges[l]),h=this.changes(c.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(c.range.map(p)),i=i.compose(f),o=Vt.mapEffects(o,f).concat(Vt.mapEffects(nm(c.effects),p))}return{changes:i,selection:Be.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof Mi?e:Mi.of(e,this.doc.length,this.facet(wn.lineSeparator))}toText(e){return On.of(e.split(this.facet(wn.lineSeparator)||lk))}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:(iv(this,n),UA(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 gs&&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(c=>o.spec.fromJSON(l,c)))}}return wn.create({doc:e.doc,selection:Be.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=QA.resolve(e.extensions||[],new Map),r=e.doc instanceof On?e.doc:On.of((e.doc||"").split(n.staticFacet(wn.lineSeparator)||lk)),i=e.selection?e.selection instanceof Be?e.selection:Be.single(e.selection.anchor,e.selection.head):Be.single(0);return vQ(i,r.length),n.staticFacet(fk)||(i=i.asSingle()),new wn(n,r,i,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(wn.tabSize)}get lineBreak(){return this.facet(wn.lineSeparator)||`
`}get readOnly(){return this.facet(jQ)}phrase(e,...n){for(let r of this.facet(wn.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(yQ))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 ome(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 c=Xi(n,o,!1);if(s(n.slice(c,o))!=Pr.Word)break;o=c}for(;l<i;){let c=Xi(n,l);if(s(n.slice(l,c))!=Pr.Word)break;l=c}return o==l?null:Be.range(o+r,l+r)}}wn.allowMultipleSelections=fk;wn.tabSize=vt.define({combine:t=>t.length?t[0]:4});wn.lineSeparator=xQ;wn.readOnly=jQ;wn.phrases=vt.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])}});wn.languageData=yQ;wn.changeFilter=AQ;wn.transactionFilter=wQ;wn.transactionExtender=SQ;K2.reconfigure=Vt.define();function fc(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 Wh{eq(e){return this==e}range(e,n=e){return $v.create(e,n,this)}}Wh.prototype.startSide=Wh.prototype.endSide=0;Wh.prototype.point=!1;Wh.prototype.mapMode=ps.TrackDel;function P6(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}class $v{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new $v(e,n,r)}}function gk(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class F6{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 c=o+l>>1,h=s[c]-e||(r?this.value[c].endSide:this.value[c].startSide)-n;if(c==o)return h>=0?o:l;h>=0?l=c:o=c+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 c=0;c<this.value.length;c++){let h=this.value[c],f=this.from[c]+e,p=this.to[c]+e,m,v;if(f==p){let y=n.mapPos(f,h.startSide,h.mapMode);if(y==null||(m=v=y,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 F6(i,s,r,l):null,pos:o}}}class vn{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 vn(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(gk)),this.isEmpty)return n.length?vn.of(n):this;let l=new TQ(this,null,-1).goto(0),c=0,h=[],f=new fu;for(;l.value||c<n.length;)if(c<n.length&&(l.from-n[c].from||l.startSide-n[c].value.startSide)>=0){let p=n[c++];f.addInner(p.from,p.to,p.value)||h.push(p)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(l.chunkIndex)<n[c].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($v.create(l.from,l.to,l.value))),l.next());return f.finishInner(this.nextLayer.isEmpty&&!h.length?vn.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],c=this.chunk[o],h=e.touchesRange(l,l+c.length);if(h===!1)i=Math.max(i,c.maxPoint),n.push(c),r.push(e.mapPos(l));else if(h===!0){let{mapped:f,pos:p}=c.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 vn(r,n,s||vn.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),c=NN(o,l,r),h=new Sg(o,c,s),f=new Sg(l,c,s);r.iterGaps((p,m,v)=>IN(h,p,f,m,v,i)),r.empty&&r.length==0&&IN(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=NN(s,o),c=new Sg(s,l,0).goto(r),h=new Sg(o,l,0).goto(r);for(;;){if(c.to!=h.to||!vk(c.active,h.active)||c.point&&(!h.point||!P6(c.point,h.point)))return!1;if(c.to>i)return!0;c.next(),h.next()}}static spans(e,n,r,i,s=-1){let o=new Sg(e,null,s).goto(n),l=n,c=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,c);i.point(l,h,o.point,f,p,o.pointRank),c=Math.min(o.openEnd(h),f.length)}else h>l&&(i.span(l,h,o.active,c),c=o.openEnd(h));if(o.to>r)return c+(o.point&&o.to>r?1:0);l=o.to,o.next()}}static of(e,n=!1){let r=new fu;for(let i of e instanceof $v?[e]:n?lme(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return vn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=vn.empty;i=i.nextLayer)n=new vn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}vn.empty=new vn([],[],null,-1);function lme(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(gk(e,r)>0)return t.slice().sort(gk);e=r}return t}vn.empty.nextLayer=vn.empty;class fu{finishChunk(e){this.chunks.push(new F6(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 fu)).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(vn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=vn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function NN(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 TQ{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 TQ(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--)T_(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--)T_(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(),T_(this.heap,0)}}}function T_(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 Sg{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){$1(this.active,e),$1(this.activeTo,e),$1(this.activeRank,e),this.minActive=LN(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++;H1(this.active,n,r),H1(this.activeTo,n,i),H1(this.activeRank,n,s),e&&H1(e,n,this.cursor.from),this.minActive=LN(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&&$1(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 IN(t,e,n,r,i,s){t.goto(e),n.goto(r);let o=r+i,l=r,c=r-e,h=!!s.boundChange;for(let f=!1;;){let p=t.to+c-n.to,m=p||t.endSide-n.endSide,v=m<0?t.to+c:n.to,y=Math.min(v,o);if(t.point||n.point?(t.point&&n.point&&P6(t.point,n.point)&&vk(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,y,t.point,n.point),f=!1):(f&&s.boundChange(l),y>l&&!vk(t.active,n.active)&&s.compareRange(l,y,t.active,n.active),h&&y<o&&(p||t.openEnd(v)!=n.openEnd(v))&&(f=!0)),v>o)break;l=v,m<=0&&t.next(),m>=0&&n.next()}}function vk(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!P6(t[n],e[n]))return!1;return!0}function $1(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function H1(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function LN(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 v0(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=Xi(t,i));return r}function bk(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=Xi(t,i)}return r===!0?-1:t.length}const yk="ͼ",BN=typeof Symbol>"u"?"__"+yk:Symbol.for(yk),xk=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),PN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Yh{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,c,h){let f=[],p=/^@(\w+)\b/.exec(o[0]),m=p&&p[1]=="keyframes";if(p&&l==null)return c.push(o[0]+";");for(let v in l){let y=l[v];if(/&/.test(v))s(v.split(/,\s*/).map(x=>o.map(S=>x.replace(/&/,S))).reduce((x,S)=>x.concat(S)),y,c);else if(y&&typeof y=="object"){if(!p)throw new RangeError("The value of a property ("+v+") should be a primitive value.");s(i(v),y,f,m)}else y!=null&&f.push(v.replace(/_.*/,"").replace(/[A-Z]/g,x=>"-"+x.toLowerCase())+": "+y+";")}(f.length||m)&&c.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=PN[BN]||1;return PN[BN]=e+1,yk+e.toString(36)}static mount(e,n,r){let i=e[xk],s=r&&r.nonce;i?s&&i.setNonce(s):i=new cme(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let FN=new Map;class cme{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=FN.get(r);if(s)return e[xk]=s;this.sheet=new i.CSSStyleSheet,FN.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[xk]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],c=this.modules.indexOf(l);if(c<s&&c>-1&&(this.modules.splice(c,1),s--,c=-1),c==-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<c;)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 c=0;c<this.modules.length;c++)o+=this.modules[c].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 Vh={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:"'"},zv={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ume=typeof navigator<"u"&&/Mac/.test(navigator.platform),hme=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ds=0;ds<10;ds++)Vh[48+ds]=Vh[96+ds]=String(ds);for(var ds=1;ds<=24;ds++)Vh[ds+111]="F"+ds;for(var ds=65;ds<=90;ds++)Vh[ds]=String.fromCharCode(ds+32),zv[ds]=String.fromCharCode(ds);for(var k_ in Vh)zv.hasOwnProperty(k_)||(zv[k_]=Vh[k_]);function dme(t){var e=ume&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||hme&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?zv:Vh)[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 lr(){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++)kQ(t,arguments[e]);return t}function kQ(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++)kQ(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let zs=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ak=typeof document<"u"?document:{documentElement:{style:{}}};const wk=/Edge\/(\d+)/.exec(zs.userAgent),OQ=/MSIE \d/.test(zs.userAgent),Sk=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zs.userAgent),Z2=!!(OQ||Sk||wk),$N=!Z2&&/gecko\/(\d+)/i.test(zs.userAgent),O_=!Z2&&/Chrome\/(\d+)/.exec(zs.userAgent),HN="webkitFontSmoothing"in Ak.documentElement.style,jk=!Z2&&/Apple Computer/.test(zs.vendor),zN=jk&&(/Mobile\/\w+/.test(zs.userAgent)||zs.maxTouchPoints>2);var yt={mac:zN||/Mac/.test(zs.platform),windows:/Win/.test(zs.platform),linux:/Linux|X11/.test(zs.platform),ie:Z2,ie_version:OQ?Ak.documentMode||6:Sk?+Sk[1]:wk?+wk[1]:0,gecko:$N,gecko_version:$N?+(/Firefox\/(\d+)/.exec(zs.userAgent)||[0,0])[1]:0,chrome:!!O_,chrome_version:O_?+O_[1]:0,ios:zN,android:/Android\b/.test(zs.userAgent),webkit:HN,webkit_version:HN?+(/\bAppleWebKit\/(\d+)/.exec(zs.userAgent)||[0,0])[1]:0,safari:jk,safari_version:jk?+(/\bVersion\/(\d+(\.\d+)?)/.exec(zs.userAgent)||[0,0])[1]:0,tabSize:Ak.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function $6(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 WA=Object.create(null);function H6(t,e,n){if(t==e)return!0;t||(t=WA),e||(e=WA);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 fme(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 qN(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 pme(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 vl{eq(e){return!1}updateDOM(e,n,r){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 ms=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(ms||(ms={}));class Dt extends Wh{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 Wb(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 Of(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}=EQ(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(o?n?2e8:1:-6e8)+1}return new Of(e,r,i,n,e.widget||null,!0)}static line(e){return new Yb(e)}static set(e,n=!1){return vn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Dt.none=vn.empty;class Wb extends Dt{constructor(e){let{start:n,end:r}=EQ(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?$6(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||WA}eq(e){return this==e||e instanceof Wb&&this.tagName==e.tagName&&H6(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)}}Wb.prototype.point=!1;class Yb extends Dt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Yb&&this.spec.class==e.spec.class&&H6(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)}}Yb.prototype.mapMode=ps.TrackBefore;Yb.prototype.point=!0;class Of extends Dt{constructor(e,n,r,i,s,o){super(n,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?n<=0?ps.TrackBefore:ps.TrackAfter:ps.TrackDel}get type(){return this.startSide!=this.endSide?ms.WidgetRange:this.startSide<=0?ms.WidgetBefore:ms.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Of&&mme(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)}}Of.prototype.point=!0;function EQ(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 mme(t,e){return t==e||!!(t&&e&&t.compare(e))}function rm(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 qv extends Wh{constructor(e,n,r){super(),this.tagName=e,this.attributes=n,this.rank=r}eq(e){return e==this||e instanceof qv&&this.tagName==e.tagName&&H6(this.attributes,e.attributes)}static create(e){return new qv(e.tagName,e.attributes||WA,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return vn.of(e,n)}}qv.prototype.startSide=qv.prototype.endSide=-1;function Qv(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Ck(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function sv(t,e){if(!e.anchorNode)return!1;try{return Ck(t,e.anchorNode)}catch{return!1}}function av(t){return t.nodeType==3?Wv(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function ov(t,e,n,r){return n?QN(t,e,n,r,-1)||QN(t,e,n,r,1):!1}function Gh(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function YA(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function QN(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:pu(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=Gh(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?pu(t):0}else return!1}}function pu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Uv(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function gme(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 MQ(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 vme(t,e,n,r,i,s,o,l){let c=t.ownerDocument,h=c.defaultView||window;for(let f=t,p=!1;f&&!p;)if(f.nodeType==1){let m,v=f==c.body,y=1,x=1;if(v)m=gme(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 A=f.getBoundingClientRect();({scaleX:y,scaleY:x}=MQ(f,A)),m={left:A.left,right:A.left+f.clientWidth*y,top:A.top,bottom:A.top+f.clientHeight*x}}let S=0,w=0;if(i=="nearest")e.top<m.top+o?(w=e.top-(m.top+o),n>0&&e.bottom>m.bottom+w&&(w=e.bottom-m.bottom+o)):e.bottom>m.bottom-o&&(w=e.bottom-m.bottom+o,n<0&&e.top-w<m.top&&(w=e.top-(m.top+o)));else{let A=e.bottom-e.top,C=m.bottom-m.top;w=(i=="center"&&A<=C?e.top+A/2-C/2:i=="start"||i=="center"&&n<0?e.top-o:e.bottom-C+o)-m.top}if(r=="nearest"?e.left<m.left+s?(S=e.left-(m.left+s),n>0&&e.right>m.right+S&&(S=e.right-m.right+s)):e.right>m.right-s&&(S=e.right-m.right+s,n<0&&e.left<m.left+S&&(S=e.left-(m.left+s))):S=(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,S||w)if(v)h.scrollBy(S,w);else{let A=0,C=0;if(w){let j=f.scrollTop;f.scrollTop+=w/x,C=(f.scrollTop-j)*x}if(S){let j=f.scrollLeft;f.scrollLeft+=S/y,A=(f.scrollLeft-j)*y}e={left:e.left-A,top:e.top-C,right:e.right-A,bottom:e.bottom-C},A&&Math.abs(A-S)<1&&(r="nearest"),C&&Math.abs(C-w)<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 RQ(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||r)&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class bme{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?pu(n):0),r,Math.min(e.focusOffset,r?pu(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Pd=null;yt.safari&&yt.safari_version>=26&&(Pd=!1);function DQ(t){if(t.setActive)return t.setActive();if(Pd)return t.focus(Pd);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Pd==null?{get preventScroll(){return Pd={preventScroll:!0},!0}}:void 0),!Pd){Pd=!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 UN;function Wv(t,e,n=e){let r=UN||(UN=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function im(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 yme(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function xme(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,pu(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=pu(n))}else{if(n==t)return!0;r=Gh(n),n=n.parentNode}}function NQ(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function IQ(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=pu(n)}else if(n.parentNode&&!YA(n))r=Gh(n),n=n.parentNode;else return null}}function LQ(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&&!YA(n))r=Gh(n)+1,n=n.parentNode;else return null}}class il{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new il(e.parentNode,Gh(e),n)}static after(e,n){return new il(e.parentNode,Gh(e)+1,n)}}var pr=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(pr||(pr={}));const Ef=pr.LTR,z6=pr.RTL;function BQ(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const Ame=BQ("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),wme=BQ("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),_k=Object.create(null),Rl=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);_k[e]=n,_k[n]=-e}function PQ(t){return t<=247?Ame[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?wme[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const Sme=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Yl{get dir(){return this.level%2?z6:Ef}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 FQ(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||!FQ(r.inner,i.inner))return!1}return!0}const hr=[];function jme(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,c=s?256:i;for(let h=o,f=c,p=c;h<l;h++){let m=PQ(t.charCodeAt(h));m==512?m=f:m==8&&p==4&&(m=16),hr[h]=m==4?2:m,m&7&&(p=m),f=m}for(let h=o,f=c,p=c;h<l;h++){let m=hr[h];if(m==128)h<l-1&&f==hr[h+1]&&f&24?m=hr[h]=f:hr[h]=256;else if(m==64){let v=h+1;for(;v<l&&hr[v]==64;)v++;let y=h&&f==8||v<n&&hr[v]==8?p==1?1:8:256;for(let x=h;x<v;x++)hr[x]=y;h=v-1}else m==8&&p==1&&(hr[h]=1);f=m,m&7&&(p=m)}}}function Cme(t,e,n,r,i){let s=i==1?2:1;for(let o=0,l=0,c=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,y;p<f;p++)if(v=_k[m=t.charCodeAt(p)])if(v<0){for(let x=l-3;x>=0;x-=3)if(Rl[x+1]==-v){let S=Rl[x+2],w=S&2?i:S&4?S&1?s:i:0;w&&(hr[p]=hr[Rl[x]]=w),l=x;break}}else{if(Rl.length==189)break;Rl[l++]=p,Rl[l++]=m,Rl[l++]=c}else if((y=hr[p])==2||y==1){let x=y==i;c=x?0:1;for(let S=l-3;S>=0;S-=3){let w=Rl[S+2];if(w&2)break;if(x)Rl[S+2]|=2;else{if(w&4)break;Rl[S+2]|=4}}}}}function _me(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 c=o;c<l;){let h=hr[c];if(h==256){let f=c+1;for(;;)if(f==l){if(i==n.length)break;f=n[i++].to,l=i<n.length?n[i].from:e}else if(hr[f]==256)f++;else break;let p=s==1,m=(f<e?hr[f]:r)==1,v=p==m?p?1:2:r;for(let y=f,x=i,S=x?n[x-1].to:t;y>c;)y==S&&(y=n[--x].from,S=x?n[x-1].to:t),hr[--y]=v;c=f}else s=h,c++}}}function Tk(t,e,n,r,i,s,o){let l=r%2?2:1;if(r%2==i%2)for(let c=e,h=0;c<n;){let f=!0,p=!1;if(h==s.length||c<s[h].from){let x=hr[c];x!=l&&(f=!1,p=x==16)}let m=!f&&l==1?[]:null,v=f?r:r+1,y=c;e:for(;;)if(h<s.length&&y==s[h].from){if(p)break e;let x=s[h];if(!f)for(let S=x.to,w=h+1;;){if(S==n)break e;if(w<s.length&&s[w].from==S)S=s[w++].to;else{if(hr[S]==l)break e;break}}if(h++,m)m.push(x);else{x.from>c&&o.push(new Yl(c,x.from,v));let S=x.direction==Ef!=!(v%2);kk(t,S?r+1:r,i,x.inner,x.from,x.to,o),c=x.to}y=x.to}else{if(y==n||(f?hr[y]!=l:hr[y]==l))break;y++}m?Tk(t,c,y,r+1,i,m,o):c<y&&o.push(new Yl(c,y,v)),c=y}else for(let c=n,h=s.length;c>e;){let f=!0,p=!1;if(!h||c>s[h-1].to){let x=hr[c-1];x!=l&&(f=!1,p=x==16)}let m=!f&&l==1?[]:null,v=f?r:r+1,y=c;e:for(;;)if(h&&y==s[h-1].to){if(p)break e;let x=s[--h];if(!f)for(let S=x.from,w=h;;){if(S==e)break e;if(w&&s[w-1].to==S)S=s[--w].from;else{if(hr[S-1]==l)break e;break}}if(m)m.push(x);else{x.to<c&&o.push(new Yl(x.to,c,v));let S=x.direction==Ef!=!(v%2);kk(t,S?r+1:r,i,x.inner,x.from,x.to,o),c=x.from}y=x.from}else{if(y==e||(f?hr[y-1]!=l:hr[y-1]==l))break;y--}m?Tk(t,y,c,r+1,i,m,o):y<c&&o.push(new Yl(y,c,v)),c=y}}function kk(t,e,n,r,i,s,o){let l=e%2?2:1;jme(t,i,s,r,l),Cme(t,i,s,r,l),_me(i,s,r,l),Tk(t,i,s,e,n,r,o)}function Tme(t,e,n){if(!t)return[new Yl(0,0,e==z6?1:0)];if(e==Ef&&!n.length&&!Sme.test(t))return $Q(t.length);if(n.length)for(;t.length>hr.length;)hr[hr.length]=256;let r=[],i=e==Ef?0:1;return kk(t,i,i,n,0,t.length,r),r}function $Q(t){return[new Yl(0,t,0)]}let HQ="";function kme(t,e,n,r,i){var s;let o=r.head-t.from,l=Yl.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),c=e[l],h=c.side(i,n);if(o==h){let m=l+=i?1:-1;if(m<0||m>=e.length)return null;c=e[l=m],o=c.side(!i,n),h=c.side(i,n)}let f=Xi(t.text,o,c.forward(i,n));(f<c.from||f>c.to)&&(f=h),HQ=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)<c.level?Be.cursor(p.side(!i,n)+t.from,p.forward(i,n)?1:-1,p.level):Be.cursor(f+t.from,c.forward(i,n)?-1:1,c.level)}function Ome(t,e,n){for(let r=e;r<n;r++){let i=PQ(t.charCodeAt(r));if(i==1)return Ef;if(i==2||i==4)return z6}return Ef}const zQ=vt.define(),qQ=vt.define(),QQ=vt.define(),UQ=vt.define(),Ok=vt.define(),WQ=vt.define(),YQ=vt.define(),q6=vt.define(),Q6=vt.define(),VQ=vt.define({combine:t=>t.some(e=>e)}),GQ=vt.define({combine:t=>t.some(e=>e)}),XQ=vt.define();class sm{constructor(e,n,r,i,s,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 sm(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 sm(Be.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const z1=Vt.define({map:(t,e)=>t.map(e)}),KQ=Vt.define();function Qs(t,e,n){let r=t.facet(UQ);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 tu=vt.define({combine:t=>t.length?t[0]:!0});let Eme=0;const Fp=vt.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 Yr{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(Fp.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Fp.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:o}=n||{};return new Yr(Eme++,e,r,i,l=>{let c=[];return o&&c.push(J2.of(h=>{let f=h.plugin(l);return f?o(f):Dt.none})),s&&c.push(s(l)),c})}static fromClass(e,n){return Yr.define((r,i)=>new e(r,i),n)}}class E_{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(Qs(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){Qs(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){Qs(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const ZQ=vt.define(),U6=vt.define(),J2=vt.define(),JQ=vt.define(),W6=vt.define(),Vb=vt.define(),eU=vt.define();function WN(t,e){let n=t.state.facet(eU);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return vn.spans(r,e.from,e.to,{point(){},span(s,o,l,c){let h=s-e.from,f=o-e.from,p=i;for(let m=l.length-1;m>=0;m--,c--){let v=l[m].spec.bidiIsolate,y;if(v==null&&(v=Ome(e.text,h,f)),c>0&&p.length&&(y=p[p.length-1]).to==h&&y.direction==v)y.to=f,p=y.inner;else{let x={from:h,to:f,direction:v,inner:[]};p.push(x),p=x.inner}}}}),i}const tU=vt.define();function Y6(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(tU)){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 zg=vt.define();class vo{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new vo(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,c=s<n.length?n[s]:1e9,h=Math.min(l,c);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 y=i;y<e.length&&e[y].fromB<=p;y++)o=e[y].toA-e[y].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 vo(f,m,h,p))}return r}}class VA{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Mi.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,c)=>i.push(new vo(s,o,l,c))),this.changedRanges=i}static create(e,n,r){return new VA(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 Mme=[];class ii{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 Mme}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&&fme(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=Gh(this.dom),i=this.length?e>0:n>0;return new il(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 tS)return e;return null}static get(e){return e.cmTile}}class eS extends ii{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=YN(i);else n.insertBefore(l.dom,i);r=l.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=YN(i);this.length=o}}function YN(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class tS extends eS{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=ii.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 au)n.push(i),r=o,i=0;else{let l=s+o.length,c=e(o,s);if(c!==void 0)return c;s=l+o.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,o=-1;if(this.blockTiles((l,c)=>{let h=c+l.length;if(e>=c&&e<=h){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(r=void 0)}(c<e||e==h&&(n<-1?l.length:l.covers(1)))&&(!r||!l.isWidget()&&r.isWidget())&&(r=l,i=e-c),(h>e||e==c&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-c)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:o}}}class au extends eS{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 au(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class qm extends eS{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new qm(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 c(f,p){for(let m=0,v=0;m<f.children.length&&v<=p;m++){let y=f.children[m],x=v+y.length;x>=p&&(y.isComposite()?c(y,p-v):(!o||o.isHidden&&(n>0||r&&Dme(o,y)))&&(x>p||y.flags&32)?(o=y,l=p-v):(v<p||y.flags&16&&!y.isHidden)&&(i=y,s=p-v)),v=x}}c(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):Rme(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 il(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 c of o.children){if(l)return new il(c.dom,0);c==r.tile&&(l=!0)}}return new il(this.dom,0)}}function Rme(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=av(e);return n[n.length-1]||null}function Dme(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class fa extends eS{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new fa(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Zd extends ii{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?yt.chrome||yt.gecko||(e?(i--,o=1):s<r&&(s++,o=-1)):n<0?i--:s<r&&s++;let l=Wv(this.dom,i,s).getClientRects();if(!l.length)return null;let c=l[(o?o<0:n>=0)?0:l.length-1];return yt.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(l,h=>h.width)||c),o?Uv(c,o<0):c||null}static of(e,n){let r=new Zd(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class Mf extends ii{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 Uv(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 c=l?s.length-1:0;o=s[c],!(e>0?c==0:c==s.length-1||o.top<o.bottom);c+=l?-1:1);return Uv(o,!l)}}get overrideDOMText(){if(!this.length)return On.empty;let{root:e}=this;if(!e)return On.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 Mf(s,r,e,i)}}class GA extends ii{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 On.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class Nme{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 c=i.children[s],h=c.breakAfter;(n>0?c.length<=e:c.length<e)&&(!r||r.skip(c,0,c.length)!==!1||!c.isComposite)?(o=!!h,s++,e-=c.length):(l.push({tile:i,index:s}),i=c,s=0,r&&c.isComposite()&&r.enter(c))}else if(s==i.length)o=!!i.breakAfter,{tile:i,index:s}=l.pop(),s++;else if(e){let c=Math.min(e,i.length-s);r&&r.skip(i,s,s+c),e-=c,s+=c}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 Ime{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class Lme{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 c=o.children[o.children.length-1]=new Zd(l.dom,l.text+e);c.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)?M_(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 c=n.marks[l],h=i.lastChild;if(h instanceof fa&&h.mark.eq(c.mark))h.dom!=c.dom&&h.setDOM(M_(c.dom)),i=h;else{if(this.cache.reused.get(c)){let p=ii.get(c.dom);p&&p.setDOM(M_(c.dom))}let f=fa.of(c.mark,c.dom);i.append(f),i=f}this.cache.reused.set(c,2)}let s=ii.get(e.text);s&&this.cache.reused.set(s,2);let o=new Zd(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,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=nU);let i=qm.start(e,n||((r=this.cache.find(qm))===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 fa&&l.mark.eq(o))i=l,n--;else{let c=fa.of(o,(r=this.cache.find(fa,h=>h.mark.eq(o)))===null||r===void 0?void 0:r.dom);i.append(c),i=c,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!VN(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(yt.ios&&VN(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(R_,0,32)||new Mf(R_.toDOM(),0,R_,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=e.rank*102+e.value.rank,r=new Ime(e.from,e.to,e.value,n),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-r.rank||this.wrappers[i-1].to-r.to)<0;)i--;this.wrappers.splice(i,0,r)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof au&&i.wrapper.eq(r.wrapper))n=i;else{let s=au.of(r.wrapper,(e=this.cache.find(au,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(GA,void 0,1);return r&&(r.flags=n),r||new GA(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Bme{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 XA=[Mf,qm,Zd,fa,GA,au,tS];for(let t=0;t<XA.length;t++)XA[t].bucket=t;class Pme{constructor(e){this.view=e,this.buckets=XA.map(()=>[]),this.index=XA.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 c=(l+o)%s.length,h=s[c];if((!n||n(h))&&!this.reused.has(h))return s.splice(c,1),c<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,l.widget)))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 Mf(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 Fme{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new Pme(e),this.text=new Bme(e.state.doc),this.builder=new Lme(this.cache,new tS(e,e.contentDOM),vn.iter(r)),this.cache.reused.set(n,2),this.old=new Nme(n),this.reuseWalker={skip:(o,l,c)=>{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,c=l?l.fromA:this.old.root.length;if(c>i){let h=c-i;this.preserve(h,!o,!l),i=c,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.builder.flushBuffer(),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=zme(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(o,l,c)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let h=c>0||l<o.length?Mf.of(o.widget,this.view,c-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&&c==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,i,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,c),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 GA)this.cache.add(o);else if(o instanceof fa)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 fa&&i.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?i.length&&(i.length=s=0):o instanceof fa&&(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=vn.spans(this.decorations,e,n,{point:(l,c,h,f,p,m)=>{if(h instanceof Of){if(this.disallowBlockEffectsFor[m]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>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(c-l);else{let v=h.widget||(h.block?Qm.block:Qm.inline),y=$me(h),x=this.cache.findWidget(v,c-l,y)||Mf.of(v,this.view,c-l,y);h.block?(h.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(x)):(i.ensureLine(r),i.addInlineWidget(x,f,p))}r=null}else r=Hme(r,h);c>l&&this.text.skip(c-l)},span:(l,c,h,f)=>{for(let p=l;p<c;){let m=this.text.next(Math.min(512,c-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=ii.get(i);if(i==this.view.contentDOM)break;s instanceof fa?n.push(s):s!=null&&s.isLine()?r=s:s instanceof au||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new qm(i,nU):r||n.push(fa.of(new Wb({tagName:i.nodeName.toLowerCase(),attributes:pme(i)}),i)))}return{line:r,marks:n}}}function VN(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 $me(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 nU={class:"cm-line"};function Hme(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&$6(n,t),r&&(t.class+=" "+r)),t}function zme(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 fa&&e.push(r.mark)}return e}function M_(t){let e=ii.get(t);return e&&e.setDOM(t.cloneNode()),t}class Qm extends vl{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}}Qm.inline=new Qm("span");Qm.block=new Qm("div");const R_=new class extends vl{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class GN{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Dt.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 tS(e,e.contentDOM),this.updateInner([new vo(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:!Kme(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?Qme(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:f,to:p}=this.hasComposition;r=new vo(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,(yt.ie||yt.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=Yme(o,this.decorations,e.changes);c.length&&(r=vo.extendWithRanges(r,c));let h=Gme(l,this.blockWrappers,e.changes);return h.length&&(r=vo.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 Fme(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&ii.get(n.text)&&l.cache.reused.set(ii.get(n.text),2),this.tile=l.run(e,n),Ek(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=yt.chrome||yt.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 D_&&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(KQ)&&(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(tu)||r.tabIndex>-1)&&sv(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,h,f;if(c.empty?f=h=this.inlineDOMNearPos(c.anchor,c.assoc||1):(f=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),h=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),yt.gecko&&c.empty&&!this.hasComposition&&qme(h)){let m=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(m,h.node.childNodes[h.offset]||null)),h=f=new il(m,0),l=!0}let p=this.view.observer.selectionRange;(l||!p.focusNode||(!ov(h.node,h.offset,p.anchorNode,p.anchorOffset)||!ov(f.node,f.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,c))&&(this.view.observer.ignore(()=>{yt.android&&yt.chrome&&r.contains(p.focusNode)&&Xme(p.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let m=Qv(this.view.root);if(m)if(c.empty){if(yt.gecko){let v=Ume(h.node,h.offset);if(v&&v!=3){let y=(v==1?IQ:LQ)(h.node,h.offset);y&&(h=new il(y.node,y.offset))}}m.collapse(h.node,h.offset),c.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=c.bidiLevel)}else if(m.extend){m.collapse(h.node,h.offset);try{m.extend(f.node,f.offset)}catch{}}else{let v=document.createRange();c.anchor>c.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 il(p.anchorNode,p.anchorOffset),this.impreciseHead=f.precise?null:new il(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&ov(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=Qv(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 c=this.coordsAt(n.head,-1),h=this.coordsAt(n.head,1);if(!c||!h||c.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=pu(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&&!ii.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let o=0,l=i;;o++){let c=r.children[o];if(c.dom==s)return l;l+=c.length+c.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,c=!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,c=f>e),f>e&&o)return!0}}),!r&&!o?this.domAtPos(e,n):(s&&o?r=null:c&&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 D_?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 c=i(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=Xi(s.text,o);if(l==o)return null;let c=Wv(s.dom,o,l).getClientRects();for(let h=0;h<c.length;h++){let f=c[h];if(h==c.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,c=this.view.textDirection==pr.LTR,h=0,f=(p,m,v)=>{for(let y=0;y<p.children.length&&!(m>i);y++){let x=p.children[y],S=m+x.length,w=x.dom.getBoundingClientRect(),{height:A}=w;if(v&&!y&&(h+=w.top-v.top),x instanceof au)S>r&&f(x,m,w);else if(m>=r&&(h>0&&n.push(-h),n.push(A+h),h=0,o)){let C=x.dom.lastChild,j=C?av(C):[];if(j.length){let _=j[j.length-1],k=c?_.right-w.left:w.right-_.left;k>l&&(l=k,this.minWidth=s,this.minWidthFrom=m,this.minWidthTo=S)}}v&&y==p.children.length-1&&(h+=v.bottom-w.bottom),m=S+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"?pr.RTL:pr.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let h of o.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let f=av(h.dom);if(f.length!=1)return;l+=f[0].width,c=f[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:c}}});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=av(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(Dt.replace({widget:new D_(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return Dt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(J2).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(W6).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(vn.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(JQ).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var n;if(e.isSnapshot){let f=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=f.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let f of this.view.state.facet(XQ))try{if(f(this.view,e.range,e))return!0}catch(p){Qs(this.view.state,p,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),s;if(!i)return;!r.empty&&(s=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let o=Y6(this.view),l={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:c,offsetHeight:h}=this.view.scrollDOM;if(vme(this.view.scrollDOM,l,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,c),-c),Math.max(Math.min(e.yMargin,h),-h),this.view.textDirection==pr.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let f=this.view.docView.lineAt(r.head,1);f&&f.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Ek(this.tile)}}function Ek(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)Ek(r,e)}}function qme(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 rU(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=IQ(n.focusNode,n.focusOffset),i=LQ(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let l=ii.get(i.node);if(!l||l.isText()&&l.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let c=ii.get(r.node);!c||c.isText()&&c.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 Qme(t,e,n){let r=rU(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 c=e.invertedDesc;return{range:new vo(c.mapPos(s),c.mapPos(o),s,o),text:i}}function Ume(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 Wme=class{constructor(){this.changes=[]}compareRange(e,n){rm(e,n,this.changes)}comparePoint(e,n){rm(e,n,this.changes)}boundChange(e){rm(e,e,this.changes)}};function Yme(t,e,n){let r=new Wme;return vn.compare(t,e,n,r),r.changes}class Vme{constructor(){this.changes=[]}compareRange(e,n){rm(e,n,this.changes)}comparePoint(){}boundChange(e){rm(e,e,this.changes)}}function Gme(t,e,n){let r=new Vme;return vn.compare(t,e,n,r),r.changes}function Xme(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 Kme(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class D_ extends vl{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 Zme(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return Be.cursor(e);s==0?n=1:s==i.length&&(n=-1);let o=s,l=s;n<0?o=Xi(i.text,s,!1):l=Xi(i.text,s);let c=r(i.text.slice(o,l));for(;o>0;){let h=Xi(i.text,o,!1);if(r(i.text.slice(h,o))!=c)break;o=h}for(;l<i.length;){let h=Xi(i.text,l);if(r(i.text.slice(l,h))!=c)break;l=h}return Be.range(o+i.from,l+i.from)}function Jme(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,c=Math.floor((i-n.top-(t.defaultLineHeight-l)*.5)/l);s+=c*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+bk(o,s,t.state.tabSize)}function Mk(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==ms.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function e0e(t,e,n,r){let i=Mk(t,e.head,e.assoc||-1),s=!r||i.type!=ms.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),c=t.posAtCoords({x:n==(l==pr.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(c!=null)return Be.cursor(c,n?-1:1)}return Be.cursor(n?i.to:i.from,n?-1:1)}function XN(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,c=null;;){let h=kme(i,s,o,l,n),f=HQ;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(c){if(!c(f))return l}else{if(!r)return h;c=r(f)}l=h}}function t0e(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let o=r(s);return i==Pr.Space&&(i=o),i==o}}function n0e(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return Be.cursor(i,e.assoc);let o=e.goalColumn,l,c=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),f=t.documentTop;if(h)o==null&&(o=h.left-c.left),l=s<0?h.top:h.bottom;else{let y=t.viewState.lineBlockAt(i);o==null&&(o=Math.min(c.right-c.left,t.defaultCharacterWidth*(i-y.from))),l=(s<0?y.top:y.bottom)+f}let p=c.left+o,m=t.viewState.heightOracle.textHeight>>1,v=r??m;for(let y=0;;y+=m){let x=l+(v+y)*s,S=Rk(t,{x:p,y:x},!1,s);if(n?x>c.bottom:x<c.top)return Be.cursor(S.pos,S.assoc);let w=t.coordsAtPos(S.pos,S.assoc),A=w?(w.top+w.bottom)/2:0;if(!w||(n?A>l:A<l))return Be.cursor(S.pos,S.assoc,void 0,o)}}function lv(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 c=r||n||(e-s<o-e?-1:1);e=c<0?s:o,r=c}});if(!r)return e}}function iU(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=lv(t,i.from,0);o!=i.from&&(s=Be.cursor(o,-1))}else{let o=lv(t,i.from,-1),l=lv(t,i.to,1);(o!=i.from||l!=i.to)&&(s=Be.range(i.from==i.anchor?o:l,i.from==i.head?o:l))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?Be.create(n,e.mainIndex):e}function N_(t,e,n){let r=lv(t.state.facet(Vb).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Be.cursor(r,r<n.from?1:-1)}class Ul{constructor(e,n){this.pos=e,this.assoc=n}}function Rk(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:o,y:l}=e,c=l-s,h;for(;;){if(c<0)return new Ul(0,1);if(c>t.viewState.docHeight)return new Ul(t.state.doc.length,-1);if(h=t.elementAtHeight(c),r==null)break;if(h.type==ms.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>0?-1:1);if(m&&(r<0?m.top<=c+s:m.bottom>=c+s))break}let p=t.viewState.heightOracle.textHeight/2;c=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==ms.Text){let p=Jme(t,i,h,o,l);return new Ul(p,p==h.from?1:-1)}}if(h.type!=ms.Text)return c<(h.top+h.bottom)/2?new Ul(h.from,1):new Ul(h.to,-1);let f=t.docView.lineAt(h.from,2);return(!f||f.length!=h.length)&&(f=t.docView.lineAt(h.from,-2)),new r0e(t,o,l,t.textDirectionAt(h.from)).scanTile(f,h.from)}class r0e{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[Yl.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[Yl.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n,r=!1){let i=0,s=e.length-1,o=new Set,l=this.bidiIn(e[0],e[s]),c,h,f=-1,p=1e9,m;e:for(;i<s;){let y=s-i,x=i+s>>1;t:if(o.has(x)){let w=i+Math.floor(Math.random()*y);for(let A=0;A<y;A++){if(!o.has(w)){x=w;break t}w++,w==s&&(w=i)}break e}o.add(x);let S=n(x);if(S)for(let w=0;w<S.length;w++){let A=S[w],C=0;if(!(A.width==0&&S.length>1)){if(A.bottom<this.y)(!c||c.bottom<A.bottom)&&(c=A),C=1;else if(A.top>this.y)(!h||h.top>A.top)&&(h=A),C=-1;else{let j=A.left>this.x?this.x-A.left:A.right<this.x?this.x-A.right:0,_=Math.abs(j);_<p&&(f=x,p=_,m=A),j&&(C=j<0==(this.baseDir==pr.LTR)?-1:1)}C==-1&&(!l||this.baseDirAt(e[x],1))?s=x:C==1&&(!l||this.baseDirAt(e[x+1],-1))&&(i=x+1)}}}if(!m){if(!h&&!c)return{i:e[0],after:!1};let y=c&&(!h||this.y-c.bottom<h.top-this.y)?c:h;return this.y=(y.top+y.bottom)/2,this.scan(e,n,!0)}if(p&&!r){let{top:y,bottom:x}=m;if(c&&c.bottom>(y+y+x)/3)return this.y=c.bottom-1,this.scan(e,n,!0);if(h&&h.top<(y+x+x)/3)return this.y=h.top+1,this.scan(e,n,!0)}let v=(l?this.dirAt(e[f],1):this.baseDir)==pr.LTR;return{i:f,after:this.x>(m.left+m.right)/2==v}}scanText(e,n){let r=[];for(let s=0;s<e.length;s=Xi(e.text,s))r.push(n+s);r.push(n+e.length);let i=this.scan(r,s=>{let o=r[s]-n,l=r[s+1]-n;return Wv(e.dom,o,l).getClientRects()});return i.after?new Ul(r[i.i+1],-1):new Ul(r[i.i],1)}scanTile(e,n){if(!e.length)return new Ul(n,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let r=[n];for(let l=0,c=n;l<e.children.length;l++)r.push(c+=e.children[l].length);let i=this.scan(r,l=>{let c=e.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:Wv(c.dom,0,c.length)).getClientRects()}),s=e.children[i.i],o=r[i.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):i.after?new Ul(r[i.i+1],-1):new Ul(o,1)}}const Mp="";class i0e{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(wn.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Mp}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=ii.get(i),l=i.nextSibling;if(l==n){o!=null&&o.breakAfter&&!l&&r!=this.view.contentDOM&&this.lineBreak();break}let c=ii.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:YA(i))||YA(l)&&(i.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!a0e(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 c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=o-1);r=s+o}}readNode(e){let n=ii.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+(s0e(e,r.node,r.offset)?n:0))}}function s0e(t,e,n){for(;;){if(!e||n<pu(e))return!1;if(e==t)return!0;n=Gh(e)+1,e=e.parentNode}}function a0e(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=ii.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 KN{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class o0e{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=sU(e.docView.tile,n,r,0))){let c=s||o?[]:c0e(e),h=new i0e(c,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=u0e(c,this.bounds.from)}else{let c=e.observer.selectionRange,h=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!Ck(e.contentDOM,c.focusNode)?l.main.head:e.docView.posFromDOM(c.focusNode,c.focusOffset),f=o&&o.node==c.anchorNode&&o.offset==c.anchorOffset||!Ck(e.contentDOM,c.anchorNode)?l.main.anchor:e.docView.posFromDOM(c.anchorNode,c.anchorOffset),p=e.viewport;if((yt.ios||yt.chrome)&&l.main.empty&&h!=f&&(p.from>0||p.to<e.state.doc.length)){let m=Math.min(h,f),v=Math.max(h,f),y=p.from-m,x=p.to-v;(y==0||y==1||m==0)&&(x==0||x==-1||v==e.state.doc.length)&&(h=0,f=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(Be.range(f,h));else if(e.lineWrapping&&f==h&&!(l.main.empty&&l.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let m=e.coordsAtPos(h,-1),v=0;m&&(v=e.inputState.lastTouchY<=m.bottom?-1:1),this.newSel=Be.create([Be.cursor(h,v)])}else this.newSel=Be.single(f,h)}}}function sU(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,o=-1,l=-1;for(let c=0,h=r,f=r;c<t.children.length;c++){let p=t.children[c],m=h+p.length;if(h<e&&m>n)return sU(p,e,n,h);if(m>=e&&i==-1&&(i=c,s=h),h>n&&p.dom.parentNode==t.dom){o=c,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 aU(t,e){let n,{newSel:r}=e,{state:i}=t,s=i.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:c}=e.bounds,h=s.from,f=null;(o===8||yt.android&&e.text.length<c-l)&&(h=s.to,f="end");let p=i.doc.sliceString(l,c,Mp),m,v;!s.empty&&s.from>=l&&s.to<=c&&(e.typeOver||p!=e.text)&&p.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&p.slice(s.to-l)==e.text.slice(m=e.text.length-(p.length-(s.to-l)))?n={from:s.from,to:s.to,insert:On.of(e.text.slice(s.from-l,m).split(Mp))}:(v=oU(p,e.text,h-l,f))&&(yt.chrome&&o==13&&v.toB==v.from+2&&e.text.slice(v.from,v.toB)==Mp+Mp&&v.toB--,n={from:l+v.from,to:l+v.toA,insert:On.of(e.text.slice(v.from,v.toB).split(Mp))})}else r&&(!t.hasFocus&&i.facet(tu)||KA(r,s))&&(r=null);if(!n&&!r)return!1;if((yt.mac||yt.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Be.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:On.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:i.toText(t.inputState.insertingText)}:yt.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
 `&&t.lineWrapping&&(r&&(r=Be.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:On.of([" "])}),n)return V6(t,n,r,o);if(r&&!KA(r,s)){let l=!1,c="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),c=t.inputState.lastSelectionOrigin,c=="select.pointer"&&(r=iU(i.facet(Vb).map(h=>h(t)),r))),t.dispatch({selection:r,scrollIntoView:l,userEvent:c}),!0}else return!1}function V6(t,e,n,r=-1){if(yt.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(yt.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&&im(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)&&im(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&im(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=l0e(t,e,n));return t.state.facet(WQ).some(c=>c(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function l0e(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 c=e.from<s.from?-1:1,h=c<0?s.from:s.to,f=lv(i.facet(Vb).map(p=>p(t)),h,c);e.from==f&&(o=f)}if(o>-1)r={changes:e,selection:Be.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 c=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(c+e.insert.sliceString(0,void 0,t.state.lineBreak)+h))}else{let c=i.changes(e),h=n&&n.main.to<=c.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&&rU(t,n.main.head);if(m){let y=e.insert.length-(e.to-e.from);p={from:m.from,to:m.to-y}}else p=t.state.doc.lineAt(s.head);let v=s.to-e.to;r=i.changeByRange(y=>{if(y.from==s.from&&y.to==s.to)return{changes:c,range:h||y.map(c)};let x=y.to-v,S=x-f.length;if(t.state.sliceDoc(S,x)!=f||x>=p.from&&S<=p.to)return{range:y};let w=i.changes({from:S,to:x,insert:e.insert}),A=y.to-s.to;return{changes:w,range:h?Be.range(Math.max(0,h.anchor+A),Math.max(0,h.head+A)):y.map(w)}})}else r={changes:c,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 oU(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 c=Math.max(0,s-Math.min(o,l));n-=o+c-s}if(o<s&&t.length<e.length){let c=n<=s&&n>=o?s-n:0;s-=c,l=s+(l-o),o=s}else if(l<s){let c=n<=s&&n>=l?s-n:0;s-=c,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function c0e(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 KN(n,r)),(i!=n||s!=r)&&e.push(new KN(i,s))),e}function u0e(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?Be.single(n+e,r+e):null}function KA(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class h0e{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.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,yt.safari&&e.contentDOM.addEventListener("input",()=>null),yt.gecko&&_0e(e.contentDOM.ownerDocument)}handleEvent(e){!y0e(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=d0e(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&&cU.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),yt.android&&yt.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return yt.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((n=lU.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||f0e.indexOf(e.key)>-1&&e.ctrlKey)?(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,im(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:yt.safari&&!yt.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 ZN(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Qs(n.state,i)}}}function d0e(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 c=s[l];c&&n(l).handlers.push(ZN(r.value,c))}if(o)for(let l in o){let c=o[l];c&&n(l).observers.push(ZN(r.value,c))}}for(let r in fl)n(r).handlers.push(fl[r]);for(let r in ba)n(r).observers.push(ba[r]);return e}const lU=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],f0e="dthko",cU=[16,17,18,20,91,92,224,225],q1=6;function Q1(t){return Math.max(0,t)*.7+8}function p0e(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class m0e{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=RQ(e.contentDOM),this.atoms=e.state.facet(Vb).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(wn.allowMultipleSelections)&&g0e(e,n),this.dragging=b0e(e,n)&&dU(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&&p0e(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 c=Y6(this.view);e.clientX-c.left<=i+q1?n=-Q1(i-e.clientX):e.clientX+c.right>=o-q1&&(n=Q1(e.clientX-o)),e.clientY-c.top<=s+q1?r=-Q1(s-e.clientY):e.clientY+c.bottom>=l-q1&&(r=Q1(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=iU(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 g0e(t,e){let n=t.state.facet(zQ);return n.length?n[0](e):yt.mac?e.metaKey:e.ctrlKey}function v0e(t,e){let n=t.state.facet(qQ);return n.length?n[0](e):yt.mac?!e.altKey:!e.ctrlKey}function b0e(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Qv(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 y0e(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=ii.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const fl=Object.create(null),ba=Object.create(null),uU=yt.ie&&yt.ie_version<15||yt.ios&&yt.webkit_version<604;function x0e(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(),hU(t,n.value)},50)}function nS(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function hU(t,e){e=nS(t.state,q6,e);let{state:n}=t,r,i=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(Dk!=null&&n.selection.ranges.every(c=>c.empty)&&Dk==s.toString()){let c=-1;r=n.changeByRange(h=>{let f=n.doc.lineAt(h.from);if(f.from==c)return{range:h};c=f.from;let p=n.toText((o?s.line(i++).text:e)+n.lineBreak);return{changes:{from:f.from,insert:p},range:Be.cursor(h.from+p.length)}})}else o?r=n.changeByRange(c=>{let h=s.line(i++);return{changes:{from:c.from,to:c.to,insert:h.text},range:Be.cursor(c.from+h.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}ba.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};ba.wheel=ba.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};fl.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);ba.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};ba.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};fl.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(QQ))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=w0e(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new m0e(t,e,n,r)),r&&t.observer.ignore(()=>{DQ(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 JN(t,e,n,r){if(r==1)return Be.cursor(e,n);if(r==2)return Zme(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++,Be.range(o,l)}}const A0e=yt.ie&&yt.ie_version<=11;let eI=null,tI=0,nI=0;function dU(t){if(!A0e)return t.detail;let e=eI,n=nI;return eI=t,nI=Date.now(),tI=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(tI+1)%3:1}function w0e(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=dU(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 c=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),h,f=JN(t,c.pos,c.assoc,r);if(n.pos!=c.pos&&!o){let p=JN(t,n.pos,n.assoc,r),m=Math.min(p.from,f.from),v=Math.max(p.to,f.to);f=m<f.from?Be.range(m,v,f.assoc):Be.range(v,m,f.assoc)}return o?i.replaceRange(i.main.extend(f.from,f.to,f.assoc)):l&&r==1&&i.ranges.length>1&&(h=S0e(i,c.pos))?h:l?i.addRange(f):Be.create([f])}}}function S0e(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 Be.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}fl.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=Be.range(s,o))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",nS(t.state,Q6,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};fl.dragend=t=>(t.inputState.draggedContent=null,!1);function rI(t,e,n,r){if(n=nS(t.state,q6,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=r&&s&&v0e(t,e)?{from:s.from,to:s.to}:null,l={from:i,insert:n},c=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}fl.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&&rI(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 rI(t,e,r,!0),!0}return!1};fl.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=uU?null:e.clipboardData;return n?(hU(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(x0e(t),!1)};function j0e(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 C0e(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:nS(t,Q6,e.join(t.lineBreak)),ranges:n,linewise:r}}let Dk=null;fl.copy=fl.cut=(t,e)=>{if(!sv(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=C0e(t.state);if(!n&&!i)return!1;Dk=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=uU?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(j0e(t,n),!1)};const fU=dc.define();function pU(t,e){let n=[];for(let r of t.facet(YQ)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:fU.of(!0)}):null}function mU(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=pU(t.state,e);n?t.dispatch(n):t.update([])}},10)}ba.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),mU(t)};ba.blur=t=>{t.observer.clearSelectionRange(),mU(t)};ba.compositionstart=ba.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};ba.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,yt.chrome&&yt.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};ba.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};fl.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],c=t.posAtDOM(l.startContainer,l.startOffset),h=t.posAtDOM(l.endContainer,l.endOffset);return V6(t,{from:c,to:h,insert:t.state.toText(s)},null),!0}}let i;if(yt.chrome&&yt.android&&(i=lU.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 yt.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),yt.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>ba.compositionend(t,e),20),!1};const iI=new Set;function _0e(t){iI.has(t)||(iI.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const sI=["pre-wrap","normal","pre-line","break-spaces"];let Um=!1;function aI(){Um=!1}class T0e{constructor(e){this.lineWrapping=e,this.doc=On.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 sI.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=sI.indexOf(e)>-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,c){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 c}}class k0e{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Jo{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"?ms.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 Of?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 Jo(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var yr=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(yr||(yr={}));const Wx=.001;class Ys{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)>Wx&&(Um=!0),this.height=e)}replace(e,n,r){return Ys.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:c,toA:h,fromB:f,toB:p}=i[l],m=s.lineAt(c,yr.ByPosNoHeight,r.setDoc(n),0,0),v=m.to>=h?m:s.lineAt(h,yr.ByPosNoHeight,r,0,0);for(p+=v.to-h,h=v.to;l>0&&m.from<=i[l-1].toA;)c=i[l-1].fromA,f=i[l-1].fromB,l--,c<m.from&&(m=s.lineAt(c,yr.ByPosNoHeight,r,0,0));f+=m.from-c,c=m.from;let y=G6.build(r.setDoc(o),e,f,p);s=ZA(s,s.replace(c,h,y))}return s.updateHeight(r,0)}static empty(){return new Pa(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 E0e(Ys.of(e.slice(0,n)),o,Ys.of(e.slice(r)))}}function ZA(t,e){return t==e?t:(t.constructor!=e.constructor&&(Um=!0),e)}Ys.prototype.size=1;const O0e=Dt.replace({});class gU extends Ys{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Jo(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 Jo(i,0,r,this.spaceAbove,O0e):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,yr.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 Pa extends gU{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 Jo(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 Pa||i instanceof ls&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof ls?i=new Pa(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Ys.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 ls extends Ys{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 c=Math.min(this.height,e.lineHeight*s);o=c/s,this.length>s+1&&(l=(this.height-c)/(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:c}=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*c,m=Math.max(r,e-p/2);return new Jo(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 Jo(f,p,r+l*h,l,0)}}lineAt(e,n,r,i,s){if(n==yr.ByHeight)return this.blockAt(e,r,i,s);if(n==yr.ByPosNoHeight){let{from:v,to:y}=r.doc.lineAt(e);return new Jo(v,y-v,0,0,0)}let{firstLine:o,perLine:l,perChar:c}=this.heightMetrics(r,s),h=r.doc.lineAt(e),f=l+h.length*c,p=h.number-o,m=i+l*p+c*(h.from-s-p);return new Jo(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:c,perChar:h}=this.heightMetrics(r,s);for(let f=e,p=i;f<=n;){let m=r.doc.lineAt(f);if(f==e){let y=m.number-l;p+=c*y+h*(e-s-y)}let v=c+h*m.length;o(new Jo(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 ls?r[r.length-1]=new ls(s.length+i):r.push(null,new ls(i-1))}if(e>0){let s=r[0];s instanceof ls?r[0]=new ls(e+s.length):r.unshift(new ls(e-1),null)}return Ys.of(r)}decomposeLeft(e,n){n.push(new ls(e-1),null)}decomposeRight(e,n){n.push(null,new ls(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),c=-1;for(i.from>n&&o.push(new ls(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++]),c==-1?c=p:Math.abs(p-c)>=Wx&&(c=-2);let v=new Pa(f,p,m);v.outdated=!1,o.push(v),l+=f+1}l<=s&&o.push(null,new ls(s-l).updateHeight(e,l));let h=Ys.of(o);return(c<0||Math.abs(h.height-this.height)>=Wx||Math.abs(c-this.heightMetrics(e,n).perLine)>=Wx)&&(Um=!0),ZA(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 E0e extends Ys{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,c=n==yr.ByHeight?e<o:e<l,h=c?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,o,l);if(this.break||(c?h.to<l:h.from>l))return h;let f=n==yr.ByPosNoHeight?yr.ByPosNoHeight:yr.ByPos;return c?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,c=s+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,n,r,i,s,o),n>=c&&this.right.forEachLine(e,n,r,l,c,o);else{let h=this.lineAt(c,yr.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,c,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&&oI(s,o-1),n<this.length){let l=s.length;this.decomposeRight(n,s),oI(s,l)}return Ys.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?Ys.of(this.break?[e,null,n]:[e,n]):(this.left=ZA(this.left,e),this.right=ZA(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,c=null;return i&&i.from<=n+s.length&&i.more?c=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=l+o.length&&i.more?c=o=o.updateHeight(e,l,r,i):o.updateHeight(e,l,r),c?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 oI(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof ls&&(r=t[e+1])instanceof ls&&t.splice(e-1,3,new ls(n.length+1+r.length))}const M0e=5;class G6{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 Pa?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Pa(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 gU(o,i,r)):(o||s||i>=M0e)&&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 Pa(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new ls(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 Pa)return e;let n=new Pa(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 Pa)&&!this.isCovered?this.nodes.push(new Pa(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 Pa&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new G6(r,e);return vn.spans(n,r,i,s,0),s.finish(r)}}function R0e(t,e,n){let r=new D0e;return vn.compare(t,e,n,r,0),r.changes}class D0e{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&rm(e,n,this.changes,5)}}function N0e(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),c=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),c=Math.min(h==t.parentNode?i.innerHeight:c,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,c)-(n.top+e)}}function I0e(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 L0e(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class I_{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 Dt.replace({widget:new B0e(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class B0e extends vl{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 lI{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=cI,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=pr.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(U6).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new T0e(r),this.stateDeco=uI(n),this.heightMap=Ys.empty().applyChanges(this.stateDeco,On.empty,this.heightOracle.setDoc(n.doc),[new vo(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Dt.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,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 U1(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?cI:new X6(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(qg(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=uI(this.state);let i=e.changedRanges,s=vo.extendWithRanges(i,R0e(r,this.stateDeco,e?e.changes:Mi.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);aI(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Um)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let c=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<c.from||n.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let h=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,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(GQ)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?pr.RTL:pr.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=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:_,scaleY:k}=MQ(n,l);(_>.005&&Math.abs(this.scaleX-_)>.005||k>.005&&Math.abs(this.scaleY-k)>.005)&&(this.scaleX=_,this.scaleY=k,h|=16,o=c=!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&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let v=RQ(this.view.contentDOM,!1).y;v!=this.scrollParent&&(this.scrollParent=v,this.scrollAnchorHeight=-1,this.scrollOffset=0);let y=this.getScrollOffset();this.scrollOffset!=y&&(this.scrollAnchorHeight=-1,this.scrollOffset=y),this.scrolledToBottom=NQ(this.scrollParent||e.win);let x=(this.printing?L0e:N0e)(n,this.paddingTop),S=x.top-this.pixelViewport.top,w=x.bottom-this.pixelViewport.bottom;this.pixelViewport=x;let A=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(A!=this.inView&&(this.inView=A,A&&(c=!0)),!this.inView&&!this.scrollTarget&&!I0e(e.dom))return 0;let C=l.width;if((this.contentDOMWidth!=C||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),c){let _=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(_)&&(o=!0),o||i.lineWrapping&&Math.abs(C-this.contentDOMWidth)>i.charWidth){let{lineHeight:k,charWidth:M,textHeight:R}=e.docView.measureTextSize();o=k>0&&i.refresh(s,k,M,R,Math.max(5,C/M),_),o&&(e.docView.minWidth=0,h|=16)}S>0&&w>0?f=Math.max(S,w):S<0&&w<0&&(f=Math.min(S,w)),aI();for(let k of this.viewports){let M=k.from==this.viewport.from?_:e.docView.measureVisibleLineHeights(k);this.heightMap=(o?Ys.empty().applyChanges(this.stateDeco,On.empty,this.heightOracle,[new vo(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new k0e(k.from,M))}Um&&(h|=2)}let j=!this.viewportIsAppropriate(this.viewport,f)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return j&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(f,this.scrollTarget),h|=this.updateForViewport()),(h&2||j)&&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,c=new U1(i.lineAt(o-r*1e3,yr.ByHeight,s,0,0).from,i.lineAt(l+(1-r)*1e3,yr.ByHeight,s,0,0).to);if(n){let{head:h}=n.range;if(h<c.from||h>c.to){let f=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=i.lineAt(h,yr.ByPos,s,0,0),m;n.y=="center"?m=(p.top+p.bottom)/2-f/2:n.y=="start"||n.y=="nearest"&&h<c.from?m=p.top:m=p.bottom-f,c=new U1(i.lineAt(m-1e3/2,yr.ByHeight,s,0,0).from,i.lineAt(m+f+1e3/2,yr.ByHeight,s,0,0).to)}}return c}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new U1(this.heightMap.lineAt(r,yr.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,yr.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,yr.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,yr.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 I_(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!=pr.LTR&&!r)return[];let l=[],c=(f,p,m,v)=>{if(p-f<s)return;let y=this.state.selection.main,x=[y.from];y.empty||x.push(y.to);for(let w of x)if(w>f&&w<p){c(f,w-10,m,v),c(w+10,p,m,v);return}let S=F0e(e,w=>w.from>=m.from&&w.to<=m.to&&Math.abs(w.from-f)<s&&Math.abs(w.to-p)<s&&!x.some(A=>w.from<A&&w.to>A));if(!S){if(p<m.to&&n&&r&&n.visibleRanges.some(C=>C.from<=p&&C.to>=p)){let C=n.moveToLineBoundary(Be.cursor(p),!1,!0).head;C>f&&(p=C)}let w=this.gapSize(m,f,p,v),A=r||w<2e6?w:2e6;S=new I_(f,p,w,A)}l.push(S)},h=f=>{if(f.length<o||f.type!=ms.Text)return;let p=P0e(f.from,f.to,this.stateDeco);if(p.total<o)return;let m=this.scrollTarget?this.scrollTarget.range.head:null,v,y;if(r){let x=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,S,w;if(m!=null){let A=Y1(p,m),C=((this.visibleBottom-this.visibleTop)/2+x)/f.height;S=A-C,w=A+C}else S=(this.visibleTop-f.top-x)/f.height,w=(this.visibleBottom-f.top+x)/f.height;v=W1(p,S),y=W1(p,w)}else{let x=p.total*this.heightOracle.charWidth,S=i*this.heightOracle.charWidth,w=0;if(x>2e6)for(let k of e)k.from>=f.from&&k.from<f.to&&k.size!=k.displaySize&&k.from*this.heightOracle.charWidth+w<this.pixelViewport.left&&(w=k.size-k.displaySize);let A=this.pixelViewport.left+w,C=this.pixelViewport.right+w,j,_;if(m!=null){let k=Y1(p,m),M=((C-A)/2+S)/x;j=k-M,_=k+M}else j=(A-S)/x,_=(C+S)/x;v=W1(p,j),y=W1(p,_)}v>f.from&&c(f.from,v,f,p),y<f.to&&c(y,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=Y1(i,r)-Y1(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){I_.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Dt.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=[];vn.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)||qg(this.heightMap.lineAt(e,yr.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)||qg(this.heightMap.lineAt(this.scaler.fromDOM(e),yr.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(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 qg(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 U1{constructor(e,n){this.from=e,this.to=n}}function P0e(t,e,n){let r=[],i=t,s=0;return vn.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 W1({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 Y1(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 F0e(t,e){for(let n of t)if(e(n))return n}const cI={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function uI(t){let e=t.facet(J2).filter(r=>typeof r!="function"),n=t.facet(W6).filter(r=>typeof r!="function");return n.length&&e.push(vn.join(n)),e}class X6{constructor(e,n,r){let i=0,s=0,o=0;this.viewports=r.map(({from:l,to:c})=>{let h=n.lineAt(l,yr.ByPos,e,0,0).top,f=n.lineAt(c,yr.ByPos,e,0,0).bottom;return i+=f-h,{from:l,to:c,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 X6?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 qg(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Jo(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>qg(i,e)):t._content)}const V1=vt.define({combine:t=>t.join(" ")}),Nk=vt.define({combine:t=>t.indexOf(!0)>-1}),Ik=Yh.newName(),vU=Yh.newName(),bU=Yh.newName(),yU={"&light":"."+vU,"&dark":"."+bU};function Lk(t,e,n){return new Yh(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 $0e=Lk("."+Ik,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},yU),H0e={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},L_=yt.ie&&yt.ie_version<=11;class z0e{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new bme,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);(yt.ie&&yt.ie_version<=11||yt.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&&yt.android&&e.constructor.EDIT_CONTEXT!==!1&&!(yt.chrome&&yt.chrome_version<126)&&(this.editContext=new Q0e(e),e.state.facet(tu)&&(e.contentDOM.editContext=this.editContext.editContext)),L_&&(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(tu)?r.root.activeElement!=this.dom:!sv(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}(yt.ie&&yt.ie_version<=11||yt.android&&yt.chrome)&&!r.state.selection.main.empty&&i.focusNode&&ov(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Qv(e.root);if(!n)return!1;let r=yt.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&q0e(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=sv(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&xme(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,H0e),L_&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),L_&&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&&im(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&&sv(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 o0e(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=aU(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!KA(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=hI(n,e.previousSibling||e.target.previousSibling,-1),i=hI(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(tu)!=e.state.facet(tu)&&(e.view.contentDOM.editContext=e.state.facet(tu)?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 hI(t,e,n){for(;e;){let r=ii.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 dI(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 ov(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function q0e(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return dI(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?dI(t,n):null}class Q0e{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),c=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:l,drifted:!1});let h=c-l>r.text.length;l==this.from&&s<this.from?l=s:c==this.to&&s>this.to&&(c=s);let f=oU(e.state.sliceDoc(l,c),r.text,(h?i.from:i.to)-l,h?"end":null);if(!f){let m=Be.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));KA(m,i)||e.dispatch({selection:m,userEvent:"select"});return}let p={from:f.from+l,to:f.toA+l,insert:On.of(r.text.slice(f.from,f.toB).split(`
`))};if((yt.mac||yt.android)&&p.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:l,to:c,insert:On.of([r.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let m=this.to-this.from+(p.to-p.from+p.insert.length);V6(e,p,Be.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 c=e.coordsForChar(o);s=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.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 c=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(c<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(Dt.mark({attributes:{style:f}}).range(c,h))}}}e.dispatch({effects:KQ.of(Dt.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=Qv(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,c,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 ot{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||yme(e.parent)||document,this.viewState=new lI(this,e.state||wn.create(e)),e.scrollTo&&e.scrollTo.is(z1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Fp).map(i=>new E_(i));for(let i of this.plugins)i.update(this);this.observer=new z0e(this),this.inputState=new h0e(this),this.inputState.ensureHandlers(this.plugins),this.docView=new GN(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof ji?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,c=null;e.some(m=>m.annotation(fU))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=pU(s,o),c||(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(wn.phrases)!=this.state.facet(wn.phrases))return this.setState(s);i=VA.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,{x:y,y:x}=this.state.facet(ot.cursorScrollMargin);p=new sm(v.empty?v:Be.cursor(v.head,v.head>v.anchor?-1:1),"nearest","nearest",x,y)}for(let v of m.effects)v.is(z1)&&(p=v.value.clip(this.state))}this.viewState.update(i,p),this.bidiCache=JA.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(zg)!=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(V1)!=i.state.facet(V1)&&(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(Ok))try{m(i)}catch(v){Qs(this.state,v,"update listener")}(c||f)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),f&&!aU(this,f)&&h.force&&im(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 lI(this,e),this.plugins=e.facet(Fp).map(r=>new E_(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new GN(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(Fp),r=e.state.facet(Fp);if(n!=r){let i=[];for(let s of r){let o=n.indexOf(s);if(o<0)i.push(new E_(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){Qs(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.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(NQ(r||this.win))s=-1,o=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(i);s=v.from,o=v.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!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=[];c&4||([this.measureRequests,h]=[h,this.measureRequests]);let f=h.map(v=>{try{return v.read(this)}catch(y){return Qs(this.state,y),fI}}),p=VA.create(this,this.state,[]),m=!1;p.flags|=c,n?n.flags|=c: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]!=fI)try{let y=h[v];y.write&&y.write(f[v],this)}catch(y){Qs(this.state,y)}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 y=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((y>1||y<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+y,r?r.scrollTop+=y:this.win.scrollBy(0,y),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Ok))l(n)}get themeClasses(){return Ik+" "+(this.state.facet(Nk)?bU:vU)+" "+this.state.facet(V1)}updateAttrs(){let e=pI(this,ZQ,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(tu)?"true":"false",class:"cm-content",style:`${yt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),pI(this,U6,n);let r=this.observer.ignore(()=>{let i=qN(this.contentDOM,this.contentAttrs,n),s=qN(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(ot.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(zg);let e=this.state.facet(ot.cspNonce);Yh.mount(this.root,this.styleModules.concat($0e).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 N_(this,e,XN(this,e,n,r))}moveByGroup(e,n){return N_(this,e,XN(this,e,n,r=>t0e(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 Be.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return e0e(this,e,n,r)}moveVertically(e,n,r){return N_(this,e,n0e(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=Rk(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Rk(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[Yl.find(s,e-i.from,-1,n)];return Uv(r,o.dir==pr.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(VQ)||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>U0e)return $Q(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||FQ(s.isolates,r=WN(this,e))))return s.order;r||(r=WN(this,e));let i=Tme(e.text,n,r);return this.bidiCache.push(new JA(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||yt.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{DQ(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={}){var r,i,s,o;return z1.of(new sm(typeof e=="number"?Be.cursor(e):e,(r=n.y)!==null&&r!==void 0?r:"nearest",(i=n.x)!==null&&i!==void 0?i:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return z1.of(new sm(Be.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 Yr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Yr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Yh.newName(),i=[V1.of(r),zg.of(Lk(`.${r}`,e))];return n&&n.dark&&i.push(Nk.of(!0)),i}static baseTheme(e){return ju.lowest(zg.of(Lk("."+Ik,e,yU)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&ii.get(r)||ii.get(e);return((n=i==null?void 0:i.root)===null||n===void 0?void 0:n.view)||null}}ot.styleModule=zg;ot.inputHandler=WQ;ot.clipboardInputFilter=q6;ot.clipboardOutputFilter=Q6;ot.scrollHandler=XQ;ot.focusChangeEffect=YQ;ot.perLineTextDirection=VQ;ot.exceptionSink=UQ;ot.updateListener=Ok;ot.editable=tu;ot.mouseSelectionStyle=QQ;ot.dragMovesSelection=qQ;ot.clickAddsSelectionRange=zQ;ot.decorations=J2;ot.blockWrappers=JQ;ot.outerDecorations=W6;ot.atomicRanges=Vb;ot.bidiIsolatedRanges=eU;ot.cursorScrollMargin=vt.define({combine:t=>{let e=5,n=5;for(let r of t)typeof r=="number"?e=n=r:{x:e,y:n}=r;return{x:e,y:n}}});ot.scrollMargins=tU;ot.darkTheme=Nk;ot.cspNonce=vt.define({combine:t=>t.length?t[0]:""});ot.contentAttributes=U6;ot.editorAttributes=ZQ;ot.lineWrapping=ot.contentAttributes.of({class:"cm-lineWrapping"});ot.announce=Vt.define();const U0e=4096,fI={};class JA{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:pr.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 JA(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function pI(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&&$6(o,n)}return n}const W0e=yt.mac?"mac":yt.windows?"win":yt.linux?"linux":"key";function Y0e(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,o,l;for(let c=0;c<n.length-1;++c){const h=n[c];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 G1(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 V0e=ju.default(ot.domEventHandlers({keydown(t,e){return AU(xU(e.state),t,e,"editor")}})),Ph=vt.define({enables:V0e}),mI=new WeakMap;function xU(t){let e=t.facet(Ph),n=mI.get(e);return n||mI.set(e,n=K0e(e.reduce((r,i)=>r.concat(i),[]))),n}function G0e(t,e,n){return AU(xU(t.state),e,t,n)}let Ah=null;const X0e=4e3;function K0e(t,e=W0e){let n=Object.create(null),r=Object.create(null),i=(o,l)=>{let c=r[o];if(c==null)r[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,c,h,f)=>{var p,m;let v=n[o]||(n[o]=Object.create(null)),y=l.split(/ (?!$)/).map(w=>Y0e(w,e));for(let w=1;w<y.length;w++){let A=y.slice(0,w).join(" ");i(A,!0),v[A]||(v[A]={preventDefault:!0,stopPropagation:!1,run:[C=>{let j=Ah={view:C,prefix:A,scope:o};return setTimeout(()=>{Ah==j&&(Ah=null)},X0e),!0}]})}let x=y.join(" ");i(x,!1);let S=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())||[]});c&&S.run.push(c),h&&(S.preventDefault=!0),f&&(S.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,Bk))}let c=o[e]||o.key;if(c)for(let h of l)s(h,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(h,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return n}let Bk=null;function AU(t,e,n,r){Bk=e;let i=dme(e),s=ua(i,0),o=Ql(s)==i.length&&i!=" ",l="",c=!1,h=!1,f=!1;Ah&&Ah.view==n&&Ah.scope==r&&(l=Ah.prefix+" ",cU.indexOf(e.keyCode)<0&&(h=!0,Ah=null));let p=new Set,m=S=>{if(S){for(let w of S.run)if(!p.has(w)&&(p.add(w),w(n)))return S.stopPropagation&&(f=!0),!0;S.preventDefault&&(S.stopPropagation&&(f=!0),h=!0)}return!1},v=t[r],y,x;return v&&(m(v[l+G1(i,e,!o)])?c=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(yt.windows&&e.ctrlKey&&e.altKey)&&!(yt.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(y=Vh[e.keyCode])&&y!=i?(m(v[l+G1(y,e,!0)])||e.shiftKey&&(x=zv[e.keyCode])!=i&&x!=y&&m(v[l+G1(x,e,!1)]))&&(c=!0):o&&e.shiftKey&&m(v[l+G1(i,e,!0)])&&(c=!0),!c&&m(v._any)&&(c=!0)),h&&(c=!0),c&&f&&e.stopPropagation(),Bk=null,c}class Af{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=wU(e);return[new Af(n,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return Z0e(e,n,r)}}function wU(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==pr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function gI(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}),c=t.posAtCoords({x:s.right-1,y:o});return l==null||c==null?r:{from:Math.max(r.from,Math.min(l,c)),to:Math.min(r.to,Math.max(l,c))}}function Z0e(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==pr.LTR,o=t.contentDOM,l=o.getBoundingClientRect(),c=wU(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=Mk(t,r,1),y=Mk(t,i,-1),x=v.type==ms.Text?v:null,S=y.type==ms.Text?y:null;if(x&&(t.lineWrapping||v.widgetLineBreaks)&&(x=gI(t,r,1,x)),S&&(t.lineWrapping||y.widgetLineBreaks)&&(S=gI(t,i,-1,S)),x&&S&&x.from==S.from&&x.to==S.to)return A(C(n.from,n.to,x));{let _=x?C(n.from,null,x):j(v,!1),k=S?C(null,n.to,S):j(y,!0),M=[];return(x||v).to<(S||y).from-(x&&S?1:0)||v.widgetLineBreaks>1&&_.bottom+t.defaultLineHeight/2<k.top?M.push(w(p,_.bottom,m,k.top)):_.bottom<k.top&&t.elementAtHeight((_.bottom+k.top)/2).type==ms.Text&&(_.bottom=k.top=(_.bottom+k.top)/2),A(_).concat(M).concat(A(k))}function w(_,k,M,R){return new Af(e,_-c.left,k-c.top,Math.max(0,M-_),R-k)}function A({top:_,bottom:k,horizontal:M}){let R=[];for(let N=0;N<M.length;N+=2)R.push(w(M[N],_,M[N+1],k));return R}function C(_,k,M){let R=1e9,N=-1e9,I=[];function D(P,H,B,F,q){let X=t.coordsAtPos(P,P==M.to?-2:2),Y=t.coordsAtPos(B,B==M.from?2:-2);!X||!Y||(R=Math.min(X.top,Y.top,R),N=Math.max(X.bottom,Y.bottom,N),q==pr.LTR?I.push(s&&H?p:X.left,s&&F?m:Y.right):I.push(!s&&F?p:Y.left,!s&&H?m:X.right))}let L=_??M.from,z=k??M.to;for(let P of t.visibleRanges)if(P.to>L&&P.from<z)for(let H=Math.max(P.from,L),B=Math.min(P.to,z);;){let F=t.state.doc.lineAt(H);for(let q of t.bidiSpans(F)){let X=q.from+F.from,Y=q.to+F.from;if(X>=B)break;Y>H&&D(Math.max(X,H),_==null&&X<=L,Math.min(Y,B),k==null&&Y>=z,q.dir)}if(H=F.to+1,H>=B)break}return I.length==0&&D(L,_==null,z,k==null,t.textDirection),{top:R,bottom:N,horizontal:I}}function j(_,k){let M=l.top+(k?_.top:_.bottom);return{top:M,bottom:M,horizontal:[]}}}function J0e(t,e){return t.constructor==e.constructor&&t.eq(e)}class ege{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(Yx)!=e.state.facet(Yx)&&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(Yx);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)=>!J0e(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,yt.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Yx=vt.define();function SU(t){return[Yr.define(e=>new ege(e,t)),Yx.of(t)]}const Wm=vt.define({combine(t){return fc(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function tge(t={}){return[Wm.of(t),nge,rge,ige,GQ.of(!0)]}function jU(t){return t.startState.facet(Wm)!=t.state.facet(Wm)}const nge=SU({above:!0,markers(t){let{state:e}=t,n=e.facet(Wm),r=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||n.drawRangeCursor&&!(s&&yt.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=i.empty?i:Be.cursor(i.head,i.assoc);for(let c of Af.forRange(t,o,l))r.push(c)}}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=jU(t);return n&&vI(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){vI(e.state,t)},class:"cm-cursorLayer"});function vI(t,e){e.style.animationDuration=t.facet(Wm).cursorBlinkRate+"ms"}const rge=SU({above:!1,markers(t){let e=[],{main:n,ranges:r}=t.state.selection;for(let i of r)if(!i.empty)for(let s of Af.forRange(t,"cm-selectionBackground",i))e.push(s);if(yt.ios&&!n.empty&&t.state.facet(Wm).iosSelectionHandles){for(let i of Af.forRange(t,"cm-selectionHandle cm-selectionHandle-start",Be.cursor(n.from,1)))e.push(i);for(let i of Af.forRange(t,"cm-selectionHandle cm-selectionHandle-end",Be.cursor(n.to,1)))e.push(i)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||jU(t)},class:"cm-selectionLayer"}),ige=ju.highest(ot.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"}}}})),CU=Vt.define({map(t,e){return t==null?null:e.mapPos(t)}}),Qg=gs.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(CU)?r.value:n,t)}}),sge=Yr.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(Qg);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(Qg)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Qg),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(Qg)!=t&&this.view.dispatch({effects:CU.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 age(){return[Qg,sge]}function bI(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 oge(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 lge{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,c,h,f)=>i(f,h,h+l[0].length,l,c);else if(typeof r=="function")this.addMatch=(l,c,h,f)=>{let p=r(l,c,h);p&&f(h,h+l[0].length,p)};else if(r)this.addMatch=(l,c,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 fu,r=n.add.bind(n);for(let{from:i,to:s}of oge(e,this.maxLength))bI(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,c)=>{c>=e.view.viewport.from&&l<=e.view.viewport.to&&(r=Math.min(l,r),i=Math.max(c,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 c=e.state.doc.lineAt(o),h=c.to<l?e.state.doc.lineAt(l):c,f=Math.max(s.from,c.from),p=Math.min(s.to,h.to);if(this.boundary){for(;o>c.from;o--)if(this.boundary.test(c.text[o-1-c.from])){f=o;break}for(;l<h.to;l++)if(this.boundary.test(h.text[l-h.from])){p=l;break}}let m=[],v,y=(x,S,w)=>m.push(w.range(x,S));if(c==h)for(this.regexp.lastIndex=f-c.from;(v=this.regexp.exec(c.text))&&v.index<p-c.from;)this.addMatch(v,e,v.index+c.from,y);else bI(e.state.doc,this.regexp,f,p,(x,S)=>this.addMatch(S,e,x,y));n=n.update({filterFrom:f,filterTo:p,filter:(x,S)=>x<f||S>p,add:m})}}return n}}const Pk=/x/.unicode!=null?"gu":"g",cge=new RegExp(`[\0-\b
--­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF￹-￼]`,Pk),uge={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 B_=null;function hge(){var t;if(B_==null&&typeof document<"u"&&document.body){let e=document.body.style;B_=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return B_||!1}const Vx=vt.define({combine(t){let e=fc(t,{render:null,specialChars:cge,addSpecialChars:null});return(e.replaceTabs=!hge())&&(e.specialChars=new RegExp("	|"+e.specialChars.source,Pk)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Pk)),e}});function _U(t={}){return[Vx.of(t),dge()]}let yI=null;function dge(){return yI||(yI=Yr.fromClass(class{constructor(t){this.view=t,this.decorations=Dt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Vx)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new lge({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,s=ua(e[0],0);if(s==9){let o=i.lineAt(r),l=n.state.tabSize,c=v0(o.text,l,r-o.from);return Dt.replace({widget:new gge((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Dt.replace({widget:new mge(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Vx);t.startState.facet(Vx)!=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 fge="•";function pge(t){return t>=32?fge:t==10?"␤":String.fromCharCode(9216+t)}class mge extends vl{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=pge(this.code),r=e.state.phrase("Control character")+" "+(uge[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 gge extends vl{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 vge(){return yge}const bge=Dt.line({class:"cm-activeLine"}),yge=Yr.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(bge.range(i.from)),e=i.from)}return Dt.set(n)}},{decorations:t=>t.decorations});class xge extends vl{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?av(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=Uv(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 TU(t){let e=Yr.fromClass(class{constructor(n){this.view=n,this.placeholder=t?Dt.set([Dt.widget({widget:new xge(t),side:1}).range(0)]):Dt.none}get decorations(){return this.view.state.doc.length?Dt.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,ot.contentAttributes.of({"aria-placeholder":t})]:e}const Fk=2e3;function Age(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),s=[];if(e.off>Fk||n.off>Fk||e.col<0||n.col<0){let o=Math.min(e.off,n.off),l=Math.max(e.off,n.off);for(let c=r;c<=i;c++){let h=t.doc.line(c);h.length<=l&&s.push(Be.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 c=r;c<=i;c++){let h=t.doc.line(c),f=bk(h.text,o,t.tabSize,!0);if(f<0)s.push(Be.cursor(h.to));else{let p=bk(h.text,l,t.tabSize);s.push(Be.range(h.from+f,h.from+p))}}}return s}function wge(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function xI(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>Fk?-1:i==r.length?wge(t,e.clientX):v0(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:s,off:i}}function Sge(t,e){let n=xI(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=xI(t,i);if(!l)return r;let c=Age(t.state,n,l);return c.length?o?Be.create(c.concat(r.ranges)):Be.create(c):r}}:null}function jge(t){let e=(n=>n.altKey&&n.button==0);return ot.mouseSelectionStyle.of((n,r)=>e(r)?Sge(n,r):null)}const Cge={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},_ge={style:"cursor: crosshair"};function Tge(t={}){let[e,n]=Cge[t.key||"Alt"],r=Yr.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,ot.contentAttributes.of(i=>{var s;return!((s=i.plugin(r))===null||s===void 0)&&s.isDown?_ge:null})]}const X1="-10000px";class kU{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(c=>c);if(i===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let o=[],l=n?[]:null;for(let c=0;c<s.length;c++){let h=s[c],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[c]=this.createTooltipView(h,c?o[c-1]:null),l&&(l[c]=!!h.above);else{let p=o[c]=this.tooltipViews[f];l&&(l[c]=n[f]),p.update&&p.update(e)}}}for(let c of this.tooltipViews)o.indexOf(c)<0&&(this.removeTooltipView(c),(r=c.destroy)===null||r===void 0||r.call(c));return n&&(l.forEach((c,h)=>n[h]=c),n.length=l.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function kge(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const P_=vt.define({combine:t=>{var e,n,r;return{position:yt.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)||kge}}}),AI=new WeakMap,K6=Yr.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(P_);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 kU(t,Z6,(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(P_);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=X1,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(yt.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=Y6(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(P_).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 c=this.manager.tooltips[l],h=this.manager.tooltipViews[l],{dom:f}=h,p=t.pos[l],m=t.size[l];if(!p||c.clip!==!1&&(p.bottom<=Math.max(n.top,r.top)||p.top>=Math.min(n.bottom,r.bottom)||p.right<Math.max(n.left,r.left)-.1||p.left>Math.min(n.right,r.right)+.1)){f.style.top=X1;continue}let v=c.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,y=v?7:0,x=m.right-m.left,S=(e=AI.get(h))!==null&&e!==void 0?e:m.bottom-m.top,w=h.offset||Ege,A=this.view.textDirection==pr.LTR,C=m.width>r.right-r.left?A?r.left:r.right-m.width:A?Math.max(r.left,Math.min(p.left-(v?14:0)+w.x,r.right-x)):Math.min(Math.max(r.left,p.left-x+(v?14:0)-w.x),r.right-x),j=this.above[l];!c.strictSide&&(j?p.top-S-y-w.y<r.top:p.bottom+S+y+w.y>r.bottom)&&j==r.bottom-p.bottom>p.top-r.top&&(j=this.above[l]=!j);let _=(j?p.top-r.top:r.bottom-p.bottom)-y;if(_<S&&h.resize!==!1){if(_<this.view.defaultLineHeight){f.style.top=X1;continue}AI.set(h,S),f.style.height=(S=_)/s+"px"}else f.style.height&&(f.style.height="");let k=j?p.top-S-y-w.y:p.bottom+y+w.y,M=C+x;if(h.overlap!==!0)for(let R of o)R.left<M&&R.right>C&&R.top<k+S&&R.bottom>k&&(k=j?R.top-S-2-y:R.bottom+y+2);if(this.position=="absolute"?(f.style.top=(k-t.parent.top)/s+"px",wI(f,(C-t.parent.left)/i)):(f.style.top=k/s+"px",wI(f,C/i)),v){let R=p.left+(A?w.x:-w.x)-(C+14-7);v.style.left=R/i+"px"}h.overlap!==!0&&o.push({left:C,top:k,right:M,bottom:k+S}),f.classList.toggle("cm-tooltip-above",j),f.classList.toggle("cm-tooltip-below",!j),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=X1}},{eventObservers:{scroll(){this.maybeMeasure()}}});function wI(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const Oge=ot.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Ege={x:0,y:0},Z6=vt.define({enables:[K6,Oge]}),ew=vt.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class rS{static create(e){return new rS(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new kU(e,ew,(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 Mge=Z6.compute([ew],t=>{let e=t.facet(ew);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:rS.create,above:e[0].above,arrow:e.some(n=>n.arrow)}}),OU=vt.define();class Rge{constructor(e,n,r,i,s,o){this.view=e,this.source=n,this.field=r,this.locked=i,this.setHover=s,this.hoverTime=o,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(e){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 o=e.coordsAtPos(i);if(!o||n.y<o.top||n.y>o.bottom||n.x<o.left-e.defaultCharacterWidth||n.x>o.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(h=>h.from<=i&&h.to>=i),c=l&&l.dir==pr.RTL?-1:1;s=n.x<o.left?-c:c}this.activateHover(e,i,s)}activateHover(e,n,r,i){let s=this.source(e,n,r),o=l=>{if(l&&!(Array.isArray(l)&&!l.length)){let c=Array.isArray(l)?l:[l];i&&this.locked.set(c,i),e.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(c=>{this.pending==l&&(this.pending=null,o(c))},c=>Qs(e.state,c,"hover tooltip"))}else o(s)}get tooltip(){let e=this.view.plugin(K6),n=e?e.manager.tooltips.findIndex(r=>r.create==rS.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&&!this.locked.has(i)&&s&&!Dge(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:!Nge(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&&!this.locked.has(n)){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);let{active:i}=this;i.length&&!this.locked.has(i)&&!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 K1=4;function Dge(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-K1&&e.clientX<=r+K1&&e.clientY>=i-K1&&e.clientY<=s+K1}function Nge(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 c=t.posAtCoords({x:r,y:i},!1);return c>=e&&c<=n}function Ige(t,e={}){let n=Vt.define(),r=new WeakMap,i=gs.define({create(){return[]},update(o,l){let c=r.get(o);if(o.length&&(e.hideOnChange&&(l.docChanged||l.selection)?o=[]:c&&c(l)?o=[]:e.hideOn&&(o=o.filter(h=>!e.hideOn(l,h)))),l.docChanged&&o.length){let h=[];for(let f of o){let p=l.changes.mapPos(f.pos,-1,ps.TrackDel);if(p!=null){let m=Object.assign(Object.create(null),f);m.pos=p,m.end!=null&&(m.end=l.changes.mapPos(m.end)),h.push(m)}}o=h}for(let h of l.effects)h.is(n)&&(o=h.value,c=void 0),(h.is(Bge)&&!h.value||h.value==i)&&(o=[]);return o.length&&c&&r.set(o,c),o},provide:o=>ew.from(o)});const s=Yr.define(o=>new Rge(o,t,i,r,n,e.hoverTime||300));return{active:i,extension:[i,s,OU.of(s),Mge]}}function Lge(t,e,n,r={}){var i;let s=t.state.facet(OU).map(o=>t.plugin(o)).filter(o=>!!o);if(r.tooltip&&r.tooltip.active){let o=s.find(l=>l.field==r.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(t,e,n,(i=r.until)!==null&&i!==void 0?i:(()=>!1))}function EU(t,e){let n=t.plugin(K6);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const Bge=Vt.define(),SI=vt.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 J6(t,e){let n=t.plugin(MU),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const MU=Yr.fromClass(class{constructor(t){this.input=t.state.facet(Yv),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(SI);this.top=new Z1(t,!0,e.topContainer),this.bottom=new Z1(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(SI);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Z1(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Z1(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Yv);if(n!=this.input){let r=n.filter(c=>c),i=[],s=[],o=[],l=[];for(let c of r){let h=this.specs.indexOf(c),f;h<0?(f=c(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 c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ot.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Z1{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=jI(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=jI(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 jI(t){let e=t.nextSibling;return t.remove(),e}const Yv=vt.define({enables:MU});function Pge(t,e){let n,r=new Promise(o=>n=o),i=o=>Fge(o,e,n);t.state.field(F_,!1)?t.dispatch({effects:RU.of(i)}):t.dispatch({effects:Vt.appendConfig.of(F_.init(()=>[i]))});let s=DU.of(i);return{close:s,result:r.then(o=>((t.win.queueMicrotask||(c=>t.win.setTimeout(c,10)))(()=>{t.state.field(F_).indexOf(i)>-1&&t.dispatch({effects:s})}),o))}}const F_=gs.define({create(){return[]},update(t,e){for(let n of e.effects)n.is(RU)?t=[n.value].concat(t):n.is(DU)&&(t=t.filter(r=>r!=n.value));return t},provide:t=>Yv.computeN([t],e=>e.field(t))}),RU=Vt.define(),DU=Vt.define();function Fge(t,e,n){let r=e.content?e.content(t,()=>o(null)):null;if(!r){if(r=lr("form"),e.input){let l=lr("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),r.appendChild(lr("label",(e.label||"")+": ",l))}else r.appendChild(document.createTextNode(e.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(lr("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let l=0;l<i.length;l++){let c=i[l];c.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),o(null)):h.keyCode==13&&(h.preventDefault(),o(c))}),c.addEventListener("submit",h=>{h.preventDefault(),o(c)})}let s=lr("div",r,lr("button",{onclick:()=>o(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&t.focus(),n(l)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=r.querySelector(e.focus):l=r.querySelector("input")||r.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class mu extends Wh{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}mu.prototype.elementClass="";mu.prototype.toDOM=void 0;mu.prototype.mapMode=ps.TrackBefore;mu.prototype.startSide=mu.prototype.endSide=-1;mu.prototype.point=!0;const Gx=vt.define(),$ge=vt.define(),Hge={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>vn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},cv=vt.define();function zge(t){return[NU(),cv.of({...Hge,...t})]}const CI=vt.define({combine:t=>t.some(e=>e)});function NU(t){return[qge]}const qge=Yr.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(cv).map(e=>new TI(t,e)),this.fixed=!t.state.facet(CI);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(CI)!=!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=vn.iter(this.view.state.facet(Gx),this.view.viewport.from),r=[],i=this.gutters.map(s=>new Qge(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==ms.Text&&o){$k(n,r,l.from);for(let c of i)c.line(this.view,l,r);o=!1}else if(l.widget)for(let c of i)c.widget(this.view,l)}else if(s.type==ms.Text){$k(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(cv),n=t.state.facet(cv),r=t.docChanged||t.heightChanged||t.viewportChanged||!vn.eq(t.startState.facet(Gx),t.state.facet(Gx),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 TI(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=>ot.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==pr.LTR?{left:r,right:i}:{right:r,left:i}})});function _I(t){return Array.isArray(t)?t:[t]}function $k(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class Qge{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=vn.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 IU(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=[];$k(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($ge)){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 TI{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 c=s.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=i.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[r](e,l,i)&&i.preventDefault()});this.markers=_I(n.markers(e)),n.initialSpacer&&(this.spacer=new IU(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=_I(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!vn.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 IU{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":""),Uge(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,c=s<n.length?n[s++]:null,h=!1;if(c){let f=c.elementClass;f&&(r+=" "+f);for(let p=o;p<this.markers.length;p++)if(this.markers[p].compare(c)){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(!c)break;c.toDOM&&(h?i=i.nextSibling:this.dom.insertBefore(c.toDOM(e),i)),h&&o++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function Uge(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 Wge=vt.define(),Yge=vt.define(),$p=vt.define({combine(t){return fc(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,c,h)=>s(l,c,h)||o(l,c,h):o}return r}})}});class $_ extends mu{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function H_(t,e){return t.state.facet($p).formatNumber(e,t.state)}const Vge=cv.compute([$p],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Wge)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new $_(H_(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(Yge)){let s=i(e,n,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet($p)!=e.state.facet($p),initialSpacer(e){return new $_(H_(e,kI(e.state.doc.lines)))},updateSpacer(e,n){let r=H_(n.view,kI(n.view.state.doc.lines));return r==e.number?e:new $_(r)},domEventHandlers:t.facet($p).domEventHandlers,side:"before"}));function Gge(t={}){return[$p.of(t),NU(),Vge]}function kI(t){let e=9;for(;e<t;)e=e*10+9;return e}const Xge=new class extends mu{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Kge=Gx.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(Xge.range(i)))}return vn.of(e)});function Zge(){return Kge}var z_;const Hp=new dn;function Jge(t){return vt.define({combine:t?e=>e.concat(t):void 0})}const eve=new dn;class sl{constructor(e,n,r=[],i=""){this.data=e,this.name=i,wn.prototype.hasOwnProperty("tree")||Object.defineProperty(wn.prototype,"tree",{get(){return Li(this)}}),this.parser=n,this.extension=[Xh.of(this),wn.languageData.of((s,o,l)=>{let c=OI(s,o,l),h=c.type.prop(Hp);if(!h)return[];let f=s.facet(h),p=c.type.prop(eve);if(p){let m=c.resolve(o-c.from,l);for(let v of p)if(v.test(m,s)){let y=s.facet(v.facet);return v.type=="replace"?y:y.concat(f)}}return f})].concat(r)}isActiveAt(e,n,r=-1){return OI(e,n,r).type.prop(Hp)==this.data}findRegions(e){let n=e.facet(Xh);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(Hp)==this.data){r.push({from:o,to:o+s.length});return}let l=s.prop(dn.mounted);if(l){if(l.tree.prop(Hp)==this.data){if(l.overlay)for(let c of l.overlay)r.push({from:c.from+o,to:c.to+o});else r.push({from:o,to:o+s.length});return}else if(l.overlay){let c=r.length;if(i(l.tree,l.overlay[0].from+o),r.length>c)return}}for(let c=0;c<s.children.length;c++){let h=s.children[c];h instanceof di&&i(h,s.positions[c]+o)}};return i(Li(e),0),r}get allowsNesting(){return!0}}sl.setState=Vt.define();function OI(t,e,n){let r=t.facet(Xh),i=Li(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,ni.ExcludeBuffers|ni.EnterBracketed))s.type.isTop&&(i=s);return i}class tw extends sl{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=Jge(e.languageData);return new tw(n,e.parser.configure({props:[Hp.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new tw(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Li(t){let e=t.field(sl.state,!1);return e?e.tree:di.empty}class tve{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 jg=null;class nw{constructor(e,n,r=[],i,s,o,l,c){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new nw(e,n,[],di.empty,0,r,[],null)}startParse(){return this.parser.startParse(new tve(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=di.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(yf.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(yf.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=jg;jg=this;try{return e()}finally{jg=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=EI(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 c=[];if(e.iterChangedRanges((h,f,p,m)=>c.push({fromA:h,toA:f,fromB:p,toB:m})),r=yf.applyChanges(r,c),i=di.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 nw(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=EI(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 Hq{createParse(n,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let c=jg;if(c){for(let h of i)c.tempSkipped.push(h);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=o,new di(va.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 jg}}function EI(t,e,n){return yf.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Ym{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 Ym(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=nw.create(e.facet(Xh).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Ym(r)}}sl.state=gs.define({create:Ym.init,update(t,e){for(let n of e.effects)if(n.is(sl.setState))return n.value;return e.startState.facet(Xh)!=e.state.facet(Xh)?Ym.init(e.state):t.apply(e)}});let LU=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(LU=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const q_=typeof navigator<"u"&&(!((z_=navigator.scheduling)===null||z_===void 0)&&z_.isInputPending)?()=>navigator.scheduling.isInputPending():null,nve=Yr.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(sl.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(sl.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=LU(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(sl.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!q_?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<i&&r.doc.length>i+1e3,c=s.context.work(()=>q_&&q_()||Date.now()>o,i+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:sl.setState.of(new Ym(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Qs(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()}}}),Xh=vt.define({combine(t){return t.length?t[0]:null},enables:t=>[sl.state,nve,ot.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),rve=vt.define(),Gb=vt.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 rw(t){let e=t.facet(Gb);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Vv(t,e){let n="",r=t.tabSize,i=t.facet(Gb)[0];if(i=="	"){for(;e>=r;)n+="	",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function e4(t,e){t instanceof wn&&(t=new iS(t));for(let r of t.state.facet(rve)){let i=r(t,e);if(i!==void 0)return i}let n=Li(t.state);return n.length>=e?sve(t,n,e):null}class iS{constructor(e,n={}){this.state=e,this.options=n,this.unit=rw(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 v0(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 ive=new dn;function sve(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 BU(r,t,n)}function BU(t,e,n){for(let r=t;r;r=r.next){let i=ove(r.node);if(i)return i(t4.create(e,n,r))}return 0}function ave(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function ove(t){let e=t.type.prop(ive);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(dn.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>hve(o,!0,1,void 0,s&&!ave(o)?i.from:void 0)}return t.parent==null?lve:null}function lve(){return 0}class t4 extends iS{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 t4(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(cve(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return BU(this.context.next,this.base,this.pos)}}function cve(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function uve(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 c=e.childAfter(l);if(!c||c==r)return null;if(!c.type.isSkipped){if(c.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=c.to}}function hve(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,c=uve(t);return c?l?t.column(c.from):t.column(c.to):t.baseIndent+(l?0:t.unit*n)}const dve=200;function PU(){return wn.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+dve)return t;let s=n.sliceString(i.from,r);if(!e.some(h=>h.test(s)))return t;let{state:o}=t,l=-1,c=[];for(let{head:h}of o.selection.ranges){let f=o.doc.lineAt(h);if(f.from==l)continue;l=f.from;let p=e4(o,f.from);if(p==null)continue;let m=/^\s*/.exec(f.text)[0],v=Vv(o,p);m!=v&&c.push({from:f.from,to:f.from+m.length,insert:v})}return c.length?[t,{changes:c,sequential:!0}]:t})}const fve=vt.define(),pve=new dn;function mve(t,e,n){let r=Li(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 c=l.type.prop(pve);if(c&&(l.to<r.length-50||r.length==t.doc.length||!gve(l))){let h=c(l,t);h&&h.from<=n&&h.from>=e&&h.to>n&&(s=h)}}return s}function gve(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function iw(t,e,n){for(let r of t.facet(fve)){let i=r(t,e,n);if(i)return i}return mve(t,e,n)}function FU(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 sS=Vt.define({map:FU}),Xb=Vt.define({map:FU});function $U(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 Rf=gs.define({create(){return Dt.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=MI(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(sS)&&!vve(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(qU),i=r?Dt.replace({widget:new jve(r(e.state,n.value))}):RI;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(Xb)&&(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=MI(t,e.selection.main.head)),t},provide:t=>ot.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(RI.range(r,i))}return Dt.set(e,!0)}});function MI(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 sw(t,e,n){var r;let i=null;return(r=t.field(Rf,!1))===null||r===void 0||r.between(e,n,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function vve(t,e,n){let r=!1;return t.between(e,e,(i,s)=>{i==e&&s==n&&(r=!0)}),r}function HU(t,e){return t.field(Rf,!1)?e:e.concat(Vt.appendConfig.of(QU()))}const bve=t=>{for(let e of $U(t)){let n=iw(t.state,e.from,e.to);if(n)return t.dispatch({effects:HU(t.state,[sS.of(n),zU(t,n)])}),!0}return!1},yve=t=>{if(!t.state.field(Rf,!1))return!1;let e=[];for(let n of $U(t)){let r=sw(t.state,n.from,n.to);r&&e.push(Xb.of(r),zU(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function zU(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return ot.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const xve=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let i=t.lineBlockAt(r),s=iw(e,i.from,i.to);s&&n.push(sS.of(s)),r=(s?t.lineBlockAt(s.to):i).to+1}return n.length&&t.dispatch({effects:HU(t.state,n)}),!!n.length},Ave=t=>{let e=t.state.field(Rf,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(Xb.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},wve=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:bve},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:yve},{key:"Ctrl-Alt-[",run:xve},{key:"Ctrl-Alt-]",run:Ave}],Sve={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},qU=vt.define({combine(t){return fc(t,Sve)}});function QU(t){return[Rf,Tve]}function UU(t,e){let{state:n}=t,r=n.facet(qU),i=o=>{let l=t.lineBlockAt(t.posAtDOM(o.target)),c=sw(t.state,l.from,l.to);c&&t.dispatch({effects:Xb.of(c)}),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 RI=Dt.replace({widget:new class extends vl{toDOM(t){return UU(t,null)}}});class jve extends vl{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return UU(e,this.value)}}const Cve={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Q_ extends mu{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 _ve(t={}){let e={...Cve,...t},n=new Q_(e,!0),r=new Q_(e,!1),i=Yr.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Xh)!=o.state.facet(Xh)||o.startState.field(Rf,!1)!=o.state.field(Rf,!1)||Li(o.startState)!=Li(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new fu;for(let c of o.viewportLineBlocks){let h=sw(o.state,c.from,c.to)?r:iw(o.state,c.from,c.to)?n:null;h&&l.add(c.from,c.from,h)}return l.finish()}}),{domEventHandlers:s}=e;return[i,zge({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(i))===null||l===void 0?void 0:l.markers)||vn.empty},initialSpacer(){return new Q_(e,!1)},domEventHandlers:{...s,click:(o,l,c)=>{if(s.click&&s.click(o,l,c))return!0;let h=sw(o.state,l.from,l.to);if(h)return o.dispatch({effects:Xb.of(h)}),!0;let f=iw(o.state,l.from,l.to);return f?(o.dispatch({effects:sS.of(f)}),!0):!1}}}),QU()]}const Tve=ot.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 Ff{constructor(e,n){this.specs=e;let r;function i(l){let c=Yh.newName();return(r||(r=Object.create(null)))["."+c]=l,c}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,o=n.scope;this.scope=o instanceof sl?l=>l.prop(Hp)==o.data:o?l=>l==o:void 0,this.style=Qq(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=r?new Yh(r):null,this.themeType=n.themeType}static define(e,n){return new Ff(e,n||{})}}const Hk=vt.define(),WU=vt.define({combine(t){return t.length?[t[0]]:null}});function U_(t){let e=t.facet(Hk);return e.length?e:t.facet(WU)}function aS(t,e){let n=[Ove],r;return t instanceof Ff&&(t.module&&n.push(ot.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(WU.of(t)):r?n.push(Hk.computeN([ot.darkTheme],i=>i.facet(ot.darkTheme)==(r=="dark")?[t]:[])):n.push(Hk.of(t)),n}class kve{constructor(e){this.markCache=Object.create(null),this.tree=Li(e.state),this.decorations=this.buildDeco(e,U_(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Li(e.state),r=U_(e.state),i=r!=U_(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 Dt.none;let r=new fu;for(let{from:i,to:s}of e.visibleRanges)cde(this.tree,n,(o,l,c)=>{r.add(o,l,this.markCache[c]||(this.markCache[c]=Dt.mark({class:c})))},i,s);return r.finish()}}const Ove=ju.high(Yr.fromClass(kve,{decorations:t=>t.decorations})),Eve=Ff.define([{tag:ge.meta,color:"#404740"},{tag:ge.link,textDecoration:"underline"},{tag:ge.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ge.emphasis,fontStyle:"italic"},{tag:ge.strong,fontWeight:"bold"},{tag:ge.strikethrough,textDecoration:"line-through"},{tag:ge.keyword,color:"#708"},{tag:[ge.atom,ge.bool,ge.url,ge.contentSeparator,ge.labelName],color:"#219"},{tag:[ge.literal,ge.inserted],color:"#164"},{tag:[ge.string,ge.deleted],color:"#a11"},{tag:[ge.regexp,ge.escape,ge.special(ge.string)],color:"#e40"},{tag:ge.definition(ge.variableName),color:"#00f"},{tag:ge.local(ge.variableName),color:"#30a"},{tag:[ge.typeName,ge.namespace],color:"#085"},{tag:ge.className,color:"#167"},{tag:[ge.special(ge.variableName),ge.macroName],color:"#256"},{tag:ge.definition(ge.propertyName),color:"#00c"},{tag:ge.comment,color:"#940"},{tag:ge.invalid,color:"#f00"}]),Mve=ot.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),YU=1e4,VU="()[]{}",GU=vt.define({combine(t){return fc(t,{afterCursor:!0,brackets:VU,maxScanDistance:YU,renderMatch:Nve})}}),Rve=Dt.mark({class:"cm-matchingBracket"}),Dve=Dt.mark({class:"cm-nonmatchingBracket"});function Nve(t){let e=[],n=t.matched?Rve:Dve;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}function DI(t){let e=[],n=t.facet(GU);for(let r of t.selection.ranges){if(!r.empty)continue;let i=Vl(t,r.head,-1,n)||r.head>0&&Vl(t,r.head-1,1,n)||n.afterCursor&&(Vl(t,r.head,1,n)||r.head<t.doc.length&&Vl(t,r.head+1,-1,n));i&&(e=e.concat(n.renderMatch(i,t)))}return Dt.set(e,!0)}const Ive=Yr.fromClass(class{constructor(t){this.paused=!1,this.decorations=DI(t.state)}update(t){(t.docChanged||t.selectionSet||this.paused)&&(t.view.composing?(this.decorations=this.decorations.map(t.changes),this.paused=!0):(this.decorations=DI(t.state),this.paused=!1))}},{decorations:t=>t.decorations}),Lve=[Ive,Mve];function XU(t={}){return[GU.of(t),Lve]}const Bve=new dn;function zk(t,e,n){let r=t.prop(e<0?dn.openedBy:dn.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 qk(t){let e=t.type.prop(Bve);return e?e(t.node):t}function Vl(t,e,n,r={}){let i=r.maxScanDistance||YU,s=r.brackets||VU,o=Li(t),l=o.resolveInner(e,n);for(let c=l;c;c=c.parent){let h=zk(c.type,n,s);if(h&&c.from<c.to){let f=qk(c);if(f&&(n>0?e>=f.from&&e<f.to:e>f.from&&e<=f.to))return Pve(t,e,n,c,f,h,s)}}return Fve(t,e,n,o,l.type,i,s)}function Pve(t,e,n,r,i,s,o){let l=r.parent,c={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=qk(f);return{start:c,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(zk(f.type,n,o))h++;else if(zk(f.type,-n,o)){if(h==0){let p=qk(f);return{start:c,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:c,matched:!1}}function Fve(t,e,n,r,i,s,o){if(n<0?!e:e==t.doc.length)return null;let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),c=o.indexOf(l);if(c<0||c%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 y=e+m*n;for(let x=n>0?0:v.length-1,S=n>0?v.length:-1;x!=S;x+=n){let w=o.indexOf(v[x]);if(!(w<0||r.resolveInner(y+x,1).type!=i))if(w%2==0==n>0)p++;else{if(p==1)return{start:h,end:{from:y+x,to:y+x+1},matched:w>>1==c>>1};p--}}n>0&&(m+=v.length)}return f.done?{start:h,matched:!1}:null}const $ve=Object.create(null),NI=[va.none],II=[],LI=Object.create(null),Hve=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"]])Hve[t]=zve($ve,e);function W_(t,e){II.indexOf(t)>-1||(II.push(t),console.warn(e))}function zve(t,e){let n=[];for(let l of e.split(" ")){let c=[];for(let h of l.split(".")){let f=t[h]||ge[h];f?typeof f=="function"?c.length?c=c.map(f):W_(h,`Modifier ${h} used at start of tag`):c.length?W_(h,`Tag ${h} used as modifier`):c=Array.isArray(f)?f:[f]:W_(h,`Unknown highlighting tag ${h}`)}for(let h of c)n.push(h)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(l=>l.id),s=LI[i];if(s)return s.id;let o=LI[i]=va.define({id:NI.length,name:r,props:[zq({[r]:n})]});return NI.push(o),o.id}pr.RTL,pr.LTR;function qve(t,e){if(!e||e.type.id!==em)return null;const n={card:zl.CardOneToOne,matchingLabels:[],on:!1,include:[],fill:{lhs:null,rhs:null}},r=e.getChild(afe);if(r){n.on=r.getChild(Xde)!==null;const o=r.getChild(Jp),l=o?o.getChildren(Iv):[];for(const p of l)n.matchingLabels.push(t.sliceDoc(p.from,p.to));const c=r.getChild(Kde),h=r.getChild(Zde),f=c||h;if(f){n.card=c?zl.CardManyToOne:zl.CardOneToMany;const p=f.nextSibling,m=(p==null?void 0:p.getChildren(Iv))||[];for(const v of m)n.include.push(t.sliceDoc(v.from,v.to))}}const i=e.getChild(ofe);if(i){const o=i.getChild(lfe),l=i.getChild(cfe),c=i.getChild(ufe),h=f=>{const p=f.getChild(X2);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)),c&&(n.fill.rhs=h(c))}return eu(e,E6,M6,R6)&&n.card===zl.CardOneToOne&&(n.card=zl.CardManyToMany),n}let Qve=class{constructor(e){this.tree=Li(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 ae.none;switch(e.type.id){case Nv:this.checkAggregationExpr(e);break;case em:this.checkBinaryExpr(e);break;case rk:this.checkCallFunction(e);break;case rQ:this.checkAST(e.getChild("Expr"));break;case iQ:{const n=this.checkAST(e.getChild("Expr"));n!==ae.scalar&&n!==ae.vector&&this.addDiagnostic(e,`unary expression only allowed on expressions of type scalar or instant vector, got ${n}`);break}case nQ:{this.checkAnchoredSmoothedExpr(e,[ak,sk,ik]);break}case tQ:{this.checkAnchoredSmoothedExpr(e,[eQ,Jq,ak,sk,ik]);break}case kf:{const n=this.checkAST(e.getChild("Expr"));n!==ae.vector&&this.addDiagnostic(e,`subquery is only allowed on instant vector, got ${n} in ${e.name} instead`);break}case Hm:this.checkAST(e.getChild("Expr"));break;case Qb:this.checkVectorSelector(e);break;case D6:{const n=this.checkAST(e.getChild("Expr"));n!==ae.vector&&n!==ae.matrix&&this.addDiagnostic(e,"@ modifier must be preceded by an instant selector vector or range vector selector or a subquery");break}}return Ll(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(su),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],ae.vector,"aggregation expression"),(r.type.id===Gq||r.type.id===Uq||r.type.id===Yq||r.type.id===Vq||r.type.id===Jde)&&this.expectType(s[0],ae.scalar,"aggregation parameter"),r.type.id===Wq&&this.expectType(s[0],ae.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(Xq),l=eu(e,Z3,Bv,tk,nk,J3,ek),c=qA(e,Zq),h=qA(e,Kq),f=eu(e,E6,M6,R6);o?l||this.addDiagnostic(e,"bool modifier can only be used on comparison operators"):i===ae.scalar&&s===ae.scalar&&(l?this.addDiagnostic(e,"comparisons between scalars must use BOOL modifier"):c?this.addDiagnostic(e,'operator ">/" not allowed for Scalar operations'):h&&this.addDiagnostic(e,'operator "</" not allowed for Scalar operations'));const p=qve(this.state,e);if(p!==null&&p.on)for(const m of p.matchingLabels)for(const v of p.include)m===v&&this.addDiagnostic(e,`label "${m}" must not occur in ON and GROUP clause at once`);i!==ae.scalar&&i!==ae.vector&&this.addDiagnostic(n,"binary expression must contain only scalar and instant vector types"),s!==ae.scalar&&s!==ae.vector&&this.addDiagnostic(r,"binary expression must contain only scalar and instant vector types"),(i!==ae.vector||s!==ae.vector)&&p!==null?p.matchingLabels.length>0&&this.addDiagnostic(e,"vector matching only allowed between instant vectors"):f&&(((p==null?void 0:p.card)===zl.CardOneToMany||(p==null?void 0:p.card)===zl.CardManyToOne)&&this.addDiagnostic(e,"no grouping allowed for set operations"),(p==null?void 0:p.card)!==zl.CardManyToMany&&this.addDiagnostic(e,"set operations must always be many-to-many")),(i===ae.scalar||s===ae.scalar)&&f&&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(su),s=i?i.getChildren("Expr"):[],o=oQ(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($A)&&this.addDiagnostic(e,`expected label selectors as the second argument to "info" function, got ${s[1].type}`);let c=0;for(let h=0;h<s.length;h++){if(c=h,c>=o.argTypes.length){if(o.variadic===0)break;c=o.argTypes.length-1}this.expectType(s[h],o.argTypes[c],`call to function "${o.name}"`)}}checkAnchoredSmoothedExpr(e,n){var r,i;const s=Ll(e);if(s!==ae.vector&&s!==ae.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!==rk)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(tm),r=[Lv,xf,Dh];let i=[];for(const c of r)i=i.concat(cQ(n?n.getChildren(c):[],this.state));let s="";const o=e.getChild($A);if(o&&(s=this.state.sliceDoc(o.from,o.to)),s!==""){const c=i.find(h=>h.name==="__name__");c&&this.addDiagnostic(e,`metric name must not be set twice: ${s} or ${c.value}`),i.push(new lQ(Ub,"__name__",s))}else{const c=i.filter(h=>h.name==="__name__");c.length>1&&this.addDiagnostic(e,`metric name must not be set twice: ${c[0].value} or ${c[1].value}`)}i.every(c=>c.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 KU{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=Li(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(ZU(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 BI(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 Uve(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=BI(e)+BI(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function Wve(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:Uve(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}class PI{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function wf(t){return t.selection.main.from}function ZU(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 n4=dc.define();function Yve(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 c=t.toText(e);return{changes:{from:l.from+s,to:r==i.from?l.to:l.from+o,insert:c},range:Be.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const FI=new WeakMap;function Vve(t){if(!Array.isArray(t))return t;let e=FI.get(t);return e||FI.set(t,e=Wve(t)),e}const aw=Vt.define(),Gv=Vt.define();class Gve{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=ua(e,n),i=Ql(r);this.chars.push(r);let s=e.slice(n,n+i),o=s.toUpperCase();this.folded.push(ua(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 A=ua(e,0),C=Ql(A),j=C==e.length?0:-100;if(A!=n[0])if(A==r[0])j+=-200;else return null;return this.ret(j,[0,C])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=n.length,h=0;if(l<0){for(let A=0,C=Math.min(e.length,200);A<C&&h<c;){let j=ua(e,A);(j==n[h]||j==r[h])&&(i[h++]=A),A+=Ql(j)}if(h<c)return null}let f=0,p=0,m=!1,v=0,y=-1,x=-1,S=/[a-z]/.test(e),w=!0;for(let A=0,C=Math.min(e.length,200),j=0;A<C&&p<c;){let _=ua(e,A);l<0&&(f<c&&_==n[f]&&(s[f++]=A),v<c&&(_==n[v]||_==r[v]?(v==0&&(y=A),x=A+1,v++):v=0));let k,M=_<255?_>=48&&_<=57||_>=97&&_<=122?2:_>=65&&_<=90?1:0:(k=I6(_))!=k.toLowerCase()?1:k!=k.toUpperCase()?2:0;(!A||M==1&&S||j==0&&M!=0)&&(n[p]==_||r[p]==_&&(m=!0)?o[p++]=A:o.length&&(w=!1)),j=M,A+=Ql(_)}return p==c&&o[0]==0&&w?this.result(-100+(m?-200:0),o,e):v==c&&y==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==c?this.ret(-900-e.length,[y,x]):p==c?this.result(-100+(m?-200:0)+-700+(w?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?Ql(ua(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 Xve{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 Vi=vt.define({combine(t){return fc(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:Kve,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=>$I(e(r),n(r)),optionClass:(e,n)=>r=>$I(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function $I(t,e){return t?e?t+" "+e:t:e}function Kve(t,e,n,r,i,s){let o=t.textDirection==pr.RTL,l=o,c=!1,h="top",f,p,m=e.left-i.left,v=i.right-e.right,y=r.right-r.left,x=r.bottom-r.top;if(l&&m<Math.min(y,v)?l=!1:!l&&v<Math.min(y,m)&&(l=!0),y<=(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{c=!0,p=Math.min(400,(o?e.right:i.right-e.left)-30);let A=i.bottom-e.bottom;A>=x||A>e.top?f=n.bottom-e.top:(h="bottom",f=e.bottom-n.top)}let S=(e.bottom-e.top)/s.offsetHeight,w=(e.right-e.left)/s.offsetWidth;return{style:`${h}: ${f/S}px; max-width: ${p/w}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}const r4=Vt.define();function Zve(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,c=0;for(let h=0;h<s.length;){let f=s[h++],p=s[h++];f>c&&o.appendChild(document.createTextNode(l.slice(c,f)));let m=o.appendChild(document.createElement("span"));m.appendChild(document.createTextNode(l.slice(f,p))),m.className="cm-completionMatchedText",c=p}return c<l.length&&o.appendChild(document.createTextNode(l.slice(c))),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 Y_(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.ceil((t-e)/n);return{from:t-r*n,to:t-(r-1)*n}}class Jve{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:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:s,selected:o}=i.open,l=e.state.facet(Vi);this.optionContent=Zve(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Y_(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:h}=e.state.field(n).open;for(let f=c.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]]),c.preventDefault();return}if(c.target==this.list){let f=this.list.classList.contains("cm-completionListIncompleteTop")&&c.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&c.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;f!=null&&(e.dispatch({effects:r4.of(f)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(Vi).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:Gv.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=Y_(s.length,o,e.state.facet(Vi).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=Y_(n.options.length,n.selected,this.view.state.facet(Vi).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=>Qs(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&&tbe(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(Vi).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:c}=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,c);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 ebe(t,e){return n=>new Jve(n,t,e)}function tbe(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 HI(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function nbe(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(Vi);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 PI(m,f.source,p?p(m):[],1e9-n.length));else{let m=e.sliceDoc(f.from,f.to),v,y=o.filterStrict?new Xve(m):new Gve(m);for(let x of f.result.options)if(v=y.match(x.label)){let S=x.displayLabel?p?p(x,v.matched):[]:v.matched,w=v.score+(x.boost||0);if(s(new PI(x,f.source,S,w)),typeof x.section=="object"&&x.section.rank==="dynamic"){let{name:A}=x.section;i||(i=Object.create(null)),i[A]=Math.max(w,i[A]||-1e9)}}}}if(r){let f=Object.create(null),p=0,m=(v,y)=>(v.rank==="dynamic"&&y.rank==="dynamic"?i[y.name]-i[v.name]:0)||(typeof v.rank=="number"?v.rank:1e9)-(typeof y.rank=="number"?y.rank:1e9)||(v.name<y.name?-1:1);for(let v of r.sort(m))p-=1e5,f[v.name]=p;for(let v of n){let{section:y}=v.completion;y&&(v.score+=f[typeof y=="string"?y:y.name])}}let l=[],c=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;!c||c.label!=p.label||c.detail!=p.detail||c.type!=null&&p.type!=null&&c.type!=p.type||c.apply!=p.apply||c.boost!=p.boost?l.push(f):HI(f.completion)>HI(c)&&(l[l.length-1]=f),c=f.completion}return l}class zp{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 zp(this.options,zI(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=nbe(e,n);if(!l.length)return i&&e.some(h=>h.isPending)?i.setDisabled():null;let c=n.facet(Vi).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let h=i.options[i.selected].completion;for(let f=0;f<l.length;f++)if(l[f].completion==h){c=f;break}}return new zp(l,zI(r,c),{pos:e.reduce((h,f)=>f.hasResult()?Math.min(h,f.from):h,1e8),create:lbe,above:s.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(e){return new zp(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new zp(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class ow{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new ow(abe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(Vi),s=(r.override||n.languageDataAt("autocomplete",wf(n)).map(Vve)).map(c=>(this.active.find(f=>f.source==c)||new bo(c,this.active.some(f=>f.state!=0)?1:0)).update(e,r));s.length==this.active.length&&s.every((c,h)=>c==this.active[h])&&(s=this.active);let o=this.open,l=e.effects.some(c=>c.is(i4));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!rbe(s,this.active)||l?o=zp.build(s,n,this.id,o,r,l):o&&o.disabled&&!s.some(c=>c.isPending)&&(o=null),!o&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new bo(c.source,0):c));for(let c of e.effects)c.is(r4)&&(o=o&&o.setSelected(c.value,this.id));return s==this.active&&o==this.open?this:new ow(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?ibe:sbe}}function rbe(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 ibe={"aria-autocomplete":"list"},sbe={};function zI(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const abe=[];function JU(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(n4);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 bo{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=JU(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new bo(i.source,0)),r&4&&i.state==0&&(i=new bo(this.source,1)),i=i.updateFor(e,r);for(let s of e.effects)if(s.is(aw))i=new bo(i.source,1,s.value);else if(s.is(Gv))i=new bo(i.source,0);else if(s.is(i4))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(wf(e.state))}}class am extends bo{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=wf(e.state);if(l>o||!i||n&2&&(wf(e.startState)==this.from||l<this.limit))return new bo(this.source,n&4?1:0);let c=e.changes.mapPos(this.limit);return obe(i.validFor,e.state,s,o)?new am(this.source,this.explicit,c,i,s,o):i.update&&(i=i.update(i,s,o,new KU(e.state,l,!1)))?new am(this.source,this.explicit,c,i,i.from,(r=i.to)!==null&&r!==void 0?r:wf(e.state)):new bo(this.source,1,this.explicit)}map(e){if(e.empty)return this;let n=this.result.map?this.result.map(this.result,e):this.result;return n?new am(this.source,this.explicit,e.mapPos(this.limit),n,e.mapPos(this.from),e.mapPos(this.to,1)):new bo(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function obe(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):ZU(t,!0).test(i)}const i4=Vt.define({map(t,e){return t.map(n=>n.map(e))}}),ha=gs.define({create(){return ow.start()},update(t,e){return t.update(e)},provide:t=>[Z6.from(t,e=>e.tooltip),ot.contentAttributes.from(t,e=>e.attrs)]});function s4(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(ha).active.find(i=>i.source==e.source);return r instanceof am?(typeof n=="string"?t.dispatch({...Yve(t.state,n,r.from,r.to),annotations:n4.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const lbe=ebe(ha,s4);function J1(t,e="option"){return n=>{let r=n.state.field(ha,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Vi).interactionDelay)return!1;let i=1,s;e=="page"&&(s=EU(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:r4.of(l)}),!0}}const cbe=t=>{let e=t.state.field(ha,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Vi).interactionDelay?!1:s4(t,e.open.options[e.open.selected])},V_=t=>t.state.field(ha,!1)?(t.dispatch({effects:aw.of(!0)}),!0):!1,ube=t=>{let e=t.state.field(ha,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:Gv.of(null)}),!0)};class hbe{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const dbe=50,fbe=1e3,pbe=Yr.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(ha).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(ha),n=t.state.facet(Vi);if(!t.selectionSet&&!t.docChanged&&t.startState.field(ha)==e)return;let r=t.transactions.some(s=>{let o=JU(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>dbe&&Date.now()-o.time>fbe){for(let l of o.context.abortListeners)try{l()}catch(c){Qs(this.view.state,c)}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(aw)))&&(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(ha);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(Vi).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=wf(e),r=new KU(e,n,t.explicit,this.view),i=new hbe(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:Gv.of(null)}),Qs(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(Vi).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Vi),r=this.view.state.field(ha);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=wf(s.updates.length?s.updates[0].startState:this.view.state),c=Math.min(l,s.done.from+(s.active.explicit?0:1)),h=new am(s.active.source,s.active.explicit,c,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 bo(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:i4.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(ha,!1);if(e&&e.tooltip&&this.view.state.facet(Vi).closeOnBlur){let n=e.open&&EU(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Gv.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:aw.of(!1)}),20),this.composing=0}}}),mbe=typeof navigator=="object"&&/Win/.test(navigator.platform),gbe=ju.highest(ot.domEventHandlers({keydown(t,e){let n=e.state.field(ha,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(mbe&&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&&s4(e,r),!1}})),eW=ot.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class vbe{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class a4{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,ps.TrackDel),r=e.mapPos(this.to,1,ps.TrackDel);return n==null||r==null?null:new a4(this.field,n,r)}}class o4{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 c of this.lines){if(r.length){let h=o,f=/^\t*/.exec(c)[0].length;for(let p=0;p<f;p++)h+=e.facet(Gb);i.push(n+h.length-f),c=h+c.slice(f)}r.push(c),n+=c.length+1}let l=this.fieldPositions.map(c=>new a4(c.field,i[c.line]+c.from,i[c.line]+c.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,c=s[2]||s[3]||"",h=-1;l===0&&(l=1e9);let f=c.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 vbe(h,r.length,s.index,s.index+f.length)),o=o.slice(0,s.index)+c+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,c,h)=>{for(let f of i)f.line==r.length&&f.from>h&&(f.from--,f.to--);return c}),r.push(o)}return new o4(r,i)}}let bbe=Dt.widget({widget:new class extends vl{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),ybe=Dt.mark({class:"cm-snippetField"});class b0{constructor(e,n){this.ranges=e,this.active=n,this.deco=Dt.set(e.map(r=>(r.from==r.to?bbe:ybe).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 b0(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 Kb=Vt.define({map(t,e){return t&&t.map(e)}}),xbe=Vt.define(),Xv=gs.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Kb))return n.value;if(n.is(xbe)&&t)return new b0(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=>ot.decorations.from(t,e=>e?e.deco:Dt.none)});function l4(t,e){return Be.create(t.filter(n=>n.field==e).map(n=>Be.range(n.from,n.to)))}function jp(t){let e=o4.parse(t);return(n,r,i,s)=>{let{text:o,ranges:l}=e.instantiate(n.state,i),{main:c}=n.state.selection,h={changes:{from:i,to:s==c.from?c.to:s,insert:On.of(o)},scrollIntoView:!0,annotations:r?[n4.of(r),ji.userEvent.of("input.complete")]:void 0};if(l.length&&(h.selection=l4(l,0)),l.some(f=>f.field>0)){let f=new b0(l,0),p=h.effects=[Kb.of(f)];n.state.field(Xv,!1)===void 0&&p.push(Vt.appendConfig.of([Xv,Cbe,_be,eW]))}n.dispatch(n.state.update(h))}}function tW(t){return({state:e,dispatch:n})=>{let r=e.field(Xv,!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:l4(r.ranges,i),effects:Kb.of(s?null:new b0(r.ranges,i)),scrollIntoView:!0})),!0}}const Abe=({state:t,dispatch:e})=>t.field(Xv,!1)?(e(t.update({effects:Kb.of(null)})),!0):!1,wbe=tW(1),Sbe=tW(-1),jbe=[{key:"Tab",run:wbe,shift:Sbe},{key:"Escape",run:Abe}],qI=vt.define({combine(t){return t.length?t[0]:jbe}}),Cbe=ju.highest(Ph.compute([qI],t=>t.facet(qI))),_be=ot.domEventHandlers({mousedown(t,e){let n=e.state.field(Xv,!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:l4(n.ranges,i.field),effects:Kb.of(n.ranges.some(s=>s.field>i.field)?new b0(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Kv={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Jd=Vt.define({map(t,e){let n=e.mapPos(t,-1,ps.TrackAfter);return n??void 0}}),c4=new class extends Wh{};c4.startSide=1;c4.endSide=-1;const nW=gs.define({create(){return vn.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(Jd)&&(t=t.update({add:[c4.range(n.value,n.value+1)]}));return t}});function rW(){return[kbe,nW]}const G_="()[]{}<>«»»«［］｛｝";function iW(t){for(let e=0;e<G_.length;e+=2)if(G_.charCodeAt(e)==t)return G_.charAt(e+1);return I6(t<128?t:t+1)}function sW(t,e){return t.languageDataAt("closeBrackets",e)[0]||Kv}const Tbe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),kbe=ot.inputHandler.of((t,e,n,r)=>{if((Tbe?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Ql(ua(r,0))==1||e!=i.from||n!=i.to)return!1;let s=Ebe(t.state,r);return s?(t.dispatch(s),!0):!1}),Obe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=sW(t,t.selection.main.head).brackets||Kv.brackets,i=null,s=t.changeByRange(o=>{if(o.empty){let l=Mbe(t.doc,o.head);for(let c of r)if(c==l&&oS(t.doc,o.head)==iW(ua(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:Be.cursor(o.head-c.length)}}return{range:i=o}});return i||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},aW=[{key:"Backspace",run:Obe}];function Ebe(t,e){let n=sW(t,t.selection.main.head),r=n.brackets||Kv.brackets;for(let i of r){let s=iW(ua(i,0));if(e==i)return s==i?Nbe(t,i,r.indexOf(i+i+i)>-1,n):Rbe(t,i,s,n.before||Kv.before);if(e==s&&oW(t,t.selection.main.from))return Dbe(t,i,s)}return null}function oW(t,e){let n=!1;return t.field(nW).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function oS(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Ql(ua(n,0)))}function Mbe(t,e){let n=t.sliceString(e-2,e);return Ql(ua(n,0))==n.length?n:n.slice(1)}function Rbe(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:Jd.of(o.to+e.length),range:Be.range(o.anchor+e.length,o.head+e.length)};let l=oS(t.doc,o.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+n,from:o.head},effects:Jd.of(o.head+e.length),range:Be.cursor(o.head+e.length)}:{range:i=o}});return i?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Dbe(t,e,n){let r=null,i=t.changeByRange(s=>s.empty&&oS(t.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:Be.cursor(s.head+n.length)}:r={range:s});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Nbe(t,e,n,r){let i=r.stringPrefixes||Kv.stringPrefixes,s=null,o=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Jd.of(l.to+e.length),range:Be.range(l.anchor+e.length,l.head+e.length)};let c=l.head,h=oS(t.doc,c),f;if(h==e){if(QI(t,c))return{changes:{insert:e+e,from:c},effects:Jd.of(c+e.length),range:Be.cursor(c+e.length)};if(oW(t,c)){let m=n&&t.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+m.length,insert:m},range:Be.cursor(c+m.length)}}}else{if(n&&t.sliceDoc(c-2*e.length,c)==e+e&&(f=UI(t,c-2*e.length,i))>-1&&QI(t,f))return{changes:{insert:e+e+e+e,from:c},effects:Jd.of(c+e.length),range:Be.cursor(c+e.length)};if(t.charCategorizer(c)(h)!=Pr.Word&&UI(t,c,i)>-1&&!Ibe(t,c,e,i))return{changes:{insert:e+e,from:c},effects:Jd.of(c+e.length),range:Be.cursor(c+e.length)}}return{range:s=l}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function QI(t,e){let n=Li(t).resolveInner(e+1);return n.parent&&n.from==e}function Ibe(t,e,n,r){let i=Li(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)),c=l.indexOf(n);if(!c||c>-1&&r.indexOf(l.slice(0,c))>-1){let f=i.firstChild;for(;f&&f.from==i.from&&f.to-f.from>n.length+c;){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 UI(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Pr.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))!=Pr.Word)return s}return-1}function lW(t={}){return[gbe,ha,Vi.of(t),pbe,Lbe,eW]}const u4=[{key:"Ctrl-Space",run:V_},{mac:"Alt-`",run:V_},{mac:"Alt-i",run:V_},{key:"Escape",run:ube},{key:"ArrowDown",run:J1(!0)},{key:"ArrowUp",run:J1(!1)},{key:"PageDown",run:J1(!0,"page")},{key:"PageUp",run:J1(!1,"page")},{key:"Enter",run:cbe}],Lbe=ju.highest(Ph.computeN([Vi],t=>t.facet(Vi).defaultKeymap?[u4]:[])),h4=[{label:"y"},{label:"w"},{label:"d"},{label:"h"},{label:"m"},{label:"s"},{label:"ms"}],Bbe=[{label:"="},{label:"!="},{label:"=~"},{label:"!~"}],cW=[{label:"^"},{label:"*"},{label:"/"},{label:"%"},{label:"+"},{label:"-"},{label:"=="},{label:">="},{label:">"},{label:"<"},{label:"</"},{label:">/"},{label:"<="},{label:"!="},{label:"atan2"},{label:"and"},{label:"or"},{label:"unless"}],Pbe=[{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"}],Fbe=[{label:"start()",info:"resolve to the start of the query",type:"keyword"},{label:"end()",info:"resolve to the end of the query",type:"keyword"}],$be=[{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_quantiles",detail:"function",info:"Calculate multiple 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:"end",detail:"function",info:"Return the query end timestamp in seconds",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:"first_over_time",detail:"function",info:"Return the value of the oldest sample in the specified interval",type:"function"},{label:"last_over_time",detail:"function",info:"Return the value of the most recent sample in the 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_first_over_time",detail:"function",info:"Return the timestamp of the first 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:"range",detail:"function",info:"Return the query range in seconds",type:"function"},{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:"start",detail:"function",info:"Return the query start timestamp in seconds",type:"function"},{label:"step",detail:"function",info:"Return the query step in seconds",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"}],uW=[{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"}],Hbe=[{label:"by",info:"Keep the listed labels, remove all others.",type:"keyword"},{label:"without",info:"Remove the listed labels, preserve all others.",type:"keyword"}],zbe=[{label:"nan",info:"Floating-point NaN value",type:"constant"},{label:"inf",info:"Floating-point infinity",type:"constant"}],qbe=[{label:"sum(rate(__input_vector__[5m]))",type:"function",detail:"snippet",info:"Sum over rates of increase",apply:jp("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:jp("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:jp('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:jp("topk(${__rank_number__}, ${__input_vector__})")},{label:"bottomk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Smallest k elements by sample value",apply:jp("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:jp('count_values("${__label_name__}", ${__metric__})')}],zc={matchOp:Bbe,binOp:cW,duration:h4,binOpModifier:Pbe,atModifier:Fbe,functionIdentifier:$be,aggregateOp:uW,aggregateOpModifier:Hbe,number:zbe};var wt;(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"})(wt||(wt={}));function Qbe(t,e){const n=N6(t,Nv);if(!n)return"";let r="";return n.cursor().iterate(i=>{if(i.type.id===Qb&&(r=Ug(i.node,e),r))return!1}),r}function Ug(t,e){let n=N6(t,Qb);return!n||(n=n.getChild($A),!n)?"":e.sliceDoc(n.from,n.to)}function Ube(t,e,n,r=!1,i=!0){const s=t;return r&&s.push(...qbe),{from:e,to:n,options:s,validFor:i?/^[a-zA-Z0-9_:]+$/:void 0}}function Wbe(t){return t.replace(/([\\"])/g,"\\$1")}function d4(t,e,n){return e.type.id===su&&n>=e.to&&e.from<e.to&&t.sliceDoc(e.to-1,e.to)===")"}function Ybe(t,e,n){var r,i;return e.type.id===0||d4(t,e,n)?n:e.type.id===tm||e.type.id===Jp||e.type.id===su||e.type.id===Hm||e.type.id===kf?e.to-1:e.type.id===$m&&(((r=e.parent)===null||r===void 0?void 0:r.type.id)===Dh||((i=e.parent)===null||i===void 0?void 0:i.type.id)===xf)?e.parent.to-1:e.to}const Vbe=new RegExp(`^(\\d+(${h4.map(t=>t.label).join("|")}))+$`);function WI(t,e){if(e.from>=e.to)return!1;const n=t.sliceDoc(e.from,e.to);return Vbe.test(n)}function Gbe(t,e){let n=t.from+1;return t.firstChild!==null&&(n=e),n}function Xbe(t,e,n){var r,i,s,o,l,c,h;const f=t.doc.slice(e.from,n).toString();let p=e.from;return d4(t,e,n)?p=n:e.type.id===tm||e.type.id===Jp?p=Gbe(e,n):e.type.id===su&&e.firstChild===null||e.type.id===$m&&(((r=e.parent)===null||r===void 0?void 0:r.type.id)===Dh||((i=e.parent)===null||i===void 0?void 0:i.type.id)===xf)?p++:(e.type.id===Pv||e.type.id===HA&&!h4.map(m=>m.label).includes(f[f.length-1])||e.type.id===X2&&((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)===kf||e.type.id===su&&hW(e)&&e.firstChild!==null||e.type.id===0&&(((l=e.parent)===null||l===void 0?void 0:l.type.id)===Pv||((c=e.parent)===null||c===void 0?void 0:c.type.id)===Hm||((h=e.parent)===null||h===void 0?void 0:h.type.id)===kf&&eu(e.parent,HA)))&&(p=n),p}function hW(t){var e;const n=t.parent;if(n!==null&&((e=n.firstChild)===null||e===void 0?void 0:e.type.id)===rfe){const r=n.firstChild.firstChild;if(r!==null&&[Gq,Uq,Yq,Vq,Wq].includes(r.type.id))return!0}return!1}function Kbe(t,e,n){var r,i,s,o,l,c,h,f,p,m,v,y,x,S,w,A,C,j,_,k,M,R;const N=[];switch(e.type.id){case 0:{if(((r=e.parent)===null||r===void 0?void 0:r.type.id)===Pv){N.push({kind:wt.Duration});break}if(((i=e.parent)===null||i===void 0?void 0:i.type.id)===Dh||((s=e.parent)===null||s===void 0?void 0:s.type.id)===xf){N.push({kind:wt.MatchOp});break}if(((o=e.parent)===null||o===void 0?void 0:o.type.id)===Hm){N.push({kind:wt.Duration});break}if(((l=e.parent)===null||l===void 0?void 0:l.type.id)===kf&&eu(e.parent,HA)){N.push({kind:wt.Duration});break}const I=t.sliceDoc(e.from,e.to);cW.filter(D=>D.label.includes(I)).length>0&&N.push({kind:wt.BinOp});break}case $A:{if(((c=e.parent)===null||c===void 0?void 0:c.type.id)===0){const L=e.parent.parent;if((L==null?void 0:L.type.id)===D6){N.push({kind:wt.AtModifiers});break}if((L==null?void 0:L.type.id)===Nv){N.push({kind:wt.AggregateOpModifier},{kind:wt.BinOp});break}if((L==null?void 0:L.type.id)===Qb){const z=Ug(e,t);uW.filter(P=>P.label===z).length>0&&N.push({kind:wt.AggregateOpModifier}),N.push({kind:wt.BinOp},{kind:wt.Offset});break}if(L&&qA(L,"Expr")){N.push({kind:wt.BinOp},{kind:wt.Offset});break}}const I=(h=e.parent)===null||h===void 0?void 0:h.parent;if(!I){N.push({kind:wt.MetricName,metricName:t.sliceDoc(e.from,e.to)});break}qA(I,"Expr","Expr")&&I.type.id!==su?I.type.id===em&&!eu(I,0)&&(N.push({kind:wt.MetricName,metricName:t.sliceDoc(e.from,e.to)},{kind:wt.Function},{kind:wt.Aggregation},{kind:wt.BinOpModifier},{kind:wt.Number}),eu(I,Z3,J3,ek,tk,nk,Bv)&&!eu(I,Xq)&&N.push({kind:wt.Bool})):(N.push({kind:wt.MetricName,metricName:t.sliceDoc(e.from,e.to)},{kind:wt.Function},{kind:wt.Aggregation}),I.type.id!==su&&I.type.id!==Hm&&N.push({kind:wt.Number}));break}case nfe:e.firstChild!==null&&e.firstChild.type.id===0&&N.push({kind:wt.MetricName,metricName:""},{kind:wt.Function},{kind:wt.Aggregation},{kind:wt.Number});break;case Jp:N.push({kind:wt.LabelName,metricName:Qbe(e,t)});break;case tm:{if(n>=e.to)break;N.push({kind:wt.LabelName,metricName:Ug(e,t)});break}case Iv:((f=e.parent)===null||f===void 0?void 0:f.type.id)===Jp?N.push({kind:wt.LabelName}):((p=e.parent)===null||p===void 0?void 0:p.type.id)===Dh&&N.push({kind:wt.LabelName,metricName:Ug(e,t)});break;case $m:if(((m=e.parent)===null||m===void 0?void 0:m.type.id)===Dh||((v=e.parent)===null||v===void 0?void 0:v.type.id)===xf){let I="";((y=e.parent.firstChild)===null||y===void 0?void 0:y.type.id)===Iv?I=t.sliceDoc(e.parent.firstChild.from,e.parent.firstChild.to):((x=e.parent.firstChild)===null||x===void 0?void 0:x.type.id)===Lv&&(I=t.sliceDoc(e.parent.firstChild.from,e.parent.firstChild.to).slice(1,-1));const D=Ug(e,t),L=N6(e,tm),z=[Lv,xf,Dh];let P=[];for(const H of z)P=P.concat(cQ(L?L.getChildren(H):[],t));N.push({kind:wt.LabelValue,metricName:D,labelName:I,matchers:P})}else((w=(S=e.parent)===null||S===void 0?void 0:S.parent)===null||w===void 0?void 0:w.type.id)===Jp?N.push({kind:wt.LabelName}):((C=(A=e.parent)===null||A===void 0?void 0:A.parent)===null||C===void 0?void 0:C.type.id)===tm&&N.push({kind:wt.MetricName,metricName:t.sliceDoc(e.from,e.to).slice(1,-1)});break;case X2:((j=e.parent)===null||j===void 0?void 0:j.type.id)===0&&((_=e.parent.parent)===null||_===void 0?void 0:_.type.id)===kf?WI(t,e)||N.push({kind:wt.Duration}):N.push({kind:wt.Number});break;case HA:WI(t,e)||N.push({kind:wt.Duration});break;case Pv:N.push({kind:wt.Duration});break;case su:if(d4(t,e,n)){((k=e.parent)===null||k===void 0?void 0:k.type.id)===Nv&&!eu(e.parent,ife)&&N.push({kind:wt.AggregateOpModifier}),N.push({kind:wt.BinOp});break}if(hW(e)){if(e.firstChild===null||e.firstChild.from<=n&&e.firstChild.to>=n){N.push({kind:wt.Number});break}N.push({kind:wt.MetricName,metricName:""},{kind:wt.Function},{kind:wt.Aggregation});break}N.push({kind:wt.MetricName,metricName:""},{kind:wt.Function},{kind:wt.Aggregation});break;case Bv:((M=e.parent)===null||M===void 0?void 0:M.type.id)===zA?N.push({kind:wt.MatchOp}):((R=e.parent)===null||R===void 0?void 0:R.type.id)===em&&N.push({kind:wt.BinOp});break;case Ub:case sQ:case aQ:case zA:N.push({kind:wt.MatchOp});break;case sfe:case hfe:case dfe:case ffe:case pfe:case mfe:case Z3:case J3:case ek:case Zq:case Kq:case tk:case nk:case E6:case R6:case M6:case em:N.push({kind:wt.BinOp});break}return N}class X_{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=Li(n).resolve(r,-1),s=Kbe(n,i,r);let o=Promise.resolve([]),l=!1,c=!0;for(const h of s)switch(h.kind){case wt.Aggregation:l=!0,o=o.then(f=>f.concat(zc.aggregateOp));break;case wt.Function:l=!0,o=o.then(f=>f.concat(zc.functionIdentifier));break;case wt.BinOpModifier:o=o.then(f=>f.concat(zc.binOpModifier));break;case wt.BinOp:o=o.then(f=>f.concat(zc.binOp));break;case wt.MatchOp:o=o.then(f=>f.concat(zc.matchOp));break;case wt.AggregateOpModifier:o=o.then(f=>f.concat(zc.aggregateOpModifier));break;case wt.Duration:c=!1,o=o.then(f=>f.concat(zc.duration));break;case wt.Offset:o=o.then(f=>f.concat([{label:"offset"}]));break;case wt.Bool:o=o.then(f=>f.concat([{label:"bool"}]));break;case wt.AtModifiers:o=o.then(f=>f.concat(zc.atModifier));break;case wt.Number:o=o.then(f=>f.concat(zc.number));break;case wt.MetricName:o=o.then(f=>this.autocompleteMetricName(f,h));break;case wt.LabelName:o=o.then(f=>this.autocompleteLabelName(f,h));break;case wt.LabelValue:o=o.then(f=>this.autocompleteLabelValue(f,h))}return o.then(h=>Ube(h,Xbe(n,i,r),Ybe(n,i,r),l,c))}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 c=(s=i[o])!==null&&s!==void 0?s:i[o.replace(/(_count|_sum|_bucket|_total)$/,"")];if(c){if(c.length>1)for(const h of c)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(c.length===1){let{type:h,help:f}=c[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,apply:Wbe(i),type:"text"}))))}}var Zbe={hasSubscribers:!1},Jbe=Zbe,eye=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,dW=new Set,YI=typeof process=="object"&&process?process:{},tye=(t,e,n,r)=>{typeof YI.emitWarning=="function"?YI.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},nye=t=>!dW.has(t),hh=t=>!!t&&t===Math.floor(t)&&t>0&&isFinite(t),fW=t=>hh(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Xx:null:null,Xx=class extends Array{constructor(t){super(t),this.fill(0)}},Kl,jm,rye=(Kl=class{constructor(e,n){vr(this,"heap");vr(this,"length");if(!Q(Kl,jm))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){let n=fW(e);if(!n)return[];Le(Kl,jm,!0);let r=new Kl(e,n);return Le(Kl,jm,!1),r}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},jm=new WeakMap,st(Kl,jm,!1),Kl),wP,SP,po,Da,qo,df,Qo,Cm,_m,Uo,ki,Wo,wi,Er,Kt,Fs,Na,ks,Wi,Yo,Yi,Vo,Go,Ia,La,Xo,Tm,$s,ff,Ze,Qk,pf,Jc,ob,Ba,pW,mf,km,lb,dh,fh,Uk,Rp,Kx,mW,gW,Zx,br,Wk,vW,bW,Wg,Yk,Yg,ph,Vk,Om,VI=(Om=class{constructor(e){st(this,Ze);st(this,po);st(this,Da);st(this,qo);st(this,df);st(this,Qo);st(this,Cm);st(this,_m);st(this,Uo);vr(this,"ttl");vr(this,"ttlResolution");vr(this,"ttlAutopurge");vr(this,"updateAgeOnGet");vr(this,"updateAgeOnHas");vr(this,"allowStale");vr(this,"noDisposeOnSet");vr(this,"noUpdateTTL");vr(this,"maxEntrySize");vr(this,"sizeCalculation");vr(this,"noDeleteOnFetchRejection");vr(this,"noDeleteOnStaleGet");vr(this,"allowStaleOnFetchAbort");vr(this,"allowStaleOnFetchRejection");vr(this,"ignoreFetchAbort");vr(this,"backgroundFetchSize");st(this,ki);st(this,Wo);st(this,wi);st(this,Er);st(this,Kt);st(this,Fs);st(this,Na);st(this,ks);st(this,Wi);st(this,Yo);st(this,Yi);st(this,Vo);st(this,Go);st(this,Ia);st(this,La);st(this,Xo);st(this,Tm);st(this,$s);st(this,ff);st(this,pf,()=>{});st(this,Jc,()=>{});st(this,ob,()=>{});st(this,Ba,()=>!1);st(this,mf,e=>{});st(this,km,(e,n,r)=>{});st(this,lb,(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});vr(this,wP,"LRUCache");let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:c,dispose:h,onInsert:f,disposeAfter:p,noDisposeOnSet:m,noUpdateTTL:v,maxSize:y=0,maxEntrySize:x=0,sizeCalculation:S,fetchMethod:w,memoMethod:A,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:j,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:k,ignoreFetchAbort:M,backgroundFetchSize:R=1,perf:N}=e;if(this.backgroundFetchSize=R,N!==void 0&&typeof(N==null?void 0:N.now)!="function")throw new TypeError("perf option must have a now() method if specified");if(Le(this,Uo,N??eye),n!==0&&!hh(n))throw new TypeError("max option must be a nonnegative integer");let I=n?fW(n):Array;if(!I)throw new Error("invalid max value: "+n);if(Le(this,po,n),Le(this,Da,y),this.maxEntrySize=x||Q(this,Da),this.sizeCalculation=S,this.sizeCalculation){if(!Q(this,Da)&&!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(A!==void 0&&typeof A!="function")throw new TypeError("memoMethod must be a function if defined");if(Le(this,_m,A),w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(Le(this,Cm,w),Le(this,Tm,!!w),Le(this,wi,new Map),Le(this,Er,Array.from({length:n}).fill(void 0)),Le(this,Kt,Array.from({length:n}).fill(void 0)),Le(this,Fs,new I(n)),Le(this,Na,new I(n)),Le(this,ks,0),Le(this,Wi,0),Le(this,Yo,rye.create(n)),Le(this,ki,0),Le(this,Wo,0),typeof h=="function"&&Le(this,qo,h),typeof f=="function"&&Le(this,df,f),typeof p=="function"?(Le(this,Qo,p),Le(this,Yi,[])):(Le(this,Qo,void 0),Le(this,Yi,void 0)),Le(this,Xo,!!Q(this,qo)),Le(this,ff,!!Q(this,df)),Le(this,$s,!!Q(this,Qo)),this.noDisposeOnSet=!!m,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!M,this.maxEntrySize!==0){if(Q(this,Da)!==0&&!hh(Q(this,Da)))throw new TypeError("maxSize must be a positive integer if specified");if(!hh(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");qe(this,Ze,pW).call(this)}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!j,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=hh(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!hh(this.ttl))throw new TypeError("ttl must be a positive integer if specified");qe(this,Ze,Qk).call(this)}if(Q(this,po)===0&&this.ttl===0&&Q(this,Da)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!Q(this,po)&&!Q(this,Da)){let D="LRU_CACHE_UNBOUNDED";nye(D)&&(dW.add(D),tye("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,Om))}}get perf(){return Q(this,Uo)}static unsafeExposeInternals(e){return{starts:Q(e,Go),ttls:Q(e,Ia),autopurgeTimers:Q(e,La),sizes:Q(e,Vo),keyMap:Q(e,wi),keyList:Q(e,Er),valList:Q(e,Kt),next:Q(e,Fs),prev:Q(e,Na),get head(){return Q(e,ks)},get tail(){return Q(e,Wi)},free:Q(e,Yo),isBackgroundFetch:n=>{var r;return qe(r=e,Ze,br).call(r,n)},backgroundFetch:(n,r,i,s)=>{var o;return qe(o=e,Ze,Zx).call(o,n,r,i,s)},moveToTail:n=>{var r;return qe(r=e,Ze,Yg).call(r,n)},indexes:n=>{var r;return qe(r=e,Ze,dh).call(r,n)},rindexes:n=>{var r;return qe(r=e,Ze,fh).call(r,n)},isStale:n=>{var r;return Q(r=e,Ba).call(r,n)}}}get max(){return Q(this,po)}get maxSize(){return Q(this,Da)}get calculatedSize(){return Q(this,Wo)}get size(){return Q(this,ki)}get fetchMethod(){return Q(this,Cm)}get memoMethod(){return Q(this,_m)}get dispose(){return Q(this,qo)}get onInsert(){return Q(this,df)}get disposeAfter(){return Q(this,Qo)}getRemainingTTL(e){return Q(this,wi).has(e)?1/0:0}*entries(){for(let e of qe(this,Ze,dh).call(this))Q(this,Kt)[e]!==void 0&&Q(this,Er)[e]!==void 0&&!qe(this,Ze,br).call(this,Q(this,Kt)[e])&&(yield[Q(this,Er)[e],Q(this,Kt)[e]])}*rentries(){for(let e of qe(this,Ze,fh).call(this))Q(this,Kt)[e]!==void 0&&Q(this,Er)[e]!==void 0&&!qe(this,Ze,br).call(this,Q(this,Kt)[e])&&(yield[Q(this,Er)[e],Q(this,Kt)[e]])}*keys(){for(let e of qe(this,Ze,dh).call(this)){let n=Q(this,Er)[e];n!==void 0&&!qe(this,Ze,br).call(this,Q(this,Kt)[e])&&(yield n)}}*rkeys(){for(let e of qe(this,Ze,fh).call(this)){let n=Q(this,Er)[e];n!==void 0&&!qe(this,Ze,br).call(this,Q(this,Kt)[e])&&(yield n)}}*values(){for(let e of qe(this,Ze,dh).call(this))Q(this,Kt)[e]!==void 0&&!qe(this,Ze,br).call(this,Q(this,Kt)[e])&&(yield Q(this,Kt)[e])}*rvalues(){for(let e of qe(this,Ze,fh).call(this))Q(this,Kt)[e]!==void 0&&!qe(this,Ze,br).call(this,Q(this,Kt)[e])&&(yield Q(this,Kt)[e])}[(SP=Symbol.iterator,wP=Symbol.toStringTag,SP)](){return this.entries()}find(e,n={}){for(let r of qe(this,Ze,dh).call(this)){let i=Q(this,Kt)[r],s=qe(this,Ze,br).call(this,i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,Q(this,Er)[r],this))return qe(this,Ze,Wg).call(this,Q(this,Er)[r],n)}}forEach(e,n=this){for(let r of qe(this,Ze,dh).call(this)){let i=Q(this,Kt)[r],s=qe(this,Ze,br).call(this,i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,Q(this,Er)[r],this)}}rforEach(e,n=this){for(let r of qe(this,Ze,fh).call(this)){let i=Q(this,Kt)[r],s=qe(this,Ze,br).call(this,i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,Q(this,Er)[r],this)}}purgeStale(){let e=!1;for(let n of qe(this,Ze,fh).call(this,{allowStale:!0}))Q(this,Ba).call(this,n)&&(qe(this,Ze,ph).call(this,Q(this,Er)[n],"expire"),e=!0);return e}info(e){let n=Q(this,wi).get(e);if(n===void 0)return;let r=Q(this,Kt)[n],i=qe(this,Ze,br).call(this,r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(Q(this,Ia)&&Q(this,Go)){let o=Q(this,Ia)[n],l=Q(this,Go)[n];if(o&&l){let c=o-(Q(this,Uo).now()-l);s.ttl=c,s.start=Date.now()}}return Q(this,Vo)&&(s.size=Q(this,Vo)[n]),s}dump(){let e=[];for(let n of qe(this,Ze,dh).call(this,{allowStale:!0})){let r=Q(this,Er)[n],i=Q(this,Kt)[n],s=qe(this,Ze,br).call(this,i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(Q(this,Ia)&&Q(this,Go)){o.ttl=Q(this,Ia)[n];let l=Q(this,Uo).now()-Q(this,Go)[n];o.start=Math.floor(Date.now()-l)}Q(this,Vo)&&(o.size=Q(this,Vo)[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Q(this,Uo).now()-i}qe(this,Ze,Rp).call(this,n,r.value,r)}}set(e,n,r={}){let{status:i=void 0}=r;return r.status=i,i&&(i.op="set",i.key=e,n!==void 0&&(i.value=n),i.cache=this),qe(this,Ze,Rp).call(this,e,n,r)}pop(){var e;try{for(;Q(this,ki);){let n=Q(this,Kt)[Q(this,ks)];if(qe(this,Ze,Kx).call(this,!0),qe(this,Ze,br).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(Q(this,$s)&&Q(this,Yi)){let n=Q(this,Yi),r;for(;r=n==null?void 0:n.shift();)(e=Q(this,Qo))==null||e.call(this,...r)}}}has(e,n={}){let{status:r=void 0}=n;return n.status=r,r&&(r.op="has",r.key=e,r.cache=this),qe(this,Ze,mW).call(this,e,n)}peek(e,n={}){let{status:r=void 0}=n;return r&&(r.op="peek",r.key=e,r.cache=this),n.status=r,qe(this,Ze,gW).call(this,e,n)}fetch(e,n={}){let{status:r=void 0}=n;return n.status=r,r&&n.context&&(r.context=n.context),qe(this,Ze,Wk).call(this,e,n)}forceFetch(e,n={}){let{status:r=void 0}=n;return n.status=r,r&&n.context&&(r.context=n.context),qe(this,Ze,vW).call(this,e,n)}memo(e,n={}){let{status:r=void 0}=n;n.status=r,r&&(r.op="memo",r.key=e,n.context&&(r.context=n.context),r.cache=this);let i=qe(this,Ze,bW).call(this,e,n);return r&&(r.value=i),i}get(e,n={}){let{status:r=void 0}=n;n.status=r,r&&(r.op="get",r.key=e,r.cache=this);let i=qe(this,Ze,Wg).call(this,e,n);return r&&(i!==void 0&&(r.value=i),Jbe.hasSubscribers),i}delete(e){return qe(this,Ze,ph).call(this,e,"delete")}clear(){return qe(this,Ze,Vk).call(this,"delete")}},po=new WeakMap,Da=new WeakMap,qo=new WeakMap,df=new WeakMap,Qo=new WeakMap,Cm=new WeakMap,_m=new WeakMap,Uo=new WeakMap,ki=new WeakMap,Wo=new WeakMap,wi=new WeakMap,Er=new WeakMap,Kt=new WeakMap,Fs=new WeakMap,Na=new WeakMap,ks=new WeakMap,Wi=new WeakMap,Yo=new WeakMap,Yi=new WeakMap,Vo=new WeakMap,Go=new WeakMap,Ia=new WeakMap,La=new WeakMap,Xo=new WeakMap,Tm=new WeakMap,$s=new WeakMap,ff=new WeakMap,Ze=new WeakSet,Qk=function(){let e=new Xx(Q(this,po)),n=new Xx(Q(this,po));Le(this,Ia,e),Le(this,Go,n);let r=this.ttlAutopurge?Array.from({length:Q(this,po)}):void 0;Le(this,La,r),Le(this,ob,(l,c,h=Q(this,Uo).now())=>{n[l]=c!==0?h:0,e[l]=c,i(l,c)}),Le(this,pf,l=>{n[l]=e[l]!==0?Q(this,Uo).now():0,i(l,e[l])});let i=this.ttlAutopurge?(l,c)=>{if(r!=null&&r[l]&&(clearTimeout(r[l]),r[l]=void 0),c&&c!==0&&r){let h=setTimeout(()=>{Q(this,Ba).call(this,l)&&qe(this,Ze,ph).call(this,Q(this,Er)[l],"expire")},c+1);h.unref&&h.unref(),r[l]=h}}:()=>{};Le(this,Jc,(l,c)=>{if(e[c]){let h=e[c],f=n[c];if(!h||!f)return;l.ttl=h,l.start=f,l.now=s||o();let p=l.now-f;l.remainingTTL=h-p}});let s=0,o=()=>{let l=Q(this,Uo).now();if(this.ttlResolution>0){s=l;let c=setTimeout(()=>s=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{let c=Q(this,wi).get(l);if(c===void 0)return 0;let h=e[c],f=n[c];if(!h||!f)return 1/0;let p=(s||o())-f;return h-p},Le(this,Ba,l=>{let c=n[l],h=e[l];return!!h&&!!c&&(s||o())-c>h})},pf=new WeakMap,Jc=new WeakMap,ob=new WeakMap,Ba=new WeakMap,pW=function(){let e=new Xx(Q(this,po));Le(this,Wo,0),Le(this,Vo,e),Le(this,mf,n=>{Le(this,Wo,Q(this,Wo)-e[n]),e[n]=0}),Le(this,lb,(n,r,i,s)=>{if(!hh(i)){if(qe(this,Ze,br).call(this,r))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!hh(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}),Le(this,km,(n,r,i)=>{if(e[n]=r,Q(this,Da)){let s=Q(this,Da)-e[n];for(;Q(this,Wo)>s;)qe(this,Ze,Kx).call(this,!0)}Le(this,Wo,Q(this,Wo)+e[n]),i&&(i.entrySize=r,i.totalCalculatedSize=Q(this,Wo))})},mf=new WeakMap,km=new WeakMap,lb=new WeakMap,dh=function*({allowStale:e=this.allowStale}={}){if(Q(this,ki))for(let n=Q(this,Wi);qe(this,Ze,Uk).call(this,n)&&((e||!Q(this,Ba).call(this,n))&&(yield n),n!==Q(this,ks));)n=Q(this,Na)[n]},fh=function*({allowStale:e=this.allowStale}={}){if(Q(this,ki))for(let n=Q(this,ks);qe(this,Ze,Uk).call(this,n)&&((e||!Q(this,Ba).call(this,n))&&(yield n),n!==Q(this,Wi));)n=Q(this,Fs)[n]},Uk=function(e){return e!==void 0&&Q(this,wi).get(Q(this,Er)[e])===e},Rp=function(e,n,r,i){var y,x,S,w,A,C,j,_;let{ttl:s=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:h}=r,f=qe(this,Ze,br).call(this,n);if(n===void 0)return h&&(h.set="deleted"),this.delete(e),this;let{noUpdateTTL:p=this.noUpdateTTL}=r;h&&!f&&(h.value=n);let m=Q(this,lb).call(this,e,n,r.size||0,c,h);if(this.maxEntrySize&&m>this.maxEntrySize)return qe(this,Ze,ph).call(this,e,"set"),h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this;let v=Q(this,ki)===0?void 0:Q(this,wi).get(e);if(v===void 0)v=Q(this,ki)===0?Q(this,Wi):Q(this,Yo).length!==0?Q(this,Yo).pop():Q(this,ki)===Q(this,po)?qe(this,Ze,Kx).call(this,!1):Q(this,ki),Q(this,Er)[v]=e,Q(this,Kt)[v]=n,Q(this,wi).set(e,v),Q(this,Fs)[Q(this,Wi)]=v,Q(this,Na)[v]=Q(this,Wi),Le(this,Wi,v),Md(this,ki)._++,Q(this,km).call(this,v,m,h),h&&(h.set="add"),p=!1,Q(this,ff)&&!f&&((y=Q(this,df))==null||y.call(this,n,e,"add"));else{qe(this,Ze,Yg).call(this,v);let k=Q(this,Kt)[v];if(n!==k){if(!l)if(qe(this,Ze,br).call(this,k)){k!==i&&k.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:M}=k;M!==void 0&&M!==n&&(Q(this,Xo)&&((x=Q(this,qo))==null||x.call(this,M,e,"set")),Q(this,$s)&&((S=Q(this,Yi))==null||S.push([M,e,"set"])))}else Q(this,Xo)&&((w=Q(this,qo))==null||w.call(this,k,e,"set")),Q(this,$s)&&((A=Q(this,Yi))==null||A.push([k,e,"set"]));if(Q(this,mf).call(this,v),Q(this,km).call(this,v,m,h),Q(this,Kt)[v]=n,!f){let M=k&&qe(this,Ze,br).call(this,k)?k.__staleWhileFetching:k,R=M===void 0?"add":n!==M?"replace":"update";h&&(h.set=R,M!==void 0&&(h.oldValue=M)),Q(this,ff)&&((C=this.onInsert)==null||C.call(this,n,e,R))}}else f||(h&&(h.set="update"),Q(this,ff)&&((j=this.onInsert)==null||j.call(this,n,e,"update")))}if(s!==0&&!Q(this,Ia)&&qe(this,Ze,Qk).call(this),Q(this,Ia)&&(p||Q(this,ob).call(this,v,s,o),h&&Q(this,Jc).call(this,h,v)),!l&&Q(this,$s)&&Q(this,Yi)){let k=Q(this,Yi),M;for(;M=k==null?void 0:k.shift();)(_=Q(this,Qo))==null||_.call(this,...M)}return this},Kx=function(e){var l,c,h;let n=Q(this,ks),r=Q(this,Er)[n],i=Q(this,Kt)[n],s=qe(this,Ze,br).call(this,i);s&&i.__abortController.abort(new Error("evicted"));let o=s?i.__staleWhileFetching:i;return(Q(this,Xo)||Q(this,$s))&&o!==void 0&&(Q(this,Xo)&&((l=Q(this,qo))==null||l.call(this,o,r,"evict")),Q(this,$s)&&((c=Q(this,Yi))==null||c.push([o,r,"evict"]))),Q(this,mf).call(this,n),(h=Q(this,La))!=null&&h[n]&&(clearTimeout(Q(this,La)[n]),Q(this,La)[n]=void 0),e&&(Q(this,Er)[n]=void 0,Q(this,Kt)[n]=void 0,Q(this,Yo).push(n)),Q(this,ki)===1?(Le(this,ks,Le(this,Wi,0)),Q(this,Yo).length=0):Le(this,ks,Q(this,Fs)[n]),Q(this,wi).delete(r),Md(this,ki)._--,n},mW=function(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=Q(this,wi).get(e);if(s!==void 0){let o=Q(this,Kt)[s];if(qe(this,Ze,br).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(Q(this,Ba).call(this,s))i&&(i.has="stale",Q(this,Jc).call(this,i,s));else return r&&Q(this,pf).call(this,s),i&&(i.has="hit",Q(this,Jc).call(this,i,s)),!0}else i&&(i.has="miss");return!1},gW=function(e,n){let{status:r,allowStale:i=this.allowStale}=n,s=Q(this,wi).get(e);if(s===void 0||!i&&Q(this,Ba).call(this,s)){r&&(r.peek=s===void 0?"miss":"stale");return}let o=Q(this,Kt)[s],l=qe(this,Ze,br).call(this,o)?o.__staleWhileFetching:o;return r&&(l!==void 0?(r.peek="hit",r.value=l):r.peek="miss"),l},Zx=function(e,n,r,i){let s=n===void 0?void 0:Q(this,Kt)[n];if(qe(this,Ze,br).call(this,s))return s;let o=new AbortController,{signal:l}=r;l==null||l.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:i},h=(x,S=!1)=>{let{aborted:w}=o.signal,A=r.ignoreFetchAbort&&x!==void 0,C=r.ignoreFetchAbort||!!(r.allowStaleOnFetchAbort&&x!==void 0);if(r.status&&(w&&!S?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,A&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),w&&!A&&!S)return p(o.signal.reason,C);let j=v,_=Q(this,Kt)[n];return(_===v||_===void 0&&A&&S)&&(x===void 0?j.__staleWhileFetching!==void 0?Q(this,Kt)[n]=j.__staleWhileFetching:qe(this,Ze,ph).call(this,e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),qe(this,Ze,Rp).call(this,e,x,c.options,j))),x},f=x=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=x),p(x,!1)),p=(x,S)=>{let{aborted:w}=o.signal,A=w&&r.allowStaleOnFetchAbort,C=A||r.allowStaleOnFetchRejection,j=C||r.noDeleteOnFetchRejection,_=v;if(Q(this,Kt)[n]===v&&(!j||!S&&_.__staleWhileFetching===void 0?qe(this,Ze,ph).call(this,e,"fetch"):A||(Q(this,Kt)[n]=_.__staleWhileFetching)),C)return r.status&&_.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),_.__staleWhileFetching;if(_.__returned===_)throw x},m=(x,S)=>{var A;let w=(A=Q(this,Cm))==null?void 0:A.call(this,e,s,c);o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(x(void 0),r.allowStaleOnFetchAbort&&(x=C=>h(C,!0)))}),w&&w instanceof Promise?w.then(C=>x(C===void 0?void 0:C),S):w!==void 0&&x(w)};r.status&&(r.status.fetchDispatched=!0);let v=new Promise(m).then(h,f),y=Object.assign(v,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(qe(this,Ze,Rp).call(this,e,y,{...c.options,status:void 0}),n=Q(this,wi).get(e)):Q(this,Kt)[n]=y,y},br=function(e){if(!Q(this,Tm))return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof AbortController},Wk=async function(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:c=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:x,forceRefresh:S=!1,status:w,signal:A}=n;if(w&&(w.op="fetch",w.key=e,S&&(w.forceRefresh=!0),w.cache=this),!Q(this,Tm))return w&&(w.fetch="get"),qe(this,Ze,Wg).call(this,e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:w});let C={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:l,size:c,sizeCalculation:h,noUpdateTTL:f,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:y,ignoreFetchAbort:v,status:w,signal:A},j=Q(this,wi).get(e);if(j===void 0){w&&(w.fetch="miss");let _=qe(this,Ze,Zx).call(this,e,j,C,x);return _.__returned=_}else{let _=Q(this,Kt)[j];if(qe(this,Ze,br).call(this,_)){let N=r&&_.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",N&&(w.returnedStale=!0)),N?_.__staleWhileFetching:_.__returned=_}let k=Q(this,Ba).call(this,j);if(!S&&!k)return w&&(w.fetch="hit"),qe(this,Ze,Yg).call(this,j),i&&Q(this,pf).call(this,j),w&&Q(this,Jc).call(this,w,j),_;let M=qe(this,Ze,Zx).call(this,e,j,C,x),R=M.__staleWhileFetching!==void 0&&r;return w&&(w.fetch=k?"stale":"refresh",R&&k&&(w.returnedStale=!0)),R?M.__staleWhileFetching:M.__returned=M}},vW=async function(e,n={}){let r=await qe(this,Ze,Wk).call(this,e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r},bW=function(e,n={}){let r=Q(this,_m);if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...l}=n;s&&o&&(s.forceRefresh=!0);let c=qe(this,Ze,Wg).call(this,e,l),h=o||c===void 0;if(s&&(s.memo=h?"miss":"hit",h||(s.value=c)),!h)return c;let f=r(e,c,{options:l,context:i});return s&&(s.value=f),qe(this,Ze,Rp).call(this,e,f,l),f},Wg=function(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,l=Q(this,wi).get(e);if(l===void 0){o&&(o.get="miss");return}let c=Q(this,Kt)[l],h=qe(this,Ze,br).call(this,c);return o&&Q(this,Jc).call(this,o,l),Q(this,Ba).call(this,l)?h?(o&&(o.get="stale-fetching"),r&&c.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),c.__staleWhileFetching):void 0):(s||qe(this,Ze,ph).call(this,e,"expire"),o&&(o.get="stale"),r?(o&&(o.returnedStale=!0),c):void 0):(o&&(o.get=h?"fetching":"hit"),qe(this,Ze,Yg).call(this,l),i&&Q(this,pf).call(this,l),h?c.__staleWhileFetching:c)},Yk=function(e,n){Q(this,Na)[n]=e,Q(this,Fs)[e]=n},Yg=function(e){e!==Q(this,Wi)&&(e===Q(this,ks)?Le(this,ks,Q(this,Fs)[e]):qe(this,Ze,Yk).call(this,Q(this,Na)[e],Q(this,Fs)[e]),qe(this,Ze,Yk).call(this,Q(this,Wi),e),Le(this,Wi,e))},ph=function(e,n){var i,s,o,l,c,h;let r=!1;if(Q(this,ki)!==0){let f=Q(this,wi).get(e);if(f!==void 0)if((i=Q(this,La))!=null&&i[f]&&(clearTimeout((s=Q(this,La))==null?void 0:s[f]),Q(this,La)[f]=void 0),r=!0,Q(this,ki)===1)qe(this,Ze,Vk).call(this,n);else{Q(this,mf).call(this,f);let p=Q(this,Kt)[f];if(qe(this,Ze,br).call(this,p)?p.__abortController.abort(new Error("deleted")):(Q(this,Xo)||Q(this,$s))&&(Q(this,Xo)&&((o=Q(this,qo))==null||o.call(this,p,e,n)),Q(this,$s)&&((l=Q(this,Yi))==null||l.push([p,e,n]))),Q(this,wi).delete(e),Q(this,Er)[f]=void 0,Q(this,Kt)[f]=void 0,f===Q(this,Wi))Le(this,Wi,Q(this,Na)[f]);else if(f===Q(this,ks))Le(this,ks,Q(this,Fs)[f]);else{let m=Q(this,Na)[f];Q(this,Fs)[m]=Q(this,Fs)[f];let v=Q(this,Fs)[f];Q(this,Na)[v]=Q(this,Na)[f]}Md(this,ki)._--,Q(this,Yo).push(f)}}if(Q(this,$s)&&((c=Q(this,Yi))!=null&&c.length)){let f=Q(this,Yi),p;for(;p=f==null?void 0:f.shift();)(h=Q(this,Qo))==null||h.call(this,...p)}return r},Vk=function(e){var n,r,i,s;for(let o of qe(this,Ze,fh).call(this,{allowStale:!0})){let l=Q(this,Kt)[o];if(qe(this,Ze,br).call(this,l))l.__abortController.abort(new Error("deleted"));else{let c=Q(this,Er)[o];Q(this,Xo)&&((n=Q(this,qo))==null||n.call(this,l,c,e)),Q(this,$s)&&((r=Q(this,Yi))==null||r.push([l,c,e]))}}if(Q(this,wi).clear(),Q(this,Kt).fill(void 0),Q(this,Er).fill(void 0),Q(this,Ia)&&Q(this,Go)){Q(this,Ia).fill(0),Q(this,Go).fill(0);for(let o of Q(this,La)??[])o!==void 0&&clearTimeout(o);(i=Q(this,La))==null||i.fill(void 0)}if(Q(this,Vo)&&Q(this,Vo).fill(0),Le(this,ks,0),Le(this,Wi,0),Q(this,Yo).length=0,Le(this,Wo,0),Le(this,ki,0),Q(this,$s)&&Q(this,Yi)){let o=Q(this,Yi),l;for(;l=o==null?void 0:o.shift();)(s=Q(this,Qo))==null||s.call(this,...l)}},Om);const iye=400,sye=422,aye=503;class oye{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[]",C_(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[]",C_(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[]",C_(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&&![iye,sye,aye].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 lye{constructor(e){const n={ttl:e&&e.maxAge?e.maxAge:3e5,ttlAutopurge:!0};this.completeAssociation=new VI(n),this.metricMetadata={},this.labelValues=new VI(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 cye{constructor(e,n){this.client=e,this.cache=new lye(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 uye(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 Gk(t){return t!=null&&t.completeStrategy?t.completeStrategy:t!=null&&t.remote?uye(t.remote)?new X_(t.remote,t.maxMetricsMetadata):new X_(new cye(new oye(t.remote),t.remote.cache),t.maxMetricsMetadata):new X_}class GI{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class Wd{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=r.facet(Gl).markerFilter;i&&(e=i(e,r));let s=e.slice().sort((v,y)=>v.from-y.from||v.to-y.to),o=new fu,l=[],c=0,h=r.doc.iter(),f=0,p=r.doc.length;for(let v=0;;){let y=v==s.length?null:s[v];if(!y&&!l.length)break;let x,S;if(l.length)x=c,S=l.reduce((C,j)=>Math.min(C,j.to),y&&y.from>x?y.from:1e8);else{if(x=y.from,x>p)break;S=y.to,l.push(y),v++}for(;v<s.length;){let C=s[v];if(C.from==x&&(C.to>C.from||C.to==x))l.push(C),v++,S=Math.min(C.to,S);else{S=Math.min(C.from,S);break}}S=Math.min(S,p);let w=!1;if(l.some(C=>C.from==x&&(C.to==S||S==p))&&(w=x==S,!w&&S-x<10)){let C=x-(f+h.value.length);C>0&&(h.next(C),f=x);for(let j=x;;){if(j>=S){w=!0;break}if(!h.lineBreak&&f+h.value.length>j)break;j=f+h.value.length,f+=h.value.length,h.next()}}let A=Cye(l);if(w)o.add(x,x,Dt.widget({widget:new Aye(A),diagnostics:l.slice()}));else{let C=l.reduce((j,_)=>_.markClass?j+" "+_.markClass:j,"");o.add(x,S,Dt.mark({class:"cm-lintRange cm-lintRange-"+A+C,diagnostics:l.slice(),inclusiveEnd:l.some(j=>j.to>S)}))}if(c=S,c==p)break;for(let C=0;C<l.length;C++)l[C].to<=c&&l.splice(C--,1)}let m=o.finish();return new Wd(m,n,Kh(m))}}function Kh(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 GI(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new GI(r.from,s,r.diagnostic)}}),r}function hye(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(Gl).hideOn(t,n,r);if(i!=null)return i;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(f4))||t.changes.touchesRange(s.from,Math.max(s.to,r)))}function yW(t,e){return t.field(qa,!1)?e:e.concat(Vt.appendConfig.of(CW))}function dye(t,e){return{effects:yW(t,[f4.of(e)])}}const f4=Vt.define(),p4=Vt.define(),xW=Vt.define(),qa=gs.define({create(){return new Wd(Dt.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=Kh(n,t.selected.diagnostic,s)||Kh(n,null,s)}!n.size&&i&&e.state.facet(Gl).autoPanel&&(i=null),t=new Wd(n,i,r)}for(let n of e.effects)if(n.is(f4)){let r=e.state.facet(Gl).autoPanel?n.value.length?Zv.open:null:t.panel;t=Wd.init(n.value,r,e.state)}else n.is(p4)?t=new Wd(t.diagnostics,n.value?Zv.open:null,t.selected):n.is(xW)&&(t=new Wd(t.diagnostics,t.panel,n.value));return t},provide:t=>[Yv.from(t,e=>e.panel),ot.decorations.from(t,e=>e.diagnostics)]}),fye=Dt.mark({class:"cm-lintRange cm-lintRange-active"});function pye(t,e,n){let{diagnostics:r}=t.state.field(qa),i,s=-1,o=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(c,h,{spec:f})=>{if(e>=c&&e<=h&&(c==h||(e>c||n>0)&&(e<h||n<0)))return i=f.diagnostics,s=c,o=h,!1});let l=t.state.facet(Gl).tooltipFilter;return i&&l&&(i=l(i,t.state)),i?{pos:s,end:o,above:!0,create(){return{dom:mye(t,i)}}}:null}function mye(t,e){return lr("ul",{class:"cm-tooltip-lint"},e.map(n=>SW(t,n,!1)))}const gye=t=>{let e=t.state.field(qa,!1);(!e||!e.panel)&&t.dispatch({effects:yW(t.state,[p4.of(!0)])});let n=J6(t,Zv.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},XI=t=>{let e=t.state.field(qa,!1);return!e||!e.panel?!1:(t.dispatch({effects:p4.of(!1)}),!0)},vye=t=>{let e=t.state.field(qa,!1);if(!e)return!1;let n=t.state.selection.main,r=Kh(e.diagnostics,null,n.to+1);return!r&&(r=Kh(e.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),Lge(t,r.from,1,{tooltip:jW,until:i=>i.docChanged||i.newSelection.main.head<r.from||i.newSelection.main.head>r.to}),!0)},AW=[{key:"Mod-Shift-m",run:gye,preventDefault:!0},{key:"F8",run:vye}],bye=Yr.fromClass(class{constructor(t){this.view=t,this.timeout=-1,this.set=!0;let{delay:e}=t.state.facet(Gl);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(Gl);n.length&&yye(n.map(r=>Promise.resolve(r(this.view))),r=>{this.view.state.doc==e.doc&&this.view.dispatch(dye(this.view.state,r.reduce((i,s)=>i.concat(s))))},r=>{Qs(this.view.state,r)})}}update(t){let e=t.state.facet(Gl);(t.docChanged||e!=t.startState.facet(Gl)||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 yye(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 Gl=vt.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...fc(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:KI,tooltipFilter:KI,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 KI(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function xye(t,e={}){return[Gl.of({source:t,config:e}),bye,CW]}function wW(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 SW(t,e,n){var r;let i=n?wW(e.actions):[];return lr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},lr("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,c=v=>{if(v.preventDefault(),l)return;l=!0;let y=Kh(t.state.field(qa).diagnostics,e);y&&s.apply(t,y.from,y.to)},{name:h}=s,f=i[o]?h.indexOf(i[o]):-1,p=f<0?h:[h.slice(0,f),lr("u",h.slice(f,f+1)),h.slice(f+1)],m=s.markClass?" "+s.markClass:"";return lr("button",{type:"button",class:"cm-diagnosticAction"+m,onclick:c,onmousedown:c,"aria-label":` Action: ${h}${f<0?"":` (access key "${i[o]})"`}.`},p)}),e.source&&lr("div",{class:"cm-diagnosticSource"},e.source))}class Aye extends vl{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return lr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class ZI{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=SW(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Zv{constructor(e){this.view=e,this.items=[];let n=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)XI(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=wW(s.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==i.keyCode){let c=Kh(this.view.state.field(qa).diagnostics,s);c&&s.actions[l].apply(e,c.from,c.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=lr("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=lr("div",{class:"cm-panel-lint"},this.list,lr("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>XI(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(qa).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(qa),r=0,i=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,c,{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 ZI(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 ZI(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:c})=>{let h=c.height/this.list.offsetHeight;l.top<c.top?this.list.scrollTop-=(c.top-l.top)/h:l.bottom>c.bottom&&(this.list.scrollTop+=(l.bottom-c.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(qa),r=Kh(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:xW.of(r)})}static open(e){return new Zv(e)}}function wye(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 ex(t){return wye(`<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 Sye=ot.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:ex("#f11")},".cm-lintRange-warning":{backgroundImage:ex("orange")},".cm-lintRange-info":{backgroundImage:ex("#999")},".cm-lintRange-hint":{backgroundImage:ex("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function jye(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function Cye(t){let e="hint",n=1;for(let r of t){let i=jye(r.severity);i>n&&(n=i,e=r.severity)}return e}const jW=Ige(pye,{hideOn:hye}),CW=[qa,ot.decorations.compute([qa],t=>{let{selected:e,panel:n}=t.field(qa);return!e||!n||e.from==e.to?Dt.none:Dt.set([fye.range(e.from,e.to)])}),jW,Sye];class _ye{promQL(){return e=>{const n=new Qve(e.state);return n.analyze(),n.getDiagnostics()}}}function Tye(){return new _ye}function kye(t,e){return xye(t.call(e))}var Xk;(function(t){t.PromQL="PromQL",t.MetricName="MetricName"})(Xk||(Xk={}));function Oye(t){return tw.define({parser:Gde.configure({top:t}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}})}class _W{constructor(){this.complete=Gk(),this.lint=Tye(),this.enableLinter=!0,this.enableCompletion=!0}setComplete(e){return this.complete=Gk(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=Xk.PromQL){const n=Oye(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(kye(this.lint.promQL,this.lint))),r}}function lw(){return lw=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},lw.apply(null,arguments)}function m4(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 Eye=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=v4(t.state,n.from);return r.line?Mye(t):r.block?Dye(t):!1};function g4(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 Mye=g4(Lye,0),Rye=g4(TW,0),Dye=g4((t,e)=>TW(t,e,Iye(e)),0);function v4(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Cg=50;function Nye(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-Cg,r),o=t.sliceDoc(i,i+Cg),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(o)[0].length,h=s.length-l;if(s.slice(h-e.length,h)==e&&o.slice(c,c+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:i+c,margin:c&&1}};let f,p;i-r<=2*Cg?f=p=t.sliceDoc(r,i):(f=t.sliceDoc(r,r+Cg),p=t.sliceDoc(i-Cg,i));let m=/^\s*/.exec(f)[0].length,v=/\s*$/.exec(p)[0].length,y=p.length-v-n.length;return f.slice(m,m+e.length)==e&&p.slice(y,y+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(y-1))?1:0}}:null}function Iye(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);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let 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 TW(t,e,n=e.selection.ranges){let r=n.map(s=>v4(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,o)=>Nye(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 c=r[o],{open:h,close:f}=l;s.push({from:h.pos-c.open.length,to:h.pos+h.margin},{from:f.pos-f.margin,to:f.pos+c.close.length})}return{changes:s}}return null}function Lye(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:o}of n){let l=r.length,c=1e9,h;for(let f=s;f<=o;){let p=e.doc.lineAt(f);if(h==null&&(h=v4(e,p.from).line,!h))continue e;if(p.from>i&&(s==o||o>p.from)){i=p.from;let m=/^\s*/.exec(p.text)[0].length,v=m==p.length,y=p.text.slice(m,m+h.length)==h?m:-1;m<p.text.length&&m<c&&(c=m),r.push({line:p,comment:y,token:h,indent:m,empty:v,single:!1})}f=p.to+1}if(c<1e9)for(let f=l;f<r.length;f++)r[f].indent<r[f].line.text.length&&(r[f].indent=c);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:c,indent:h,empty:f,single:p}of r)(p||!f)&&s.push({from:l.from+h,insert:c+" "});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:c}of r)if(l>=0){let h=o.from+l,f=h+c.length;o.text[f-o.from]==" "&&f++,s.push({from:h,to:f})}return{changes:s}}return null}const Kk=dc.define(),Bye=dc.define(),Pye=vt.define(),kW=vt.define({combine(t){return fc(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)})}}),OW=gs.define({create(){return Xl.empty},update(t,e){let n=e.state.facet(kW),r=e.annotation(Kk);if(r){let c=pa.fromTransaction(e,r.selection),h=r.side,f=h==0?t.undone:t.done;return c?f=cw(f,f.length,n.minDepth,c):f=DW(f,e.startState.selection),new Xl(h==0?r.rest:f,h==0?f:r.rest)}let i=e.annotation(Bye);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(ji.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=pa.fromTransaction(e),o=e.annotation(ji.time),l=e.annotation(ji.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 Xl(t.done.map(pa.fromJSON),t.undone.map(pa.fromJSON))}});function EW(t={}){return[OW,kW.of(t),ot.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?MW:e.inputType=="historyRedo"?Zk:null;return r?(e.preventDefault(),r(n)):!1}})]}function lS(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(OW,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const MW=lS(0,!1),Zk=lS(1,!1),Fye=lS(0,!0),$ye=lS(1,!0);class pa{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 pa(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 pa(e.changes&&Mi.fromJSON(e.changes),[],e.mapped&&ec.fromJSON(e.mapped),e.startSelection&&Be.fromJSON(e.startSelection),e.selectionsAfter.map(Be.fromJSON))}static fromTransaction(e,n){let r=yo;for(let i of e.startState.facet(Pye)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new pa(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,yo)}static selection(e){return new pa(void 0,yo,void 0,void 0,e)}}function cw(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 Hye(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,o,l)=>{for(let c=0;c<n.length;){let h=n[c++],f=n[c++];l>=h&&o<=f&&(r=!0)}}),r}function zye(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function RW(t,e){return t.length?e.length?t.concat(e):t:e}const yo=[],qye=200;function DW(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-qye));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),cw(t,t.length-1,1e9,n.setSelAfter(r)))}else return[pa.selection([e])]}function Qye(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 K_(t,e){if(!t.length)return t;let n=t.length,r=yo;for(;n;){let i=Uye(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?[pa.selection(r)]:yo}function Uye(t,e,n){let r=RW(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):yo,n);if(!t.changes)return pa.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new pa(i,Vt.mapEffects(t.effects,e),o,t.startSelection.map(s),r)}const Wye=/^(input\.type|delete)($|\.)/;class Xl{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 Xl(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||Wye.test(r))&&(!l.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,Hye(l.changes,e.changes))||r=="input.type.compose")?o=cw(o,o.length-1,i.minDepth,new pa(e.changes.compose(l.changes),RW(Vt.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,yo)):o=cw(o,o.length,i.minDepth,e),new Xl(o,yo,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:yo;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&zye(s[s.length-1],e)?this:new Xl(DW(this.done,e),this.undone,n,r)}addMapping(e){return new Xl(K_(this.done,e),K_(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]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Kk.of({side:e,rest:Qye(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=i.length==1?yo:i.slice(0,i.length-1);return s.mapped&&(l=K_(l,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Kk.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Xl.empty=new Xl(yo,yo);const NW=[{key:"Mod-z",run:MW,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Zk,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Zk,preventDefault:!0},{key:"Mod-u",run:Fye,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:$ye,preventDefault:!0}];function y0(t,e){return Be.create(t.ranges.map(e),t.mainIndex)}function bl(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function yl({state:t,dispatch:e},n){let r=y0(t.selection,n);return r.eq(t.selection,!0)?!1:(e(bl(t,r)),!0)}function cS(t,e){return Be.cursor(e?t.to:t.from)}function IW(t,e){return yl(t,n=>n.empty?t.moveByChar(n,e):cS(n,e))}function Ns(t){return t.textDirectionAt(t.state.selection.main.head)==pr.LTR}const LW=t=>IW(t,!Ns(t)),BW=t=>IW(t,Ns(t));function PW(t,e){return yl(t,n=>n.empty?t.moveByGroup(n,e):cS(n,e))}const Yye=t=>PW(t,!Ns(t)),Vye=t=>PW(t,Ns(t));function Gye(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 uS(t,e,n){let r=Li(t).resolveInner(e.head),i=n?dn.closedBy:dn.openedBy;for(let c=e.head;;){let h=n?r.childAfter(c):r.childBefore(c);if(!h)break;Gye(t,h,i)?r=h:c=n?h.to:h.from}let s=r.type.prop(i),o,l;return s&&(o=n?Vl(t,r.from,1):Vl(t,r.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?r.to:r.from,Be.cursor(l,n?-1:1)}const Xye=t=>yl(t,e=>uS(t.state,e,!Ns(t))),Kye=t=>yl(t,e=>uS(t.state,e,Ns(t)));function FW(t,e){return yl(t,n=>{if(!n.empty)return cS(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const $W=t=>FW(t,!1),HW=t=>FW(t,!0);function zW(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(ot.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 qW(t,e){let n=zW(t),{state:r}=t,i=y0(r.selection,o=>o.empty?t.moveVertically(o,e,n.height):cS(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(),c=l.top+n.marginTop,h=l.bottom-n.marginBottom;o&&o.top>c&&o.bottom<h&&(s=ot.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-c}))}return t.dispatch(bl(r,i),{effects:s}),!0}const JI=t=>qW(t,!1),Jk=t=>qW(t,!0);function cd(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=Be.cursor(r.from+s))}return i}const Zye=t=>yl(t,e=>cd(t,e,!0)),Jye=t=>yl(t,e=>cd(t,e,!1)),e1e=t=>yl(t,e=>cd(t,e,!Ns(t))),t1e=t=>yl(t,e=>cd(t,e,Ns(t))),n1e=t=>yl(t,e=>Be.cursor(t.lineBlockAt(e.head).from,1)),r1e=t=>yl(t,e=>Be.cursor(t.lineBlockAt(e.head).to,-1));function i1e(t,e,n){let r=!1,i=y0(t.selection,s=>{let o=Vl(t,s.head,-1)||Vl(t,s.head,1)||s.head>0&&Vl(t,s.head-1,1)||s.head<t.doc.length&&Vl(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 Be.cursor(l)});return r?(e(bl(t,i)),!0):!1}const s1e=({state:t,dispatch:e})=>i1e(t,e);function Oo(t,e){let n=y0(t.state.selection,r=>{let i=e(r);return Be.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(bl(t.state,n)),!0)}function QW(t,e){return Oo(t,n=>t.moveByChar(n,e))}const UW=t=>QW(t,!Ns(t)),WW=t=>QW(t,Ns(t));function YW(t,e){return Oo(t,n=>t.moveByGroup(n,e))}const a1e=t=>YW(t,!Ns(t)),o1e=t=>YW(t,Ns(t)),l1e=t=>Oo(t,e=>uS(t.state,e,!Ns(t))),c1e=t=>Oo(t,e=>uS(t.state,e,Ns(t)));function VW(t,e){return Oo(t,n=>t.moveVertically(n,e))}const GW=t=>VW(t,!1),XW=t=>VW(t,!0);function KW(t,e){return Oo(t,n=>t.moveVertically(n,e,zW(t).height))}const eL=t=>KW(t,!1),tL=t=>KW(t,!0),u1e=t=>Oo(t,e=>cd(t,e,!0)),h1e=t=>Oo(t,e=>cd(t,e,!1)),d1e=t=>Oo(t,e=>cd(t,e,!Ns(t))),f1e=t=>Oo(t,e=>cd(t,e,Ns(t))),p1e=t=>Oo(t,e=>Be.cursor(t.lineBlockAt(e.head).from)),m1e=t=>Oo(t,e=>Be.cursor(t.lineBlockAt(e.head).to)),nL=({state:t,dispatch:e})=>(e(bl(t,{anchor:0})),!0),rL=({state:t,dispatch:e})=>(e(bl(t,{anchor:t.doc.length})),!0),iL=({state:t,dispatch:e})=>(e(bl(t,{anchor:t.selection.main.anchor,head:0})),!0),sL=({state:t,dispatch:e})=>(e(bl(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),g1e=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),v1e=({state:t,dispatch:e})=>{let n=hS(t).map(({from:r,to:i})=>Be.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:Be.create(n),userEvent:"select"})),!0},b1e=({state:t,dispatch:e})=>{let n=y0(t.selection,r=>{let i=Li(t),s=i.resolveStack(r.from,1);if(r.empty){let o=i.resolveStack(r.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}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)&&o.next)return Be.range(l.to,l.from)}return r});return n.eq(t.selection)?!1:(e(bl(t,n)),!0)};function ZW(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=s;;){let c=t.moveVertically(l,e);if(c.head<o.from||c.head>o.to){i.some(h=>h.head==c.head)||i.push(c);break}else{if(c.head==l.head)break;l=c}}}return i.length==r.ranges.length?!1:(t.dispatch(bl(n,Be.create(i,i.length-1))),!0)}const y1e=t=>ZW(t,!1),x1e=t=>ZW(t,!0),A1e=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Be.create([n.main]):n.main.empty||(r=Be.create([Be.cursor(n.main.head)])),r?(e(bl(t,r)),!0):!1};function Zb(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 c=e(s);c<o?(n="delete.backward",c=tx(t,c,!1)):c>o&&(n="delete.forward",c=tx(t,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=tx(t,o,!1),l=tx(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:Be.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"?ot.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function tx(t,e,n){if(t instanceof ot)for(let r of t.state.facet(ot.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=n?s:i)});return e}const JW=(t,e,n)=>Zb(t,r=>{let i=r.from,{state:s}=t,o=s.doc.lineAt(i),l,c;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=v0(l,s.tabSize),f=h%rw(s)||rw(s);for(let p=0;p<f&&l[l.length-1-p]==" ";p++)i--;c=i}else c=Xi(o.text,i-o.from,e,e)+o.from,c==i&&o.number!=(e?s.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=Xi(o.text,c-o.from,!1,!1)+o.from);return c}),eO=t=>JW(t,!1,!0),eY=t=>JW(t,!0,!1),tY=(t,e)=>Zb(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 c=Xi(s.text,r-s.from,e)+s.from,h=s.text.slice(Math.min(r,c)-s.from,Math.max(r,c)-s.from),f=o(h);if(l!=null&&f!=l)break;(h!=" "||r!=n.head)&&(l=f),r=c}return r}),nY=t=>tY(t,!1),w1e=t=>tY(t,!0),S1e=t=>Zb(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),j1e=t=>Zb(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),C1e=t=>Zb(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),_1e=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:On.of(["",""])},range:Be.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},T1e=({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:Xi(s.text,i-s.from,!1)+s.from,l=i==s.to?i+1:Xi(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:Be.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function hS(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 rY(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of hS(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 c of s.ranges)i.push(Be.range(Math.min(t.doc.length,c.anchor+l),Math.min(t.doc.length,c.head+l)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let c of s.ranges)i.push(Be.range(c.anchor-l,c.head-l))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Be.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const k1e=({state:t,dispatch:e})=>rY(t,e,!1),O1e=({state:t,dispatch:e})=>rY(t,e,!0);function iY(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of hS(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const E1e=({state:t,dispatch:e})=>iY(t,e,!1),M1e=({state:t,dispatch:e})=>iY(t,e,!0),R1e=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(hS(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=y0(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 D1e(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Li(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(dn.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 tO=sY(!1),N1e=sY(!0);function sY(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),c=!t&&s==o&&D1e(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new iS(e,{simulateBreak:s,simulateDoubleBreak:!!c}),f=e4(h,s);for(f==null&&(f=v0(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;c?{from:s,to:o}=c:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let p=["",Vv(e,f)];return c&&p.push(Vv(e,h.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:On.of(p)},range:Be.cursor(s+1+p[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function b4(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:Be.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const I1e=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new iS(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),i=b4(t,(s,o,l)=>{let c=e4(r,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let h=/^\s*/.exec(s.text)[0],f=Vv(t,c);(h!=f||l.from<s.from+h.length)&&(n[s.from]=c,o.push({from:s.from,to:s.from+h.length,insert:f}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},aY=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(b4(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Gb)})}),{userEvent:"input.indent"})),!0),oY=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(b4(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=v0(i,t.tabSize),o=0,l=Vv(t,Math.max(0,s-rw(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),L1e=t=>(t.setTabFocusMode(),!0),B1e=[{key:"Ctrl-b",run:LW,shift:UW,preventDefault:!0},{key:"Ctrl-f",run:BW,shift:WW},{key:"Ctrl-p",run:$W,shift:GW},{key:"Ctrl-n",run:HW,shift:XW},{key:"Ctrl-a",run:n1e,shift:p1e},{key:"Ctrl-e",run:r1e,shift:m1e},{key:"Ctrl-d",run:eY},{key:"Ctrl-h",run:eO},{key:"Ctrl-k",run:S1e},{key:"Ctrl-Alt-h",run:nY},{key:"Ctrl-o",run:_1e},{key:"Ctrl-t",run:T1e},{key:"Ctrl-v",run:Jk}],P1e=[{key:"ArrowLeft",run:LW,shift:UW,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Yye,shift:a1e,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e1e,shift:d1e,preventDefault:!0},{key:"ArrowRight",run:BW,shift:WW,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Vye,shift:o1e,preventDefault:!0},{mac:"Cmd-ArrowRight",run:t1e,shift:f1e,preventDefault:!0},{key:"ArrowUp",run:$W,shift:GW,preventDefault:!0},{mac:"Cmd-ArrowUp",run:nL,shift:iL},{mac:"Ctrl-ArrowUp",run:JI,shift:eL},{key:"ArrowDown",run:HW,shift:XW,preventDefault:!0},{mac:"Cmd-ArrowDown",run:rL,shift:sL},{mac:"Ctrl-ArrowDown",run:Jk,shift:tL},{key:"PageUp",run:JI,shift:eL},{key:"PageDown",run:Jk,shift:tL},{key:"Home",run:Jye,shift:h1e,preventDefault:!0},{key:"Mod-Home",run:nL,shift:iL},{key:"End",run:Zye,shift:u1e,preventDefault:!0},{key:"Mod-End",run:rL,shift:sL},{key:"Enter",run:tO,shift:tO},{key:"Mod-a",run:g1e},{key:"Backspace",run:eO,shift:eO,preventDefault:!0},{key:"Delete",run:eY,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:nY,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:w1e,preventDefault:!0},{mac:"Mod-Backspace",run:j1e,preventDefault:!0},{mac:"Mod-Delete",run:C1e,preventDefault:!0}].concat(B1e.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),lY=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Xye,shift:l1e},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Kye,shift:c1e},{key:"Alt-ArrowUp",run:k1e},{key:"Shift-Alt-ArrowUp",run:E1e},{key:"Alt-ArrowDown",run:O1e},{key:"Shift-Alt-ArrowDown",run:M1e},{key:"Mod-Alt-ArrowUp",run:y1e},{key:"Mod-Alt-ArrowDown",run:x1e},{key:"Escape",run:A1e},{key:"Mod-Enter",run:N1e},{key:"Alt-l",mac:"Ctrl-l",run:v1e},{key:"Mod-i",run:b1e,preventDefault:!0},{key:"Mod-[",run:oY},{key:"Mod-]",run:aY},{key:"Mod-Alt-\\",run:I1e},{key:"Shift-Mod-k",run:R1e},{key:"Shift-Mod-\\",run:s1e},{key:"Mod-/",run:Eye},{key:"Alt-A",run:Rye},{key:"Ctrl-m",mac:"Shift-Alt-m",run:L1e}].concat(P1e),F1e={key:"Tab",run:aY,shift:oY},aL=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Vm{constructor(e,n,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?l=>s(aL(l)):aL,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 ua(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=I6(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ql(e);let i=this.normalize(n);if(i.length)for(let s=0,o=r,l=!0;;s++){let c=i.charCodeAt(s),h=this.match(c,o,l,this.bufferPos+this.bufferStart,s==i.length-1);if(h)return this.value=h,this;if(s==i.length-1)break;l&&s<n.length&&n.charCodeAt(s)==c?o++:l=!1}}}match(e,n,r,i,s){let o=null;for(let l=0;l<this.matches.length;){let c=this.matches[l],h=!1;this.query.charCodeAt(c.index)==e&&(c.index==this.query.length-1?o={from:c.from,to:i,precise:s&&c.precise}:(c.index++,h=!0)),h?l++:this.matches.splice(l,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?o={from:n,to:i,precise:r&&s}:this.matches.push({from:n,index:1,precise:r})),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}typeof Symbol<"u"&&(Vm.prototype[Symbol.iterator]=function(){return this});const cY={from:-1,to:-1,match:/.*/.exec(""),precise:!0},y4="gm"+(/x/.unicode==null?"":"u");class uY{constructor(e,n,r,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=cY,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new hY(e,n,r,i,s);this.re=new RegExp(n,y4+(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=uw(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=uw(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this;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 Z_=new WeakMap;class om{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=Z_.get(e);if(!i||i.from>=r||i.to<=n){let l=new om(n,e.sliceString(n,r));return Z_.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)),Z_.set(e,new om(o,s)),new om(n,s.slice(n-o,r-o))}}class hY{constructor(e,n,r,i,s){this.text=e,this.to=s,this.done=!1,this.value=cY,this.matchPos=uw(e,i),this.re=new RegExp(n,y4+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=om.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,precise:!0,match:n},this.matchPos=uw(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=om.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(uY.prototype[Symbol.iterator]=hY.prototype[Symbol.iterator]=function(){return this});function $1e(t){try{return new RegExp(t,y4),!0}catch{return!1}}function uw(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}const H1e=t=>{let{state:e}=t,n=String(e.doc.lineAt(t.state.selection.main.head).number),{close:r,result:i}=Pge(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:e.phrase("go")});return i.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){t.dispatch({effects:r});return}let l=e.doc.lineAt(e.selection.main.head),[,c,h,f,p]=o,m=f?+f.slice(1):0,v=h?+h:l.number;if(h&&p){let S=v/100;c&&(S=S*(c=="-"?-1:1)+l.number/e.doc.lines),v=Math.round(e.doc.lines*S)}else h&&c&&(v=v*(c=="-"?-1:1)+l.number);let y=e.doc.line(Math.max(1,Math.min(e.doc.lines,v))),x=Be.cursor(y.from+Math.max(0,Math.min(m,y.length)));t.dispatch({effects:[r,ot.scrollIntoView(x.from,{y:"center"})],selection:x})}),!0},z1e={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},q1e=vt.define({combine(t){return fc(t,z1e,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function dY(t){return[V1e,Y1e]}const Q1e=Dt.mark({class:"cm-selectionMatch"}),U1e=Dt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function oL(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Pr.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Pr.Word)}function W1e(t,e,n,r){return t(e.sliceDoc(n,n+1))==Pr.Word&&t(e.sliceDoc(r-1,r))==Pr.Word}const Y1e=Yr.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(q1e),{state:n}=t,r=n.selection;if(r.ranges.length>1)return Dt.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return Dt.none;let c=n.wordAt(i.head);if(!c)return Dt.none;o=n.charCategorizer(i.head),s=n.sliceDoc(c.from,c.to)}else{let c=i.to-i.from;if(c<e.minSelectionLength||c>200)return Dt.none;if(e.wholeWords){if(s=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(oL(o,n,i.from,i.to)&&W1e(o,n,i.from,i.to)))return Dt.none}else if(s=n.sliceDoc(i.from,i.to),!s)return Dt.none}let l=[];for(let c of t.visibleRanges){let h=new Vm(n.doc,s,c.from,c.to);for(;!h.next().done;){let{from:f,to:p}=h.value;if((!o||oL(o,n,f,p))&&(i.empty&&f<=i.from&&p>=i.to?l.push(U1e.range(f,p)):(f>=i.to||p<=i.from)&&l.push(Q1e.range(f,p)),l.length>e.maxMatches))return Dt.none}}return Dt.set(l)}},{decorations:t=>t.decorations}),V1e=ot.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),G1e=({state:t,dispatch:e})=>{let{selection:n}=t,r=Be.create(n.ranges.map(i=>t.wordAt(i.head)||Be.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function X1e(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 Vm(t.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Vm(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(c=>c.from==l.value.from))continue;if(s){let c=t.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const K1e=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(s=>s.from===s.to))return G1e({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=X1e(t,r);return i?(e(t.update({selection:t.selection.addRange(Be.range(i.from,i.to),!1),effects:ot.scrollIntoView(i.to)})),!0):!1},x0=vt.define({combine(t){return fc(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new hxe(e),scrollToMatch:e=>ot.scrollIntoView(e)})}});class fY{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||$1e(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}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&&this.test==e.test}create(){return this.regexp?new rxe(this):new exe(this)}getCursor(e,n=0,r){let i=e.doc?e:wn.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Np(this,i,n,r):Dp(this,i,n,r)}}class pY{constructor(e){this.spec=e}}function Z1e(t,e,n){return(r,i,s,o)=>{if(n&&!n(r,i,s,o))return!1;let l=r>=o&&i<=o+s.length?s.slice(r-o,i-o):e.doc.sliceString(r,i);return t(l,e,r,i)}}function Dp(t,e,n,r){let i;return t.wholeWord&&(i=J1e(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=Z1e(t.test,e,i)),new Vm(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:s=>s.toLowerCase(),i)}function J1e(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(hw(i,n-s))!=Pr.Word||e(dw(i,n-s))!=Pr.Word)&&(e(dw(i,r-s))!=Pr.Word||e(hw(i,r-s))!=Pr.Word))}class exe extends pY{constructor(e){super(e)}nextMatch(e,n,r){let i=Dp(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,n+this.spec.unquoted.length);i=Dp(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let s=Math.max(n,i-1e4-this.spec.unquoted.length),o=Dp(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){let i=this.prevMatchInRange(e,0,n);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=Dp(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=Dp(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 txe(t,e,n){return(r,i,s)=>(!n||n(r,i,s))&&t(s[0],e,r,i)}function Np(t,e,n,r){let i;return t.wholeWord&&(i=nxe(e.charCategorizer(e.selection.main.head))),t.test&&(i=txe(t.test,e,i)),new uY(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},n,r)}function hw(t,e){return t.slice(Xi(t,e,!1),e)}function dw(t,e){return t.slice(e,Xi(t,e))}function nxe(t){return(e,n,r)=>!r[0].length||(t(hw(r.input,r.index))!=Pr.Word||t(dw(r.input,r.index))!=Pr.Word)&&(t(dw(r.input,r.index+r[0].length))!=Pr.Word||t(hw(r.input,r.index+r[0].length))!=Pr.Word)}class rxe extends pY{nextMatch(e,n,r){let i=Np(this.spec,e,r,e.doc.length).next();return i.done&&(i=Np(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=Np(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)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return n})}matchAll(e,n){let r=Np(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=Np(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 Jv=Vt.define(),x4=Vt.define(),Fh=gs.define({create(t){return new J_(nO(t).create(),null)},update(t,e){for(let n of e.effects)n.is(Jv)?t=new J_(n.value.create(),t.panel):n.is(x4)&&(t=new J_(t.query,n.value?A4:null));return t},provide:t=>Yv.from(t,e=>e.panel)});class J_{constructor(e,n){this.query=e,this.panel=n}}const ixe=Dt.mark({class:"cm-searchMatch"}),sxe=Dt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),axe=Yr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Fh))}update(t){let e=t.state.field(Fh);(e!=t.startState.field(Fh)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Dt.none;let{view:n}=this,r=new fu;for(let i=0,s=n.visibleRanges,o=s.length;i<o;i++){let{from:l,to:c}=s[i];for(;i<o-1&&c>s[i+1].from-500;)c=s[++i].to;t.highlight(n.state,l,c,(h,f)=>{let p=n.state.selection.ranges.some(m=>m.from==h&&m.to==f);r.add(h,f,p?sxe:ixe)})}return r.finish()}},{decorations:t=>t.decorations});function Jb(t){return e=>{let n=e.state.field(Fh,!1);return n&&n.query.spec.valid?t(e,n):vY(e)}}const fw=Jb((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=Be.single(r.from,r.to),s=t.state.facet(x0);return t.dispatch({selection:i,effects:[w4(t,r),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),gY(t),!0}),pw=Jb((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let s=Be.single(i.from,i.to),o=t.state.facet(x0);return t.dispatch({selection:s,effects:[w4(t,i),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),gY(t),!0}),oxe=Jb((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Be.create(n.map(r=>Be.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),lxe=({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 Vm(t.doc,t.sliceDoc(r,i));!l.next().done;){if(s.length>1e3)return!1;l.value.from==r&&(o=s.length),s.push(Be.range(l.value.from,l.value.to))}return e(t.update({selection:Be.create(s,o),userEvent:"select.search.matches"})),!0},lL=Jb((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=s,l=[],c,h,f=[];o.precise?o.from==r&&o.to==i&&(h=n.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),f.push(ot.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):o=e.nextMatch(n,o.from,o.to);let p=t.state.changes(l);return o&&(c=Be.single(o.from,o.to).map(p),f.push(w4(t,o)),f.push(n.facet(x0).scrollToMatch(c.main,t))),t.dispatch({changes:p,selection:c,effects:f,userEvent:"input.replace"}),!0}),cxe=Jb((t,{query:e})=>{if(t.state.readOnly)return!1;let n=[];for(let i of e.matchAll(t.state,1e9)){let{from:s,to:o,precise:l}=i;l&&n.push({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:ot.announce.of(r),userEvent:"input.replace.all"}),!0});function A4(t){return t.state.facet(x0).createPanel(t)}function nO(t,e){var n,r,i,s,o;let l=t.selection.main,c=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!c)return e;let h=t.facet(x0);return new fY({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:h.literal)?c:c.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 mY(t){let e=J6(t,A4);return e&&e.dom.querySelector("[main-field]")}function gY(t){let e=mY(t);e&&e==t.root.activeElement&&e.select()}const vY=t=>{let e=t.state.field(Fh,!1);if(e&&e.panel){let n=mY(t);if(n&&n!=t.root.activeElement){let r=nO(t.state,e.query.spec);r.valid&&t.dispatch({effects:Jv.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[x4.of(!0),e?Jv.of(nO(t.state,e.query.spec)):Vt.appendConfig.of(fxe)]});return!0},bY=t=>{let e=t.state.field(Fh,!1);if(!e||!e.panel)return!1;let n=J6(t,A4);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:x4.of(!1)}),!0},uxe=[{key:"Mod-f",run:vY,scope:"editor search-panel"},{key:"F3",run:fw,shift:pw,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:fw,shift:pw,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:bY,scope:"editor search-panel"},{key:"Mod-Shift-l",run:lxe},{key:"Mod-Alt-g",run:H1e},{key:"Mod-d",run:K1e,preventDefault:!0}];class hxe{constructor(e){this.view=e;let n=this.query=e.state.field(Fh).query.spec;this.commit=this.commit.bind(this),this.searchField=lr("input",{value:n.search,placeholder:Ea(e,"Find"),"aria-label":Ea(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=lr("input",{value:n.replace,placeholder:Ea(e,"Replace"),"aria-label":Ea(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=lr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=lr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=lr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,s,o){return lr("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=lr("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>fw(e),[Ea(e,"next")]),r("prev",()=>pw(e),[Ea(e,"previous")]),r("select",()=>oxe(e),[Ea(e,"all")]),lr("label",null,[this.caseField,Ea(e,"match case")]),lr("label",null,[this.reField,Ea(e,"regexp")]),lr("label",null,[this.wordField,Ea(e,"by word")]),...e.state.readOnly?[]:[lr("br"),this.replaceField,r("replace",()=>lL(e),[Ea(e,"replace")]),r("replaceAll",()=>cxe(e),[Ea(e,"replace all")])],lr("button",{name:"close",onclick:()=>bY(e),"aria-label":Ea(e,"close"),type:"button"},["×"])])}commit(){let e=new fY({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:Jv.of(e)}))}keydown(e){G0e(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?pw:fw)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),lL(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(Jv)&&!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(x0).top}}function Ea(t,e){return t.state.phrase(e)}const nx=30,rx=/[\s\.,:;?!]/;function w4(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-nx),o=Math.min(i,n+nx),l=t.state.sliceDoc(s,o);if(s!=r.from){for(let c=0;c<nx;c++)if(!rx.test(l[c+1])&&rx.test(l[c])){l=l.slice(c);break}}if(o!=i){for(let c=l.length-1;c>l.length-nx;c--)if(!rx.test(l[c-1])&&rx.test(l[c])){l=l.slice(0,c);break}}return ot.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${r.number}.`)}const dxe=ot.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"}}),fxe=[Fh,ju.low(axe),dxe];var cL=function(e){e===void 0&&(e={});var n=e,r=n.crosshairCursor,i=r===void 0?!1:r,s=[];e.closeBracketsKeymap!==!1&&(s=s.concat(aW)),e.defaultKeymap!==!1&&(s=s.concat(lY)),e.searchKeymap!==!1&&(s=s.concat(uxe)),e.historyKeymap!==!1&&(s=s.concat(NW)),e.foldKeymap!==!1&&(s=s.concat(wve)),e.completionKeymap!==!1&&(s=s.concat(u4)),e.lintKeymap!==!1&&(s=s.concat(AW));var o=[];return e.lineNumbers!==!1&&o.push(Gge()),e.highlightActiveLineGutter!==!1&&o.push(Zge()),e.highlightSpecialChars!==!1&&o.push(_U()),e.history!==!1&&o.push(EW()),e.foldGutter!==!1&&o.push(_ve()),e.drawSelection!==!1&&o.push(tge()),e.dropCursor!==!1&&o.push(age()),e.allowMultipleSelections!==!1&&o.push(wn.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&o.push(PU()),e.syntaxHighlighting!==!1&&o.push(aS(Eve,{fallback:!0})),e.bracketMatching!==!1&&o.push(XU()),e.closeBrackets!==!1&&o.push(rW()),e.autocompletion!==!1&&o.push(lW()),e.rectangularSelection!==!1&&o.push(jge()),i!==!1&&o.push(Tge()),e.highlightActiveLine!==!1&&o.push(vge()),e.highlightSelectionMatches!==!1&&o.push(dY()),e.tabSize&&typeof e.tabSize=="number"&&o.push(Gb.of(" ".repeat(e.tabSize))),o.concat([Ph.of(s.flat())]).filter(Boolean)};const pxe="#e5c07b",uL="#e06c75",mxe="#56b6c2",gxe="#ffffff",Jx="#abb2bf",rO="#7d8799",vxe="#61afef",bxe="#98c379",hL="#d19a66",yxe="#c678dd",xxe="#21252b",dL="#2c313a",fL="#282c34",eT="#353a42",Axe="#3E4451",pL="#528bff",wxe=ot.theme({"&":{color:Jx,backgroundColor:fL},".cm-content":{caretColor:pL},".cm-cursor, .cm-dropCursor":{borderLeftColor:pL},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Axe},".cm-panels":{backgroundColor:xxe,color:Jx},".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:fL,color:rO,border:"none"},".cm-activeLineGutter":{backgroundColor:dL},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:eT},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:eT,borderBottomColor:eT},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:dL,color:Jx}}},{dark:!0}),Sxe=Ff.define([{tag:ge.keyword,color:yxe},{tag:[ge.name,ge.deleted,ge.character,ge.propertyName,ge.macroName],color:uL},{tag:[ge.function(ge.variableName),ge.labelName],color:vxe},{tag:[ge.color,ge.constant(ge.name),ge.standard(ge.name)],color:hL},{tag:[ge.definition(ge.name),ge.separator],color:Jx},{tag:[ge.typeName,ge.className,ge.number,ge.changed,ge.annotation,ge.modifier,ge.self,ge.namespace],color:pxe},{tag:[ge.operator,ge.operatorKeyword,ge.url,ge.escape,ge.regexp,ge.link,ge.special(ge.string)],color:mxe},{tag:[ge.meta,ge.comment],color:rO},{tag:ge.strong,fontWeight:"bold"},{tag:ge.emphasis,fontStyle:"italic"},{tag:ge.strikethrough,textDecoration:"line-through"},{tag:ge.link,color:rO,textDecoration:"underline"},{tag:ge.heading,fontWeight:"bold",color:uL},{tag:[ge.atom,ge.bool,ge.special(ge.variableName)],color:hL},{tag:[ge.processingInstruction,ge.string,ge.inserted],color:bxe},{tag:ge.invalid,color:gxe}]),jxe=[wxe,aS(Sxe)];var Cxe=ot.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),_xe=function(e){e===void 0&&(e={});var n=e,r=n.indentWithTab,i=r===void 0?!0:r,s=n.editable,o=s===void 0?!0:s,l=n.readOnly,c=l===void 0?!1:l,h=n.theme,f=h===void 0?"light":h,p=n.placeholder,m=p===void 0?"":p,v=n.basicSetup,y=v===void 0?!0:v,x=[];switch(i&&x.unshift(Ph.of([F1e])),y&&(typeof y=="boolean"?x.unshift(cL()):x.unshift(cL(y))),m&&x.unshift(TU(m)),f){case"light":x.push(Cxe);break;case"dark":x.push(jxe);break;case"none":break;default:x.push(f);break}return o===!1&&x.push(ot.editable.of(!1)),c&&x.push(wn.readOnly.of(!0)),[...x]},Txe=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 kxe{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 mL{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 tT=null,Oxe=()=>typeof window>"u"?new mL:(tT||(tT=new mL),tT),gL=dc.define(),Exe=200,Mxe=[];function Rxe(t){var e=t.value,n=t.selection,r=t.onChange,i=t.onStatistics,s=t.onCreateEditor,o=t.onUpdate,l=t.extensions,c=l===void 0?Mxe:l,h=t.autoFocus,f=t.theme,p=f===void 0?"light":f,m=t.height,v=m===void 0?null:m,y=t.minHeight,x=y===void 0?null:y,S=t.maxHeight,w=S===void 0?null:S,A=t.width,C=A===void 0?null:A,j=t.minWidth,_=j===void 0?null:j,k=t.maxWidth,M=k===void 0?null:k,R=t.placeholder,N=R===void 0?"":R,I=t.editable,D=I===void 0?!0:I,L=t.readOnly,z=L===void 0?!1:L,P=t.indentWithTab,H=P===void 0?!0:P,B=t.basicSetup,F=B===void 0?!0:B,q=t.root,X=t.initialState,Y=O.useState(),U=Y[0],V=Y[1],G=O.useState(),J=G[0],ne=G[1],de=O.useState(),fe=de[0],ke=de[1],Me=O.useState(()=>({current:null}))[0],Oe=O.useState(()=>({current:null}))[0],Ye=ot.theme({"&":{height:v,minHeight:x,maxHeight:w,width:C,minWidth:_,maxWidth:M},"& .cm-scroller":{height:"100% !important"}}),ie=ot.updateListener.of(_e=>{if(_e.docChanged&&typeof r=="function"&&!_e.transactions.some(Xe=>Xe.annotation(gL))){Me.current?Me.current.reset():(Me.current=new kxe(()=>{if(Oe.current){var Xe=Oe.current;Oe.current=null,Xe()}Me.current=null},Exe),Oxe().add(Me.current));var et=_e.state.doc,Te=et.toString();r(Te,_e)}i&&i(Txe(_e))}),Se=_xe({theme:p,editable:D,readOnly:z,placeholder:N,indentWithTab:H,basicSetup:F}),se=[ie,Ye,...Se];return o&&typeof o=="function"&&se.push(ot.updateListener.of(o)),se=se.concat(c),O.useLayoutEffect(()=>{if(U&&!fe){var _e={doc:e,selection:n,extensions:se},et=X?wn.fromJSON(X.json,_e,X.fields):wn.create(_e);if(ke(et),!J){var Te=new ot({state:et,parent:U,root:q});ne(Te),s&&s(Te,et)}}return()=>{J&&(ke(void 0),ne(void 0))}},[U,fe]),O.useEffect(()=>{t.container&&V(t.container)},[t.container]),O.useEffect(()=>()=>{J&&(J.destroy(),ne(void 0)),Me.current&&(Me.current.cancel(),Me.current=null)},[J]),O.useEffect(()=>{h&&J&&J.focus()},[h,J]),O.useEffect(()=>{J&&J.dispatch({effects:Vt.reconfigure.of(se)})},[p,c,v,x,w,C,_,M,N,D,z,H,F,r,o]),O.useEffect(()=>{if(e!==void 0){var _e=J?J.state.doc.toString():"";if(J&&e!==_e){var et=Me.current&&!Me.current.isDone,Te=()=>{J&&e!==J.state.doc.toString()&&J.dispatch({changes:{from:0,to:J.state.doc.toString().length,insert:e||""},annotations:[gL.of(!0)]})};et?Oe.current=Te:Te()}}},[e,J]),{state:fe,setState:ke,view:J,setView:ne,container:U,setContainer:V}}var Dxe=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],S4=O.forwardRef((t,e)=>{var n=t.className,r=t.value,i=r===void 0?"":r,s=t.selection,o=t.extensions,l=o===void 0?[]:o,c=t.onChange,h=t.onStatistics,f=t.onCreateEditor,p=t.onUpdate,m=t.autoFocus,v=t.theme,y=v===void 0?"light":v,x=t.height,S=t.minHeight,w=t.maxHeight,A=t.width,C=t.minWidth,j=t.maxWidth,_=t.basicSetup,k=t.placeholder,M=t.indentWithTab,R=t.editable,N=t.readOnly,I=t.root,D=t.initialState,L=m4(t,Dxe),z=O.useRef(null),P=Rxe({root:I,value:i,autoFocus:m,theme:y,height:x,minHeight:S,maxHeight:w,width:A,minWidth:C,maxWidth:j,basicSetup:_,placeholder:k,indentWithTab:M,editable:R,readOnly:N,selection:s,onChange:c,onStatistics:h,onCreateEditor:f,onUpdate:p,extensions:l,initialState:D}),H=P.state,B=P.view,F=P.container,q=P.setContainer;O.useImperativeHandle(e,()=>({editor:z.current,state:H,view:B}),[z,F,H,B]);var X=O.useCallback(U=>{z.current=U,q(U)},[q]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var Y=typeof y=="string"?"cm-theme-"+y:"cm-theme";return a.jsx("div",lw({ref:X,className:""+Y+(n?" "+n:"")},L))});S4.displayName="CodeMirror";const yY=ot.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"}}),xY=ot.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}),Nxe=ot.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}),AY=Ff.define([{tag:ge.number,color:"#09885a"},{tag:ge.string,color:"#a31515"},{tag:ge.keyword,color:"#008080"},{tag:ge.function(ge.variableName),color:"#008080"},{tag:ge.labelName,color:"#800000"},{tag:ge.operator},{tag:ge.modifier,color:"#008080"},{tag:ge.paren},{tag:ge.squareBracket},{tag:ge.brace},{tag:ge.invalid,color:"red"},{tag:ge.comment,color:"#888",fontStyle:"italic"}]),wY=Ff.define([{tag:ge.number,color:"#22c55e"},{tag:ge.string,color:"#fca5a5"},{tag:ge.keyword,color:"#14bfad"},{tag:ge.function(ge.variableName),color:"#14bfad"},{tag:ge.labelName,color:"#ff8585"},{tag:ge.operator},{tag:ge.modifier,color:"#14bfad"},{tag:ge.paren},{tag:ge.squareBracket},{tag:ge.brace},{tag:ge.invalid,color:"#ff3d3d"},{tag:ge.comment,color:"#9ca3af",fontStyle:"italic"}]),Ixe="_input_k0obd_1",Lxe={input:Ixe},iO="api/v1",SY=({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(),c=await fetch(`${t}/${iO}${e}${s}`,{cache:"no-store",credentials:"same-origin",signal:i});if(!c.ok&&!((o=c.headers.get("content-type"))!=null&&o.startsWith("application/json")))throw new Error(c.statusText);const h=await c.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}}},Zh=({key:t,path:e,params:n,enabled:r,recordResponseTime:i,refetchInterval:s})=>{const{pathPrefix:o}=fi();return Yle({queryKey:t!==void 0?t:[e,n],retry:!1,refetchOnWindowFocus:!1,refetchInterval:s,gcTime:0,enabled:r,queryFn:SY({pathPrefix:o,path:e,params:n,recordResponseTime:i})})},Ci=({key:t,path:e,params:n})=>{const{pathPrefix:r}=fi();return wz({queryKey:t!==void 0?t:[e,n],retry:!1,refetchOnWindowFocus:!1,staleTime:1/0,gcTime:0,queryFn:SY({pathPrefix:r,path:e,params:n})})};function Bxe(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 Pxe(t){return O.useSyncExternalStore(t.subscribe,()=>t.getState(),()=>t.getState())}function Fxe(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 $xe=()=>Bxe({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),$f=$xe(),Hxe=(t=$f)=>Pxe(t);function A0(t,e){const n=t.getState(),r=Fxe(e([...n.notifications,...n.queue]),n.defaultPosition,n.limit);t.setState({notifications:r.notifications,queue:r.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function zxe(t,e=$f){const n=t.id||Em();return A0(e,r=>t.id&&r.some(i=>i.id===t.id)?r:[...r,{...t,id:n}]),n}function jY(t,e=$f){return A0(e,n=>n.filter(r=>{var i;return r.id===t?((i=r.onClose)==null||i.call(r,r),!1):!0})),t}function qxe(t,e=$f){return A0(e,n=>n.map(r=>r.id===t.id?{...r,...t}:r)),t.id}function Qxe(t=$f){A0(t,()=>[])}function Uxe(t=$f){A0(t,e=>e.slice(0,t.getState().limit))}const ll={show:zxe,hide:jY,update:qxe,clean:Qxe,cleanQueue:Uxe,updateState:A0},CY=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function Wxe(t,e){return t.reduce((n,r)=>(n[r.position||e].push(r),n),CY.reduce((n,r)=>(n[r]=[],n),{}))}const vL={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},Yxe={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function Vxe({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:vL[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"},c={opacity:1,transform:Yxe[o]},h={opacity:0,maxHeight:0,transform:vL[o]};return{...l,...{entering:c,entered:c,exiting:h,exited:h}[t]}}function Gxe(t,e){return typeof e=="number"?e:e===!1||t===!1?!1:t}const Xxe=120;function _Y({data:t,onHide:e,autoClose:n,transitionDuration:r,allowDragDismiss:i,allowScrollDismiss:s,paused:o,onHoverStart:l,onHoverEnd:c,ref:h,style:f,...p}){const[m,v]=O.useState(0),[y,x]=O.useState(!1),[S,w]=O.useState(1),[A,C]=O.useState(!1),j=pi(),{autoClose:_,message:k,allowClose:M,position:R,style:N,withCloseButton:I,onOpen:D,...L}=t,z=Gxe(n,t.autoClose),P=O.useRef(-1),H=O.useRef(-1),B=O.useRef(-1),F=O.useRef(null),q=O.useRef(!1),X=O.useRef(0),Y=M===!1,U=()=>window.clearTimeout(P.current),V=()=>window.clearTimeout(H.current),G=()=>window.clearTimeout(B.current),J=Ce=>{X.current=Ce,v(Ce)},ne=()=>{e(t.id),U(),V(),G()},de=()=>{y||Se||o||q.current||typeof z!="number"||(P.current=window.setTimeout(ne,z))},fe=Ce=>{var ze;return Ce*((((ze=F.current)==null?void 0:ze.offsetWidth)??440)+40)},ke=(Ce,ze)=>{var Rt;const ht=((Rt=F.current)==null?void 0:Rt.offsetWidth)??440;return Math.abs(Ce)>ht*.35||ze>.5},Me=()=>{G(),C(!1),J(0)},Oe=Ce=>{w(Ce),x(!0),C(!1),J(fe(Ce)),U(),V(),G(),H.current=window.setTimeout(ne,r)},Ye=()=>{G(),B.current=window.setTimeout(()=>{C(!1),J(0),de()},Xxe)},{ref:ie,active:Se}=LK(Ce=>{if(!y)if(Ce.first&&U(),Ce.last){if(Ce.tap||Ce.canceled){J(0),de();return}const ze=Ce.movement[0],ht=ze===0?Ce.direction[0]===-1?-1:1:ze>0?1:-1;ke(ze,Ce.velocity[0])?Oe(ht):(J(0),de())}else J(Ce.movement[0])},{axis:"x",threshold:5,filterTaps:!0,enabled:i&&!Y&&!y}),se=En(h,F,ie),_e=vv(f,j),et=vv(N,j),Te={..._e,...et},Xe=typeof Te.opacity=="number"?Te.opacity:1,at=y?0:1-Math.min(Math.abs(m)/200,1)*.6,Ve=Te.transitionDuration??`${r}ms, ${r}ms, ${r}ms`,Ge={...Te,"--notifications-state-transform":typeof Te.transform=="string"?Te.transform:"translateX(0)","--notifications-state-opacity":String(Xe),"--notifications-swipe-offset":`${m}px`,"--notifications-swipe-opacity":String(at),transform:"var(--notifications-state-transform) translate3d(var(--notifications-swipe-offset), 0, 0)",opacity:"calc(var(--notifications-state-opacity) * var(--notifications-swipe-opacity))",transitionDuration:Se||A?"0ms, 0ms, 0ms":Ve,cursor:"default",touchAction:"pan-y"},ut=()=>{q.current=!0,U(),l==null||l()},Ue=()=>{q.current=!1,A||(Me(),de()),c==null||c()},De=O.useEffectEvent(Ce=>{if(y||Se)return;const ze=Ce.currentTarget===document;if(!ze&&!q.current)return;const{deltaX:ht,deltaY:Rt}=Ce;if(Math.abs(ht)<=Math.abs(Rt)||ht===0||!s||Y)return;ze||(Ce.preventDefault(),Ce.stopPropagation()),U(),C(!0);const Tn=X.current-ht,fn=Tn>0?1:-1;if(ke(Tn,0)){Oe(fn);return}J(Tn),Ye()});return O.useEffect(()=>{if(A)return document.addEventListener("wheel",De,{passive:!1}),()=>document.removeEventListener("wheel",De,{passive:!1})},[A]),O.useEffect(()=>{const Ce=()=>{y&&J(fe(S))};return window.addEventListener("resize",Ce),()=>window.removeEventListener("resize",Ce)},[S,y]),O.useEffect(()=>{const Ce=F.current;if(Ce)return Ce.addEventListener("wheel",De,{passive:!1}),()=>Ce.removeEventListener("wheel",De,{passive:!1})},[]),O.useEffect(()=>()=>{V(),G()},[]),O.useEffect(()=>{var Ce;(Ce=t.onOpen)==null||Ce.call(t,t)},[]),O.useEffect(()=>(de(),U),[z,Se,y]),O.useEffect(()=>(o?U():de(),U),[o]),a.jsx(d2,{ref:se,...p,style:Ge,...L,withCloseButton:Y?!1:I,onClose:ne,onMouseEnter:ut,onMouseLeave:Ue,children:k})}_Y.displayName="@mantine/notifications/NotificationContainer";var TY={root:"m_b37d9ac7",notification:"m_5ed0edd0"};function sO(t,e){return sO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},sO(t,e)}function kY(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,sO(t,e)}const bL={disabled:!1},mw=zn.createContext(null);var Kxe=function(e){return e.scrollTop},Vg="unmounted",Fd="exited",$d="entering",Ip="entered",aO="exiting",Cu=(function(t){kY(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,c;return s.appearStatus=null,r.in?l?(c=Fd,s.appearStatus=$d):c=Ip:r.unmountOnExit||r.mountOnEnter?c=Vg:c=Fd,s.state={status:c},s.nextCallback=null,s}e.getDerivedStateFromProps=function(i,s){var o=i.in;return o&&s.status===Vg?{status:Fd}: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!==$d&&o!==Ip&&(s=$d):(o===$d||o===Ip)&&(s=aO)}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===$d){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:Lg.findDOMNode(this);o&&Kxe(o)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Fd&&this.setState({status:Vg})},n.performEnter=function(i){var s=this,o=this.props.enter,l=this.context?this.context.isMounting:i,c=this.props.nodeRef?[l]:[Lg.findDOMNode(this),l],h=c[0],f=c[1],p=this.getTimeouts(),m=l?p.appear:p.enter;if(!i&&!o||bL.disabled){this.safeSetState({status:Ip},function(){s.props.onEntered(h)});return}this.props.onEnter(h,f),this.safeSetState({status:$d},function(){s.props.onEntering(h,f),s.onTransitionEnd(m,function(){s.safeSetState({status:Ip},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:Lg.findDOMNode(this);if(!s||bL.disabled){this.safeSetState({status:Fd},function(){i.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:aO},function(){i.props.onExiting(l),i.onTransitionEnd(o.exit,function(){i.safeSetState({status:Fd},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:Lg.findDOMNode(this),l=i==null&&!this.props.addEndListener;if(!o||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],h=c[0],f=c[1];this.props.addEndListener(h,f)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Vg)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=m4(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return zn.createElement(mw.Provider,{value:null},typeof o=="function"?o(i,l):zn.cloneElement(zn.Children.only(o),l))},e})(zn.Component);Cu.contextType=mw;Cu.propTypes={};function Cp(){}Cu.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Cp,onEntering:Cp,onEntered:Cp,onExit:Cp,onExiting:Cp,onExited:Cp};Cu.UNMOUNTED=Vg;Cu.EXITED=Fd;Cu.ENTERING=$d;Cu.ENTERED=Ip;Cu.EXITING=aO;function Zxe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j4(t,e){var n=function(s){return e&&O.isValidElement(s)?e(s):s},r=Object.create(null);return t&&O.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function Jxe(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 c in e){if(r[c])for(o=0;o<r[c].length;o++){var h=r[c][o];l[r[c][o]]=n(h)}l[c]=n(c)}for(o=0;o<i.length;o++)l[i[o]]=n(i[o]);return l}function ef(t,e,n){return n[e]!=null?n[e]:t.props[e]}function eAe(t,e){return j4(t.children,function(n){return O.cloneElement(n,{onExited:e.bind(null,n),in:!0,appear:ef(n,"appear",t),enter:ef(n,"enter",t),exit:ef(n,"exit",t)})})}function tAe(t,e,n){var r=j4(t.children),i=Jxe(e,r);return Object.keys(i).forEach(function(s){var o=i[s];if(O.isValidElement(o)){var l=s in e,c=s in r,h=e[s],f=O.isValidElement(h)&&!h.props.in;c&&(!l||f)?i[s]=O.cloneElement(o,{onExited:n.bind(null,o),in:!0,exit:ef(o,"exit",t),enter:ef(o,"enter",t)}):!c&&l&&!f?i[s]=O.cloneElement(o,{in:!1}):c&&l&&O.isValidElement(h)&&(i[s]=O.cloneElement(o,{onExited:n.bind(null,o),in:h.props.in,exit:ef(o,"exit",t),enter:ef(o,"enter",t)}))}}),i}var nAe=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},rAe={component:"div",childFactory:function(e){return e}},bh=(function(t){kY(e,t);function e(r,i){var s;s=t.call(this,r,i)||this;var o=s.handleExited.bind(Zxe(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,c=s.firstRender;return{children:c?eAe(i,l):tAe(i,o,l),firstRender:!1}},n.handleExited=function(i,s){var o=j4(this.props.children);i.key in o||(i.props.onExited&&i.props.onExited(s),this.mounted&&this.setState(function(l){var c=lw({},l.children);return delete c[i.key],{children:c}}))},n.render=function(){var i=this.props,s=i.component,o=i.childFactory,l=m4(i,["component","childFactory"]),c=this.state.contextValue,h=nAe(this.state.children).map(o);return delete l.appear,delete l.enter,delete l.exit,s===null?zn.createElement(mw.Provider,{value:c},h):zn.createElement(mw.Provider,{value:c},zn.createElement(s,l,h))},e})(zn.Component);bh.propTypes={};bh.defaultProps=rAe;const iAe=Cu,sAe={position:"bottom-right",autoClose:4e3,transitionDuration:250,allowDragDismiss:!0,allowScrollDismiss:!0,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:jo("overlay"),store:$f,withinPortal:!0,pauseResetOnHover:"all"},OY=(t,{zIndex:e,containerWidth:n})=>({root:{"--notifications-z-index":e==null?void 0:e.toString(),"--notifications-container-width":me(n)}}),pc=Ie(t=>{const e=xe("Notifications",sAe,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,attributes:c,position:h,autoClose:f,transitionDuration:p,allowDragDismiss:m,allowScrollDismiss:v,containerWidth:y,notificationMaxHeight:x,limit:S,zIndex:w,store:A,portalProps:C,withinPortal:j,pauseResetOnHover:_,...k}=e,M=pi(),R=Hxe(A),N=hK(),I=pb(),D=O.useRef({}),L=O.useRef(0),[z,P]=O.useState(0),H=O.useCallback(()=>P(U=>U+1),[]),B=O.useCallback(()=>P(U=>Math.max(0,U-1)),[]),F=M.respectReducedMotion&&I?1:p,q=mt({name:"Notifications",classes:TY,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:c,vars:l,varsResolver:OY});O.useEffect(()=>{A==null||A.updateState(U=>({...U,limit:S||5,defaultPosition:h}))},[S,h]),vu(()=>{R.notifications.length>L.current&&setTimeout(()=>N(),0),L.current=R.notifications.length},[R.notifications]);const X=Wxe(R.notifications,h),Y=CY.reduce((U,V)=>(U[V]=X[V].map(({style:G,...J})=>a.jsx(iAe,{timeout:F,onEnter:()=>D.current[J.id].offsetHeight,nodeRef:{current:D.current[J.id]},children:ne=>a.jsx(_Y,{ref:de=>{de?D.current[J.id]=de:delete D.current[J.id]},data:J,onHide:de=>jY(de,A),autoClose:f,transitionDuration:F,allowDragDismiss:m,allowScrollDismiss:v,paused:_==="all"?z>0:!1,onHoverStart:H,onHoverEnd:B,...q("notification",{style:{...Vxe({state:ne,position:V,transitionDuration:F,maxHeight:x}),...G}})})},J.id)),U),{});return a.jsxs(zh,{withinPortal:j,...C,children:[a.jsx(ve,{...q("root"),"data-position":"top-center",...k,children:a.jsx(bh,{children:Y["top-center"]})}),a.jsx(ve,{...q("root"),"data-position":"top-left",...k,children:a.jsx(bh,{children:Y["top-left"]})}),a.jsx(ve,{...q("root",{className:_f.classNames.fullWidth}),"data-position":"top-right",...k,children:a.jsx(bh,{children:Y["top-right"]})}),a.jsx(ve,{...q("root",{className:_f.classNames.fullWidth}),"data-position":"bottom-right",...k,children:a.jsx(bh,{children:Y["bottom-right"]})}),a.jsx(ve,{...q("root"),"data-position":"bottom-left",...k,children:a.jsx(bh,{children:Y["bottom-left"]})}),a.jsx(ve,{...q("root"),"data-position":"bottom-center",...k,children:a.jsx(bh,{children:Y["bottom-center"]})})]})});pc.classes=TY;pc.varsResolver=OY;pc.displayName="@mantine/notifications/Notifications";pc.show=ll.show;pc.hide=ll.hide;pc.update=ll.update;pc.clean=ll.clean;pc.cleanQueue=ll.cleanQueue;pc.updateState=ll.updateState;function aAe(t){return t.replace(/[&<>"']/g,e=>{switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return"&#039;"}})}function oO(t){return t.to-t.from+1}function EY(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 oAe(t,e){let n=0;for(let r=0;r<t.length;r++){const i=t[r],s=EY(t,r);s!==null&&(n=n-oO(s)/e),n=n+oO(i)**2}return n}class MY{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,c=(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:c?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:c?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 c=0;c<n.length;c++){const h=n[c],f=EY(n,c);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,oO(n));return i&&(s=aAe(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 c=r;c<n.length&&o<e.length;){if(s.includes(n[c])){c++;continue}if(s.includes(e[o])){o++;continue}if(n[c]===e[o]){const h={from:c,to:c};o++,c++;for(let f=c;f<n.length&&o<e.length&&n[f]===e[o];f++)h.to=f,o++,c=f;l.push(h)}c++}return l.length===0||o!==e.length?null:{score:oAe(l,n.length),intervals:l}}}const RY=new MY;function lAe(t,e,n){return RY.match(t,e,n)}function yL(t,e,n){return RY.render(t,e,n)}var Lo={},Bo={},_p={},nT={},rT={},xL;function AL(){return xL||(xL=1,(function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.fromCodePoint=void 0,t.replaceCodePoint=r,t.decodeCodePoint=i;const 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:(s=>{let 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}function i(s){return(0,t.fromCodePoint)(r(s))}})(rT)),rT}var _g={},ix={},wL;function DY(){if(wL)return ix;wL=1,Object.defineProperty(ix,"__esModule",{value:!0}),ix.decodeBase64=t;function t(e){const n=typeof atob=="function"?atob(e):typeof Buffer.from=="function"?Buffer.from(e,"base64").toString("binary"):new Buffer(e,"base64").toString("binary"),r=n.length&-2,i=new Uint16Array(r/2);for(let s=0,o=0;s<r;s+=2){const l=n.charCodeAt(s),c=n.charCodeAt(s+1);i[o++]=l|c<<8}return i}return ix}var SL;function jL(){if(SL)return _g;SL=1,Object.defineProperty(_g,"__esModule",{value:!0}),_g.htmlDecodeTree=void 0;const t=DY();return _g.htmlDecodeTree=(0,t.decodeBase64)(" "),_g}var Tg={},CL;function _L(){if(CL)return Tg;CL=1,Object.defineProperty(Tg,"__esModule",{value:!0}),Tg.xmlDecodeTree=void 0;const t=DY();return Tg.xmlDecodeTree=(0,t.decodeBase64)("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg"),Tg}var kg={},TL;function cAe(){if(TL)return kg;TL=1,Object.defineProperty(kg,"__esModule",{value:!0}),kg.BinTrieFlags=void 0;var t;return(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(t||(kg.BinTrieFlags=t={})),kg}var kL;function NY(){return kL||(kL=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.xmlDecodeTree=t.htmlDecodeTree=t.replaceCodePoint=t.fromCodePoint=t.decodeCodePoint=t.EntityDecoder=t.DecodingMode=void 0,t.determineBranch=x,t.decodeHTML=A,t.decodeHTMLAttribute=C,t.decodeHTMLStrict=j,t.decodeXML=_;const e=AL(),n=jL(),r=_L(),i=cAe();var s;(function(N){N[N.NUM=35]="NUM",N[N.SEMI=59]="SEMI",N[N.EQUALS=61]="EQUALS",N[N.ZERO=48]="ZERO",N[N.NINE=57]="NINE",N[N.LOWER_A=97]="LOWER_A",N[N.LOWER_F=102]="LOWER_F",N[N.LOWER_X=120]="LOWER_X",N[N.LOWER_Z=122]="LOWER_Z",N[N.UPPER_A=65]="UPPER_A",N[N.UPPER_F=70]="UPPER_F",N[N.UPPER_Z=90]="UPPER_Z"})(s||(s={}));const o=32;function l(N){return N>=s.ZERO&&N<=s.NINE}function c(N){return N>=s.UPPER_A&&N<=s.UPPER_F||N>=s.LOWER_A&&N<=s.LOWER_F}function h(N){return N>=s.UPPER_A&&N<=s.UPPER_Z||N>=s.LOWER_A&&N<=s.LOWER_Z||l(N)}function f(N){return N===s.EQUALS||h(N)}var p;(function(N){N[N.EntityStart=0]="EntityStart",N[N.NumericStart=1]="NumericStart",N[N.NumericDecimal=2]="NumericDecimal",N[N.NumericHex=3]="NumericHex",N[N.NamedEntity=4]="NamedEntity"})(p||(p={}));var m;(function(N){N[N.Legacy=0]="Legacy",N[N.Strict=1]="Strict",N[N.Attribute=2]="Attribute"})(m||(t.DecodingMode=m={}));class v{constructor(I,D,L){this.decodeTree=I,this.emitCodePoint=D,this.errors=L,this.state=p.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=m.Strict,this.runConsumed=0}startEntity(I){this.decodeMode=I,this.state=p.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(I,D){switch(this.state){case p.EntityStart:return I.charCodeAt(D)===s.NUM?(this.state=p.NumericStart,this.consumed+=1,this.stateNumericStart(I,D+1)):(this.state=p.NamedEntity,this.stateNamedEntity(I,D));case p.NumericStart:return this.stateNumericStart(I,D);case p.NumericDecimal:return this.stateNumericDecimal(I,D);case p.NumericHex:return this.stateNumericHex(I,D);case p.NamedEntity:return this.stateNamedEntity(I,D)}}stateNumericStart(I,D){return D>=I.length?-1:(I.charCodeAt(D)|o)===s.LOWER_X?(this.state=p.NumericHex,this.consumed+=1,this.stateNumericHex(I,D+1)):(this.state=p.NumericDecimal,this.stateNumericDecimal(I,D))}stateNumericHex(I,D){for(;D<I.length;){const L=I.charCodeAt(D);if(l(L)||c(L)){const z=L<=s.NINE?L-s.ZERO:(L|o)-s.LOWER_A+10;this.result=this.result*16+z,this.consumed++,D++}else return this.emitNumericEntity(L,3)}return-1}stateNumericDecimal(I,D){for(;D<I.length;){const L=I.charCodeAt(D);if(l(L))this.result=this.result*10+(L-s.ZERO),this.consumed++,D++;else return this.emitNumericEntity(L,2)}return-1}emitNumericEntity(I,D){var L;if(this.consumed<=D)return(L=this.errors)===null||L===void 0||L.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(I===s.SEMI)this.consumed+=1;else if(this.decodeMode===m.Strict)return 0;return this.emitCodePoint((0,e.replaceCodePoint)(this.result),this.consumed),this.errors&&(I!==s.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(I,D){const{decodeTree:L}=this;let z=L[this.treeIndex],P=(z&i.BinTrieFlags.VALUE_LENGTH)>>14;for(;D<I.length;){if(P===0&&(z&i.BinTrieFlags.FLAG13)!==0){const B=(z&i.BinTrieFlags.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const F=z&i.BinTrieFlags.JUMP_TABLE;if(I.charCodeAt(D)!==F)return this.result===0?0:this.emitNotTerminatedNamedEntity();D++,this.excess++,this.runConsumed++}for(;this.runConsumed<B;){if(D>=I.length)return-1;const F=this.runConsumed-1,q=L[this.treeIndex+1+(F>>1)],X=F%2===0?q&255:q>>8&255;if(I.charCodeAt(D)!==X)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();D++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(B>>1),z=L[this.treeIndex],P=(z&i.BinTrieFlags.VALUE_LENGTH)>>14}if(D>=I.length)break;const H=I.charCodeAt(D);if(H===s.SEMI&&P!==0&&(z&i.BinTrieFlags.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,P,this.consumed+this.excess);if(this.treeIndex=x(L,z,this.treeIndex+Math.max(1,P),H),this.treeIndex<0)return this.result===0||this.decodeMode===m.Attribute&&(P===0||f(H))?0:this.emitNotTerminatedNamedEntity();if(z=L[this.treeIndex],P=(z&i.BinTrieFlags.VALUE_LENGTH)>>14,P!==0){if(H===s.SEMI)return this.emitNamedEntityData(this.treeIndex,P,this.consumed+this.excess);this.decodeMode!==m.Strict&&(z&i.BinTrieFlags.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}D++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var I;const{result:D,decodeTree:L}=this,z=(L[D]&i.BinTrieFlags.VALUE_LENGTH)>>14;return this.emitNamedEntityData(D,z,this.consumed),(I=this.errors)===null||I===void 0||I.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(I,D,L){const{decodeTree:z}=this;return this.emitCodePoint(D===1?z[I]&~(i.BinTrieFlags.VALUE_LENGTH|i.BinTrieFlags.FLAG13):z[I+1],L),D===3&&this.emitCodePoint(z[I+2],L),L}end(){var I;switch(this.state){case p.NamedEntity:return this.result!==0&&(this.decodeMode!==m.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case p.NumericDecimal:return this.emitNumericEntity(0,2);case p.NumericHex:return this.emitNumericEntity(0,3);case p.NumericStart:return(I=this.errors)===null||I===void 0||I.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case p.EntityStart:return 0}}}t.EntityDecoder=v;function y(N){let I="";const D=new v(N,L=>I+=(0,e.fromCodePoint)(L));return function(z,P){let H=0,B=0;for(;(B=z.indexOf("&",B))>=0;){I+=z.slice(H,B),D.startEntity(P);const q=D.write(z,B+1);if(q<0){H=B+D.end();break}H=B+q,B=q===0?H+1:H}const F=I+z.slice(H);return I="",F}}function x(N,I,D,L){const z=(I&i.BinTrieFlags.BRANCH_LENGTH)>>7,P=I&i.BinTrieFlags.JUMP_TABLE;if(z===0)return P!==0&&L===P?D:-1;if(P){const q=L-P;return q<0||q>=z?-1:N[D+q]-1}const H=z+1>>1;let B=0,F=z-1;for(;B<=F;){const q=B+F>>>1,X=q>>1,U=N[D+X]>>(q&1)*8&255;if(U<L)B=q+1;else if(U>L)F=q-1;else return N[D+H+q]}return-1}const S=y(n.htmlDecodeTree),w=y(r.xmlDecodeTree);function A(N,I=m.Legacy){return S(N,I)}function C(N){return S(N,m.Attribute)}function j(N){return S(N,m.Strict)}function _(N){return w(N,m.Strict)}var k=AL();Object.defineProperty(t,"decodeCodePoint",{enumerable:!0,get:function(){return k.decodeCodePoint}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return k.fromCodePoint}}),Object.defineProperty(t,"replaceCodePoint",{enumerable:!0,get:function(){return k.replaceCodePoint}});var M=jL();Object.defineProperty(t,"htmlDecodeTree",{enumerable:!0,get:function(){return M.htmlDecodeTree}});var R=_L();Object.defineProperty(t,"xmlDecodeTree",{enumerable:!0,get:function(){return R.xmlDecodeTree}})})(nT)),nT}var OL;function IY(){if(OL)return _p;OL=1,Object.defineProperty(_p,"__esModule",{value:!0}),_p.QuoteType=void 0;const t=NY();var e;(function(h){h[h.Tab=9]="Tab",h[h.NewLine=10]="NewLine",h[h.FormFeed=12]="FormFeed",h[h.CarriageReturn=13]="CarriageReturn",h[h.Space=32]="Space",h[h.ExclamationMark=33]="ExclamationMark",h[h.Number=35]="Number",h[h.Amp=38]="Amp",h[h.SingleQuote=39]="SingleQuote",h[h.DoubleQuote=34]="DoubleQuote",h[h.Dash=45]="Dash",h[h.Slash=47]="Slash",h[h.Zero=48]="Zero",h[h.Nine=57]="Nine",h[h.Semi=59]="Semi",h[h.Lt=60]="Lt",h[h.Eq=61]="Eq",h[h.Gt=62]="Gt",h[h.Questionmark=63]="Questionmark",h[h.UpperA=65]="UpperA",h[h.LowerA=97]="LowerA",h[h.UpperF=70]="UpperF",h[h.LowerF=102]="LowerF",h[h.UpperZ=90]="UpperZ",h[h.LowerZ=122]="LowerZ",h[h.LowerX=120]="LowerX",h[h.OpeningSquareBracket=91]="OpeningSquareBracket"})(e||(e={}));var n;(function(h){h[h.Text=1]="Text",h[h.BeforeTagName=2]="BeforeTagName",h[h.InTagName=3]="InTagName",h[h.InSelfClosingTag=4]="InSelfClosingTag",h[h.BeforeClosingTagName=5]="BeforeClosingTagName",h[h.InClosingTagName=6]="InClosingTagName",h[h.AfterClosingTagName=7]="AfterClosingTagName",h[h.BeforeAttributeName=8]="BeforeAttributeName",h[h.InAttributeName=9]="InAttributeName",h[h.AfterAttributeName=10]="AfterAttributeName",h[h.BeforeAttributeValue=11]="BeforeAttributeValue",h[h.InAttributeValueDq=12]="InAttributeValueDq",h[h.InAttributeValueSq=13]="InAttributeValueSq",h[h.InAttributeValueNq=14]="InAttributeValueNq",h[h.BeforeDeclaration=15]="BeforeDeclaration",h[h.InDeclaration=16]="InDeclaration",h[h.InProcessingInstruction=17]="InProcessingInstruction",h[h.BeforeComment=18]="BeforeComment",h[h.CDATASequence=19]="CDATASequence",h[h.InSpecialComment=20]="InSpecialComment",h[h.InCommentLike=21]="InCommentLike",h[h.BeforeSpecialS=22]="BeforeSpecialS",h[h.BeforeSpecialT=23]="BeforeSpecialT",h[h.SpecialStartSequence=24]="SpecialStartSequence",h[h.InSpecialTag=25]="InSpecialTag",h[h.InEntity=26]="InEntity"})(n||(n={}));function r(h){return h===e.Space||h===e.NewLine||h===e.Tab||h===e.FormFeed||h===e.CarriageReturn}function i(h){return h===e.Slash||h===e.Gt||r(h)}function s(h){return h>=e.LowerA&&h<=e.LowerZ||h>=e.UpperA&&h<=e.UpperZ}var o;(function(h){h[h.NoValue=0]="NoValue",h[h.Unquoted=1]="Unquoted",h[h.Single=2]="Single",h[h.Double=3]="Double"})(o||(_p.QuoteType=o={}));const l={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]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};let c=class{constructor({xmlMode:f=!1,decodeEntities:p=!0},m){this.cbs=m,this.state=n.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=n.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=f,this.decodeEntities=p,this.entityDecoder=new t.EntityDecoder(f?t.xmlDecodeTree:t.htmlDecodeTree,(v,y)=>this.emitCodePoint(v,y))}reset(){this.state=n.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=n.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(f){this.offset+=this.buffer.length,this.buffer=f,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(f){f===e.Lt||!this.decodeEntities&&this.fastForwardTo(e.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=n.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&f===e.Amp&&this.startEntity()}stateSpecialStartSequence(f){const p=this.sequenceIndex===this.currentSequence.length;if(!(p?i(f):(f|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!p){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=n.InTagName,this.stateInTagName(f)}stateInSpecialTag(f){if(this.sequenceIndex===this.currentSequence.length){if(f===e.Gt||r(f)){const p=this.index-this.currentSequence.length;if(this.sectionStart<p){const m=this.index;this.index=p,this.cbs.ontext(this.sectionStart,p),this.index=m}this.isSpecial=!1,this.sectionStart=p+2,this.stateInClosingTagName(f);return}this.sequenceIndex=0}(f|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===l.TitleEnd?this.decodeEntities&&f===e.Amp&&this.startEntity():this.fastForwardTo(e.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(f===e.Lt)}stateCDATASequence(f){f===l.Cdata[this.sequenceIndex]?++this.sequenceIndex===l.Cdata.length&&(this.state=n.InCommentLike,this.currentSequence=l.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=n.InDeclaration,this.stateInDeclaration(f))}fastForwardTo(f){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===f)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(f){f===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===l.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=n.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):f!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(f){return this.xmlMode?!i(f):s(f)}startSpecial(f,p){this.isSpecial=!0,this.currentSequence=f,this.sequenceIndex=p,this.state=n.SpecialStartSequence}stateBeforeTagName(f){if(f===e.ExclamationMark)this.state=n.BeforeDeclaration,this.sectionStart=this.index+1;else if(f===e.Questionmark)this.state=n.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(f)){const p=f|32;this.sectionStart=this.index,this.xmlMode?this.state=n.InTagName:p===l.ScriptEnd[2]?this.state=n.BeforeSpecialS:p===l.TitleEnd[2]||p===l.XmpEnd[2]?this.state=n.BeforeSpecialT:this.state=n.InTagName}else f===e.Slash?this.state=n.BeforeClosingTagName:(this.state=n.Text,this.stateText(f))}stateInTagName(f){i(f)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(f))}stateBeforeClosingTagName(f){r(f)||(f===e.Gt?this.state=n.Text:(this.state=this.isTagStartChar(f)?n.InClosingTagName:n.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(f){(f===e.Gt||r(f))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=n.AfterClosingTagName,this.stateAfterClosingTagName(f))}stateAfterClosingTagName(f){(f===e.Gt||this.fastForwardTo(e.Gt))&&(this.state=n.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(f){f===e.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=n.InSpecialTag,this.sequenceIndex=0):this.state=n.Text,this.sectionStart=this.index+1):f===e.Slash?this.state=n.InSelfClosingTag:r(f)||(this.state=n.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(f){f===e.Gt?(this.cbs.onselfclosingtag(this.index),this.state=n.Text,this.sectionStart=this.index+1,this.isSpecial=!1):r(f)||(this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(f))}stateInAttributeName(f){(f===e.Eq||i(f))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=n.AfterAttributeName,this.stateAfterAttributeName(f))}stateAfterAttributeName(f){f===e.Eq?this.state=n.BeforeAttributeValue:f===e.Slash||f===e.Gt?(this.cbs.onattribend(o.NoValue,this.sectionStart),this.sectionStart=-1,this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(f)):r(f)||(this.cbs.onattribend(o.NoValue,this.sectionStart),this.state=n.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(f){f===e.DoubleQuote?(this.state=n.InAttributeValueDq,this.sectionStart=this.index+1):f===e.SingleQuote?(this.state=n.InAttributeValueSq,this.sectionStart=this.index+1):r(f)||(this.sectionStart=this.index,this.state=n.InAttributeValueNq,this.stateInAttributeValueNoQuotes(f))}handleInAttributeValue(f,p){f===p||!this.decodeEntities&&this.fastForwardTo(p)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(p===e.DoubleQuote?o.Double:o.Single,this.index+1),this.state=n.BeforeAttributeName):this.decodeEntities&&f===e.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(f){this.handleInAttributeValue(f,e.DoubleQuote)}stateInAttributeValueSingleQuotes(f){this.handleInAttributeValue(f,e.SingleQuote)}stateInAttributeValueNoQuotes(f){r(f)||f===e.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(o.Unquoted,this.index),this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(f)):this.decodeEntities&&f===e.Amp&&this.startEntity()}stateBeforeDeclaration(f){f===e.OpeningSquareBracket?(this.state=n.CDATASequence,this.sequenceIndex=0):this.state=f===e.Dash?n.BeforeComment:n.InDeclaration}stateInDeclaration(f){(f===e.Gt||this.fastForwardTo(e.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=n.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(f){(f===e.Gt||this.fastForwardTo(e.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=n.Text,this.sectionStart=this.index+1)}stateBeforeComment(f){f===e.Dash?(this.state=n.InCommentLike,this.currentSequence=l.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=n.InDeclaration}stateInSpecialComment(f){(f===e.Gt||this.fastForwardTo(e.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=n.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(f){const p=f|32;p===l.ScriptEnd[3]?this.startSpecial(l.ScriptEnd,4):p===l.StyleEnd[3]?this.startSpecial(l.StyleEnd,4):(this.state=n.InTagName,this.stateInTagName(f))}stateBeforeSpecialT(f){switch(f|32){case l.TitleEnd[3]:{this.startSpecial(l.TitleEnd,4);break}case l.TextareaEnd[3]:{this.startSpecial(l.TextareaEnd,4);break}case l.XmpEnd[3]:{this.startSpecial(l.XmpEnd,4);break}default:this.state=n.InTagName,this.stateInTagName(f)}}startEntity(){this.baseState=this.state,this.state=n.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?t.DecodingMode.Strict:this.baseState===n.Text||this.baseState===n.InSpecialTag?t.DecodingMode.Legacy:t.DecodingMode.Attribute)}stateInEntity(){const f=this.index-this.offset,p=this.entityDecoder.write(this.buffer,f);if(p>=0)this.state=this.baseState,p===0&&(this.index-=1);else{if(f<this.buffer.length&&this.buffer.charCodeAt(f)===e.Amp){this.state=this.baseState,this.index-=1;return}this.index=this.offset+this.buffer.length-1}}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===n.Text||this.state===n.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===n.InAttributeValueDq||this.state===n.InAttributeValueSq||this.state===n.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const f=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case n.Text:{this.stateText(f);break}case n.SpecialStartSequence:{this.stateSpecialStartSequence(f);break}case n.InSpecialTag:{this.stateInSpecialTag(f);break}case n.CDATASequence:{this.stateCDATASequence(f);break}case n.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(f);break}case n.InAttributeName:{this.stateInAttributeName(f);break}case n.InCommentLike:{this.stateInCommentLike(f);break}case n.InSpecialComment:{this.stateInSpecialComment(f);break}case n.BeforeAttributeName:{this.stateBeforeAttributeName(f);break}case n.InTagName:{this.stateInTagName(f);break}case n.InClosingTagName:{this.stateInClosingTagName(f);break}case n.BeforeTagName:{this.stateBeforeTagName(f);break}case n.AfterAttributeName:{this.stateAfterAttributeName(f);break}case n.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(f);break}case n.BeforeAttributeValue:{this.stateBeforeAttributeValue(f);break}case n.BeforeClosingTagName:{this.stateBeforeClosingTagName(f);break}case n.AfterClosingTagName:{this.stateAfterClosingTagName(f);break}case n.BeforeSpecialS:{this.stateBeforeSpecialS(f);break}case n.BeforeSpecialT:{this.stateBeforeSpecialT(f);break}case n.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(f);break}case n.InSelfClosingTag:{this.stateInSelfClosingTag(f);break}case n.InDeclaration:{this.stateInDeclaration(f);break}case n.BeforeDeclaration:{this.stateBeforeDeclaration(f);break}case n.BeforeComment:{this.stateBeforeComment(f);break}case n.InProcessingInstruction:{this.stateInProcessingInstruction(f);break}case n.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){this.state===n.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const f=this.buffer.length+this.offset;this.sectionStart>=f||(this.state===n.InCommentLike?this.currentSequence===l.CdataEnd?this.cbs.oncdata(this.sectionStart,f,0):this.cbs.oncomment(this.sectionStart,f,0):this.state===n.InTagName||this.state===n.BeforeAttributeName||this.state===n.BeforeAttributeValue||this.state===n.AfterAttributeName||this.state===n.InAttributeName||this.state===n.InAttributeValueSq||this.state===n.InAttributeValueDq||this.state===n.InAttributeValueNq||this.state===n.InClosingTagName||this.cbs.ontext(this.sectionStart,f))}emitCodePoint(f,p){this.baseState!==n.Text&&this.baseState!==n.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+p,this.index=this.sectionStart-1,this.cbs.onattribentity(f)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+p,this.index=this.sectionStart-1,this.cbs.ontextentity(f,this.sectionStart))}};return _p.default=c,_p}var EL;function ML(){if(EL)return Bo;EL=1;var t=Bo&&Bo.__createBinding||(Object.create?(function(S,w,A,C){C===void 0&&(C=A);var j=Object.getOwnPropertyDescriptor(w,A);(!j||("get"in j?!w.__esModule:j.writable||j.configurable))&&(j={enumerable:!0,get:function(){return w[A]}}),Object.defineProperty(S,C,j)}):(function(S,w,A,C){C===void 0&&(C=A),S[C]=w[A]})),e=Bo&&Bo.__setModuleDefault||(Object.create?(function(S,w){Object.defineProperty(S,"default",{enumerable:!0,value:w})}):function(S,w){S.default=w}),n=Bo&&Bo.__importStar||(function(){var S=function(w){return S=Object.getOwnPropertyNames||function(A){var C=[];for(var j in A)Object.prototype.hasOwnProperty.call(A,j)&&(C[C.length]=j);return C},S(w)};return function(w){if(w&&w.__esModule)return w;var A={};if(w!=null)for(var C=S(w),j=0;j<C.length;j++)C[j]!=="default"&&t(A,w,C[j]);return e(A,w),A}})();Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.Parser=void 0;const r=n(IY()),i=NY(),s=new Set(["input","option","optgroup","select","button","datalist","textarea"]),o=new Set(["p"]),l=new Set(["thead","tbody"]),c=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",c],["dt",c],["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"]),y=/\s|\//;let x=class{constructor(w,A={}){var C,j,_,k,M,R;this.options=A,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=w??{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=(C=A.lowerCaseTags)!==null&&C!==void 0?C:this.htmlMode,this.lowerCaseAttributeNames=(j=A.lowerCaseAttributeNames)!==null&&j!==void 0?j:this.htmlMode,this.recognizeSelfClosing=(_=A.recognizeSelfClosing)!==null&&_!==void 0?_:!this.htmlMode,this.tokenizer=new((k=A.Tokenizer)!==null&&k!==void 0?k:r.default)(this.options,this),this.foreignContext=[!this.htmlMode],(R=(M=this.cbs).onparserinit)===null||R===void 0||R.call(M,this)}ontext(w,A){var C,j;const _=this.getSlice(w,A);this.endIndex=A-1,(j=(C=this.cbs).ontext)===null||j===void 0||j.call(C,_),this.startIndex=A}ontextentity(w,A){var C,j;this.endIndex=A-1,(j=(C=this.cbs).ontext)===null||j===void 0||j.call(C,(0,i.fromCodePoint)(w)),this.startIndex=A}isVoidElement(w){return this.htmlMode&&p.has(w)}onopentagname(w,A){this.endIndex=A;let C=this.getSlice(w,A);this.lowerCaseTagNames&&(C=C.toLowerCase()),this.emitOpenTag(C)}emitOpenTag(w){var A,C,j,_;this.openTagStart=this.startIndex,this.tagname=w;const k=this.htmlMode&&f.get(w);if(k)for(;this.stack.length>0&&k.has(this.stack[0]);){const M=this.stack.shift();(C=(A=this.cbs).onclosetag)===null||C===void 0||C.call(A,M,!0)}this.isVoidElement(w)||(this.stack.unshift(w),this.htmlMode&&(m.has(w)?this.foreignContext.unshift(!0):v.has(w)&&this.foreignContext.unshift(!1))),(_=(j=this.cbs).onopentagname)===null||_===void 0||_.call(j,w),this.cbs.onopentag&&(this.attribs={})}endOpenTag(w){var A,C;this.startIndex=this.openTagStart,this.attribs&&((C=(A=this.cbs).onopentag)===null||C===void 0||C.call(A,this.tagname,this.attribs,w),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(w){this.endIndex=w,this.endOpenTag(!1),this.startIndex=w+1}onclosetag(w,A){var C,j,_,k,M,R,N,I;this.endIndex=A;let D=this.getSlice(w,A);if(this.lowerCaseTagNames&&(D=D.toLowerCase()),this.htmlMode&&(m.has(D)||v.has(D))&&this.foreignContext.shift(),this.isVoidElement(D))this.htmlMode&&D==="br"&&((k=(_=this.cbs).onopentagname)===null||k===void 0||k.call(_,"br"),(R=(M=this.cbs).onopentag)===null||R===void 0||R.call(M,"br",{},!0),(I=(N=this.cbs).onclosetag)===null||I===void 0||I.call(N,"br",!1));else{const L=this.stack.indexOf(D);if(L!==-1)for(let z=0;z<=L;z++){const P=this.stack.shift();(j=(C=this.cbs).onclosetag)===null||j===void 0||j.call(C,P,z!==L)}else this.htmlMode&&D==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=A+1}onselfclosingtag(w){this.endIndex=w,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=w+1):this.onopentagend(w)}closeCurrentTag(w){var A,C;const j=this.tagname;this.endOpenTag(w),this.stack[0]===j&&((C=(A=this.cbs).onclosetag)===null||C===void 0||C.call(A,j,!w),this.stack.shift())}onattribname(w,A){this.startIndex=w;const C=this.getSlice(w,A);this.attribname=this.lowerCaseAttributeNames?C.toLowerCase():C}onattribdata(w,A){this.attribvalue+=this.getSlice(w,A)}onattribentity(w){this.attribvalue+=(0,i.fromCodePoint)(w)}onattribend(w,A){var C,j;this.endIndex=A,(j=(C=this.cbs).onattribute)===null||j===void 0||j.call(C,this.attribname,this.attribvalue,w===r.QuoteType.Double?'"':w===r.QuoteType.Single?"'":w===r.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(w){const A=w.search(y);let C=A<0?w:w.substr(0,A);return this.lowerCaseTagNames&&(C=C.toLowerCase()),C}ondeclaration(w,A){this.endIndex=A;const C=this.getSlice(w,A);if(this.cbs.onprocessinginstruction){const j=this.getInstructionName(C);this.cbs.onprocessinginstruction(`!${j}`,`!${C}`)}this.startIndex=A+1}onprocessinginstruction(w,A){this.endIndex=A;const C=this.getSlice(w,A);if(this.cbs.onprocessinginstruction){const j=this.getInstructionName(C);this.cbs.onprocessinginstruction(`?${j}`,`?${C}`)}this.startIndex=A+1}oncomment(w,A,C){var j,_,k,M;this.endIndex=A,(_=(j=this.cbs).oncomment)===null||_===void 0||_.call(j,this.getSlice(w,A-C)),(M=(k=this.cbs).oncommentend)===null||M===void 0||M.call(k),this.startIndex=A+1}oncdata(w,A,C){var j,_,k,M,R,N,I,D,L,z;this.endIndex=A;const P=this.getSlice(w,A-C);!this.htmlMode||this.options.recognizeCDATA?((_=(j=this.cbs).oncdatastart)===null||_===void 0||_.call(j),(M=(k=this.cbs).ontext)===null||M===void 0||M.call(k,P),(N=(R=this.cbs).oncdataend)===null||N===void 0||N.call(R)):((D=(I=this.cbs).oncomment)===null||D===void 0||D.call(I,`[CDATA[${P}]]`),(z=(L=this.cbs).oncommentend)===null||z===void 0||z.call(L)),this.startIndex=A+1}onend(){var w,A;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let C=0;C<this.stack.length;C++)this.cbs.onclosetag(this.stack[C],!0)}(A=(w=this.cbs).onend)===null||A===void 0||A.call(w)}reset(){var w,A,C,j;(A=(w=this.cbs).onreset)===null||A===void 0||A.call(w),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(j=(C=this.cbs).onparserinit)===null||j===void 0||j.call(C,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(w){this.reset(),this.end(w)}getSlice(w,A){for(;w-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let C=this.buffers[0].slice(w-this.bufferOffset,A-this.bufferOffset);for(;A-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),C+=this.buffers[0].slice(0,A-this.bufferOffset);return C}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(w){var A,C;if(this.ended){(C=(A=this.cbs).onerror)===null||C===void 0||C.call(A,new Error(".write() after done!"));return}this.buffers.push(w),this.tokenizer.running&&(this.tokenizer.write(w),this.writeIndex++)}end(w){var A,C;if(this.ended){(C=(A=this.cbs).onerror)===null||C===void 0||C.call(A,new Error(".end() after done!"));return}w&&this.write(w),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(w){this.write(w)}done(w){this.end(w)}};return Bo.Parser=x,Bo}var Id={},iT={},RL;function ey(){return RL||(RL=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})(iT)),iT}var an={},DL;function NL(){if(DL)return an;DL=1;var t=an&&an.__extends||(function(){var _=function(k,M){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,N){R.__proto__=N}||function(R,N){for(var I in N)Object.prototype.hasOwnProperty.call(N,I)&&(R[I]=N[I])},_(k,M)};return function(k,M){if(typeof M!="function"&&M!==null)throw new TypeError("Class extends value "+String(M)+" is not a constructor or null");_(k,M);function R(){this.constructor=k}k.prototype=M===null?Object.create(M):(R.prototype=M.prototype,new R)}})(),e=an&&an.__assign||function(){return e=Object.assign||function(_){for(var k,M=1,R=arguments.length;M<R;M++){k=arguments[M];for(var N in k)Object.prototype.hasOwnProperty.call(k,N)&&(_[N]=k[N])}return _},e.apply(this,arguments)};Object.defineProperty(an,"__esModule",{value:!0}),an.cloneNode=an.hasChildren=an.isDocument=an.isDirective=an.isComment=an.isText=an.isCDATA=an.isTag=an.Element=an.Document=an.CDATA=an.NodeWithChildren=an.ProcessingInstruction=an.Comment=an.Text=an.DataNode=an.Node=void 0;var n=ey(),r=(function(){function _(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(_.prototype,"parentNode",{get:function(){return this.parent},set:function(k){this.parent=k},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"previousSibling",{get:function(){return this.prev},set:function(k){this.prev=k},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"nextSibling",{get:function(){return this.next},set:function(k){this.next=k},enumerable:!1,configurable:!0}),_.prototype.cloneNode=function(k){return k===void 0&&(k=!1),C(this,k)},_})();an.Node=r;var i=(function(_){t(k,_);function k(M){var R=_.call(this)||this;return R.data=M,R}return Object.defineProperty(k.prototype,"nodeValue",{get:function(){return this.data},set:function(M){this.data=M},enumerable:!1,configurable:!0}),k})(r);an.DataNode=i;var s=(function(_){t(k,_);function k(){var M=_!==null&&_.apply(this,arguments)||this;return M.type=n.ElementType.Text,M}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),k})(i);an.Text=s;var o=(function(_){t(k,_);function k(){var M=_!==null&&_.apply(this,arguments)||this;return M.type=n.ElementType.Comment,M}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),k})(i);an.Comment=o;var l=(function(_){t(k,_);function k(M,R){var N=_.call(this,R)||this;return N.name=M,N.type=n.ElementType.Directive,N}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),k})(i);an.ProcessingInstruction=l;var c=(function(_){t(k,_);function k(M){var R=_.call(this)||this;return R.children=M,R}return Object.defineProperty(k.prototype,"firstChild",{get:function(){var M;return(M=this.children[0])!==null&&M!==void 0?M:null},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"childNodes",{get:function(){return this.children},set:function(M){this.children=M},enumerable:!1,configurable:!0}),k})(r);an.NodeWithChildren=c;var h=(function(_){t(k,_);function k(){var M=_!==null&&_.apply(this,arguments)||this;return M.type=n.ElementType.CDATA,M}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),k})(c);an.CDATA=h;var f=(function(_){t(k,_);function k(){var M=_!==null&&_.apply(this,arguments)||this;return M.type=n.ElementType.Root,M}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),k})(c);an.Document=f;var p=(function(_){t(k,_);function k(M,R,N,I){N===void 0&&(N=[]),I===void 0&&(I=M==="script"?n.ElementType.Script:M==="style"?n.ElementType.Style:n.ElementType.Tag);var D=_.call(this,N)||this;return D.name=M,D.attribs=R,D.type=I,D}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"tagName",{get:function(){return this.name},set:function(M){this.name=M},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"attributes",{get:function(){var M=this;return Object.keys(this.attribs).map(function(R){var N,I;return{name:R,value:M.attribs[R],namespace:(N=M["x-attribsNamespace"])===null||N===void 0?void 0:N[R],prefix:(I=M["x-attribsPrefix"])===null||I===void 0?void 0:I[R]}})},enumerable:!1,configurable:!0}),k})(c);an.Element=p;function m(_){return(0,n.isTag)(_)}an.isTag=m;function v(_){return _.type===n.ElementType.CDATA}an.isCDATA=v;function y(_){return _.type===n.ElementType.Text}an.isText=y;function x(_){return _.type===n.ElementType.Comment}an.isComment=x;function S(_){return _.type===n.ElementType.Directive}an.isDirective=S;function w(_){return _.type===n.ElementType.Root}an.isDocument=w;function A(_){return Object.prototype.hasOwnProperty.call(_,"children")}an.hasChildren=A;function C(_,k){k===void 0&&(k=!1);var M;if(y(_))M=new s(_.data);else if(x(_))M=new o(_.data);else if(m(_)){var R=k?j(_.children):[],N=new p(_.name,e({},_.attribs),R);R.forEach(function(z){return z.parent=N}),_.namespace!=null&&(N.namespace=_.namespace),_["x-attribsNamespace"]&&(N["x-attribsNamespace"]=e({},_["x-attribsNamespace"])),_["x-attribsPrefix"]&&(N["x-attribsPrefix"]=e({},_["x-attribsPrefix"])),M=N}else if(v(_)){var R=k?j(_.children):[],I=new h(R);R.forEach(function(P){return P.parent=I}),M=I}else if(w(_)){var R=k?j(_.children):[],D=new f(R);R.forEach(function(P){return P.parent=D}),_["x-mode"]&&(D["x-mode"]=_["x-mode"]),M=D}else if(S(_)){var L=new l(_.name,_.data);_["x-name"]!=null&&(L["x-name"]=_["x-name"],L["x-publicId"]=_["x-publicId"],L["x-systemId"]=_["x-systemId"]),M=L}else throw new Error("Not implemented yet: ".concat(_.type));return M.startIndex=_.startIndex,M.endIndex=_.endIndex,_.sourceCodeLocation!=null&&(M.sourceCodeLocation=_.sourceCodeLocation),M}an.cloneNode=C;function j(_){for(var k=_.map(function(R){return C(R,!0)}),M=1;M<k.length;M++)k[M].prev=k[M-1],k[M-1].next=k[M];return k}return an}var IL;function Jh(){return IL||(IL=1,(function(t){var e=Id&&Id.__createBinding||(Object.create?(function(l,c,h,f){f===void 0&&(f=h);var p=Object.getOwnPropertyDescriptor(c,h);(!p||("get"in p?!c.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return c[h]}}),Object.defineProperty(l,f,p)}):(function(l,c,h,f){f===void 0&&(f=h),l[f]=c[h]})),n=Id&&Id.__exportStar||function(l,c){for(var h in l)h!=="default"&&!Object.prototype.hasOwnProperty.call(c,h)&&e(c,l,h)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var r=ey(),i=NL();n(NL(),t);var s={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},o=(function(){function l(c,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 c=="object"&&(h=c,c=void 0),this.callback=c??null,this.options=h??s,this.elementCB=f??null}return l.prototype.onparserinit=function(c){this.parser=c},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(c){this.handleCallback(c)},l.prototype.onclosetag=function(){this.lastNode=null;var c=this.tagStack.pop();this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(c)},l.prototype.onopentag=function(c,h){var f=this.options.xmlMode?r.ElementType.Tag:void 0,p=new i.Element(c,h,void 0,f);this.addNode(p),this.tagStack.push(p)},l.prototype.ontext=function(c){var h=this.lastNode;if(h&&h.type===r.ElementType.Text)h.data+=c,this.options.withEndIndices&&(h.endIndex=this.parser.endIndex);else{var f=new i.Text(c);this.addNode(f),this.lastNode=f}},l.prototype.oncomment=function(c){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=c;return}var h=new i.Comment(c);this.addNode(h),this.lastNode=h},l.prototype.oncommentend=function(){this.lastNode=null},l.prototype.oncdatastart=function(){var c=new i.Text(""),h=new i.CDATA([c]);this.addNode(h),c.parent=h,this.lastNode=c},l.prototype.oncdataend=function(){this.lastNode=null},l.prototype.onprocessinginstruction=function(c,h){var f=new i.ProcessingInstruction(c,h);this.addNode(f)},l.prototype.handleCallback=function(c){if(typeof this.callback=="function")this.callback(c,this.dom);else if(c)throw c},l.prototype.addNode=function(c){var h=this.tagStack[this.tagStack.length-1],f=h.children[h.children.length-1];this.options.withStartIndices&&(c.startIndex=this.parser.startIndex),this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),h.children.push(c),f&&(c.prev=f,f.next=c),c.parent=h,this.lastNode=null},l})();t.DomHandler=o,t.default=o})(Id)),Id}var Ld={},Dl={},sa={},sT={},Po={},sx={},LL;function uAe(){return LL||(LL=1,Object.defineProperty(sx,"__esModule",{value:!0}),sx.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)}))),sx}var ax={},BL;function hAe(){return BL||(BL=1,Object.defineProperty(ax,"__esModule",{value:!0}),ax.default=new Uint16Array("Ȁaglq	\x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(function(t){return t.charCodeAt(0)}))),ax}var aT={},PL;function FL(){return PL||(PL=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})(aT)),aT}var $L;function HL(){return $L||($L=1,(function(t){var e=Po&&Po.__createBinding||(Object.create?(function(D,L,z,P){P===void 0&&(P=z);var H=Object.getOwnPropertyDescriptor(L,z);(!H||("get"in H?!L.__esModule:H.writable||H.configurable))&&(H={enumerable:!0,get:function(){return L[z]}}),Object.defineProperty(D,P,H)}):(function(D,L,z,P){P===void 0&&(P=z),D[P]=L[z]})),n=Po&&Po.__setModuleDefault||(Object.create?(function(D,L){Object.defineProperty(D,"default",{enumerable:!0,value:L})}):function(D,L){D.default=L}),r=Po&&Po.__importStar||function(D){if(D&&D.__esModule)return D;var L={};if(D!=null)for(var z in D)z!=="default"&&Object.prototype.hasOwnProperty.call(D,z)&&e(L,D,z);return n(L,D),L},i=Po&&Po.__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(uAe());t.htmlDecodeTree=s.default;var o=i(hAe());t.xmlDecodeTree=o.default;var l=r(FL());t.decodeCodePoint=l.default;var c=FL();Object.defineProperty(t,"replaceCodePoint",{enumerable:!0,get:function(){return c.replaceCodePoint}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return c.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 y(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||y(D)}var S;(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"})(S||(S={}));var w;(function(D){D[D.Legacy=0]="Legacy",D[D.Strict=1]="Strict",D[D.Attribute=2]="Attribute"})(w=t.DecodingMode||(t.DecodingMode={}));var A=(function(){function D(L,z,P){this.decodeTree=L,this.emitCodePoint=z,this.errors=P,this.state=S.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=w.Strict}return D.prototype.startEntity=function(L){this.decodeMode=L,this.state=S.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},D.prototype.write=function(L,z){switch(this.state){case S.EntityStart:return L.charCodeAt(z)===h.NUM?(this.state=S.NumericStart,this.consumed+=1,this.stateNumericStart(L,z+1)):(this.state=S.NamedEntity,this.stateNamedEntity(L,z));case S.NumericStart:return this.stateNumericStart(L,z);case S.NumericDecimal:return this.stateNumericDecimal(L,z);case S.NumericHex:return this.stateNumericHex(L,z);case S.NamedEntity:return this.stateNamedEntity(L,z)}},D.prototype.stateNumericStart=function(L,z){return z>=L.length?-1:(L.charCodeAt(z)|f)===h.LOWER_X?(this.state=S.NumericHex,this.consumed+=1,this.stateNumericHex(L,z+1)):(this.state=S.NumericDecimal,this.stateNumericDecimal(L,z))},D.prototype.addToNumericResult=function(L,z,P,H){if(z!==P){var B=P-z;this.result=this.result*Math.pow(H,B)+parseInt(L.substr(z,B),H),this.consumed+=B}},D.prototype.stateNumericHex=function(L,z){for(var P=z;z<L.length;){var H=L.charCodeAt(z);if(m(H)||v(H))z+=1;else return this.addToNumericResult(L,P,z,16),this.emitNumericEntity(H,3)}return this.addToNumericResult(L,P,z,16),-1},D.prototype.stateNumericDecimal=function(L,z){for(var P=z;z<L.length;){var H=L.charCodeAt(z);if(m(H))z+=1;else return this.addToNumericResult(L,P,z,10),this.emitNumericEntity(H,2)}return this.addToNumericResult(L,P,z,10),-1},D.prototype.emitNumericEntity=function(L,z){var P;if(this.consumed<=z)return(P=this.errors)===null||P===void 0||P.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(L===h.SEMI)this.consumed+=1;else if(this.decodeMode===w.Strict)return 0;return this.emitCodePoint((0,l.replaceCodePoint)(this.result),this.consumed),this.errors&&(L!==h.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed},D.prototype.stateNamedEntity=function(L,z){for(var P=this.decodeTree,H=P[this.treeIndex],B=(H&p.VALUE_LENGTH)>>14;z<L.length;z++,this.excess++){var F=L.charCodeAt(z);if(this.treeIndex=j(P,H,this.treeIndex+Math.max(1,B),F),this.treeIndex<0)return this.result===0||this.decodeMode===w.Attribute&&(B===0||x(F))?0:this.emitNotTerminatedNamedEntity();if(H=P[this.treeIndex],B=(H&p.VALUE_LENGTH)>>14,B!==0){if(F===h.SEMI)return this.emitNamedEntityData(this.treeIndex,B,this.consumed+this.excess);this.decodeMode!==w.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},D.prototype.emitNotTerminatedNamedEntity=function(){var L,z=this,P=z.result,H=z.decodeTree,B=(H[P]&p.VALUE_LENGTH)>>14;return this.emitNamedEntityData(P,B,this.consumed),(L=this.errors)===null||L===void 0||L.missingSemicolonAfterCharacterReference(),this.consumed},D.prototype.emitNamedEntityData=function(L,z,P){var H=this.decodeTree;return this.emitCodePoint(z===1?H[L]&~p.VALUE_LENGTH:H[L+1],P),z===3&&this.emitCodePoint(H[L+2],P),P},D.prototype.end=function(){var L;switch(this.state){case S.NamedEntity:return this.result!==0&&(this.decodeMode!==w.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case S.NumericDecimal:return this.emitNumericEntity(0,2);case S.NumericHex:return this.emitNumericEntity(0,3);case S.NumericStart:return(L=this.errors)===null||L===void 0||L.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case S.EntityStart:return 0}},D})();t.EntityDecoder=A;function C(D){var L="",z=new A(D,function(P){return L+=(0,l.fromCodePoint)(P)});return function(H,B){for(var F=0,q=0;(q=H.indexOf("&",q))>=0;){L+=H.slice(F,q),z.startEntity(B);var X=z.write(H,q+1);if(X<0){F=q+z.end();break}F=q+X,q=X===0?F+1:F}var Y=L+H.slice(F);return L="",Y}}function j(D,L,z,P){var H=(L&p.BRANCH_LENGTH)>>7,B=L&p.JUMP_TABLE;if(H===0)return B!==0&&P===B?z:-1;if(B){var F=P-B;return F<0||F>=H?-1:D[z+F]-1}for(var q=z,X=q+H-1;q<=X;){var Y=q+X>>>1,U=D[Y];if(U<P)q=Y+1;else if(U>P)X=Y-1;else return D[Y+H]}return-1}t.determineBranch=j;var _=C(s.default),k=C(o.default);function M(D,L){return L===void 0&&(L=w.Legacy),_(D,L)}t.decodeHTML=M;function R(D){return _(D,w.Attribute)}t.decodeHTMLAttribute=R;function N(D){return _(D,w.Strict)}t.decodeHTMLStrict=N;function I(D){return k(D,w.Strict)}t.decodeXML=I})(Po)),Po}var qc={},ox={},zL;function dAe(){if(zL)return ox;zL=1,Object.defineProperty(ox,"__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 ox.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;"]])),ox}var oT={},qL;function lO(){return qL||(qL=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 c=l.index,h=i.charCodeAt(c),f=e.get(h);f!==void 0?(s+=i.substring(o,c)+f,o=c+1):(s+="".concat(i.substring(o,c),"&#x").concat((0,t.getCodePoint)(i,c).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 c,h=0,f="";c=i.exec(l);)h!==c.index&&(f+=l.substring(h,c.index)),f+=s.get(c[0].charCodeAt(0)),h=c.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;"]]))})(oT)),oT}var QL;function UL(){if(QL)return qc;QL=1;var t=qc&&qc.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(qc,"__esModule",{value:!0}),qc.encodeNonAsciiHTML=qc.encodeHTML=void 0;var e=t(dAe()),n=lO(),r=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function i(l){return o(r,l)}qc.encodeHTML=i;function s(l){return o(n.xmlReplacer,l)}qc.encodeNonAsciiHTML=s;function o(l,c){for(var h="",f=0,p;(p=l.exec(c))!==null;){var m=p.index;h+=c.substring(f,m);var v=c.charCodeAt(m),y=e.default.get(v);if(typeof y=="object"){if(m+1<c.length){var x=c.charCodeAt(m+1),S=typeof y.n=="number"?y.n===x?y.o:void 0:y.n.get(x);if(S!==void 0){h+=S,f=l.lastIndex+=1;continue}}y=y.v}if(y!==void 0)h+=y,f=m+1;else{var w=(0,n.getCodePoint)(c,m);h+="&#x".concat(w.toString(16),";"),f=l.lastIndex+=+(w!==v)}}return h+c.substr(f)}return qc}var WL;function fAe(){return WL||(WL=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=HL(),n=UL(),r=lO(),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 y=typeof v=="number"?v:v.level;if(y===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 y;v===void 0&&(v=i.XML);var x=typeof v=="number"?{level:v}:v;return(y=x.mode)!==null&&y!==void 0||(x.mode=e.DecodingMode.Strict),o(m,x)}t.decodeStrict=l;function c(m,v){v===void 0&&(v=i.XML);var y=typeof v=="number"?{level:v}:v;return y.mode===s.UTF8?(0,r.escapeUTF8)(m):y.mode===s.Attribute?(0,r.escapeAttribute)(m):y.mode===s.Text?(0,r.escapeText)(m):y.level===i.HTML?y.mode===s.ASCII?(0,n.encodeNonAsciiHTML)(m):(0,n.encodeHTML)(m):(0,r.encodeXML)(m)}t.encode=c;var h=lO();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=UL();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=HL();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}})})(sT)),sT}var Bd={},YL;function pAe(){return YL||(YL=1,Object.defineProperty(Bd,"__esModule",{value:!0}),Bd.attributeNames=Bd.elementNames=void 0,Bd.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]})),Bd.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]}))),Bd}var VL;function mAe(){if(VL)return sa;VL=1;var t=sa&&sa.__assign||function(){return t=Object.assign||function(j){for(var _,k=1,M=arguments.length;k<M;k++){_=arguments[k];for(var R in _)Object.prototype.hasOwnProperty.call(_,R)&&(j[R]=_[R])}return j},t.apply(this,arguments)},e=sa&&sa.__createBinding||(Object.create?(function(j,_,k,M){M===void 0&&(M=k);var R=Object.getOwnPropertyDescriptor(_,k);(!R||("get"in R?!_.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return _[k]}}),Object.defineProperty(j,M,R)}):(function(j,_,k,M){M===void 0&&(M=k),j[M]=_[k]})),n=sa&&sa.__setModuleDefault||(Object.create?(function(j,_){Object.defineProperty(j,"default",{enumerable:!0,value:_})}):function(j,_){j.default=_}),r=sa&&sa.__importStar||function(j){if(j&&j.__esModule)return j;var _={};if(j!=null)for(var k in j)k!=="default"&&Object.prototype.hasOwnProperty.call(j,k)&&e(_,j,k);return n(_,j),_};Object.defineProperty(sa,"__esModule",{value:!0}),sa.render=void 0;var i=r(ey()),s=fAe(),o=pAe(),l=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function c(j){return j.replace(/"/g,"&quot;")}function h(j,_){var k;if(j){var M=((k=_.encodeEntities)!==null&&k!==void 0?k:_.decodeEntities)===!1?c:_.xmlMode||_.encodeEntities!=="utf8"?s.encodeXML:s.escapeAttribute;return Object.keys(j).map(function(R){var N,I,D=(N=j[R])!==null&&N!==void 0?N:"";return _.xmlMode==="foreign"&&(R=(I=o.attributeNames.get(R))!==null&&I!==void 0?I:R),!_.emptyAttrs&&!_.xmlMode&&D===""?R:"".concat(R,'="').concat(M(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(j,_){_===void 0&&(_={});for(var k=("length"in j)?j:[j],M="",R=0;R<k.length;R++)M+=m(k[R],_);return M}sa.render=p,sa.default=p;function m(j,_){switch(j.type){case i.Root:return p(j.children,_);case i.Doctype:case i.Directive:return S(j);case i.Comment:return C(j);case i.CDATA:return A(j);case i.Script:case i.Style:case i.Tag:return x(j,_);case i.Text:return w(j,_)}}var v=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),y=new Set(["svg","math"]);function x(j,_){var k;_.xmlMode==="foreign"&&(j.name=(k=o.elementNames.get(j.name))!==null&&k!==void 0?k:j.name,j.parent&&v.has(j.parent.name)&&(_=t(t({},_),{xmlMode:!1}))),!_.xmlMode&&y.has(j.name)&&(_=t(t({},_),{xmlMode:"foreign"}));var M="<".concat(j.name),R=h(j.attribs,_);return R&&(M+=" ".concat(R)),j.children.length===0&&(_.xmlMode?_.selfClosingTags!==!1:_.selfClosingTags&&f.has(j.name))?(_.xmlMode||(M+=" "),M+="/>"):(M+=">",j.children.length>0&&(M+=p(j.children,_)),(_.xmlMode||!f.has(j.name))&&(M+="</".concat(j.name,">"))),M}function S(j){return"<".concat(j.data,">")}function w(j,_){var k,M=j.data||"";return((k=_.encodeEntities)!==null&&k!==void 0?k:_.decodeEntities)!==!1&&!(!_.xmlMode&&j.parent&&l.has(j.parent.name))&&(M=_.xmlMode||_.encodeEntities!=="utf8"?(0,s.encodeXML)(M):(0,s.escapeText)(M)),M}function A(j){return"<![CDATA[".concat(j.children[0].data,"]]>")}function C(j){return"<!--".concat(j.data,"-->")}return sa}var GL;function LY(){if(GL)return Dl;GL=1;var t=Dl&&Dl.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.getOuterHTML=i,Dl.getInnerHTML=s,Dl.getText=o,Dl.textContent=l,Dl.innerText=c;var e=Jh(),n=t(mAe()),r=ey();function i(h,f){return(0,n.default)(h,f)}function s(h,f){return(0,e.hasChildren)(h)?h.children.map(function(p){return i(p,f)}).join(""):""}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:""}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:""}function c(h){return Array.isArray(h)?h.map(c).join(""):(0,e.hasChildren)(h)&&(h.type===r.ElementType.Tag||(0,e.isCDATA)(h))?c(h.children):(0,e.isText)(h)?h.data:""}return Dl}var Fo={},XL;function gAe(){if(XL)return Fo;XL=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.getChildren=e,Fo.getParent=n,Fo.getSiblings=r,Fo.getAttributeValue=i,Fo.hasAttrib=s,Fo.getName=o,Fo.nextElementSibling=l,Fo.prevElementSibling=c;var t=Jh();function e(h){return(0,t.hasChildren)(h)?h.children:[]}function n(h){return h.parent||null}function r(h){var f,p,m=n(h);if(m!=null)return e(m);for(var v=[h],y=h.prev,x=h.next;y!=null;)v.unshift(y),f=y,y=f.prev;for(;x!=null;)v.push(x),p=x,x=p.next;return v}function i(h,f){var p;return(p=h.attribs)===null||p===void 0?void 0:p[f]}function s(h,f){return h.attribs!=null&&Object.prototype.hasOwnProperty.call(h.attribs,f)&&h.attribs[f]!=null}function o(h){return h.name}function l(h){for(var f,p=h.next;p!==null&&!(0,t.isTag)(p);)f=p,p=f.next;return p}function c(h){for(var f,p=h.prev;p!==null&&!(0,t.isTag)(p);)f=p,p=f.prev;return p}return Fo}var Qc={},KL;function vAe(){if(KL)return Qc;KL=1,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.removeElement=t,Qc.replaceElement=e,Qc.appendChild=n,Qc.append=r,Qc.prependChild=i,Qc.prepend=s;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,c=l.lastIndexOf(o);c>=0&&l.splice(c,1)}o.next=null,o.prev=null,o.parent=null}function e(o,l){var c=l.prev=o.prev;c&&(c.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}}function n(o,l){if(t(l),l.next=null,l.parent=o,o.children.push(l)>1){var c=o.children[o.children.length-2];c.next=l,l.prev=c}else l.prev=null}function r(o,l){t(l);var c=o.parent,h=o.next;if(l.next=h,l.prev=o,o.next=l,l.parent=c,h){if(h.prev=l,c){var f=c.children;f.splice(f.lastIndexOf(h),0,l)}}else c&&c.children.push(l)}function i(o,l){if(t(l),l.parent=o,l.prev=null,o.children.unshift(l)!==1){var c=o.children[1];c.prev=l,l.next=c}else l.next=null}function s(o,l){t(l);var c=o.parent;if(c){var h=c.children;h.splice(h.indexOf(o),0,l)}o.prev&&(o.prev.next=l),l.parent=c,l.prev=o.prev,l.next=o,o.prev=l}return Qc}var Uc={},ZL;function BY(){if(ZL)return Uc;ZL=1,Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.filter=e,Uc.find=n,Uc.findOneChild=r,Uc.findOne=i,Uc.existsOne=s,Uc.findAll=o;var t=Jh();function e(l,c,h,f){return h===void 0&&(h=!0),f===void 0&&(f=1/0),n(l,Array.isArray(c)?c:[c],h,f)}function n(l,c,h,f){for(var p=[],m=[Array.isArray(c)?c:[c]],v=[0];;){if(v[0]>=m[0].length){if(v.length===1)return p;m.shift(),v.shift();continue}var y=m[0][v[0]++];if(l(y)&&(p.push(y),--f<=0))return p;h&&(0,t.hasChildren)(y)&&y.children.length>0&&(v.unshift(0),m.unshift(y.children))}}function r(l,c){return c.find(l)}function i(l,c,h){h===void 0&&(h=!0);for(var f=Array.isArray(c)?c:[c],p=0;p<f.length;p++){var m=f[p];if((0,t.isTag)(m)&&l(m))return m;if(h&&(0,t.hasChildren)(m)&&m.children.length>0){var v=i(l,m.children,!0);if(v)return v}}return null}function s(l,c){return(Array.isArray(c)?c:[c]).some(function(h){return(0,t.isTag)(h)&&l(h)||(0,t.hasChildren)(h)&&s(l,h.children)})}function o(l,c){for(var h=[],f=[Array.isArray(c)?c:[c]],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),(0,t.hasChildren)(m)&&m.children.length>0&&(p.unshift(0),f.unshift(m.children))}}return Uc}var Wc={},JL;function PY(){if(JL)return Wc;JL=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.testElement=o,Wc.getElements=l,Wc.getElementById=c,Wc.getElementsByTagName=h,Wc.getElementsByClassName=f,Wc.getElementsByTagType=p;var t=Jh(),e=BY(),n={tag_name:function(m){return typeof m=="function"?function(v){return(0,t.isTag)(v)&&m(v.name)}:m==="*"?t.isTag:function(v){return(0,t.isTag)(v)&&v.name===m}},tag_type:function(m){return typeof m=="function"?function(v){return m(v.type)}:function(v){return v.type===m}},tag_contains:function(m){return typeof m=="function"?function(v){return(0,t.isText)(v)&&m(v.data)}:function(v){return(0,t.isText)(v)&&v.data===m}}};function r(m,v){return typeof v=="function"?function(y){return(0,t.isTag)(y)&&v(y.attribs[m])}:function(y){return(0,t.isTag)(y)&&y.attribs[m]===v}}function i(m,v){return function(y){return m(y)||v(y)}}function s(m){var v=Object.keys(m).map(function(y){var x=m[y];return Object.prototype.hasOwnProperty.call(n,y)?n[y](x):r(y,x)});return v.length===0?null:v.reduce(i)}function o(m,v){var y=s(m);return y?y(v):!0}function l(m,v,y,x){x===void 0&&(x=1/0);var S=s(m);return S?(0,e.filter)(S,v,y,x):[]}function c(m,v,y){return y===void 0&&(y=!0),Array.isArray(v)||(v=[v]),(0,e.findOne)(r("id",m),v,y)}function h(m,v,y,x){return y===void 0&&(y=!0),x===void 0&&(x=1/0),(0,e.filter)(n.tag_name(m),v,y,x)}function f(m,v,y,x){return y===void 0&&(y=!0),x===void 0&&(x=1/0),(0,e.filter)(r("class",m),v,y,x)}function p(m,v,y,x){return y===void 0&&(y=!0),x===void 0&&(x=1/0),(0,e.filter)(n.tag_type(m),v,y,x)}return Wc}var oh={},eB;function bAe(){if(eB)return oh;eB=1,Object.defineProperty(oh,"__esModule",{value:!0}),oh.DocumentPosition=void 0,oh.removeSubsets=e,oh.compareDocumentPosition=r,oh.uniqueSort=i;var t=Jh();function e(s){for(var o=s.length;--o>=0;){var l=s[o];if(o>0&&s.lastIndexOf(l,o-1)>=0){s.splice(o,1);continue}for(var c=l.parent;c;c=c.parent)if(s.includes(c)){s.splice(o,1);break}}return s}var n;(function(s){s[s.DISCONNECTED=1]="DISCONNECTED",s[s.PRECEDING=2]="PRECEDING",s[s.FOLLOWING=4]="FOLLOWING",s[s.CONTAINS=8]="CONTAINS",s[s.CONTAINED_BY=16]="CONTAINED_BY"})(n||(oh.DocumentPosition=n={}));function r(s,o){var l=[],c=[];if(s===o)return 0;for(var h=(0,t.hasChildren)(s)?s:s.parent;h;)l.unshift(h),h=h.parent;for(h=(0,t.hasChildren)(o)?o:o.parent;h;)c.unshift(h),h=h.parent;for(var f=Math.min(l.length,c.length),p=0;p<f&&l[p]===c[p];)p++;if(p===0)return n.DISCONNECTED;var m=l[p-1],v=m.children,y=l[p],x=c[p];return v.indexOf(y)>v.indexOf(x)?m===o?n.FOLLOWING|n.CONTAINED_BY:n.FOLLOWING:m===s?n.PRECEDING|n.CONTAINS:n.PRECEDING}function i(s){return s=s.filter(function(o,l,c){return!c.includes(o,l+1)}),s.sort(function(o,l){var c=r(o,l);return c&n.PRECEDING?-1:c&n.FOLLOWING?1:0}),s}return oh}var lx={},tB;function yAe(){if(tB)return lx;tB=1,Object.defineProperty(lx,"__esModule",{value:!0}),lx.getFeed=n;var t=LY(),e=PY();function n(m){var v=c(p,m);return v?v.name==="feed"?r(v):i(v):null}function r(m){var v,y=m.children,x={type:"atom",items:(0,e.getElementsByTagName)("entry",y).map(function(A){var C,j=A.children,_={media:l(j)};f(_,"id","id",j),f(_,"title","title",j);var k=(C=c("link",j))===null||C===void 0?void 0:C.attribs.href;k&&(_.link=k);var M=h("summary",j)||h("content",j);M&&(_.description=M);var R=h("updated",j);return R&&(_.pubDate=new Date(R)),_})};f(x,"id","id",y),f(x,"title","title",y);var S=(v=c("link",y))===null||v===void 0?void 0:v.attribs.href;S&&(x.link=S),f(x,"description","subtitle",y);var w=h("updated",y);return w&&(x.updated=new Date(w)),f(x,"author","email",y,!0),x}function i(m){var v,y,x=(y=(v=c("channel",m.children))===null||v===void 0?void 0:v.children)!==null&&y!==void 0?y:[],S={type:m.name.substr(0,3),id:"",items:(0,e.getElementsByTagName)("item",m.children).map(function(A){var C=A.children,j={media:l(C)};f(j,"id","guid",C),f(j,"title","title",C),f(j,"link","link",C),f(j,"description","description",C);var _=h("pubDate",C)||h("dc:date",C);return _&&(j.pubDate=new Date(_)),j})};f(S,"title","title",x),f(S,"link","link",x),f(S,"description","description",x);var w=h("lastBuildDate",x);return w&&(S.updated=new Date(w)),f(S,"author","managingEditor",x,!0),S}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 y=v.attribs,x={medium:y.medium,isDefault:!!y.isDefault},S=0,w=s;S<w.length;S++){var A=w[S];y[A]&&(x[A]=y[A])}for(var C=0,j=o;C<j.length;C++){var A=j[C];y[A]&&(x[A]=parseInt(y[A],10))}return y.expression&&(x.expression=y.expression),x})}function c(m,v){return(0,e.getElementsByTagName)(m,v,!0,1)[0]}function h(m,v,y){return y===void 0&&(y=!1),(0,t.textContent)((0,e.getElementsByTagName)(m,v,y,1)).trim()}function f(m,v,y,x,S){S===void 0&&(S=!1);var w=h(y,x,S);w&&(m[v]=w)}function p(m){return m==="rss"||m==="feed"||m==="rdf:RDF"}return lx}var nB;function lT(){return nB||(nB=1,(function(t){var e=Ld&&Ld.__createBinding||(Object.create?(function(i,s,o,l){l===void 0&&(l=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,l,c)}):(function(i,s,o,l){l===void 0&&(l=o),i[l]=s[o]})),n=Ld&&Ld.__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(LY(),t),n(gAe(),t),n(vAe(),t),n(BY(),t),n(PY(),t),n(bAe(),t),n(yAe(),t);var r=Jh();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}})})(Ld)),Ld}var rB;function xAe(){return rB||(rB=1,(function(t){var e=Lo&&Lo.__createBinding||(Object.create?(function(A,C,j,_){_===void 0&&(_=j);var k=Object.getOwnPropertyDescriptor(C,j);(!k||("get"in k?!C.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return C[j]}}),Object.defineProperty(A,_,k)}):(function(A,C,j,_){_===void 0&&(_=j),A[_]=C[j]})),n=Lo&&Lo.__setModuleDefault||(Object.create?(function(A,C){Object.defineProperty(A,"default",{enumerable:!0,value:C})}):function(A,C){A.default=C}),r=Lo&&Lo.__importStar||(function(){var A=function(C){return A=Object.getOwnPropertyNames||function(j){var _=[];for(var k in j)Object.prototype.hasOwnProperty.call(j,k)&&(_[_.length]=k);return _},A(C)};return function(C){if(C&&C.__esModule)return C;var j={};if(C!=null)for(var _=A(C),k=0;k<_.length;k++)_[k]!=="default"&&e(j,C,_[k]);return n(j,C),j}})(),i=Lo&&Lo.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomUtils=t.getFeed=t.ElementType=t.QuoteType=t.Tokenizer=t.DefaultHandler=t.DomHandler=t.Parser=void 0,t.parseDocument=h,t.parseDOM=f,t.createDocumentStream=p,t.createDomStream=m,t.parseFeed=w;const s=ML();var o=ML();Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return o.Parser}});const l=Jh();var c=Jh();Object.defineProperty(t,"DomHandler",{enumerable:!0,get:function(){return c.DomHandler}}),Object.defineProperty(t,"DefaultHandler",{enumerable:!0,get:function(){return c.DomHandler}});function h(A,C){const j=new l.DomHandler(void 0,C);return new s.Parser(j,C).end(A),j.root}function f(A,C){return h(A,C).children}function p(A,C,j){const _=new l.DomHandler(k=>A(k,_.root),C,j);return new s.Parser(_,C)}function m(A,C,j){const _=new l.DomHandler(A,C,j);return new s.Parser(_,C)}var v=IY();Object.defineProperty(t,"Tokenizer",{enumerable:!0,get:function(){return i(v).default}}),Object.defineProperty(t,"QuoteType",{enumerable:!0,get:function(){return v.QuoteType}}),t.ElementType=r(ey());const y=lT();var x=lT();Object.defineProperty(t,"getFeed",{enumerable:!0,get:function(){return x.getFeed}});const S={xmlMode:!0};function w(A,C=S){return(0,y.getFeed)(f(A,C))}t.DomUtils=r(lT())})(Lo)),Lo}var cT,iB;function AAe(){return iB||(iB=1,cT=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}),cT}var cx={},sB;function wAe(){if(sB)return cx;sB=1,Object.defineProperty(cx,"__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 cx.isPlainObject=e,cx}var uT,aB;function SAe(){if(aB)return uT;aB=1;var t=function(A){return e(A)&&!n(A)};function e(w){return!!w&&typeof w=="object"}function n(w){var A=Object.prototype.toString.call(w);return A==="[object RegExp]"||A==="[object Date]"||s(w)}var r=typeof Symbol=="function"&&Symbol.for,i=r?Symbol.for("react.element"):60103;function s(w){return w.$$typeof===i}function o(w){return Array.isArray(w)?[]:{}}function l(w,A){return A.clone!==!1&&A.isMergeableObject(w)?x(o(w),w,A):w}function c(w,A,C){return w.concat(A).map(function(j){return l(j,C)})}function h(w,A){if(!A.customMerge)return x;var C=A.customMerge(w);return typeof C=="function"?C:x}function f(w){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(w).filter(function(A){return Object.propertyIsEnumerable.call(w,A)}):[]}function p(w){return Object.keys(w).concat(f(w))}function m(w,A){try{return A in w}catch{return!1}}function v(w,A){return m(w,A)&&!(Object.hasOwnProperty.call(w,A)&&Object.propertyIsEnumerable.call(w,A))}function y(w,A,C){var j={};return C.isMergeableObject(w)&&p(w).forEach(function(_){j[_]=l(w[_],C)}),p(A).forEach(function(_){v(w,_)||(m(w,_)&&C.isMergeableObject(A[_])?j[_]=h(_,C)(w[_],A[_],C):j[_]=l(A[_],C))}),j}function x(w,A,C){C=C||{},C.arrayMerge=C.arrayMerge||c,C.isMergeableObject=C.isMergeableObject||t,C.cloneUnlessOtherwiseSpecified=l;var j=Array.isArray(A),_=Array.isArray(w),k=j===_;return k?j?C.arrayMerge(w,A,C):y(w,A,C):l(A,C)}x.all=function(A,C){if(!Array.isArray(A))throw new Error("first argument should be an array");return A.reduce(function(j,_){return x(j,_,C)},{})};var S=x;return uT=S,uT}var eA={exports:{}},jAe=eA.exports,oB;function CAe(){return oB||(oB=1,(function(t){(function(e,n){t.exports?t.exports=n():e.parseSrcset=n()})(jAe,function(){return function(e){function n(j){return j===" "||j==="	"||j===`
`||j==="\f"||j==="\r"}function r(j){var _,k=j.exec(e.substring(S));if(k)return _=k[0],S+=_.length,_}for(var i=e.length,s=/^[ \t\n\r\u000c]+/,o=/^[, \t\n\r\u000c]+/,l=/^[^ \t\n\r\u000c]+/,c=/[,]+$/,h=/^\d+$/,f=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,p,m,v,y,x,S=0,w=[];;){if(r(o),S>=i)return w;p=r(l),m=[],p.slice(-1)===","?(p=p.replace(c,""),C()):A()}function A(){for(r(s),v="",y="in descriptor";;){if(x=e.charAt(S),y==="in descriptor")if(n(x))v&&(m.push(v),v="",y="after descriptor");else if(x===","){S+=1,v&&m.push(v),C();return}else if(x==="(")v=v+x,y="in parens";else if(x===""){v&&m.push(v),C();return}else v=v+x;else if(y==="in parens")if(x===")")v=v+x,y="in descriptor";else if(x===""){m.push(v),C();return}else v=v+x;else if(y==="after descriptor"&&!n(x))if(x===""){C();return}else y="in descriptor",S-=1;S+=1}}function C(){var j=!1,_,k,M,R,N={},I,D,L,z,P;for(R=0;R<m.length;R++)I=m[R],D=I[I.length-1],L=I.substring(0,I.length-1),z=parseInt(L,10),P=parseFloat(L),h.test(L)&&D==="w"?((_||k)&&(j=!0),z===0?j=!0:_=z):f.test(L)&&D==="x"?((_||k||M)&&(j=!0),P<0?j=!0:k=P):h.test(L)&&D==="h"?((M||k)&&(j=!0),z===0?j=!0:M=z):j=!0;j?console&&console.log&&console.log("Invalid srcset descriptor found in '"+e+"' at '"+I+"'."):(N.url=p,_&&(N.w=_),k&&(N.d=k),M&&(N.h=M),w.push(N))}}})})(eA)),eA.exports}var ux={exports:{}},lB;function _Ae(){if(lB)return ux.exports;lB=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 ux.exports=e(),ux.exports.createColors=e,ux.exports}const TAe={},kAe=Object.freeze(Object.defineProperty({__proto__:null,default:TAe},Symbol.toStringTag,{value:"Module"})),al=jP(kAe);var hT,cB;function C4(){if(cB)return hT;cB=1;let t=_Ae(),e=al;class n extends Error{constructor(i,s,o,l,c,h){super(i),this.name="CssSyntaxError",this.reason=i,c&&(this.file=c),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,c=v=>v;if(i){let{bold:v,gray:y,red:x}=t.createColors(!0);l=S=>v(x(S)),o=S=>y(S),e&&(c=S=>e(S))}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,y)=>{let x=f+1+y,S=" "+(" "+x).slice(-m)+" | ";if(x===this.line){if(v.length>160){let A=20,C=Math.max(0,this.column-A),j=Math.max(this.column+A,this.endColumn+A),_=v.slice(C,j),k=o(S.replace(/\d/g," "))+v.slice(0,Math.min(this.column-1,A-1)).replace(/[^\t]/g," ");return l(">")+o(S)+c(_)+`
 `+k+l("^")}let w=o(S.replace(/\d/g," "))+v.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+o(S)+c(v)+`
 `+w+l("^")}return" "+o(S)+c(v)}).join(`
`)}toString(){let i=this.showSourceCode();return i&&(i=`

`+i+`
`),this.name+": "+this.message+i}}return hT=n,n.default=n,hT}var dT,uB;function FY(){if(uB)return dT;uB=1;const t=/(<)(\/?style\b)/gi,e=/(<)(!--)/g;function n(o){return typeof o!="string"||!o.includes("<")?o:o.replace(t,"\\3c $2").replace(e,"\\3c $2")}const r={after:`
`,beforeClose:`
`,beforeComment:`
`,beforeDecl:`
`,beforeOpen:" ",beforeRule:`
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:"    ",semicolon:!1};function i(o){return o[0].toUpperCase()+o.slice(1)}class s{constructor(l){this.builder=l}atrule(l,c){let h=l.raws,f="@"+l.name,p=l.params?this.rawValue(l,"params"):"";if(typeof h.afterName<"u"?f+=h.afterName:p&&(f+=" "),l.nodes)this.block(l,f+p);else{let m=(h.between||"")+(c?";":"");this.builder(n(f+p+m),l)}}beforeAfter(l,c){let h;l.type==="decl"?h=this.raw(l,null,"beforeDecl"):l.type==="comment"?h=this.raw(l,null,"beforeComment"):c==="before"?h=this.raw(l,null,"beforeRule"):h=this.raw(l,null,"beforeClose");let f=l.parent,p=0;for(;f&&f.type!=="root";)p+=1,f=f.parent;if(h.includes(`
`)){let m=this.raw(l,null,"indent");if(m.length)for(let v=0;v<p;v++)h+=m}return h}block(l,c){let h=this.raw(l,"between","beforeOpen");this.builder(n(c+h)+"{",l,"start");let f;l.nodes&&l.nodes.length?(this.body(l),f=this.raw(l,"after")):f=this.raw(l,"after","emptyBody"),f&&this.builder(n(f)),this.builder("}",l,"end")}body(l){let c=l.nodes,h=c.length-1;for(;h>0&&c[h].type==="comment";)h-=1;let f=this.raw(l,"semicolon"),p=l.type==="document";for(let m=0;m<c.length;m++){let v=c[m],y=this.raw(v,"before");y&&this.builder(p?y:n(y)),this.stringify(v,h!==m||f)}}comment(l){let c=this.raw(l,"left","commentLeft"),h=this.raw(l,"right","commentRight");this.builder(n("/*"+c+l.text+h+"*/"),l)}decl(l,c){let h=l.raws,f=this.raw(l,"between","colon"),p=l.prop+f+this.rawValue(l,"value");l.important&&(p+=h.important||" !important"),c&&(p+=";"),this.builder(n(p),l)}document(l){this.body(l)}raw(l,c,h){let f;if(h||(h=c),c&&(f=l.raws[c],typeof f<"u"))return f;let p=l.parent;if(h==="before"&&(!p||p.type==="root"&&p.first===l||p&&p.type==="document"))return"";if(!p)return r[h];let m=l.root(),v=m.rawCache||(m.rawCache={});if(typeof v[h]<"u")return v[h];if(h==="before"||h==="after")return this.beforeAfter(l,h);{let y="raw"+i(h);this[y]?f=this[y](m,l):m.walk(x=>{if(f=x.raws[c],typeof f<"u")return!1})}return typeof f>"u"&&(f=r[h]),v[h]=f,f}rawBeforeClose(l){let c;return l.walk(h=>{if(h.nodes&&h.nodes.length>0&&typeof h.raws.after<"u")return c=h.raws.after,c.includes(`
`)&&(c=c.replace(/[^\n]+$/,"")),!1}),c&&(c=c.replace(/\S/g,"")),c}rawBeforeComment(l,c){let h;return l.walkComments(f=>{if(typeof f.raws.before<"u")return h=f.raws.before,h.includes(`
`)&&(h=h.replace(/[^\n]+$/,"")),!1}),typeof h>"u"?h=this.raw(c,null,"beforeDecl"):h&&(h=h.replace(/\S/g,"")),h}rawBeforeDecl(l,c){let h;return l.walkDecls(f=>{if(typeof f.raws.before<"u")return h=f.raws.before,h.includes(`
`)&&(h=h.replace(/[^\n]+$/,"")),!1}),typeof h>"u"?h=this.raw(c,null,"beforeRule"):h&&(h=h.replace(/\S/g,"")),h}rawBeforeOpen(l){let c;return l.walk(h=>{if(h.type!=="decl"&&(c=h.raws.between,typeof c<"u"))return!1}),c}rawBeforeRule(l){let c;return l.walk(h=>{if(h.nodes&&(h.parent!==l||l.first!==h)&&typeof h.raws.before<"u")return c=h.raws.before,c.includes(`
`)&&(c=c.replace(/[^\n]+$/,"")),!1}),c&&(c=c.replace(/\S/g,"")),c}rawColon(l){let c;return l.walkDecls(h=>{if(typeof h.raws.between<"u")return c=h.raws.between.replace(/[^\s:]/g,""),!1}),c}rawEmptyBody(l){let c;return l.walk(h=>{if(h.nodes&&h.nodes.length===0&&(c=h.raws.after,typeof c<"u"))return!1}),c}rawIndent(l){if(l.raws.indent)return l.raws.indent;let c;return l.walk(h=>{let f=h.parent;if(f&&f!==l&&f.parent&&f.parent===l&&typeof h.raws.before<"u"){let p=h.raws.before.split(`
`);return c=p[p.length-1],c=c.replace(/\S/g,""),!1}}),c}rawSemicolon(l){let c;return l.walk(h=>{if(h.nodes&&h.nodes.length&&h.last.type==="decl"&&(c=h.raws.semicolon,typeof c<"u"))return!1}),c}rawValue(l,c){let h=l[c],f=l.raws[c];return f&&f.value===h?f.raw:h}root(l){if(this.body(l),l.raws.after){let c=l.raws.after,h=l.parent&&l.parent.type==="document";this.builder(h?c:n(c))}}rule(l){this.block(l,this.rawValue(l,"selector")),l.raws.ownSemicolon&&this.builder(n(l.raws.ownSemicolon),l,"end")}stringify(l,c){if(!this[l.type])throw new Error("Unknown AST node type "+l.type+". Maybe you need to change PostCSS stringifier.");this[l.type](l,c)}}return dT=s,s.default=s,dT}var fT,hB;function dS(){if(hB)return fT;hB=1;let t=FY();function e(n,r){new t(r).stringify(n)}return fT=e,e.default=e,fT}var hx={},dB;function _4(){return dB||(dB=1,hx.isClean=Symbol("isClean"),hx.my=Symbol("my")),hx}var pT,fB;function fS(){if(fB)return pT;fB=1;let t=C4(),e=FY(),n=dS(),{isClean:r,my:i}=_4();function s(c,h){let f=new c.constructor;for(let p in c){if(!Object.prototype.hasOwnProperty.call(c,p)||p==="proxyCache")continue;let m=c[p],v=typeof m;p==="parent"&&v==="object"?h&&(f[p]=h):p==="source"?f[p]=m:Array.isArray(m)?f[p]=m.map(y=>s(y,f)):(v==="object"&&m!==null&&(m=s(m)),f[p]=m)}return f}function o(c,h){if(h&&typeof h.offset<"u")return h.offset;let f=1,p=1,m=0;for(let v=0;v<c.length;v++){if(p===h.line&&f===h.column){m=v;break}c[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),y=v+h;for(let x=v;x<y;x++)m[x]===`
`?(f=1,p+=1):f+=1;return{column:f,line:p,offset:y}}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 y=f.slice(o(f,this.source.start),o(f,this.source.end)).indexOf(h.word);y!==-1&&(p=this.positionInside(y),m=this.positionInside(y+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 y in this){if(!Object.prototype.hasOwnProperty.call(this,y)||y==="parent"||y==="proxyCache")continue;let x=this[y];if(Array.isArray(x))p[y]=x.map(S=>typeof S=="object"&&S.toJSON?S.toJSON(null,f):S);else if(typeof x=="object"&&x.toJSON)p[y]=x.toJSON(null,f);else if(y==="source"){if(x==null)continue;let S=f.get(x.input);S==null&&(S=v,f.set(x.input,v),v++),p[y]={end:x.end,inputId:S,start:x.start}}else p[y]=x}return m&&(p.inputs=[...f.keys()].map(y=>y.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 pT=l,l.default=l,pT}var mT,pB;function pS(){if(pB)return mT;pB=1;let t=fS();class e extends t{constructor(r){super(r),this.type="comment"}}return mT=e,e.default=e,mT}var gT,mB;function mS(){if(mB)return gT;mB=1;let t=fS();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 gT=e,e.default=e,gT}var vT,gB;function Hf(){if(gB)return vT;gB=1;let t=pS(),e=mS(),n=fS(),{isClean:r,my:i}=_4(),s,o,l,c;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 y of v){let x=this.normalize(y,this.last);for(let S of x)this.proxyOf.nodes.push(S)}return this.markDirty(),this}cleanRaws(v){if(super.cleanRaws(v),this.nodes)for(let y of this.nodes)y.cleanRaws(v)}each(v){if(!this.proxyOf.nodes)return;let y=this.getIterator(),x,S;for(;this.indexes[y]<this.proxyOf.nodes.length&&(x=this.indexes[y],S=v(this.proxyOf.nodes[x],x),S!==!1);)this.indexes[y]+=1;return delete this.indexes[y],S}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,y){return y==="proxyOf"?v:v[y]?y==="each"||typeof y=="string"&&y.startsWith("walk")?(...x)=>v[y](...x.map(S=>typeof S=="function"?(w,A)=>S(w.toProxy(),A):S)):y==="every"||y==="some"?x=>v[y]((S,...w)=>x(S.toProxy(),...w)):y==="root"?()=>v.root().toProxy():y==="nodes"?v.nodes.map(x=>x.toProxy()):y==="first"||y==="last"?v[y].toProxy():v[y]:v[y]},set(v,y,x){return v[y]===x||(v[y]=x,(y==="name"||y==="params"||y==="selector")&&v.markDirty()),!0}}}index(v){return typeof v=="number"?v:(v.proxyOf&&(v=v.proxyOf),this.proxyOf.nodes.indexOf(v))}insertAfter(v,y){let x=this.index(v),S=this.normalize(y,this.proxyOf.nodes[x]).reverse();x=this.index(v);for(let A of S)this.proxyOf.nodes.splice(x+1,0,A);let w;for(let A in this.indexes)w=this.indexes[A],x<w&&(this.indexes[A]=w+S.length);return this.markDirty(),this}insertBefore(v,y){let x=this.index(v),S=x===0?"prepend":!1,w=this.normalize(y,this.proxyOf.nodes[x],S).reverse();x=this.index(v);for(let C of w)this.proxyOf.nodes.splice(x,0,C);let A;for(let C in this.indexes)A=this.indexes[C],x<=A&&(this.indexes[C]=A+w.length);return this.markDirty(),this}normalize(v,y){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 S of v)S.parent&&S.parent.removeChild(S,"ignore")}else if(v.type==="root"&&this.type!=="document"){v=v.nodes.slice(0);for(let S of v)S.parent&&S.parent.removeChild(S,"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 c(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(S=>(S[i]||p.rebuild(S),S=S.proxyOf,S.parent&&S.parent.removeChild(S),S[r]&&f(S),S.raws||(S.raws={}),typeof S.raws.before>"u"&&y&&typeof y.raws.before<"u"&&(S.raws.before=y.raws.before.replace(/\S/g,"")),S.parent=this.proxyOf,S))}prepend(...v){v=v.reverse();for(let y of v){let x=this.normalize(y,this.first,"prepend").reverse();for(let S of x)this.proxyOf.nodes.unshift(S);for(let S in this.indexes)this.indexes[S]=this.indexes[S]+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 y;for(let x in this.indexes)y=this.indexes[x],y>=v&&(this.indexes[x]=y-1);return this.markDirty(),this}replaceValues(v,y,x){return x||(x=y,y={}),this.walkDecls(S=>{y.props&&!y.props.includes(S.prop)||y.fast&&!S.value.includes(y.fast)||(S.value=S.value.replace(v,x))}),this.markDirty(),this}some(v){return this.nodes.some(v)}walk(v){return this.each((y,x)=>{let S;try{S=v(y,x)}catch(w){throw y.addToError(w)}return S!==!1&&y.walk&&(S=y.walk(v)),S})}walkAtRules(v,y){return y?v instanceof RegExp?this.walk((x,S)=>{if(x.type==="atrule"&&v.test(x.name))return y(x,S)}):this.walk((x,S)=>{if(x.type==="atrule"&&x.name===v)return y(x,S)}):(y=v,this.walk((x,S)=>{if(x.type==="atrule")return y(x,S)}))}walkComments(v){return this.walk((y,x)=>{if(y.type==="comment")return v(y,x)})}walkDecls(v,y){return y?v instanceof RegExp?this.walk((x,S)=>{if(x.type==="decl"&&v.test(x.prop))return y(x,S)}):this.walk((x,S)=>{if(x.type==="decl"&&x.prop===v)return y(x,S)}):(y=v,this.walk((x,S)=>{if(x.type==="decl")return y(x,S)}))}walkRules(v,y){return y?v instanceof RegExp?this.walk((x,S)=>{if(x.type==="rule"&&v.test(x.selector))return y(x,S)}):this.walk((x,S)=>{if(x.type==="rule"&&x.selector===v)return y(x,S)}):(y=v,this.walk((x,S)=>{if(x.type==="rule")return y(x,S)}))}}return p.registerParse=m=>{o=m},p.registerRule=m=>{c=m},p.registerAtRule=m=>{s=m},p.registerRoot=m=>{l=m},vT=p,p.default=p,p.rebuild=m=>{m.type==="atrule"?Object.setPrototypeOf(m,s.prototype):m.type==="rule"?Object.setPrototypeOf(m,c.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)})},vT}var bT,vB;function T4(){if(vB)return bT;vB=1;let t=Hf();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 bT=e,e.default=e,t.registerAtRule(e),bT}var yT,bB;function k4(){if(bB)return yT;bB=1;let t=Hf(),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},yT=r,r.default=r,yT}var xT,yB;function OAe(){if(yB)return xT;yB=1;let t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return xT={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}},xT}var AT,xB;function $Y(){if(xB)return AT;xB=1;let{existsSync:t,readFileSync:e}=al,{dirname:n,join:r}=al,{SourceMapConsumer:i,SourceMapGenerator:s}=al;function o(c){return Buffer?Buffer.from(c,"base64").toString():window.atob(c)}class l{constructor(h,f){if(f.map===!1)return;f.unsafeMap&&(this.unsafeMap=!0),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.json||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,/,y=h.match(m)||h.match(v);if(y)return decodeURIComponent(h.substr(y[0].length));let x=h.match(f)||h.match(p);if(x)return o(h.substr(x[0].length));let S=h.slice(22);throw S=S.slice(0,S.indexOf(",")),new Error("Unsupported source map encoding "+S)}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,f,p){if(!(!p&&!this.unsafeMap&&!/\.map$/i.test(h))&&(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,h,!0);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;h&&(p=r(n(h),p));let m=this.loadFile(p,h,!1);if(m)try{this.json=JSON.parse(m.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return m}}}startWith(h,f){return h?h.substr(0,f.length)===f:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return AT=l,l.default=l,AT}var wT,AB;function gS(){if(AB)return wT;AB=1;let{nanoid:t}=OAe(),{isAbsolute:e,resolve:n}=al,{SourceMapConsumer:r,SourceMapGenerator:i}=al,{fileURLToPath:s,pathToFileURL:o}=al,l=C4(),c=$Y(),h=al,f=Symbol("lineToIndexCache"),p=!!(r&&i),m=!!(n&&e);function v(x){if(x[f])return x[f];let S=x.css.split(`
`),w=new Array(S.length),A=0;for(let C=0,j=S.length;C<j;C++)w[C]=A,A+=S[C].length+1;return x[f]=w,w}class y{get from(){return this.file||this.id}constructor(S,w={}){if(S===null||typeof S>"u"||typeof S=="object"&&!S.toString)throw new Error(`PostCSS received ${S} instead of CSS string`);if(this.css=S.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,w.document&&(this.document=w.document.toString()),w.from&&(!m||/^\w+:\/\//.test(w.from)||e(w.from)?this.file=w.from:this.file=n(w.from)),m&&p){let A=new c(this.css,w);if(A.text){this.map=A;let C=A.consumer().file;!this.file&&C&&(this.file=this.mapResolve(C))}}this.file||(this.id="<input css "+t(6)+">"),this.map&&(this.map.file=this.from)}error(S,w,A,C={}){let j,_,k,M,R;if(w&&typeof w=="object"){let I=w,D=A;if(typeof I.offset=="number"){M=I.offset;let L=this.fromOffset(M);w=L.line,A=L.col}else w=I.line,A=I.column,M=this.fromLineAndColumn(w,A);if(typeof D.offset=="number"){k=D.offset;let L=this.fromOffset(k);_=L.line,j=L.col}else _=D.line,j=D.column,k=this.fromLineAndColumn(D.line,D.column)}else if(A)M=this.fromLineAndColumn(w,A);else{M=w;let I=this.fromOffset(M);w=I.line,A=I.col}let N=this.origin(w,A,_,j);return N?R=new l(S,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,C.plugin):R=new l(S,_===void 0?w:{column:A,line:w},_===void 0?A:{column:j,line:_},this.css,this.file,C.plugin),R.input={column:A,endColumn:j,endLine:_,endOffset:k,line:w,offset:M,source:this.css},this.file&&(o&&(R.input.url=o(this.file).toString()),R.input.file=this.file),R}fromLineAndColumn(S,w){return v(this)[S-1]+w-1}fromOffset(S){let w=v(this),A=w[w.length-1],C=0;if(S>=A)C=w.length-1;else{let j=w.length-2,_;for(;C<j;)if(_=C+(j-C>>1),S<w[_])j=_-1;else if(S>=w[_+1])C=_+1;else{C=_;break}}return{col:S-w[C]+1,line:C+1}}mapResolve(S){return/^\w+:\/\//.test(S)?S:n(this.map.consumer().sourceRoot||this.map.root||".",S)}origin(S,w,A,C){if(!this.map)return!1;let j=this.map.consumer(),_=j.originalPositionFor({column:w,line:S});if(!_.source)return!1;let k;typeof A=="number"&&(k=j.originalPositionFor({column:C,line:A}));let M;e(_.source)?M=o(_.source):M=new URL(_.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let R={column:_.column,endColumn:k&&k.column,endLine:k&&k.line,line:_.line,url:M.toString()};if(M.protocol==="file:")if(s)R.file=s(M);else throw new Error("file: protocol is not available in this PostCSS build");let N=j.sourceContentFor(_.source);return N&&(R.source=N),R}toJSON(){let S={};for(let w of["hasBOM","css","file","id"])this[w]!=null&&(S[w]=this[w]);return this.map&&(S.map={...this.map},S.map.consumerCache&&(S.map.consumerCache=void 0)),S}}return wT=y,y.default=y,h&&h.registerInput&&h.registerInput(y),wT}var ST,wB;function ty(){if(wB)return ST;wB=1;let t=Hf(),e,n;class r extends t{constructor(s){super(s),this.type="root",this.nodes||(this.nodes=[])}normalize(s,o,l){let c=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 c)h.raws.before=o.raws.before}return c}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},ST=r,r.default=r,t.registerRoot(r),ST}var jT,SB;function HY(){if(SB)return jT;SB=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,c=!1,h="",f=!1;for(let p of e)f?f=!1:p==="\\"?f=!0:c?p===h&&(c=!1):p==='"'||p==="'"?(c=!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 jT=t,t.default=t,jT}var CT,jB;function O4(){if(jB)return CT;jB=1;let t=Hf(),e=HY();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 CT=n,n.default=n,t.registerRule(n),CT}var _T,CB;function EAe(){if(CB)return _T;CB=1;let t=T4(),e=pS(),n=mS(),r=gS(),i=$Y(),s=ty(),o=O4();function l(c,h){if(Array.isArray(c))return c.map(m=>l(m));let{inputs:f,...p}=c;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=c.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: "+c.type)}return _T=l,l.default=l,_T}var TT,_B;function zY(){if(_B)return TT;_B=1;let{dirname:t,relative:e,resolve:n,sep:r}=al,{SourceMapConsumer:i,SourceMapGenerator:s}=al,{pathToFileURL:o}=al,l=gS(),c=!!(i&&s),h=!!(t&&n&&e&&r);class f{constructor(m,v,y,x){this.stringify=m,this.mapOpts=y.map||{},this.root=v,this.opts=y,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)),y=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(y)))}}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 if(this.css){let m;for(;(m=this.css.lastIndexOf("/*#"))!==-1;){let v=this.css.indexOf("*/",m+3);if(v===-1)break;for(;m>0&&this.css[m-1]===`
`;)m--;this.css=this.css.slice(0,m)+this.css.slice(v+2)}}}}generate(){if(this.clearAnnotation(),h&&c&&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,y="<no source>",x={generated:{column:0,line:0},original:{column:0,line:0},source:""},S,w;this.stringify(this.root,(A,C,j)=>{if(this.css+=A,C&&j!=="end"&&(x.generated.line=m,x.generated.column=v-1,C.source&&C.source.start?(x.source=this.sourcePath(C),x.original.line=C.source.start.line,x.original.column=C.source.start.column-1,this.map.addMapping(x)):(x.source=y,x.original.line=1,x.original.column=0,this.map.addMapping(x))),w=A.match(/\n/g),w?(m+=w.length,S=A.lastIndexOf(`
`),v=A.length-S):v+=A.length,C&&j!=="start"){let _=C.parent||{raws:{}};(!(C.type==="decl"||C.type==="atrule"&&!C.nodes)||C!==_.last||_.raws.semicolon)&&(C.source&&C.source.end?(x.source=this.sourcePath(C),x.original.line=C.source.end.line,x.original.column=C.source.end.column-1,x.generated.line=m,x.generated.column=v-2,this.map.addMapping(x)):(x.source=y,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 y=this.opts.to?t(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(y=t(n(y,this.mapOpts.annotation)));let x=e(y,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 y=v.source.input.from;if(y&&!m[y]){m[y]=!0;let x=this.usesFileUrls?this.toFileUrl(y):this.toUrl(this.path(y));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 y=o(m).toString();return this.memoizedFileURLs.set(m,y),y}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 y=encodeURI(m).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(m,y),y}}return TT=f,TT}var kT,TB;function MAe(){if(TB)return kT;TB=1;const t=39,e=34,n=92,r=47,i=10,s=32,o=12,l=9,c=13,h=91,f=93,p=40,m=41,v=123,y=125,x=59,S=42,w=58,A=64,C=/[\t\n\f\r "#'()/;[\\\]{}]/g,j=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,_=/.[\r\n"'(/\\]/,k=/[\da-f]/i;return kT=function(R,N={}){let I=R.css.valueOf(),D=N.ignoreErrors,L,z,P,H,B,F,q,X,Y,U,V=I.length,G=0,J=[],ne=[],de=-1;function fe(){return G}function ke(ie){throw R.error("Unclosed "+ie,G)}function Me(){return ne.length===0&&G>=V}function Oe(ie){if(ne.length)return ne.pop();if(G>=V)return;let Se=ie?ie.ignoreUnclosed:!1;switch(L=I.charCodeAt(G),L){case i:case s:case l:case c:case o:{H=G;do H+=1,L=I.charCodeAt(H);while(L===s||L===i||L===l||L===c||L===o);F=["space",I.slice(G,H)],G=H-1;break}case h:case f:case v:case y:case w:case x:case m:{let se=String.fromCharCode(L);F=[se,se,G];break}case p:{if(U=J.length?J.pop()[1]:"",Y=I.charCodeAt(G+1),U==="url"&&Y!==t&&Y!==e&&Y!==s&&Y!==i&&Y!==l&&Y!==o&&Y!==c){H=G;do{if(q=!1,H=I.indexOf(")",H+1),H===-1)if(D||Se){H=G;break}else ke("bracket");for(X=H;I.charCodeAt(X-1)===n;)X-=1,q=!q}while(q);F=["brackets",I.slice(G,H+1),G,H],G=H}else G<=de?F=["(","(",G]:(H=I.indexOf(")",G+1),z=I.slice(G,H+1),H===-1||_.test(z)?(de=H===-1?V:H,F=["(","(",G]):(F=["brackets",z,G,H],G=H));break}case t:case e:{B=L===t?"'":'"',H=G;do{if(q=!1,H=I.indexOf(B,H+1),H===-1)if(D||Se){H=G+1;break}else ke("string");for(X=H;I.charCodeAt(X-1)===n;)X-=1,q=!q}while(q);F=["string",I.slice(G,H+1),G,H],G=H;break}case A:{C.lastIndex=G+1,C.test(I),C.lastIndex===0?H=I.length-1:H=C.lastIndex-2,F=["at-word",I.slice(G,H+1),G,H],G=H;break}case n:{for(H=G,P=!0;I.charCodeAt(H+1)===n;)H+=1,P=!P;if(L=I.charCodeAt(H+1),P&&L!==r&&L!==s&&L!==i&&L!==l&&L!==c&&L!==o&&(H+=1,k.test(I.charAt(H)))){for(;k.test(I.charAt(H+1));)H+=1;I.charCodeAt(H+1)===s&&(H+=1)}F=["word",I.slice(G,H+1),G,H],G=H;break}default:{L===r&&I.charCodeAt(G+1)===S?(H=I.indexOf("*/",G+2)+1,H===0&&(D||Se?H=I.length:ke("comment")),F=["comment",I.slice(G,H+1),G,H],G=H):(j.lastIndex=G+1,j.test(I),j.lastIndex===0?H=I.length-1:H=j.lastIndex-2,F=["word",I.slice(G,H+1),G,H],J.push(F),G=H);break}}return G++,F}function Ye(ie){ne.push(ie)}return{back:Ye,endOfFile:Me,nextToken:Oe,position:fe}},kT}var OT,kB;function RAe(){if(kB)return OT;kB=1;let t=T4(),e=pS(),n=mS(),r=ty(),i=O4(),s=MAe();const o={empty:!0,space:!0};function l(f){for(let p=f.length-1;p>=0;p--){let m=f[p],v=m[3]||m[2];if(v)return v}}function c(f,p,m){let v="";for(let y=p;y<m;y++)v+=f[y][1];return v}class h{constructor(p){this.input=p,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:p,start:{column:1,line:1,offset:0}}}atrule(p){let m=new t;m.name=p[1].slice(1),m.name===""&&this.unnamedAtrule(m,p),this.init(m,p[2]);let v,y,x,S=!1,w=!1,A=[],C=[];for(;!this.tokenizer.endOfFile();){if(p=this.tokenizer.nextToken(),v=p[0],v==="("||v==="["?C.push(v==="("?")":"]"):v==="{"&&C.length>0?C.push("}"):v===C[C.length-1]&&C.pop(),C.length===0)if(v===";"){m.source.end=this.getPosition(p[2]),m.source.end.offset++,this.semicolon=!0;break}else if(v==="{"){w=!0;break}else if(v==="}"){if(A.length>0){for(x=A.length-1,y=A[x];y&&y[0]==="space";)y=A[--x];y&&(m.source.end=this.getPosition(y[3]||y[2]),m.source.end.offset++)}this.end(p);break}else A.push(p);else A.push(p);if(this.tokenizer.endOfFile()){S=!0;break}}m.raws.between=this.spacesAndCommentsFromEnd(A),A.length?(m.raws.afterName=this.spacesAndCommentsFromStart(A),this.raw(m,"params",A),S&&(p=A[A.length-1],m.source.end=this.getPosition(p[3]||p[2]),m.source.end.offset++,this.spaces=m.raws.between,m.raws.between="")):(m.raws.afterName="",m.params=""),w&&(m.nodes=[],this.current=m)}checkMissedSemicolon(p){let m=this.colon(p);if(m===!1)return;let v=0,y;for(let x=m-1;x>=0&&(y=p[x],!(y[0]!=="space"&&(v+=1,v===2)));x--);throw this.input.error("Missed semicolon",y[0]==="word"?y[3]+1:y[2])}colon(p){let m=0,v,y,x;for(let[S,w]of p.entries()){if(y=w,x=y[0],x==="("&&(m+=1),x===")"&&(m-=1),m===0&&x===":")if(!v)this.doubleColon(y);else{if(v[0]==="word"&&v[1]==="progid")continue;return S}v=y}return!1}comment(p){let m=new e;this.init(m,p[2]),m.source.end=this.getPosition(p[3]||p[2]),m.source.end.offset++;let v=p[1].slice(2,-2);if(!v.trim())m.text="",m.raws.left=v,m.raws.right="";else{let y=v.match(/^(\s*)([^]*\S)(\s*)$/);m.text=y[2],m.raws.left=y[1],m.raws.right=y[3]}}createTokenizer(){this.tokenizer=s(this.input)}decl(p,m){let v=new n;this.init(v,p[0][2]);let y=p[p.length-1];y[0]===";"&&(this.semicolon=!0,p.pop()),v.source.end=this.getPosition(y[3]||y[2]||l(p)),v.source.end.offset++;let x=0;for(;p[x][0]!=="word";)x===p.length-1&&this.unknownWord([p[x]]),x++;v.raws.before+=c(p,0,x),v.source.start=this.getPosition(p[x][2]);let S=x;for(;x<p.length;){let k=p[x][0];if(k===":"||k==="space"||k==="comment")break;x++}v.prop=c(p,S,x);let w=x,A;for(;x<p.length&&(A=p[x],x++,A[0]!==":");)A[0]==="word"&&/\w/.test(A[1])&&this.unknownWord([A]);v.raws.between=c(p,w,x),(v.prop[0]==="_"||v.prop[0]==="*")&&(v.raws.before+=v.prop[0],v.prop=v.prop.slice(1));let C=x;for(;x<p.length;){let k=p[x][0];if(k!=="space"&&k!=="comment")break;x++}let j=p.slice(C,x);p=p.slice(x),this.precheckMissedSemicolon(p);for(let k=p.length-1;k>=0;k--){if(A=p[k],A[1].toLowerCase()==="!important"){v.important=!0;let M=this.stringFrom(p,k);M=this.spacesFromEnd(p)+M,M!==" !important"&&(v.raws.important=M);break}else if(A[1].toLowerCase()==="important"){let M=p.slice(0),R="";for(let N=k;N>0;N--){let I=M[N][0];if(R.trim().startsWith("!")&&I!=="space")break;R=M.pop()[1]+R}R.trim().startsWith("!")&&(v.important=!0,v.raws.important=R,p=M)}if(A[0]!=="space"&&A[0]!=="comment")break}p.some(k=>k[0]!=="space"&&k[0]!=="comment")&&(v.raws.between+=j.map(k=>k[1]).join(""),j=[]),this.raw(v,"value",j.concat(p),m),v.value.includes(":")&&!m&&this.checkMissedSemicolon(p)}doubleColon(p){throw this.input.error("Double colon",{offset:p[2]},{offset:p[2]+p[1].length})}emptyRule(p){let m=new i;this.init(m,p[2]),m.selector="",m.raws.between="",this.current=m}end(p){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(p[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(p)}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(p){if(this.spaces+=p[1],this.current.nodes){let m=this.current.nodes[this.current.nodes.length-1];m&&m.type==="rule"&&!m.raws.ownSemicolon&&(m.raws.ownSemicolon=this.spaces,this.spaces="",m.source.end=this.getPosition(p[2]),m.source.end.offset+=m.raws.ownSemicolon.length)}}getPosition(p){let m=this.input.fromOffset(p);return{column:m.col,line:m.line,offset:p}}init(p,m){this.current.push(p),p.source={input:this.input,start:this.getPosition(m)},p.raws.before=this.spaces,this.spaces="",p.type!=="comment"&&(this.semicolon=!1)}other(p){let m=!1,v=null,y=!1,x=null,S=[],w=p[1].startsWith("--"),A=[],C=p;for(;C;){if(v=C[0],A.push(C),v==="("||v==="[")x||(x=C),S.push(v==="("?")":"]");else if(w&&y&&v==="{")x||(x=C),S.push("}");else if(S.length===0)if(v===";")if(y){this.decl(A,w);return}else break;else if(v==="{"){this.rule(A);return}else if(v==="}"){this.tokenizer.back(A.pop()),m=!0;break}else v===":"&&(y=!0);else v===S[S.length-1]&&(S.pop(),S.length===0&&(x=null));C=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(m=!0),S.length>0&&this.unclosedBracket(x),m&&y){if(!w)for(;A.length&&(C=A[A.length-1][0],!(C!=="space"&&C!=="comment"));)this.tokenizer.back(A.pop());this.decl(A,w)}else this.unknownWord(A)}parse(){let p;for(;!this.tokenizer.endOfFile();)switch(p=this.tokenizer.nextToken(),p[0]){case"space":this.spaces+=p[1];break;case";":this.freeSemicolon(p);break;case"}":this.end(p);break;case"comment":this.comment(p);break;case"at-word":this.atrule(p);break;case"{":this.emptyRule(p);break;default:this.other(p);break}this.endFile()}precheckMissedSemicolon(){}raw(p,m,v,y){let x,S,w=v.length,A="",C=!0,j,_;for(let k=0;k<w;k+=1)x=v[k],S=x[0],S==="space"&&k===w-1&&!y?C=!1:S==="comment"?(_=v[k-1]?v[k-1][0]:"empty",j=v[k+1]?v[k+1][0]:"empty",!o[_]&&!o[j]?A.slice(-1)===","?C=!1:A+=x[1]:C=!1):A+=x[1];if(!C){let k=v.reduce((M,R)=>M+R[1],"");p.raws[m]={raw:k,value:A}}p[m]=A}rule(p){p.pop();let m=new i;this.init(m,p[0][2]),m.raws.between=this.spacesAndCommentsFromEnd(p),this.raw(m,"selector",p),this.current=m}spacesAndCommentsFromEnd(p){let m,v="";for(;p.length&&(m=p[p.length-1][0],!(m!=="space"&&m!=="comment"));)v=p.pop()[1]+v;return v}spacesAndCommentsFromStart(p){let m,v="";for(;p.length&&(m=p[0][0],!(m!=="space"&&m!=="comment"));)v+=p.shift()[1];return v}spacesFromEnd(p){let m,v="";for(;p.length&&(m=p[p.length-1][0],m==="space");)v=p.pop()[1]+v;return v}stringFrom(p,m){let v="";for(let y=m;y<p.length;y++)v+=p[y][1];return p.splice(m,p.length-m),v}unclosedBlock(){let p=this.current.source.start;throw this.input.error("Unclosed block",p.line,p.column)}unclosedBracket(p){throw this.input.error("Unclosed bracket",{offset:p[2]},{offset:p[2]+1})}unexpectedClose(p){throw this.input.error("Unexpected }",{offset:p[2]},{offset:p[2]+1})}unknownWord(p){throw this.input.error("Unknown word "+p[0][1],{offset:p[0][2]},{offset:p[0][2]+p[0][1].length})}unnamedAtrule(p,m){throw this.input.error("At-rule without name",{offset:m[2]},{offset:m[2]+m[1].length})}}return OT=h,OT}var ET,OB;function E4(){if(OB)return ET;OB=1;let t=Hf(),e=gS(),n=RAe();function r(i,s){let o=new e(i,s),l=new n(o);try{l.parse()}catch(c){throw c}return l.root}return ET=r,r.default=r,t.registerParse(r),ET}var MT,EB;function qY(){if(EB)return MT;EB=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 MT=t,t.default=t,MT}var RT,MB;function M4(){if(MB)return RT;MB=1;let t=qY();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 RT=e,e.default=e,RT}var DT,RB;function QY(){if(RB)return DT;RB=1;let t=Hf(),e=k4(),n=zY(),r=E4(),i=M4(),s=ty(),o=dS(),{isClean:l,my:c}=_4();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(C){return typeof C=="object"&&typeof C.then=="function"}function y(C){let j=!1,_=h[C.type];return C.type==="decl"?j=C.prop.toLowerCase():C.type==="atrule"&&(j=C.name.toLowerCase()),j&&C.append?[_,_+"-"+j,m,_+"Exit",_+"Exit-"+j]:j?[_,_+"-"+j,_+"Exit",_+"Exit-"+j]:C.append?[_,m,_+"Exit"]:[_,_+"Exit"]}function x(C){let j;return C.type==="document"?j=["Document",m,"DocumentExit"]:C.type==="root"?j=["Root",m,"RootExit"]:j=y(C),{eventIndex:0,events:j,iterator:0,node:C,visitorIndex:0,visitors:[]}}function S(C){return C[l]=!1,C.nodes&&C.nodes.forEach(j=>S(j)),C}let w={};class A{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(j,_,k){this.stringified=!1,this.processed=!1;let M;if(typeof _=="object"&&_!==null&&(_.type==="root"||_.type==="document"))M=S(_);else if(_ instanceof A||_ instanceof i)M=S(_.root),_.map&&(typeof k.map>"u"&&(k.map={}),k.map.inline||(k.map.inline=!1),k.map.prev=_.map);else{let R=r;k.syntax&&(R=k.syntax.parse),k.parser&&(R=k.parser),R.parse&&(R=R.parse);try{M=R(_,k)}catch(N){this.processed=!0,this.error=N}M&&!M[c]&&t.rebuild(M)}this.result=new i(j,M,k),this.helpers={...w,postcss:w,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(j){return this.async().catch(j)}finally(j){return this.async().then(j,j)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(j,_){let k=this.result.lastPlugin;try{_&&_.addToError(j),this.error=j,j.name==="CssSyntaxError"&&!j.plugin?(j.plugin=k.postcssPlugin,j.setMessage()):k.postcssVersion}catch(M){console&&console.error&&console.error(M)}return j}prepareVisitors(){this.listeners={};let j=(_,k,M)=>{this.listeners[k]||(this.listeners[k]=[]),this.listeners[k].push([_,M])};for(let _ of this.plugins)if(typeof _=="object")for(let k in _){if(!f[k]&&/^[A-Z]/.test(k))throw new Error(`Unknown event ${k} in ${_.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[k])if(typeof _[k]=="object")for(let M in _[k])M==="*"?j(_,k,_[k][M]):j(_,k+"-"+M.toLowerCase(),_[k][M]);else typeof _[k]=="function"&&j(_,k,_[k])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let j=0;j<this.plugins.length;j++){let _=this.plugins[j],k=this.runOnRoot(_);if(v(k))try{await k}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let j=this.result.root;for(;!j[l];){j[l]=!0;let _=[x(j)];for(;_.length>0;){let k=this.visitTick(_);if(v(k))try{await k}catch(M){let R=_[_.length-1].node;throw this.handleError(M,R)}}}if(this.listeners.OnceExit)for(let[_,k]of this.listeners.OnceExit){this.result.lastPlugin=_;try{if(j.type==="document"){let M=j.nodes.map(R=>k(R,this.helpers));await Promise.all(M)}else await k(j,this.helpers)}catch(M){throw this.handleError(M)}}}return this.processed=!0,this.stringify()}runOnRoot(j){this.result.lastPlugin=j;try{if(typeof j=="object"&&j.Once){if(this.result.root.type==="document"){let _=this.result.root.nodes.map(k=>j.Once(k,this.helpers));return v(_[0])?Promise.all(_):_}return j.Once(this.result.root,this.helpers)}else if(typeof j=="function")return j(this.result.root,this.result)}catch(_){throw this.handleError(_)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let j=this.result.opts,_=o;j.syntax&&(_=j.syntax.stringify),j.stringifier&&(_=j.stringifier),_.stringify&&(_=_.stringify);let k=this.result.root.source;if(j.map===void 0&&!(k&&k.input&&k.input.map)){let N="";return _(this.result.root,I=>{N+=I}),this.result.css=N,this.result}let R=new n(_,this.result.root,this.result.opts).generate();return this.result.css=R[0],this.result.map=R[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 j of this.plugins){let _=this.runOnRoot(j);if(v(_))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let j=this.result.root;for(;!j[l];)j[l]=!0,this.walkSync(j);if(this.listeners.OnceExit)if(j.type==="document")for(let _ of j.nodes)this.visitSync(this.listeners.OnceExit,_);else this.visitSync(this.listeners.OnceExit,j)}return this.result}then(j,_){return this.async().then(j,_)}toString(){return this.css}visitSync(j,_){for(let[k,M]of j){this.result.lastPlugin=k;let R;try{R=M(_,this.helpers)}catch(N){throw this.handleError(N,_.proxyOf)}if(_.type!=="root"&&_.type!=="document"&&!_.parent)return!0;if(v(R))throw this.getAsyncError()}}visitTick(j){let _=j[j.length-1],{node:k,visitors:M}=_;if(k.type!=="root"&&k.type!=="document"&&!k.parent){j.pop();return}if(M.length>0&&_.visitorIndex<M.length){let[N,I]=M[_.visitorIndex];_.visitorIndex+=1,_.visitorIndex===M.length&&(_.visitors=[],_.visitorIndex=0),this.result.lastPlugin=N;try{return I(k.toProxy(),this.helpers)}catch(D){throw this.handleError(D,k)}}if(_.iterator!==0){let N=_.iterator,I;for(;I=k.nodes[k.indexes[N]];)if(k.indexes[N]+=1,!I[l]){I[l]=!0,j.push(x(I));return}_.iterator=0,delete k.indexes[N]}let R=_.events;for(;_.eventIndex<R.length;){let N=R[_.eventIndex];if(_.eventIndex+=1,N===m){k.nodes&&k.nodes.length&&(k[l]=!0,_.iterator=k.getIterator());return}else if(this.listeners[N]){_.visitors=this.listeners[N];return}}j.pop()}walkSync(j){j[l]=!0;let _=y(j);for(let k of _)if(k===m)j.nodes&&j.each(M=>{M[l]||this.walkSync(M)});else{let M=this.listeners[k];if(M&&this.visitSync(M,j.toProxy()))return}}warnings(){return this.sync().warnings()}}return A.registerPostcss=C=>{w=C},DT=A,A.default=A,s.registerLazyResult(A),e.registerLazyResult(A),DT}var NT,DB;function DAe(){if(DB)return NT;DB=1;let t=zY(),e=E4(),n=M4(),r=dS();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(c){this.error=c}if(this.error)throw this.error;return this._root=o,o}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(o,l,c){l=l.toString(),this.stringified=!1,this._processor=o,this._css=l,this._opts=c,this._map=void 0;let h=r;this.result=new n(this._processor,void 0,this._opts),this.result.css=l;let f=this;Object.defineProperty(this.result,"root",{get(){return f.root}});let p=new t(h,void 0,this._opts,l);if(p.isMap()){let[m,v]=p.generate();m&&(this.result.css=m),v&&(this.result.map=v)}else p.clearAnnotation(),this.result.css=p.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 NT=i,i.default=i,NT}var IT,NB;function NAe(){if(NB)return IT;NB=1;let t=k4(),e=QY(),n=DAe(),r=ty();class i{constructor(o=[]){this.version="8.5.15",this.plugins=this.normalize(o)}normalize(o){let l=[];for(let c of o)if(c.postcss===!0?c=c():c.postcss&&(c=c.postcss),typeof c=="object"&&Array.isArray(c.plugins))l=l.concat(c.plugins);else if(typeof c=="object"&&c.postcssPlugin)l.push(c);else if(typeof c=="function")l.push(c);else if(!(typeof c=="object"&&(c.parse||c.stringify)))throw new Error(c+" 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 IT=i,i.default=i,r.registerProcessor(i),t.registerProcessor(i),IT}var LT,IB;function IAe(){if(IB)return LT;IB=1;var t={};let e=T4(),n=pS(),r=Hf(),i=C4(),s=mS(),o=k4(),l=EAe(),c=gS(),h=QY(),f=HY(),p=fS(),m=E4(),v=NAe(),y=M4(),x=ty(),S=O4(),w=dS(),A=qY();function C(...j){return j.length===1&&Array.isArray(j[0])&&(j=j[0]),new v(j)}return C.plugin=function(_,k){let M=!1;function R(...I){console&&console.warn&&!M&&(M=!0,console.warn(_+`: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),t.LANG&&t.LANG.startsWith("cn")&&console.warn(_+`: 里面 postcss.plugin 被弃用. 迁移指南:
https://www.w3ctech.com/topic/2226`));let D=k(...I);return D.postcssPlugin=_,D.postcssVersion=new v().version,D}let N;return Object.defineProperty(R,"postcss",{get(){return N||(N=R()),N}}),R.process=function(I,D,L){return C([R(L)]).process(I,D)},R},C.stringify=w,C.parse=m,C.fromJSON=l,C.list=f,C.comment=j=>new n(j),C.atRule=j=>new e(j),C.decl=j=>new s(j),C.rule=j=>new S(j),C.root=j=>new x(j),C.document=j=>new o(j),C.CssSyntaxError=i,C.Declaration=s,C.Container=r,C.Processor=v,C.Document=o,C.Comment=n,C.Warning=A,C.AtRule=e,C.Result=y,C.Input=c,C.Rule=S,C.Root=x,C.Node=p,h.registerPostcss(C),LT=C,C.default=C,LT}var dx={exports:{}},LB;function LAe(){if(LB)return dx.exports;LB=1;const t=Xz();function e(r){for(r=r.replace(/[\x00-\x20]+/g,"");;){const i=r.indexOf("<!--");if(i===-1)break;const s=r.indexOf("-->",i+4);if(s===-1)break;r=r.substring(0,i)+r.substring(s+3)}return r}function n(r,i){i=i||{};const s=i.allowedSchemes||["http","https","ftp","mailto","tel","sms"],o=i.allowProtocolRelative!==!1;if(typeof r!="string")return!1;r=e(r);const l=r.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!l)return r.match(/^[/\\]{2}/)?!o:!1;const c=l[1].toLowerCase();return s.indexOf(c)===-1}return dx.exports=function(r){const i={};return i.options=r||{},i.filterTag=i.options.filterTag||function(s){return s=s.trim(),s.toLowerCase()},i.string=function(s,o){return typeof s!="string"&&(typeof s=="number"||typeof s=="boolean"?s+="":s=""),s=s.trim(),o!==void 0&&s===""&&(s=o),s},i.strings=function(s){return Array.isArray(s)?s.map(function(o){return i.string(o)}):[]},i.integer=function(s,o,l,c){if(o===void 0&&(o=0),typeof s=="number")s=Math.floor(s);else try{s=parseInt(s,10),isNaN(s)&&(s=o)}catch{s=o}return typeof l=="number"&&s<l&&(s=l),typeof c=="number"&&s>c&&(s=c),s},i.padInteger=function(s,o){let l=s+"";for(;l.length<o;)l="0"+l;return l},i.float=function(s,o,l,c){if(o===void 0&&(o=0),typeof s!="number")try{s=parseFloat(s,10),isNaN(s)&&(s=o)}catch{s=o}return typeof l=="number"&&s<l&&(s=l),typeof c=="number"&&s>c&&(s=c),s},i.naughtyHref=n,i.url=function(s,o,l){if(s=i.string(s,o),s===o)return s;if(s=e(s),n(s)||(s=c(s),s===null))return o;return s;function c(h){return h.match(/^(((https?|ftp):\/\/)|((mailto|tel|sms):)|#|([^/.]+)?\/|[^/.]+$)/)?h:h.match(/^[^/.]+\.[^/.]+/)?(l?"https://":"http://")+h:null}},i.select=function(s,o,l){if(s=i.string(s),!o||!o.length)return l;let c;return typeof o[0]=="object"?(c=o.find(function(h){return h.value===null||h.value===void 0?!1:h.value.toString()===s}),c!=null?c.value:l):(c=o.find(function(h){return h==null?!1:h.toString()===s}),c!==void 0?c:l)},i.boolean=function(s,o){return s===!0?!0:s===!1?!1:(s=i.string(s,o),s===o?s===void 0?!1:s:(s=s.toLowerCase().charAt(0),s===""||s==="n"||s==="0"||s==="f"?!1:s==="t"||s==="y"||s==="1"))},i.addBooleanFilterToCriteria=function(s,o,l,c){c===void 0&&(c=null);let h=typeof s=="object"&&s!==null?s[o]:s;h=h===void 0?c:h,h=i.booleanOrNull(h),h===null||(h?l[o]=!0:l[o]={$ne:!0})},i.booleanOrNull=function(s,o){return s===!0||s===!1||s===null?s:(s=i.string(s,o),s===o?o===void 0?null:s:s==="null"?null:(s=s.toLowerCase().charAt(0),s===""||s==="n"||s==="0"||s==="f"?!1:s==="t"||s==="y"||s==="1"?!0:s==="a"?null:o))},i.date=function(s,o,l){let c;function h(){return o===void 0&&(o=t().format("YYYY-MM-DD")),o}if(typeof s=="string"){if(s.match(/\//)){if(c=s.split("/"),c.length===2)return(l||new Date).getFullYear()+"-"+i.padInteger(c[0],2)+"-"+i.padInteger(c[1],2);if(c.length===3){if(c[2]<100){const f=l||new Date,p=f.getFullYear()%100,m=f.getFullYear()-p;let v=parseInt(c[2])+m;v-f.getFullYear()>50&&(v-=100),c[2]=v}return i.padInteger(c[2],4)+"-"+i.padInteger(c[0],2)+"-"+i.padInteger(c[1],2)}else return h()}else if(s.match(/-/))return c=s.split("-"),c.length===2?(l||new Date).getFullYear()+"-"+i.padInteger(c[0],2)+"-"+i.padInteger(c[1],2):c.length===3?i.padInteger(c[0],4)+"-"+i.padInteger(c[1],2)+"-"+i.padInteger(c[2],2):h()}try{return s===null||(s=l||new Date(s),isNaN(s.getTime()))?h():s.getFullYear()+"-"+i.padInteger(s.getMonth()+1,2)+"-"+i.padInteger(s.getDate(),2)}catch{return h()}},i.formatDate=function(s){return t(s).format("YYYY-MM-DD")},i.time=function(s,o){s=i.string(s).toLowerCase(),s=s.trim();const l=s.match(/^(\d+)([:|.](\d+))?([:|.](\d+))?\s*(am|pm|AM|PM|a|p|A|M)?$/);if(l){let c=parseInt(l[1],10);const h=l[3]!==void 0?parseInt(l[3],10):0,f=l[5]!==void 0?parseInt(l[5],10):0;let p=l[6]?l[6].toLowerCase():l[6];return p=p&&p.charAt(0),c===12&&p==="a"?c-=12:c===12&&p==="p"||p==="p"&&(c+=12),(c===24||c==="24")&&(c=0),i.padInteger(c,2)+":"+i.padInteger(h,2)+":"+i.padInteger(f,2)}else return o!==void 0?o:t().format("HH:mm")},i.formatTime=function(s){return t(s).format("HH:mm:ss")},i.tags=function(s,o){return typeof s=="string"&&(s=s.split(/,\s*/)),Array.isArray(s)?s.map(f=>i.string(f)).map(o||i.filterTag).filter(f=>f.length>0):[]},i.idRegExp=i.options.idRegExp||/^[A-Za-z0-9_]+$/,i.id=function(s,o){const l=i.string(s,o);return l===o||l.match(i.idRegExp)?l:o},i.ids=function(s){return Array.isArray(s)?s.filter(function(l){return i.id(l)!==void 0}):[]},i},dx.exports.naughtyHref=n,dx.exports}var BT,BB;function BAe(){if(BB)return BT;BB=1;const t=xAe(),e=AAe(),{isPlainObject:n}=wAe(),r=SAe(),i=CAe(),{parse:s}=IAe(),{naughtyHref:o}=LAe(),l=["img","audio","video","picture","svg","object","map","iframe","embed"],c=["script","style"];function h(w,A){w&&Object.keys(w).forEach(function(C){A(w[C],C)})}function f(w,A){return{}.hasOwnProperty.call(w,A)}function p(w,A){const C=[];return h(w,function(j){A(j)&&C.push(j)}),C}function m(w){for(const A in w)if(f(w,A))return!1;return!0}function v(w){return w.map(function(A){if(!A.url)throw new Error("URL missing");return A.url+(A.w?` ${A.w}w`:"")+(A.h?` ${A.h}h`:"")+(A.d?` ${A.d}x`:"")}).join(", ")}BT=x;const y=/^[^\0\t\n\f\r /<=>]+$/;function x(w,A,C){if(w==null)return"";typeof w=="number"&&(w=w.toString());let j="",_="";function k(ie,Se){const se=this;this.tag=ie,this.attribs=Se||{},this.tagPosition=j.length,this.text="",this.openingTagLength=0,this.mediaChildren=[],this.updateParentNodeText=function(){if(F.length){const _e=F[F.length-1];_e.text+=se.text}},this.updateParentNodeMediaChildren=function(){F.length&&l.includes(this.tag)&&F[F.length-1].mediaChildren.push(this.tag)}}A=Object.assign({},x.defaults,A),A.parser=Object.assign({},S,A.parser);const M=function(ie){return A.allowedTags===!1||(A.allowedTags||[]).indexOf(ie)>-1};c.forEach(function(ie){M(ie)&&!A.allowVulnerableTags&&console.warn(`

⚠️ Your \`allowedTags\` option includes, \`${ie}\`, 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 R=A.nonTextTags||["script","style","textarea","option","xmp"];let N,I;A.allowedAttributes&&(N={},I={},h(A.allowedAttributes,function(ie,Se){N[Se]=[];const se=[];ie.forEach(function(_e){typeof _e=="string"&&_e.indexOf("*")>=0?se.push(e(_e).replace(/\\\*/g,".*")):N[Se].push(_e)}),se.length&&(I[Se]=new RegExp("^("+se.join("|")+")$"))}));const D={},L={},z={};h(A.allowedClasses,function(ie,Se){if(N&&(f(N,Se)||(N[Se]=[]),N[Se].push("class")),D[Se]=ie,Array.isArray(ie)){const se=[];D[Se]=[],z[Se]=[],ie.forEach(function(_e){typeof _e=="string"&&_e.indexOf("*")>=0?se.push(e(_e).replace(/\\\*/g,".*")):_e instanceof RegExp?z[Se].push(_e):D[Se].push(_e)}),se.length&&(L[Se]=new RegExp("^("+se.join("|")+")$"))}});const P={};let H;h(A.transformTags,function(ie,Se){let se;typeof ie=="function"?se=ie:typeof ie=="string"&&(se=x.simpleTransform(ie)),Se==="*"?H=se:P[Se]=se});let B,F,q,X,Y,U,V=!1;J();const G=new t.Parser({onopentag:function(ie,Se){if(A.onOpenTag&&A.onOpenTag(ie,Se),A.enforceHtmlBoundary&&ie==="html"&&J(),Y){U++;return}const se=new k(ie,Se);F.push(se);let _e=!1;const et=!!se.text;let Te;if(f(P,ie)&&(Te=P[ie](ie,Se),se.attribs=Se=Te.attribs,Te.text!==void 0&&(se.innerText=Te.text),ie!==Te.tagName&&(se.name=ie=Te.tagName,X[B]=Te.tagName)),H&&(Te=H(ie,Se),se.attribs=Se=Te.attribs,ie!==Te.tagName&&(se.name=ie=Te.tagName,X[B]=Te.tagName)),(!M(ie)||A.disallowedTagsMode==="recursiveEscape"&&!m(q)||A.nestingLimit!=null&&B>=A.nestingLimit)&&(_e=!0,q[B]=!0,(A.disallowedTagsMode==="discard"||A.disallowedTagsMode==="completelyDiscard")&&R.indexOf(ie)!==-1&&(Y=!0,U=1)),B++,_e){if(A.disallowedTagsMode==="discard"||A.disallowedTagsMode==="completelyDiscard"){if(se.innerText&&!et){const Ve=ne(se.innerText);A.textFilter?j+=A.textFilter(Ve,ie):j+=Ve,V=!0}return}_=j,j=""}j+="<"+ie,ie==="script"&&(A.allowedScriptHostnames||A.allowedScriptDomains)&&(se.innerText=""),_e&&(A.disallowedTagsMode==="escape"||A.disallowedTagsMode==="recursiveEscape")&&A.preserveEscapedAttributes?h(Se,function(Ve,Ge){j+=" "+Ge+'="'+ne(Ve||"",!0)+'"'}):(!N||f(N,ie)||N["*"])&&h(Se,function(Ve,Ge){if(!y.test(Ge)){delete se.attribs[Ge];return}if(Ve===""&&!A.allowedEmptyAttributes.includes(Ge)&&(A.nonBooleanAttributes.includes(Ge)||A.nonBooleanAttributes.includes("*"))){delete se.attribs[Ge];return}let ut=!1;if(!N||f(N,ie)&&N[ie].indexOf(Ge)!==-1||N["*"]&&N["*"].indexOf(Ge)!==-1||f(I,ie)&&I[ie].test(Ge)||I["*"]&&I["*"].test(Ge))ut=!0;else if(N&&N[ie]){for(const Ue of N[ie])if(n(Ue)&&Ue.name&&Ue.name===Ge){ut=!0;let De="";if(Ue.multiple===!0){const Ce=Ve.split(" ");for(const ze of Ce)Ue.values.indexOf(ze)!==-1&&(De===""?De=ze:De+=" "+ze)}else Ue.values.indexOf(Ve)>=0&&(De=Ve);Ve=De}}if(ut){if(A.allowedSchemesAppliedToAttributes.indexOf(Ge)!==-1&&de(ie,Ve)){delete se.attribs[Ge];return}if(ie==="script"&&Ge==="src"){let Ue=!0;try{const De=fe(Ve);if(A.allowedScriptHostnames||A.allowedScriptDomains){const Ce=(A.allowedScriptHostnames||[]).find(function(ht){return ht===De.url.hostname}),ze=(A.allowedScriptDomains||[]).find(function(ht){return De.url.hostname===ht||De.url.hostname.endsWith(`.${ht}`)});Ue=Ce||ze}}catch{Ue=!1}if(!Ue){delete se.attribs[Ge];return}}if(ie==="iframe"&&Ge==="src"){let Ue=!0;try{const De=fe(Ve);if(De.isRelativeUrl)Ue=f(A,"allowIframeRelativeUrls")?A.allowIframeRelativeUrls:!A.allowedIframeHostnames&&!A.allowedIframeDomains;else if(A.allowedIframeHostnames||A.allowedIframeDomains){const Ce=(A.allowedIframeHostnames||[]).find(function(ht){return ht===De.url.hostname}),ze=(A.allowedIframeDomains||[]).find(function(ht){return De.url.hostname===ht||De.url.hostname.endsWith(`.${ht}`)});Ue=Ce||ze}}catch{Ue=!1}if(!Ue){delete se.attribs[Ge];return}}if(Ge==="srcset"||Ge==="imagesrcset")try{let Ue=i(Ve);if(Ue.forEach(function(De){de(Ge,De.url)&&(De.evil=!0)}),Ue=p(Ue,function(De){return!De.evil}),Ue.length)Ve=v(p(Ue,function(De){return!De.evil})),se.attribs[Ge]=Ve;else{delete se.attribs[Ge];return}}catch{delete se.attribs[Ge];return}if(Ge==="class"){const Ue=D[ie],De=D["*"],Ce=L[ie],ze=z[ie],ht=z["*"],Rt=L["*"],Tn=[Ce,Rt].concat(ze,ht).filter(function(fn){return fn});if(Ue&&De?Ve=Ye(Ve,r(Ue,De),Tn):Ve=Ye(Ve,Ue||De,Tn),!Ve.length){delete se.attribs[Ge];return}}if(Ge==="style"){if(A.parseStyleAttributes)try{const Ue=s(ie+" {"+Ve+"}",{map:!1}),De=ke(Ue,A.allowedStyles);if(Ve=Me(De),Ve.length===0){delete se.attribs[Ge];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+ie+" {"+Ve+`}", 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 se.attribs[Ge];return}else if(A.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}j+=" "+Ge,Ve&&Ve.length?j+='="'+ne(Ve,!0)+'"':A.allowedEmptyAttributes.includes(Ge)&&(j+='=""')}else delete se.attribs[Ge]}),A.selfClosing.indexOf(ie)!==-1?j+=" />":(j+=">",se.innerText&&!et&&!A.textFilter&&(j+=ne(se.innerText),V=!0)),_e&&(j=_+ne(j),_=""),se.openingTagLength=j.length-se.tagPosition},ontext:function(ie){if(Y)return;const Se=F[F.length-1];let se;if(Se&&(se=Se.tag,ie=Se.innerText!==void 0?Se.innerText:ie),A.disallowedTagsMode==="completelyDiscard"&&!M(se))ie="";else if(se&&M(se)&&(A.disallowedTagsMode==="discard"||A.disallowedTagsMode==="completelyDiscard")&&(se==="script"||se==="style"))j+=ie;else if(se&&M(se)&&(A.disallowedTagsMode==="discard"||A.disallowedTagsMode==="completelyDiscard")&&(se==="textarea"||se==="xmp"))j+=ie;else if(!V){const _e=ne(ie,!1);A.textFilter?j+=A.textFilter(_e,se):j+=_e}if(F.length){const _e=F[F.length-1];_e.text+=ie}},onclosetag:function(ie,Se){if(A.onCloseTag&&A.onCloseTag(ie,Se),Y)if(U--,!U)Y=!1;else return;const se=F.pop();if(!se)return;if(se.tag!==ie){F.push(se);return}Y=A.enforceHtmlBoundary?ie==="html":!1,B--;const _e=q[B];if(_e){if(delete q[B],A.disallowedTagsMode==="discard"||A.disallowedTagsMode==="completelyDiscard"){se.updateParentNodeText();return}_=j,j=""}if(X[B]&&(ie=X[B],delete X[B]),A.exclusiveFilter){const et=A.exclusiveFilter(se);if(et==="excludeTag"){_e&&(j=_,_=""),j=j.substring(0,se.tagPosition)+j.substring(se.tagPosition+se.openingTagLength);return}else if(et){j=j.substring(0,se.tagPosition);return}}if(se.updateParentNodeMediaChildren(),se.updateParentNodeText(),A.selfClosing.indexOf(ie)!==-1||Se&&!M(ie)&&["escape","recursiveEscape"].indexOf(A.disallowedTagsMode)>=0){_e&&(j=_,_="");return}j+="</"+ie+">",_e&&(j=_+ne(j),_=""),V=!1}},A.parser);if(G.write(w),G.end(),A.disallowedTagsMode==="escape"||A.disallowedTagsMode==="recursiveEscape"){const ie=G.endIndex;if(ie!=null&&ie>=0&&ie<w.length){const Se=w.substring(ie);j+=ne(Se)}else(ie==null||ie<0)&&w.length>0&&j===""&&(j=ne(w))}return j;function J(){j="",B=0,F=[],q={},X={},Y=!1,U=0}function ne(ie,Se){return typeof ie!="string"&&(ie=ie+""),A.parser.decodeEntities&&(ie=ie.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Se&&(ie=ie.replace(/"/g,"&quot;"))),ie=ie.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Se&&(ie=ie.replace(/"/g,"&quot;")),ie}function de(ie,Se){const se=f(A.allowedSchemesByTag,ie)?A.allowedSchemesByTag[ie]:A.allowedSchemes||[];return o(Se,{allowedSchemes:se,allowProtocolRelative:A.allowProtocolRelative})}function fe(ie){if(ie=ie.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),ie.startsWith("relative:"))throw new Error("relative: exploit attempt");let Se="relative://relative-site";for(let et=0;et<100;et++)Se+=`/${et}`;const se=new URL(ie,Se);return{isRelativeUrl:se&&se.hostname==="relative-site"&&se.protocol==="relative:",url:se}}function ke(ie,Se){if(!Se)return ie;const se=ie.nodes[0];let _e;return Se[se.selector]&&Se["*"]?_e=r(Se[se.selector],Se["*"]):_e=Se[se.selector]||Se["*"],_e&&(ie.nodes[0].nodes=se.nodes.reduce(Oe(_e),[])),ie}function Me(ie){return ie.nodes[0].nodes.reduce(function(Se,se){return Se.push(`${se.prop}:${se.value}${se.important?" !important":""}`),Se},[]).join(";")}function Oe(ie){return function(Se,se){return f(ie,se.prop)&&ie[se.prop].some(function(et){return et.test(se.value)})&&Se.push(se),Se}}function Ye(ie,Se,se){return Se?(ie=ie.split(/\s+/),ie.filter(function(_e){return Se.indexOf(_e)!==-1||se.some(function(et){return et.test(_e)})}).join(" ")):ie}}const S={decodeEntities:!0};return x.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","action","formaction","data","xlink:href","poster","background","ping","longdesc","usemap","codebase","classid","archive","profile","manifest","itemid","dynsrc","lowsrc"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0,preserveEscapedAttributes:!1},x.simpleTransform=function(w,A,C){return C=C===void 0?!0:C,A=A||{},function(j,_){let k;if(C)for(k in A)_[k]=A[k];else _=A;return{tagName:w,attribs:_}}},BT}var PAe=BAe();const FAe=pl(PAe);var xt=(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))(xt||{}),en=(t=>(t.add="+",t.sub="-",t.mul="*",t.div="/",t.mod="%",t.pow="^",t.eql="==",t.neq="!=",t.gtr=">",t.lss="<",t.trimUpper="</",t.trimLower=">/",t.gte=">=",t.lte="<=",t.and="and",t.or="or",t.unless="unless",t.atan2="atan2",t))(en||{});const $Ae=["==","!=",">","<",">=","<="],HAe=["and","or","unless"];var Rr=(t=>(t.oneToOne="one-to-one",t.manyToOne="many-to-one",t.oneToMany="one-to-many",t.manyToMany="many-to-many",t))(Rr||{}),ce=(t=>(t.none="none",t.vector="vector",t.scalar="scalar",t.matrix="matrix",t.string="string",t))(ce||{}),xo=(t=>(t.equal="=",t.notEqual="!=",t.matchRegexp="=~",t.matchNotRegexp="!~",t))(xo||{});const $h=t=>t.replace(/([\\"])/g,"\\$1"),R4=t=>$Ae.includes(t),cO=t=>HAe.includes(t),PB={[en.add]:3,[en.sub]:3,[en.mul]:2,[en.div]:2,[en.mod]:2,[en.pow]:1,[en.eql]:4,[en.neq]:4,[en.gtr]:4,[en.lss]:4,[en.gte]:4,[en.lte]:4,[en.trimLower]:4,[en.trimUpper]:4,[en.and]:5,[en.or]:6,[en.unless]:5,[en.atan2]:2},gw=(t,e)=>e.type!==xt.binaryExpr||PB[t]>PB[e.op]?e:{type:xt.parenExpr,expr:e},zAe=t=>{switch(t.type){case xt.aggregation:return t.param===null?[t.expr]:[t.param,t.expr];case xt.subquery:return[t.expr];case xt.parenExpr:return[t.expr];case xt.call:return t.args;case xt.matrixSelector:case xt.vectorSelector:case xt.numberLiteral:case xt.stringLiteral:return[];case xt.placeholder:return t.children;case xt.unaryExpr:return[t.expr];case xt.binaryExpr:return[t.lhs,t.rhs];default:throw new Error("unsupported node type")}},qp=t=>{switch(t.type){case xt.aggregation:return ce.vector;case xt.binaryExpr:{const e=[qp(t.lhs),qp(t.rhs)];return e.includes(null)?null:e.includes(ce.vector)?ce.vector:ce.scalar}case xt.call:return t.func.returnType;case xt.matrixSelector:return ce.matrix;case xt.numberLiteral:return ce.scalar;case xt.parenExpr:return qp(t.expr);case xt.placeholder:return null;case xt.stringLiteral:return ce.string;case xt.subquery:return ce.matrix;case xt.unaryExpr:return qp(t.expr);case xt.vectorSelector:return ce.vector;default:throw new Error("invalid node type")}},qAe=["topk","bottomk","quantile","count_values","limitk","limit_ratio"];ce.scalar,ce.string,ce.matrix,ce.vector;ce.none+"",ce.string+"",ce.scalar+"",ce.vector+"",ce.matrix+"";const QAe=/^[a-zA-Z_:][a-zA-Z0-9_:]*$/,UAe=/^[a-zA-Z_][a-zA-Z0-9_]*$/,vS=t=>t!==""&&!QAe.test(t),WAe=t=>!UAe.test(t),us=t=>t.replace(/([\\"])/g,"\\$1"),ed=t=>WAe(t)?`"${us(t)}"`:t,fx=t=>t.map(e=>ed(e)).join(", "),UY=(t,e,n)=>`${t!==null?` @ ${(t/1e3).toFixed(3)}`:e!==null?` @ ${e}()`:""}${n===0?"":n>0?` offset ${Yn(n)}`:` offset -${Yn(-n)}`}`,FB=t=>{var l;const e=t.matchers.filter(c=>!(c.name==="__name__"&&c.type===xo.equal)).map(c=>`${ed(c.name)}${c.type}"${us(c.value)}"`),n=t.name||((l=t.matchers.find(c=>c.name==="__name__"&&c.type===xo.equal))==null?void 0:l.value)||"",r=vS(n);r&&e.unshift(`"${us(n)}"`);const i=t.type===xt.matrixSelector?`[${Yn(t.range)}]`:"",s=t.anchored?" anchored":t.smoothed?" smoothed":"",o=UY(t.timestamp,t.startOrEnd,t.offset);return`${r?"":n}${e.length>0?`{${e.join(",")}}`:""}${i}${s}${o}`},cs=(t,e=0,n=!1,r=!0)=>{const i=n?`
`:"",s=n?`
`:" ",o=e+2,l=n?" ".repeat(e):"",c=r?l:"";switch(t.type){case xt.aggregation:return`${c}${t.op}${t.without?` without(${fx(t.grouping)}) `:t.grouping.length>0?` by(${fx(t.grouping)}) `:""}(${i}${qAe.includes(t.op)&&t.param!==null?`${cs(t.param,o,n)},${s}`:""}${cs(t.expr,o,n)}${i}${l})`;case xt.subquery:return`${c}${cs(t.expr,e,n)}[${Yn(t.range)}:${t.step!==0?Yn(t.step):""}]${UY(t.timestamp,t.startOrEnd,t.offset)}`;case xt.parenExpr:return`${c}(${i}${cs(t.expr,o,n)}${i}${l})`;case xt.call:{const h=t.args.length>0?i:"";return`${c}${t.func.name}(${h}${t.args.map(f=>cs(f,o,n)).join(","+s)}${h}${t.args.length>0?l:""})`}case xt.matrixSelector:return`${c}${FB(t)}`;case xt.vectorSelector:return`${c}${FB(t)}`;case xt.numberLiteral:return`${c}${t.val}`;case xt.stringLiteral:return`${c}"${us(t.val)}"`;case xt.unaryExpr:return`${c}${t.op}${cs(t.expr,e,n,!1)}`;case xt.binaryExpr:{let h="",f="",p="";const m=t.matching;if(m!==null){(m.labels.length>0||m.on||m.card===Rr.manyToOne||m.card===Rr.oneToMany)&&(h=` ${m.on?"on":"ignoring"}(${fx(m.labels)})`),(m.card===Rr.manyToOne||m.card===Rr.oneToMany)&&(f=` group_${m.card===Rr.manyToOne?"left":"right"}(${fx(m.include)})`);const v=m.fillValues.lhs,y=m.fillValues.rhs;(v!==null||y!==null)&&(v===y?p=` fill(${v})`:(v!==null&&(p+=` fill_left(${v})`),y!==null&&(p+=` fill_right(${y})`)))}return`${cs(gw(t.op,t.lhs),o,n)}${s}${l}${t.op}${t.bool?" bool":""}${h}${f}${p}${s}${cs(gw(t.op,t.rhs),o,n)}`}case xt.placeholder:return`${c}…${t.children.length>0?`(${i}${t.children.map(h=>cs(h,o,n)).join(","+s)}${i}${l})`:""}`;default:throw new Error("unsupported node type")}},da=t=>t.map((e,n)=>a.jsxs("span",{children:[n!==0&&", ",a.jsx("span",{className:"promql-code promql-label-name",children:ed(e)})]},n)),WY=(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:Yn(n)})]}):a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"promql-keyword",children:"offset"})," ",a.jsxs("span",{className:"promql-duration",children:["-",Yn(-n)]})]})]}),$B=t=>{var i;const e=[],n=t.name||((i=t.matchers.find(s=>s.name==="__name__"&&s.type===xo.equal))==null?void 0:i.value)||"",r=vS(n);return r&&e.push(a.jsx("span",{children:a.jsxs("span",{className:"promql-string",children:['"',us(n),'"']})},"__name__")),e.push(...t.matchers.filter(s=>!(s.name==="__name__"&&s.type===xo.equal)).map((s,o)=>a.jsxs("span",{children:[(o!==0||r)&&",",a.jsx("span",{className:"promql-label-name",children:ed(s.name)}),s.type,a.jsxs("span",{className:"promql-string",children:['"',us(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===xt.matrixSelector&&a.jsxs(a.Fragment,{children:["[",a.jsx("span",{className:"promql-duration",children:Yn(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"})]}),WY(t.timestamp,t.startOrEnd,t.offset)]})},PT=a.jsx("span",{className:"promql-ellipsis",children:"…"}),YAe=(t,e,n)=>{if(n===0)return PT;const r=n===void 0?void 0:n-1;switch(t.type){case xt.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:"("}),da(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:"("}),da(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:[Ho(t.param,e,r),", "]}),Ho(t.expr,e,r),a.jsx("span",{className:"promql-paren",children:")"})]})]});case xt.subquery:return a.jsxs(a.Fragment,{children:[e&&Ho(t.expr,e,r),"[",a.jsx("span",{className:"promql-duration",children:Yn(t.range)}),":",t.step!==0&&a.jsx("span",{className:"promql-duration",children:Yn(t.step)}),"]",WY(t.timestamp,t.startOrEnd,t.offset)]});case xt.parenExpr:return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"promql-paren",children:"("}),e&&Ho(t.expr,e,r),a.jsx("span",{className:"promql-paren",children:")"})]});case xt.call:{const i=r===void 0||r>0?t.args.map((s,o)=>a.jsxs("span",{children:[o!==0&&", ",Ho(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 xt.matrixSelector:return $B(t);case xt.vectorSelector:return $B(t);case xt.numberLiteral:return a.jsx("span",{className:"promql-number",children:t.val});case xt.stringLiteral:return a.jsxs("span",{className:"promql-string",children:['"',us(t.val),'"']});case xt.unaryExpr:return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"promql-operator",children:t.op}),e&&Ho(t.expr,e,r)]});case xt.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===Rr.manyToOne||l.card===Rr.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:"("}),da(l.labels),a.jsx("span",{className:"promql-paren",children:")"})]})),(l.card===Rr.manyToOne||l.card===Rr.oneToMany)&&(s=a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"promql-keyword",children:[" ","group_",l.card===Rr.manyToOne?"left":"right"]}),a.jsx("span",{className:"promql-paren",children:"("}),da(l.include),a.jsx("span",{className:"promql-paren",children:")"})]}));const c=l.fillValues.lhs,h=l.fillValues.rhs;(c!==null||h!==null)&&(c===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:c}),a.jsx("span",{className:"promql-paren",children:")"})]}):o=a.jsxs(a.Fragment,{children:[c!==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:c}),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&&Ho(gw(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&&Ho(gw(t.op,t.rhs),e,r)]})}case xt.placeholder:return PT;default:throw new Error("unsupported node type")}},Ho=(t,e,n)=>a.jsx("span",{className:"promql-code",children:YAe(t,e,n)}),VAe="_labelValue_1cwwq_1",GAe="_promqlPill_1cwwq_13",FT={labelValue:VAe,promqlPill:GAe},qs={width:me(16),height:me(16)},Og={width:me(14),height:me(14)},el={width:Rs(17),height:Rs(17)},gu={width:"70%",height:"70%"},zf={width:Rs(16),height:Rs(16)},Gg={width:Rs(20),height:Rs(20)},XAe={width:Rs(17.5),height:Rs(17.5)},vw={width:Rs(16),height:Rs(16)};me(20),me(20);const KAe=({metricName:t,insertText:e,hideLabelsExplorer:n})=>{const[r,i]=O.useState([]),[s,o]=O.useState([]),[l,c]=O.useState(null),[h,f]=O.useState(!0),p=_=>{o(s.filter(k=>k.name!==_))},m=()=>{if(l===null)throw new Error("tried to add null label matcher");o([...s,l]),c(null)},v=_=>a.jsx(Wl,{size:"md",withRemoveButton:!0,onRemove:()=>{p(_.name)},className:FT.promqlPill,children:a.jsxs("span",{className:"promql-code",children:[a.jsx("span",{className:"promql-label-name",children:_.name}),_.type,a.jsxs("span",{className:"promql-string",children:['"',$h(_.value),'"']})]})},_.name),y={type:xt.vectorSelector,name:t,matchers:s,offset:0,timestamp:null,startOrEnd:null,anchored:!1,smoothed:!1},{data:x,error:S,isLoading:w}=Zh({path:"/series",params:{"match[]":cs(y)}}),[A,C,j]=O.useMemo(()=>{const _={},k={},M={};x!==void 0&&(x.data.forEach(N=>{Object.entries(N).forEach(([I,D])=>{I!=="__name__"&&(I in M?D in M[I]?M[I][D]++:M[I][D]=1:M[I]={[D]:1})})}),Object.entries(M).forEach(([N,I])=>{_[N]=Object.keys(I).length,k[N]=Object.entries(I).sort(([,D],[,L])=>L-D).map(([D,L])=>({value:D,count:L}))}));const R=Object.entries(_).sort((N,I)=>h?I[1]-N[1]:0);return[x==null?void 0:x.data.length,R,k]},[x,h]);return S?a.jsxs(Nt,{color:"red",title:"Error querying series",icon:a.jsx(Di,{}),children:[a.jsx("strong",{children:"Error:"})," ",S.message]}):a.jsxs(_n,{fz:"sm",children:[a.jsxs(_n,{style:{overflow:"auto"},children:[a.jsxs(ft,{align:"center",mt:"lg",wrap:"nowrap",children:[a.jsx(ve,{w:70,fw:700,style:{flexShrink:0},children:"Selector:"}),a.jsx(Wl.Group,{children:a.jsx(Wl,{size:"md",className:FT.promqlPill,children:a.jsx("span",{style:{wordBreak:"break-word",whiteSpace:"pre"},children:Ho(y,!1)})})}),a.jsxs(ft,{wrap:"nowrap",children:[a.jsx(Ri,{variant:"light",size:"xs",onClick:()=>e(cs(y)),leftSection:a.jsx(LH,{style:Gg}),title:"Insert selector at cursor and close explorer",children:"Insert"}),a.jsx(TE,{value:cs(y),children:({copied:_,copy:k})=>a.jsx(Ri,{variant:"light",size:"xs",leftSection:_?a.jsx(yA,{style:Gg}):a.jsx(ZE,{style:Gg}),onClick:k,title:"Copy selector to clipboard",children:"Copy"})})]})]}),a.jsxs(ft,{align:"center",children:[a.jsx(ve,{w:70,fw:700,style:{flexShrink:0},children:"Filters:"}),s.length>0?a.jsx(Wl.Group,{children:s.map(_=>v(_))}):a.jsx(a.Fragment,{children:"No label filters"})]}),a.jsxs(ft,{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:A!==void 0?`${A} series`:"loading..."})]})]}),a.jsxs(ft,{justify:"space-between",children:[a.jsx(ve,{children:a.jsx(Ri,{variant:"light",size:"xs",onClick:n,leftSection:a.jsx(Vie,{style:Gg}),children:"Back to all metrics"})}),a.jsx(f0,{w:"fit-content",size:"xs",value:h?"cardinality":"alphabetic",onChange:_=>f(_==="cardinality"),data:[{label:"By cardinality",value:"cardinality"},{label:"Alphabetic",value:"alphabetic"}]})]}),w?a.jsx(ve,{mt:"lg",children:Array.from(Array(10),(_,k)=>a.jsx(Wa,{height:40,mb:15,width:"100%"},k))}):a.jsxs(le,{fz:"sm",children:[a.jsx(le.Thead,{children:a.jsxs(le.Tr,{children:[a.jsx(le.Th,{children:"Label"}),a.jsx(le.Th,{children:"Values"})]})}),a.jsx(le.Tbody,{children:C.map(([_,k])=>a.jsxs(le.Tr,{children:[a.jsx(le.Td,{w:"50%",children:a.jsx("form",{onSubmit:M=>{M.preventDefault()},children:a.jsxs(ft,{justify:"space-between",align:"baseline",children:[a.jsx("span",{className:"promql-code promql-label-name",children:_}),s.some(M=>M.name===_)?v(s.find(M=>M.name===_)):(l==null?void 0:l.name)===_?a.jsxs(ft,{wrap:"nowrap",gap:"xs",children:[a.jsx(p0,{size:"xs",w:50,style:{width:"auto"},value:l.type,data:Object.values(xo).map(M=>({value:M,label:M})),onChange:(M,R)=>c({...l,type:R.value})}),a.jsx(CE,{value:l.value,size:"xs",placeholder:"label value",onChange:M=>c({...l,value:M}),data:j[_].map(M=>M.value),autoFocus:!0}),a.jsx(Ri,{variant:"secondary",size:"xs",onClick:()=>m(),style:{flexShrink:0},children:"Apply"}),a.jsx(Ri,{variant:"light",w:40,size:"xs",onClick:()=>c(null),title:"Cancel",style:{flexShrink:0},children:a.jsx(yae,{style:{width:me(18),height:me(18)}})})]}):a.jsx(Ri,{variant:"light",size:"xs",mr:"xs",onClick:()=>c({name:_,type:xo.equal,value:""}),children:"Filter..."})]})})}),a.jsxs(le.Td,{w:"50%",children:[a.jsxs(pt,{fw:700,fz:"sm",my:"xs",children:[k," value",k>1&&"s"]}),a.jsxs(tr,{size:"sm",listStyleType:"none",children:[(r.includes(_)?j[_]:j[_].slice(0,5)).map(({value:M,count:R})=>a.jsxs(tr.Item,{children:[a.jsxs("span",{className:`${FT.labelValue} promql-code promql-string`,onClick:()=>{o([...s.filter(N=>N.name!==_),{name:_,type:xo.equal,value:M}]),c(null)},title:"Click to filter by value",children:['"',$h(M),'"']})," ","(",R," series)"]},M)),r.includes(_)?a.jsx(tr.Item,{my:"xs",children:a.jsx(Wr,{size:"sm",href:"#",onClick:M=>{M.preventDefault(),i(r.filter(R=>R!=_))},children:"Hide full values"})}):j[_].length>5&&a.jsx(tr.Item,{my:"xs",children:a.jsxs(Wr,{size:"sm",href:"#",onClick:M=>{M.preventDefault(),i([...r,_])},children:["Show ",j[_].length-5," more values..."]})})]})]})]},_))})]})]})},ZAe="_typeLabel_u9odf_1",JAe="_helpLabel_u9odf_5",HB={typeLabel:ZAe,helpLabel:JAe};/*! *****************************************************************************
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 uO=function(t,e){return uO=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])},uO(t,e)};function ewe(t,e){uO(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var uv=function(){return uv=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},uv.apply(this,arguments)};function twe(t,e,n,r){var i,s=!1,o=0;function l(){i&&clearTimeout(i)}function c(){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 y(){i=void 0}r&&!i&&v(),l(),r===void 0&&p>t?v():e!==!0&&(i=setTimeout(r?y:v,r===void 0?t-p:t))}return h.cancel=c,h}var lm={Pixel:"Pixel",Percent:"Percent"},zB={unit:lm.Percent,value:.8};function qB(t){return typeof t=="number"?{unit:lm.Percent,value:t*100}:typeof t=="string"?t.match(/^(\d*(\.\d+)?)px$/)?{unit:lm.Pixel,value:parseFloat(t)}:t.match(/^(\d*(\.\d+)?)%$/)?{unit:lm.Percent,value:parseFloat(t)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),zB):(console.warn("scrollThreshold should be string or number"),zB)}var nwe=(function(t){ewe(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=twe(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?uv(uv({},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=qB(r);return s.unit===lm.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=qB(r);return s.unit===lm.Pixel?n.scrollTop+i>=n.scrollHeight-s.value:n.scrollTop+i>=s.value/100*n.scrollHeight},e.prototype.render=function(){var n=this,r=uv({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 zn.createElement("div",{style:s,className:"infinite-scroll-component__outerdiv"},zn.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(o){return n._infScroll=o},style:r},this.props.pullDownToRefresh&&zn.createElement("div",{style:{position:"relative"},ref:function(o){return n._pullDown=o}},zn.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})(O.Component);const Eg=50,Gm=({allItems:t,child:e})=>{const[n,r]=O.useState(t.slice(0,50)),[i,s]=O.useState(Eg),[o,l]=O.useState(t.length>Eg),c=e;O.useEffect(()=>{r(t.slice(0,Eg)),l(t.length>Eg)},[t]);const h=()=>{if(n.length===t.length)l(!1);else{const f=i+Eg;s(f),r(t.slice(0,f))}};return a.jsx(nwe,{next:h,hasMore:o,loader:a.jsx("h4",{children:"loading..."}),dataLength:n.length,height:n.length>25?"75vh":"",children:a.jsx(c,{items:n})})},rwe=new MY({pre:'<b style="color: rgb(0, 102, 191)">',post:"</b>",shouldSort:!0}),iwe={allowedTags:["b"],allowedAttributes:{b:["style"]}},swe=(t,e)=>rwe.filter(t.replace(/ /g,""),e,{pre:'<b style="color: rgb(0, 102, 191)">',post:"</b>"}),awe=({metricNames:t,insertText:e,close:n})=>{const{data:r}=Ci({path:"/metadata"}),[i,s]=O.useState(null),[o,l]=O.useState(""),[c]=db(o,250),h=O.useMemo(()=>c===""?t.map(p=>({original:p,rendered:p})):swe(c,t),[c,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(KAe,{metricName:i,insertText:p=>{e(p),n()},hideLabelsExplorer:()=>s(null)}):a.jsxs(_n,{children:[a.jsx(cc,{title:"Filter by text",placeholder:"Enter text to filter metric names by...",value:o,onChange:p=>l(p.target.value),autoFocus:!0}),a.jsx(Gm,{allItems:h,child:({items:p})=>a.jsxs(le,{children:[a.jsx(le.Thead,{children:a.jsxs(le.Tr,{children:[a.jsx(le.Th,{children:"Metric"}),a.jsx(le.Th,{children:"Type"}),a.jsx(le.Th,{children:"Help"})]})}),a.jsx(le.Tbody,{children:p.map(m=>a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:a.jsxs(ft,{justify:"space-between",wrap:"nowrap",children:[c===""?m.original:a.jsx("div",{dangerouslySetInnerHTML:{__html:FAe(m.rendered,iwe)}}),a.jsxs(ft,{gap:"xs",children:[a.jsx(Sr,{size:"sm",color:"gray",variant:"light",title:"Explore metric",onClick:()=>{s(m.original)},children:a.jsx(Aae,{style:{width:"70%",height:"70%"},stroke:1.5})}),a.jsx(Sr,{size:"sm",color:"gray",variant:"light",title:"Insert at cursor and close explorer",onClick:()=>{e(m.original),n()},children:a.jsx(LH,{style:{width:"70%",height:"70%"},stroke:1.5})}),a.jsx(TE,{value:m.original,children:({copied:v,copy:y})=>a.jsx(Sr,{size:"sm",color:"gray",variant:"light",title:"Copy to clipboard",onClick:y,children:v?a.jsx(yA,{style:{width:"70%",height:"70%"},stroke:1.5}):a.jsx(ZE,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})]})}),a.jsx(le.Td,{px:"lg",children:f(m.original).map((v,y)=>a.jsxs(zn.Fragment,{children:[a.jsx("span",{className:HB.typeLabel,children:v.type}),a.jsx("br",{})]},y))}),a.jsx(le.Td,{children:f(m.original).map((v,y)=>a.jsxs(zn.Fragment,{children:[a.jsx("span",{className:HB.helpLabel,children:v.help}),a.jsx("br",{})]},y))})]},m.original))})]})})]})};class owe extends O.Component{constructor(){super(...arguments);vr(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(Di,{}),maw:500,mx:"auto",mt:"lg",children:[a.jsx("strong",{children:"Error:"})," ",this.state.error.message]}):this.props.children}}const Df=t=>{const e=ko();return a.jsx(owe,{title:t.title,children:t.children},e.pathname)};class lwe{constructor(e,n){vr(this,"complete");vr(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=Li(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(c=>({label:c.length<80?c:c.slice(0,76).concat("..."),detail:"past query",apply:c,info:c.length<80?void 0:c})),validFor:/^[a-zA-Z0-9_:]+$/};return n!==null&&(l.options=l.options.concat(n.options)),l})}}const QB=new _W,cwe=({initialExpr:t,metricNames:e,executeQuery:n,duplicatePanel:r,removePanel:i,treeShown:s,setShowTree:o})=>{const l=Ow(),{queryHistory:c}=hc(M=>M.queryPage),{pathPrefix:h,enableAutocomplete:f,enableSyntaxHighlighting:p,enableLinter:m,enableQueryHistory:v}=fi(),[y,x]=O.useState(t);O.useEffect(()=>{x(t)},[t]);const{data:S,error:w,isFetching:A,refetch:C}=Zh({path:"/format_query",params:{query:y},enabled:!1});O.useEffect(()=>{if(w){ll.show({color:"red",title:"Error formatting query",message:w.message});return}S&&(x(S.data),ll.show({title:"Expression formatted",message:"Expression formatted successfully!"}))},[S,w]);const j=O.useRef(null),[_,k]=O.useState(!1);return O.useEffect(()=>{QB.activateCompletion(f).activateLinter(m).setComplete({completeStrategy:new lwe(Gk({remote:{url:h,cache:{initialMetricList:e}}}),v?c:[])})},[h,e,f,m,v,c]),a.jsxs(ft,{align:"flex-start",wrap:"nowrap",gap:"xs",children:[a.jsx(Ds,{leftSection:A?a.jsx(So,{size:"xs",color:"gray.5"}):a.jsx(dae,{}),rightSection:a.jsxs(Ln,{shadow:"md",width:200,children:[a.jsx(Ln.Target,{children:a.jsx(Sr,{size:"lg",variant:"transparent",color:"gray","aria-label":"Show query options",children:a.jsx(Tse,{style:zf})})}),a.jsxs(Ln.Dropdown,{children:[a.jsx(Ln.Label,{children:"Query options"}),a.jsx(Ln.Item,{leftSection:a.jsx(od,{style:Og}),onClick:()=>k(!0),children:"Explore metrics"}),a.jsx(Ln.Item,{leftSection:a.jsx(Uie,{style:Og}),onClick:()=>C(),disabled:A||y===""||y===(S==null?void 0:S.data),children:"Format expression"}),a.jsxs(Ln.Item,{leftSection:a.jsx(Jie,{style:Og}),onClick:()=>o(!s),children:[s?"Hide":"Show"," tree view"]}),a.jsx(Ln.Item,{leftSection:a.jsx(ZE,{style:Og}),onClick:()=>r(y),children:"Duplicate query"}),a.jsx(Ln.Item,{color:"red",leftSection:a.jsx(w3,{style:Og}),onClick:i,children:"Remove query"})]})]}),component:S4,className:Lxe.input,basicSetup:!1,value:y,onChange:x,autoFocus:!0,ref:j,extensions:[yY,_U(),EW(),wn.allowMultipleSelections.of(!0),PU(),XU(),rW(),lW(),dY(),ot.lineWrapping,Ph.of([...aW,...lY,...NW,...u4,...AW]),TU("Enter expression (press Shift+Enter for newlines)"),p?aS(l==="light"?AY:wY):[],QB.asExtension(),l==="light"?xY:Nxe,Ph.of([{key:"Escape",run:M=>(M.contentDOM.blur(),!1)}]),ju.highest(Ph.of([{key:"Enter",run:()=>(n(y),!0)},{key:"Shift-Enter",run:tO}]))],multiline:!0}),a.jsx(Ri,{variant:"primary",onClick:()=>n(y),style:{flexShrink:0},children:"Execute"}),a.jsx(Ga,{size:"95%",opened:_,onClose:()=>k(!1),title:"Explore metrics",children:a.jsx(Df,{title:"Error showing metrics",children:a.jsx(O.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(20),(M,R)=>a.jsx(Wa,{height:30,mb:15,width:"100%"},R))}),children:a.jsx(awe,{metricNames:e,insertText:M=>{if(j.current&&j.current.view){const R=j.current.view;R.dispatch(R.state.update({changes:{from:R.state.selection.ranges[0].from,to:R.state.selection.ranges[0].to,insert:M}}))}},close:()=>k(!1)})})},location.pathname)})]})},uwe="_chartWrapper_apsqz_1",hwe="_uplotChart_apsqz_7",YY={chartWrapper:uwe,uplotChart:hwe};var tA={exports:{}};const dwe=!0,Bi="u-",fwe="uplot",pwe=Bi+"hz",mwe=Bi+"vt",gwe=Bi+"title",vwe=Bi+"wrap",bwe=Bi+"under",ywe=Bi+"over",xwe=Bi+"axis",Yd=Bi+"off",Awe=Bi+"select",wwe=Bi+"cursor-x",Swe=Bi+"cursor-y",jwe=Bi+"cursor-pt",Cwe=Bi+"legend",_we=Bi+"live",Twe=Bi+"inline",kwe=Bi+"series",Owe=Bi+"marker",UB=Bi+"label",Ewe=Bi+"value",Xg="width",Kg="height",Mg="top",WB="bottom",Tp="left",$T="right",D4="#000",YB=D4+"0",HT="mousemove",VB="mousedown",zT="mouseup",GB="mouseenter",XB="mouseleave",KB="dblclick",Mwe="resize",Rwe="scroll",ZB="change",bw="dppxchange",N4="--",w0=typeof window<"u",hO=w0?document:null,cm=w0?window:null,Dwe=w0?navigator:null;let Hn,px;function dO(){let t=devicePixelRatio;Hn!=t&&(Hn=t,px&&pO(ZB,px,dO),px=matchMedia(`(min-resolution: ${Hn-.001}dppx) and (max-resolution: ${Hn+.001}dppx)`),Sf(ZB,px,dO),cm.dispatchEvent(new CustomEvent(bw)))}function Ma(t,e){if(e!=null){let n=t.classList;!n.contains(e)&&n.add(e)}}function fO(t,e){let n=t.classList;n.contains(e)&&n.remove(e)}function Mr(t,e,n){t.style[e]=n+"px"}function $o(t,e,n,r){let i=hO.createElement(t);return e!=null&&Ma(i,e),n!=null&&n.insertBefore(i,r),i}function uo(t,e){return $o("div",t,e)}const JB=new WeakMap;function Nl(t,e,n,r,i){let s="translate("+e+"px,"+n+"px)",o=JB.get(t);s!=o&&(t.style.transform=s,JB.set(t,s),e<0||n<0||e>r||n>i?Ma(t,Yd):fO(t,Yd))}const e9=new WeakMap;function t9(t,e,n){let r=e+n,i=e9.get(t);r!=i&&(e9.set(t,r),t.style.background=e,t.style.borderColor=n)}const n9=new WeakMap;function r9(t,e,n,r){let i=e+""+n,s=n9.get(t);i!=s&&(n9.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 I4={passive:!0},Nwe={...I4,capture:!0};function Sf(t,e,n,r){e.addEventListener(t,n,r?Nwe:I4)}function pO(t,e,n,r){e.removeEventListener(t,n,I4)}w0&&dO();function Ko(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:Ua((n+r)/2),e[i]<t?n=i:r=i;return t-e[n]<=e[r]-t?n:r}function VY(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 GY=t=>t!=null,XY=t=>t!=null&&t>0,bS=VY(GY),Iwe=VY(XY);function Lwe(t,e,n,r=0,i=!1){let s=i?Iwe:bS,o=i?XY:GY;[e,n]=s(t,e,n);let l=t[e],c=t[e];if(e>-1)if(r==1)l=t[e],c=t[n];else if(r==-1)l=t[n],c=t[e];else for(let h=e;h<=n;h++){let f=t[h];o(f)&&(f<l?l=f:f>c&&(c=f))}return[l??dr,c??-dr]}function yS(t,e,n,r){let i=a9(t),s=a9(e);t==e&&(i==-1?(t*=n,e/=n):(t/=n,e*=n));let o=n==10?ou:KY,l=i==1?Ua:mo,c=s==1?mo:Ua,h=l(o(Ei(t))),f=c(o(Ei(e))),p=Xm(n,h),m=Xm(n,f);return n==10&&(h<0&&(p=fr(p,-h)),f<0&&(m=fr(m,-f))),r||n==2?(t=p*i,e=m*s):(t=tV(t,p),e=xS(e,m)),[t,e]}function L4(t,e,n,r){let i=yS(t,e,n,r);return t==0&&(i[0]=0),e==0&&(i[1]=0),i}const B4=.1,i9={mode:3,pad:B4},hv={pad:0,soft:null,mode:0},Bwe={min:hv,max:hv};function yw(t,e,n,r){return AS(n)?s9(t,e,n):(hv.pad=n,hv.soft=r?0:null,hv.mode=r?3:0,s9(t,e,Bwe))}function Bn(t,e){return t??e}function Pwe(t,e,n){for(e=Bn(e,0),n=Bn(n,t.length-1);e<=n;){if(t[e]!=null)return!0;e++}return!1}function s9(t,e,n){let r=n.min,i=n.max,s=Bn(r.pad,0),o=Bn(i.pad,0),l=Bn(r.hard,-dr),c=Bn(i.hard,dr),h=Bn(r.soft,dr),f=Bn(i.soft,-dr),p=Bn(r.mode,0),m=Bn(i.mode,0),v=e-t,y=ou(v),x=Us(Ei(t),Ei(e)),S=ou(x),w=Ei(S-y);(v<1e-24||w>10)&&(v=0,(t==0||e==0)&&(v=1e-24,p==2&&h!=dr&&(s=0),m==2&&f!=-dr&&(o=0)));let A=v||x||1e3,C=ou(A),j=Xm(10,Ua(C)),_=A*(v==0?t==0?.1:1:s),k=fr(tV(t-_,j/10),24),M=t>=h&&(p==1||p==3&&k<=h||p==2&&k>=h)?h:dr,R=Us(l,k<M&&t>=M?M:tl(M,k)),N=A*(v==0?e==0?.1:1:o),I=fr(xS(e+N,j/10),24),D=e<=f&&(m==1||m==3&&I>=f||m==2&&I<=f)?f:-dr,L=tl(c,I>D&&e<=D?D:Us(D,I));return R==L&&R==0&&(L=100),[R,L]}const Fwe=new Intl.NumberFormat(w0?Dwe.language:"en-US"),P4=t=>Fwe.format(t),Ka=Math,nA=Ka.PI,Ei=Ka.abs,Ua=Ka.floor,Oi=Ka.round,mo=Ka.ceil,tl=Ka.min,Us=Ka.max,Xm=Ka.pow,a9=Ka.sign,ou=Ka.log10,KY=Ka.log2,$we=(t,e=1)=>Ka.sinh(t)*e,qT=(t,e=1)=>Ka.asinh(t/e),dr=1/0;function o9(t){return(ou((t^t>>31)-(t>>31))|0)+1}function mO(t,e,n){return tl(Us(t,e),n)}function ZY(t){return typeof t=="function"}function An(t){return ZY(t)?t:()=>t}const Hwe=()=>{},JY=t=>t,eV=(t,e)=>e,zwe=t=>null,l9=t=>!0,c9=(t,e)=>t==e,qwe=/\.\d*?(?=9{6,}|0{6,})/gm,Nf=t=>{if(rV(t)||td.has(t))return t;const e=`${t}`,n=e.match(qwe);if(n==null)return t;let r=n[0].length-1;if(e.indexOf("e-")!=-1){let[i,s]=e.split("e");return+`${Nf(i)}e${s}`}return fr(t,r)};function Hd(t,e){return Nf(fr(Nf(t/e))*e)}function xS(t,e){return Nf(mo(Nf(t/e))*e)}function tV(t,e){return Nf(Ua(Nf(t/e))*e)}function fr(t,e=0){if(rV(t))return t;let n=10**e,r=t*n*(1+Number.EPSILON);return Oi(r)/n}const td=new Map;function nV(t){return((""+t).split(".")[1]||"").length}function eb(t,e,n,r){let i=[],s=r.map(nV);for(let o=e;o<n;o++){let l=Ei(o),c=fr(Xm(t,o),l);for(let h=0;h<r.length;h++){let f=t==10?+`${r[h]}e${o}`:r[h]*c,p=(o>=0?0:l)+(o>=s[h]?0:s[h]),m=t==10?f:fr(f,p);i.push(m),td.set(m,p)}}return i}const dv={},F4=[],Km=[null,null],yh=Array.isArray,rV=Number.isInteger,Qwe=t=>t===void 0;function u9(t){return typeof t=="string"}function AS(t){let e=!1;if(t!=null){let n=t.constructor;e=n==null||n==Object}return e}function Uwe(t){return t!=null&&typeof t=="object"}const Wwe=Object.getPrototypeOf(Uint8Array),iV="__proto__";function Zm(t,e=AS){let n;if(yh(t)){let r=t.find(i=>i!=null);if(yh(r)||e(r)){n=Array(t.length);for(let i=0;i<t.length;i++)n[i]=Zm(t[i],e)}else n=t.slice()}else if(t instanceof Wwe)n=t.slice();else if(e(t)){n={};for(let r in t)r!=iV&&(n[r]=Zm(t[r],e))}else n=t;return n}function Si(t){let e=arguments;for(let n=1;n<e.length;n++){let r=e[n];for(let i in r)i!=iV&&(AS(t[i])?Si(t[i],Zm(r[i])):t[i]=Zm(r[i]))}return t}const Ywe=0,Vwe=1,Gwe=2;function Xwe(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 Kwe(t,e){if(e2e(t)){let o=t[0].slice();for(let l=1;l<t.length;l++)o.push(...t[l].slice(1));return t2e(o[0])||(o=Jwe(o)),o}let n=new Set;for(let o=0;o<t.length;o++){let c=t[o][0],h=c.length;for(let f=0;f<h;f++)n.add(c[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],c=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]:Vwe,v=[];for(let y=0;y<f.length;y++){let x=f[y],S=s.get(c[y]);x===null?m!=Ywe&&(p[S]=x,m==Gwe&&v.push(S)):p[S]=x}Xwe(p,v,i),r.push(p)}}return r}const Zwe=typeof queueMicrotask>"u"?t=>Promise.resolve().then(t):queueMicrotask;function Jwe(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 c=0;c<n;c++)l[c]=o[r[c]];i.push(l)}return i}function e2e(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 t2e(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=Us(1,Ua((i-r+1)/e));for(let o=t[r],l=r+s;l<=i;l+=s){const c=t[l];if(c!=null){if(c<=o)return!1;o=c}}return!0}const sV=["January","February","March","April","May","June","July","August","September","October","November","December"],aV=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function oV(t){return t.slice(0,3)}const n2e=aV.map(oV),r2e=sV.map(oV),i2e={MMMM:sV,MMM:r2e,WWWW:aV,WWW:n2e};function Rg(t){return(t<10?"0":"")+t}function s2e(t){return(t<10?"00":t<100?"0":"")+t}const a2e={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=>Rg(t.getMonth()+1),M:t=>t.getMonth()+1,DD:t=>Rg(t.getDate()),D:t=>t.getDate(),WWWW:(t,e)=>e.WWWW[t.getDay()],WWW:(t,e)=>e.WWW[t.getDay()],HH:t=>Rg(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=>Rg(t.getMinutes()),m:t=>t.getMinutes(),ss:t=>Rg(t.getSeconds()),s:t=>t.getSeconds(),fff:t=>s2e(t.getMilliseconds())};function $4(t,e){e=e||i2e;let n=[],r=/\{([a-z]+)\}|[^{]+/gi,i;for(;i=r.exec(t);)n.push(i[0][0]=="{"?a2e[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 o2e=new Intl.DateTimeFormat().resolvedOptions().timeZone;function l2e(t,e){let n;return e=="UTC"||e=="Etc/UTC"?n=new Date(+t+t.getTimezoneOffset()*6e4):e==o2e?n=t:(n=new Date(t.toLocaleString("en-US",{timeZone:e})),n.setMilliseconds(t.getMilliseconds())),n}const lV=t=>t%1==0,xw=[1,2,2.5,5],c2e=eb(10,-32,0,xw),cV=eb(10,0,32,xw),u2e=cV.filter(lV),zd=c2e.concat(cV),H4=`
`,uV="{YYYY}",h9=H4+uV,hV="{M}/{D}",Zg=H4+hV,mx=Zg+"/{YY}",dV="{aa}",h2e="{h}:{mm}",Lp=h2e+dV,d9=H4+Lp,f9=":{ss}",Wn=null;function fV(t){let e=t*1e3,n=e*60,r=n*60,i=r*24,s=i*30,o=i*365,c=(t==1?eb(10,0,3,xw).filter(lV):eb(10,-3,0,xw)).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,uV,Wn,Wn,Wn,Wn,Wn,Wn,1],[i*28,"{MMM}",h9,Wn,Wn,Wn,Wn,Wn,1],[i,hV,h9,Wn,Wn,Wn,Wn,Wn,1],[r,"{h}"+dV,mx,Wn,Zg,Wn,Wn,Wn,1],[n,Lp,mx,Wn,Zg,Wn,Wn,Wn,1],[e,f9,mx+" "+Lp,Wn,Zg+" "+Lp,Wn,d9,Wn,1],[t,f9+".{fff}",mx+" "+Lp,Wn,Zg+" "+Lp,Wn,d9,Wn,1]];function f(p){return(m,v,y,x,S,w)=>{let A=[],C=S>=o,j=S>=s&&S<o,_=p(y),k=fr(_*t,3),M=QT(_.getFullYear(),C?0:_.getMonth(),j||C?1:_.getDate()),R=fr(M*t,3);if(j||C){let N=j?S/s:0,I=C?S/o:0,D=k==R?k:fr(QT(M.getFullYear()+I,M.getMonth()+N,1)*t,3),L=new Date(Oi(D/t)),z=L.getFullYear(),P=L.getMonth();for(let H=0;D<=x;H++){let B=QT(z+I*H,P+N*H,1),F=B-p(fr(B*t,3));D=fr((+B+F)*t,3),D<=x&&A.push(D)}}else{let N=S>=i?i:S,I=Ua(y)-Ua(k),D=R+I+xS(k-R,N);A.push(D);let L=p(D),z=L.getHours()+L.getMinutes()/n+L.getSeconds()/r,P=S/r,H=m.axes[v]._space,B=w/H;for(;D=fr(D+S,t==1?0:3),!(D>x);)if(P>1){let F=Ua(fr(z+P,6))%24,Y=p(D).getHours()-F;Y>1&&(Y=-1),D-=Y*r,z=(z+P)%24;let U=A[A.length-1];fr((D-U)/S,3)*B>=.7&&A.push(D)}else A.push(D)}return A}}return[c,h,f]}const[d2e,f2e,p2e]=fV(1),[m2e,g2e,v2e]=fV(.001);eb(2,-53,53,[1]);function p9(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 m9(t,e){return(n,r,i,s,o)=>{let l=e.find(y=>o>=y[0])||e[e.length-1],c,h,f,p,m,v;return r.map(y=>{let x=t(y),S=x.getFullYear(),w=x.getMonth(),A=x.getDate(),C=x.getHours(),j=x.getMinutes(),_=x.getSeconds(),k=S!=c&&l[2]||w!=h&&l[3]||A!=f&&l[4]||C!=p&&l[5]||j!=m&&l[6]||_!=v&&l[7]||l[1];return c=S,h=w,f=A,p=C,m=j,v=_,k(x)})}}function b2e(t,e){let n=$4(e);return(r,i,s,o,l)=>i.map(c=>n(t(c)))}function QT(t,e,n){return new Date(t,e,n)}function g9(t,e){return e(t)}const y2e="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function v9(t,e){return(n,r,i,s)=>s==null?N4:e(t(r))}function x2e(t,e){let n=t.series[e];return n.width?n.stroke(t,e):n.points.width?n.points.stroke(t,e):null}function A2e(t,e){return t.series[e].fill(t,e)}const w2e={show:!0,live:!0,isolate:!1,mount:Hwe,markers:{show:!0,width:2,stroke:x2e,fill:A2e,dash:"solid"},idx:null,idxs:null,values:[]};function S2e(t,e){let n=t.cursor.points,r=uo(),i=n.size(t,e);Mr(r,Xg,i),Mr(r,Kg,i);let s=i/-2;Mr(r,"marginLeft",s),Mr(r,"marginTop",s);let o=n.width(t,e,i);return o&&Mr(r,"borderWidth",o),r}function j2e(t,e){let n=t.series[e].points;return n._fill||n._stroke}function C2e(t,e){let n=t.series[e].points;return n._stroke||n._fill}function _2e(t,e){return t.series[e].points.size}const UT=[0,0];function T2e(t,e,n){return UT[0]=e,UT[1]=n,UT}function gx(t,e,n,r=!0){return i=>{i.button==0&&(!r||i.target==e)&&n(i)}}function WT(t,e,n,r=!0){return i=>{(!r||i.target==e)&&n(i)}}const k2e={show:!0,x:!0,y:!0,lock:!1,move:T2e,points:{one:!1,show:S2e,size:_2e,width:0,stroke:C2e,fill:j2e},bind:{mousedown:gx,mouseup:gx,click:gx,dblclick:gx,mousemove:WT,mouseleave:WT,mouseenter:WT},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},pV={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},z4=Si({},pV,{filter:eV}),mV=Si({},z4,{size:10}),gV=Si({},pV,{show:!1}),q4='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"',vV="bold "+q4,bV=1.5,b9={show:!0,scale:"x",stroke:D4,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:vV,side:2,grid:z4,ticks:mV,border:gV,font:q4,lineGap:bV,rotate:0},O2e="Value",E2e="Time",y9={show:!0,scale:"x",auto:!1,sorted:1,min:dr,max:-dr,idxs:[]};function M2e(t,e,n,r,i){return e.map(s=>s==null?"":P4(s))}function R2e(t,e,n,r,i,s,o){let l=[],c=td.get(i)||0;n=o?n:fr(xS(n,i),c);for(let h=n;h<=r;h=fr(h+i,c))l.push(Object.is(h,-0)?0:h);return l}function gO(t,e,n,r,i,s,o){const l=[],c=t.scales[t.axes[e].scale].log,h=c==10?ou:KY,f=Ua(h(n));i=Xm(c,f),c==10&&(i=zd[Ko(i,zd)]);let p=n,m=i*c;c==10&&(m=zd[Ko(m,zd)]);do l.push(p),p=p+i,c==10&&!td.has(p)&&(p=fr(p,td.get(i))),p>=m&&(i=p,m=i*c,c==10&&(m=zd[Ko(m,zd)]));while(p<=r);return l}function D2e(t,e,n,r,i,s,o){let c=t.scales[t.axes[e].scale].asinh,h=r>c?gO(t,e,Us(c,n),r,i):[c],f=r>=0&&n<=0?[0]:[];return(n<-c?gO(t,e,Us(c,-r),-n,i):[c]).reverse().map(m=>-m).concat(f,h)}const yV=/./,N2e=/[12357]/,I2e=/[125]/,x9=/1/,vO=(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 L2e(t,e,n,r,i){let s=t.axes[n],o=s.scale,l=t.scales[o],c=t.valToPos,h=s._space,f=c(10,o),p=c(9,o)-f>=h?yV:c(7,o)-f>=h?N2e:c(5,o)-f>=h?I2e:x9;if(p==x9){let m=Ei(c(1,o)-f);if(m<h)return vO(e.slice().reverse(),l.distr,p,mo(h/m)).reverse()}return vO(e,l.distr,p,1)}function B2e(t,e,n,r,i){let s=t.axes[n],o=s.scale,l=s._space,c=t.valToPos,h=Ei(c(1,o)-c(2,o));return h<l?vO(e.slice().reverse(),3,yV,mo(l/h)).reverse():e}function P2e(t,e,n,r){return r==null?N4:e==null?"":P4(e)}const A9={show:!0,scale:"y",stroke:D4,space:30,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:vV,side:3,grid:z4,ticks:mV,border:gV,font:q4,lineGap:bV,rotate:0};function F2e(t,e){let n=3+(t||1)*2;return fr(n*e,3)}function $2e(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=Ei(o-s),c=t.series[e],h=l/(c.points.space*Hn);return r[1]-r[0]<=h}const w9={scale:null,auto:!0,sorted:0,min:dr,max:-dr},xV=(t,e,n,r,i)=>i,S9={show:!0,auto:!0,sorted:0,gaps:xV,alpha:1,facets:[Si({},w9,{scale:"x"}),Si({},w9,{scale:"y"})]},j9={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:xV,alpha:1,points:{show:$2e,filter:null},values:null,min:dr,max:-dr,idxs:[],path:null,clip:null};function H2e(t,e,n,r,i){return n/10}const AV={time:dwe,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},z2e=Si({},AV,{time:!1,ori:1}),C9={};function wV(t,e){let n=C9[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,c,h){for(let f=0;f<n.plots.length;f++)n.plots[f]!=i&&n.plots[f].pub(r,i,s,o,l,c,h)}},t!=null&&(C9[t]=n)),n}const Jm=1,bO=2;function qf(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 c=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,y=l.width,x=l.height,S=t.valToPosH,w=t.valToPosV;return f.ori==0?n(i,c,h,f,p,S,w,m,v,y,x,SS,S0,CS,jV,_V):n(i,c,h,f,p,w,S,v,m,x,y,jS,j0,W4,CV,TV)}function Q4(t,e){let n=0,r=0,i=Bn(t.bands,F4);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 q2e(t,e,n,r,i){let s=t.mode,o=t.series[e],l=s==2?o.facets[1].scale:o.scale,c=t.scales[l];return i==-1?c.min:i==1?c.max:c.distr==3?c.dir==1?c.min:c.max:0}function lu(t,e,n,r,i,s){return qf(t,e,(o,l,c,h,f,p,m,v,y,x,S)=>{let w=o.pxRound;const A=h.dir*(h.ori==0?1:-1),C=h.ori==0?S0:j0;let j,_;A==1?(j=n,_=r):(j=r,_=n);let k=w(p(l[j],h,x,v)),M=w(m(c[j],f,S,y)),R=w(p(l[_],h,x,v)),N=w(m(s==1?f.max:f.min,f,S,y)),I=new Path2D(i);return C(I,R,N),C(I,k,N),C(I,k,M),I})}function wS(t,e,n,r,i,s){let o=null;if(t.length>0){o=new Path2D;const l=e==0?CS:W4;let c=n;for(let p=0;p<t.length;p++){let m=t[p];if(m[1]>m[0]){let v=m[0]-c;v>0&&l(o,c,r,v,r+s),c=m[1]}}let h=n+i-c,f=10;h>0&&l(o,c,r-f/2,h,r+s+f)}return o}function Q2e(t,e,n){let r=t[t.length-1];r&&r[0]==e?r[1]=n:t.push([e,n])}function U4(t,e,n,r,i,s,o){let l=[],c=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]),y=m==p?v:s(t[m]),x=p-i;v=o<=0&&x>=0&&x<c?s(t[x]):v;let w=m+i;y=o>=0&&w>=0&&w<c?s(t[w]):y,y>=v&&l.push([v,y])}return l}function _9(t){return t==0?JY:t==1?Oi:e=>Hd(e,t)}function SV(t){let e=t==0?SS:jS,n=t==0?(i,s,o,l,c,h)=>{i.arcTo(s,o,l,c,h)}:(i,s,o,l,c,h)=>{i.arcTo(o,s,c,l,h)},r=t==0?(i,s,o,l,c)=>{i.rect(s,o,l,c)}:(i,s,o,l,c)=>{i.rect(o,s,c,l)};return(i,s,o,l,c,h=0,f=0)=>{h==0&&f==0?r(i,s,o,l,c):(h=tl(h,l/2,c/2),f=tl(f,l/2,c/2),e(i,s+h,o),n(i,s+l,o,s+l,o+c,h),n(i,s+l,o+c,s,o+c,f),n(i,s,o+c,s,o,f),n(i,s,o,s+l,o,h),i.closePath())}}const SS=(t,e,n)=>{t.moveTo(e,n)},jS=(t,e,n)=>{t.moveTo(n,e)},S0=(t,e,n)=>{t.lineTo(e,n)},j0=(t,e,n)=>{t.lineTo(n,e)},CS=SV(0),W4=SV(1),jV=(t,e,n,r,i,s)=>{t.arc(e,n,r,i,s)},CV=(t,e,n,r,i,s)=>{t.arc(n,e,r,i,s)},_V=(t,e,n,r,i,s,o)=>{t.bezierCurveTo(e,n,r,i,s,o)},TV=(t,e,n,r,i,s,o)=>{t.bezierCurveTo(n,e,i,r,o,s)};function kV(t){return(e,n,r,i,s)=>qf(e,n,(o,l,c,h,f,p,m,v,y,x,S)=>{let{pxRound:w,points:A}=o,C,j;h.ori==0?(C=SS,j=jV):(C=jS,j=CV);const _=fr(A.width*Hn,3);let k=(A.size-A.width)/2*Hn,M=fr(k*2,3),R=new Path2D,N=new Path2D,{left:I,top:D,width:L,height:z}=e.bbox;CS(N,I-M,D-M,L+M*2,z+M*2);const P=H=>{if(c[H]!=null){let B=w(p(l[H],h,x,v)),F=w(m(c[H],f,S,y));C(R,B+k,F),j(R,B,F,k,0,nA*2)}};if(s)s.forEach(P);else for(let H=r;H<=i;H++)P(H);return{stroke:_>0?R:null,fill:R,clip:N,flags:Jm|bO}})}function OV(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 U2e=OV(S0),W2e=OV(j0);function EV(t){const e=Bn(t==null?void 0:t.alignGaps,0);return(n,r,i,s)=>qf(n,r,(o,l,c,h,f,p,m,v,y,x,S)=>{[i,s]=bS(c,i,s);let w=o.pxRound,A=z=>w(p(z,h,x,v)),C=z=>w(m(z,f,S,y)),j,_;h.ori==0?(j=S0,_=U2e):(j=j0,_=W2e);const k=h.dir*(h.ori==0?1:-1),M={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Jm},R=M.stroke;let N=!1;if(s-i>=x*4){let z=G=>n.posToVal(G,h.key,!0),P=null,H=null,B,F,q,X=A(l[k==1?i:s]),Y=A(l[i]),U=A(l[s]),V=z(k==1?Y+1:U-1);for(let G=k==1?i:s;G>=i&&G<=s;G+=k){let J=l[G],de=(k==1?J<V:J>V)?X:A(J),fe=c[G];de==X?fe!=null?(F=fe,P==null?(j(R,de,C(F)),B=P=H=F):F<P?P=F:F>H&&(H=F)):fe===null&&(N=!0):(P!=null&&_(R,X,C(P),C(H),C(B),C(F)),fe!=null?(F=fe,j(R,de,C(F)),P=H=B=F):(P=H=null,fe===null&&(N=!0)),X=de,V=z(X+k))}P!=null&&P!=H&&q!=X&&_(R,X,C(P),C(H),C(B),C(F))}else for(let z=k==1?i:s;z>=i&&z<=s;z+=k){let P=c[z];P===null?N=!0:P!=null&&j(R,A(l[z]),C(P))}let[D,L]=Q4(n,r);if(o.fill!=null||D!=0){let z=M.fill=new Path2D(R),P=o.fillTo(n,r,o.min,o.max,D),H=C(P),B=A(l[i]),F=A(l[s]);k==-1&&([F,B]=[B,F]),j(z,F,H),j(z,B,H)}if(!o.spanGaps){let z=[];N&&z.push(...U4(l,c,i,s,k,A,e)),M.gaps=z=o.gaps(n,r,i,s,z),M.clip=wS(z,h.ori,v,y,x,S)}return L!=0&&(M.band=L==2?[lu(n,r,i,s,R,-1),lu(n,r,i,s,R,1)]:lu(n,r,i,s,R,L)),M})}function Y2e(t){const e=Bn(t.align,1),n=Bn(t.ascDesc,!1),r=Bn(t.alignGaps,0),i=Bn(t.extend,!1);return(s,o,l,c)=>qf(s,o,(h,f,p,m,v,y,x,S,w,A,C)=>{[l,c]=bS(p,l,c);let j=h.pxRound,{left:_,width:k}=s.bbox,M=Y=>j(y(Y,m,A,S)),R=Y=>j(x(Y,v,C,w)),N=m.ori==0?S0:j0;const I={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Jm},D=I.stroke,L=m.dir*(m.ori==0?1:-1);let z=R(p[L==1?l:c]),P=M(f[L==1?l:c]),H=P,B=P;i&&e==-1&&(B=_,N(D,B,z)),N(D,P,z);for(let Y=L==1?l:c;Y>=l&&Y<=c;Y+=L){let U=p[Y];if(U==null)continue;let V=M(f[Y]),G=R(U);e==1?N(D,V,z):N(D,H,G),N(D,V,G),z=G,H=V}let F=H;i&&e==1&&(F=_+k,N(D,F,z));let[q,X]=Q4(s,o);if(h.fill!=null||q!=0){let Y=I.fill=new Path2D(D),U=h.fillTo(s,o,h.min,h.max,q),V=R(U);N(Y,F,V),N(Y,B,V)}if(!h.spanGaps){let Y=[];Y.push(...U4(f,p,l,c,L,M,r));let U=h.width*Hn/2,V=n||e==1?U:-U,G=n||e==-1?-U:U;Y.forEach(J=>{J[0]+=V,J[1]+=G}),I.gaps=Y=h.gaps(s,o,l,c,Y),I.clip=wS(Y,m.ori,S,w,A,C)}return X!=0&&(I.band=X==2?[lu(s,o,l,c,D,-1),lu(s,o,l,c,D,1)]:lu(s,o,l,c,D,X)),I})}function T9(t,e,n,r,i,s,o=dr){if(t.length>1){let l=null;for(let c=0,h=1/0;c<t.length;c++)if(e[c]!==void 0){if(l!=null){let f=Ei(t[c]-t[l]);f<h&&(h=f,o=Ei(n(t[c],r,i,s)-n(t[l],r,i,s)))}l=c}}return o}function V2e(t){t=t||dv;const e=Bn(t.size,[.6,dr,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=An(i),o=1-e[0],l=Bn(e[1],dr),c=Bn(e[2],1),h=Bn(t.disp,dv),f=Bn(t.each,v=>{}),{fill:p,stroke:m}=h;return(v,y,x,S)=>qf(v,y,(w,A,C,j,_,k,M,R,N,I,D)=>{let L=w.pxRound,z=n,P=r*Hn,H=l*Hn,B=c*Hn,F,q;j.ori==0?[F,q]=s(v,y):[q,F]=s(v,y);const X=j.dir*(j.ori==0?1:-1);let Y=j.ori==0?CS:W4,U=j.ori==0?f:(Ce,ze,ht,Rt,Tn,fn,Zt)=>{f(Ce,ze,ht,Tn,Rt,Zt,fn)},V=Bn(v.bands,F4).find(Ce=>Ce.series[0]==y),G=V!=null?V.dir:0,J=w.fillTo(v,y,w.min,w.max,G),ne=L(M(J,_,D,N)),de,fe,ke,Me=I,Oe=L(w.width*Hn),Ye=!1,ie=null,Se=null,se=null,_e=null;p!=null&&(Oe==0||m!=null)&&(Ye=!0,ie=p.values(v,y,x,S),Se=new Map,new Set(ie).forEach(Ce=>{Ce!=null&&Se.set(Ce,new Path2D)}),Oe>0&&(se=m.values(v,y,x,S),_e=new Map,new Set(se).forEach(Ce=>{Ce!=null&&_e.set(Ce,new Path2D)})));let{x0:et,size:Te}=h;if(et!=null&&Te!=null){z=1,A=et.values(v,y,x,S),et.unit==2&&(A=A.map(ht=>v.posToVal(R+ht*I,j.key,!0)));let Ce=Te.values(v,y,x,S);Te.unit==2?fe=Ce[0]*I:fe=k(Ce[0],j,I,R)-k(0,j,I,R),Me=T9(A,C,k,j,I,R,Me),ke=Me-fe+P}else Me=T9(A,C,k,j,I,R,Me),ke=Me*o+P,fe=Me-ke;ke<1&&(ke=0),Oe>=fe/2&&(Oe=0),ke<5&&(L=JY);let Xe=ke>0,at=Me-ke-(Xe?Oe:0);fe=L(mO(at,B,H)),de=(z==0?fe/2:z==X?0:fe)-z*X*((z==0?P/2:0)+(Xe?Oe/2:0));const Ve={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Ge=Ye?null:new Path2D;let ut=null;if(V!=null)ut=v.data[V.series[1]];else{let{y0:Ce,y1:ze}=h;Ce!=null&&ze!=null&&(C=ze.values(v,y,x,S),ut=Ce.values(v,y,x,S))}let Ue=F*fe,De=q*fe;for(let Ce=X==1?x:S;Ce>=x&&Ce<=S;Ce+=X){let ze=C[Ce];if(ze==null)continue;if(ut!=null){let Bt=ut[Ce]??0;if(ze-Bt==0)continue;ne=M(Bt,_,D,N)}let ht=j.distr!=2||h!=null?A[Ce]:Ce,Rt=k(ht,j,I,R),Tn=M(Bn(ze,J),_,D,N),fn=L(Rt-de),Zt=L(Us(Tn,ne)),lt=L(tl(Tn,ne)),tn=Zt-lt;if(ze!=null){let Bt=ze<0?De:Ue,Lt=ze<0?Ue:De;Ye?(Oe>0&&se[Ce]!=null&&Y(_e.get(se[Ce]),fn,lt+Ua(Oe/2),fe,Us(0,tn-Oe),Bt,Lt),ie[Ce]!=null&&Y(Se.get(ie[Ce]),fn,lt+Ua(Oe/2),fe,Us(0,tn-Oe),Bt,Lt)):Y(Ge,fn,lt+Ua(Oe/2),fe,Us(0,tn-Oe),Bt,Lt),U(v,y,Ce,fn-Oe/2,lt,fe+Oe,tn)}}return Oe>0?Ve.stroke=Ye?_e:Ge:Ye||(Ve._fill=w.width==0?w._fill:w._stroke??w._fill,Ve.width=0),Ve.fill=Ye?Se:Ge,Ve})}function G2e(t,e){const n=Bn(e==null?void 0:e.alignGaps,0);return(r,i,s,o)=>qf(r,i,(l,c,h,f,p,m,v,y,x,S,w)=>{[s,o]=bS(h,s,o);let A=l.pxRound,C=F=>A(m(F,f,S,y)),j=F=>A(v(F,p,w,x)),_,k,M;f.ori==0?(_=SS,M=S0,k=_V):(_=jS,M=j0,k=TV);const R=f.dir*(f.ori==0?1:-1);let N=C(c[R==1?s:o]),I=N,D=[],L=[];for(let F=R==1?s:o;F>=s&&F<=o;F+=R)if(h[F]!=null){let X=c[F],Y=C(X);D.push(I=Y),L.push(j(h[F]))}const z={stroke:t(D,L,_,M,k,A),fill:null,clip:null,band:null,gaps:null,flags:Jm},P=z.stroke;let[H,B]=Q4(r,i);if(l.fill!=null||H!=0){let F=z.fill=new Path2D(P),q=l.fillTo(r,i,l.min,l.max,H),X=j(q);M(F,I,X),M(F,N,X)}if(!l.spanGaps){let F=[];F.push(...U4(c,h,s,o,R,C,n)),z.gaps=F=l.gaps(r,i,s,o,F),z.clip=wS(F,f.ori,y,x,S,w)}return B!=0&&(z.band=B==2?[lu(r,i,s,o,P,-1),lu(r,i,s,o,P,1)]:lu(r,i,s,o,P,B)),z})}function X2e(t){return G2e(K2e,t)}function K2e(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 c=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];c[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?c[m]=0:(c[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(c[m])||(c[m]=0));c[o-1]=h[o-2];for(let m=0;m<o-1;m++)i(l,t[m]+p[m]/3,e[m]+c[m]*p[m]/3,t[m+1]-p[m]/3,e[m+1]-c[m+1]*p[m]/3,t[m+1],e[m+1])}return l}const yO=new Set;function k9(){for(let t of yO)t.syncRect(!0)}w0&&(Sf(Mwe,cm,k9),Sf(Rwe,cm,k9,!0),Sf(bw,cm,()=>{Ni.pxRatio=Hn}));const Z2e=EV(),J2e=kV();function O9(t,e,n,r){return(r?[t[0],t[1]].concat(t.slice(2)):[t[0]].concat(t.slice(1))).map((s,o)=>xO(s,o,e,n))}function eSe(t,e){return t.map((n,r)=>r==0?{}:Si({},e,n))}function xO(t,e,n,r){return Si({},e==0?n:r,t)}function MV(t,e,n){return e==null?Km:[e,n]}const tSe=MV;function nSe(t,e,n){return e==null?Km:yw(e,n,B4,!0)}function RV(t,e,n,r){return e==null?Km:yS(e,n,t.scales[r].log,!1)}const rSe=RV;function DV(t,e,n,r){return e==null?Km:L4(e,n,t.scales[r].log,!1)}const iSe=DV;function sSe(t,e,n,r,i){let s=Us(o9(t),o9(e)),o=e-t,l=Ko(i/r*o,n);do{let c=n[l],h=r*c/o;if(h>=i&&s+(c<5?td.get(c):0)<=17)return[c,h]}while(++l<n.length);return[0,0]}function E9(t){let e,n;return t=t.replace(/(\d+)px/,(r,i)=>(e=Oi((n=+i)*Hn))+"px"),[t,e,n]}function aSe(t){t.show&&[t.font,t.labelFont].forEach(e=>{let n=fr(e[2]*Hn,1);e[0]=e[0].replace(/[0-9.]+px/,n+"px"),e[1]=n})}function Ni(t,e,n){const r={mode:Bn(t.mode,1)},i=r.mode;function s(W,K,ee,te){let ue=K.valToPct(W);return te+ee*(K.dir==-1?1-ue:ue)}function o(W,K,ee,te){let ue=K.valToPct(W);return te+ee*(K.dir==-1?ue:1-ue)}function l(W,K,ee,te){return K.ori==0?s(W,K,ee,te):o(W,K,ee,te)}r.valToPosH=s,r.valToPosV=o;let c=!1;r.status=0;const h=r.root=uo(fwe);if(t.id!=null&&(h.id=t.id),Ma(h,t.class),t.title){let W=uo(gwe,h);W.textContent=t.title}const f=$o("canvas"),p=r.ctx=f.getContext("2d"),m=uo(vwe,h);Sf("click",m,W=>{W.target===y&&(Qn!=Is||Kn!=Sl)&&Dn.click(r,W)},!0);const v=r.under=uo(bwe,m);m.appendChild(f);const y=r.over=uo(ywe,m);t=Zm(t);const x=+Bn(t.pxAlign,1),S=_9(x);(t.plugins||[]).forEach(W=>{W.opts&&(t=W.opts(r,t)||t)});const w=t.ms||.001,A=r.series=i==1?O9(t.series||[],y9,j9,!1):eSe(t.series||[null],S9),C=r.axes=O9(t.axes||[],b9,A9,!0),j=r.scales={},_=r.bands=t.bands||[];_.forEach(W=>{W.fill=An(W.fill||null),W.dir=Bn(W.dir,-1)});const k=i==2?A[1].facets[0].scale:A[0].scale,M={axes:Al,series:_0},R=(t.drawOrder||["axes","series"]).map(W=>M[W]);function N(W){const K=W.distr==3?ee=>ou(ee>0?ee:W.clamp(r,ee,W.min,W.max,W.key)):W.distr==4?ee=>qT(ee,W.asinh):W.distr==100?ee=>W.fwd(ee):ee=>ee;return ee=>{let te=K(ee),{_min:ue,_max:be}=W,Fe=be-ue;return(te-ue)/Fe}}function I(W){let K=j[W];if(K==null){let ee=(t.scales||dv)[W]||dv;if(ee.from!=null){I(ee.from);let te=Si({},j[ee.from],ee,{key:W});te.valToPct=N(te),j[W]=te}else{K=j[W]=Si({},W==k?AV:z2e,ee),K.key=W;let te=K.time,ue=K.range,be=yh(ue);if((W!=k||i==2&&!te)&&(be&&(ue[0]==null||ue[1]==null)&&(ue={min:ue[0]==null?i9:{mode:1,hard:ue[0],soft:ue[0]},max:ue[1]==null?i9:{mode:1,hard:ue[1],soft:ue[1]}},be=!1),!be&&AS(ue))){let Fe=ue;ue=(Ke,rt,gt)=>rt==null?Km:yw(rt,gt,Fe)}K.range=An(ue||(te?tSe:W==k?K.distr==3?rSe:K.distr==4?iSe:MV:K.distr==3?RV:K.distr==4?DV:nSe)),K.auto=An(be?!1:K.auto),K.clamp=An(K.clamp||H2e),K._min=K._max=null,K.valToPct=N(K)}}}I("x"),I("y"),i==1&&A.forEach(W=>{I(W.scale)}),C.forEach(W=>{I(W.scale)});for(let W in t.scales)I(W);const D=j[k],L=D.distr;let z,P;D.ori==0?(Ma(h,pwe),z=s,P=o):(Ma(h,mwe),z=o,P=s);const H={};for(let W in j){let K=j[W];(K.min!=null||K.max!=null)&&(H[W]={min:K.min,max:K.max},K.min=K.max=null)}const B=t.tzDate||(W=>new Date(Oi(W/w))),F=t.fmtDate||$4,q=w==1?p2e(B):v2e(B),X=m9(B,p9(w==1?f2e:g2e,F)),Y=v9(B,g9(y2e,F)),U=[],V=r.legend=Si({},w2e,t.legend),G=r.cursor=Si({},k2e,{drag:{y:i==2}},t.cursor),J=V.show,ne=G.show,de=V.markers;V.idxs=U,de.width=An(de.width),de.dash=An(de.dash),de.stroke=An(de.stroke),de.fill=An(de.fill);let fe,ke,Me,Oe=[],Ye=[],ie,Se=!1,se={};if(V.live){const W=A[1]?A[1].values:null;Se=W!=null,ie=Se?W(r,1,0):{_:0};for(let K in ie)se[K]=N4}if(J)if(fe=$o("table",Cwe,h),Me=$o("tbody",null,fe),V.mount(r,fe),Se){ke=$o("thead",null,fe,Me);let W=$o("tr",null,ke);$o("th",null,W);for(var _e in ie)$o("th",UB,W).textContent=_e}else Ma(fe,Twe),V.live&&Ma(fe,_we);const et={show:!0},Te={show:!1};function Xe(W,K){if(K==0&&(Se||!V.live||i==2))return Km;let ee=[],te=$o("tr",kwe,Me,Me.childNodes[K]);Ma(te,W.class),W.show||Ma(te,Yd);let ue=$o("th",null,te);if(de.show){let Ke=uo(Owe,ue);if(K>0){let rt=de.width(r,K);rt&&(Ke.style.border=rt+"px "+de.dash(r,K)+" "+de.stroke(r,K)),Ke.style.background=de.fill(r,K)}}let be=uo(UB,ue);W.label instanceof HTMLElement?be.appendChild(W.label):be.textContent=W.label,K>0&&(de.show||(be.style.color=W.width>0?de.stroke(r,K):de.fill(r,K)),Ve("click",ue,Ke=>{if(G._lock)return;Qt(Ke);let rt=A.indexOf(W);if((Ke.ctrlKey||Ke.metaKey)!=V.isolate){let gt=A.some((bt,At)=>At>0&&At!=rt&&bt.show);A.forEach((bt,At)=>{At>0&&Ls(At,gt?At==rt?et:Te:et,!0,Kr.setSeries)})}else Ls(rt,{show:!W.show},!0,Kr.setSeries)},!1),nt&&Ve(GB,ue,Ke=>{G._lock||(Qt(Ke),Ls(A.indexOf(W),Iu,!0,Kr.setSeries))},!1));for(var Fe in ie){let Ke=$o("td",Ewe,te);Ke.textContent="--",ee.push(Ke)}return[te,ee]}const at=new Map;function Ve(W,K,ee,te=!0){const ue=at.get(K)||{},be=G.bind[W](r,K,ee,te);be&&(Sf(W,K,ue[W]=be),at.set(K,ue))}function Ge(W,K,ee){const te=at.get(K)||{};for(let ue in te)(W==null||ue==W)&&(pO(ue,K,te[ue]),delete te[ue]);W==null&&at.delete(K)}let ut=0,Ue=0,De=0,Ce=0,ze=0,ht=0,Rt=ze,Tn=ht,fn=De,Zt=Ce,lt=0,tn=0,Bt=0,Lt=0;r.bbox={};let Wt=!1,jt=!1,Ht=!1,cn=!1,qn=!1,bn=!1;function un(W,K,ee){(ee||W!=r.width||K!=r.height)&&ct(W,K),xs(!1),Ht=!0,jt=!0,zt()}function ct(W,K){r.width=ut=De=W,r.height=Ue=Ce=K,ze=ht=0,We(),qt();let ee=r.bbox;lt=ee.left=Hd(ze*Hn,.5),tn=ee.top=Hd(ht*Hn,.5),Bt=ee.width=Hd(De*Hn,.5),Lt=ee.height=Hd(Ce*Hn,.5)}const re=3;function Re(){let W=!1,K=0;for(;!W;){K++;let ee=Xr(K),te=Pn(K);W=K==re||ee&&te,W||(ct(r.width,r.height),jt=!0)}}function ye({width:W,height:K}){un(W,K)}r.setSize=ye;function We(){let W=!1,K=!1,ee=!1,te=!1;C.forEach((ue,be)=>{if(ue.show&&ue._show){let{side:Fe,_size:Ke}=ue,rt=Fe%2,gt=ue.label!=null?ue.labelSize:0,bt=Ke+gt;bt>0&&(rt?(De-=bt,Fe==3?(ze+=bt,te=!0):ee=!0):(Ce-=bt,Fe==0?(ht+=bt,W=!0):K=!0))}}),vs[0]=W,vs[1]=ee,vs[2]=K,vs[3]=te,De-=Aa[1]+Aa[3],ze+=Aa[3],Ce-=Aa[2]+Aa[0],ht+=Aa[0]}function qt(){let W=ze+De,K=ht+Ce,ee=ze,te=ht;function ue(be,Fe){switch(be){case 1:return W+=Fe,W-Fe;case 2:return K+=Fe,K-Fe;case 3:return ee-=Fe,ee+Fe;case 0:return te-=Fe,te+Fe}}C.forEach((be,Fe)=>{if(be.show&&be._show){let Ke=be.side;be._pos=ue(Ke,be._size),be.label!=null&&(be._lpos=ue(Ke,be.labelSize))}})}if(G.dataIdx==null){let W=G.hover,K=W.skip=new Set(W.skip??[]);K.add(void 0);let ee=W.prox=An(W.prox),te=W.bias??(W.bias=0);G.dataIdx=(ue,be,Fe,Ke)=>{if(be==0)return Fe;let rt=Fe,gt=ee(ue,be,Fe,Ke)??dr,bt=gt>=0&&gt<dr,At=D.ori==0?De:Ce,Ut=G.left,Rn=e[0],Yt=e[be];if(K.has(Yt[Fe])){rt=null;let Jt=null,Ft=null,Mt;if(te==0||te==-1)for(Mt=Fe;Jt==null&&Mt-- >0;)K.has(Yt[Mt])||(Jt=Mt);if(te==0||te==1)for(Mt=Fe;Ft==null&&Mt++<Yt.length;)K.has(Yt[Mt])||(Ft=Mt);if(Jt!=null||Ft!=null)if(bt){let ir=Jt==null?-1/0:z(Rn[Jt],D,At,0),Tr=Ft==null?1/0:z(Rn[Ft],D,At,0),Zr=Ut-ir,Un=Tr-Ut;Zr<=Un?Zr<=gt&&(rt=Jt):Un<=gt&&(rt=Ft)}else rt=Ft==null?Jt:Jt==null?Ft:Fe-Jt<=Ft-Fe?Jt:Ft}else bt&&Ei(Ut-z(Rn[Fe],D,At,0))>gt&&(rt=null);return rt}}const Qt=W=>{G.event=W};G.idxs=U,G._lock=!1;let tt=G.points;tt.show=An(tt.show),tt.size=An(tt.size),tt.stroke=An(tt.stroke),tt.width=An(tt.width),tt.fill=An(tt.fill);const Pe=r.focus=Si({},t.focus||{alpha:.3},G.focus),nt=Pe.prox>=0,_t=nt&&tt.one;let Tt=[],on=[],Vr=[];function Gr(W,K){let ee=tt.show(r,K);if(ee instanceof HTMLElement)return Ma(ee,jwe),Ma(ee,W.class),Nl(ee,-10,-10,De,Ce),y.insertBefore(ee,Tt[K]),ee}function _i(W,K){if(i==1||K>0){let ee=i==1&&j[W.scale].time,te=W.value;W.value=ee?u9(te)?v9(B,g9(te,F)):te||Y:te||P2e,W.label=W.label||(ee?E2e:O2e)}if(_t||K>0){W.width=W.width==null?1:W.width,W.paths=W.paths||Z2e||zwe,W.fillTo=An(W.fillTo||q2e),W.pxAlign=+Bn(W.pxAlign,x),W.pxRound=_9(W.pxAlign),W.stroke=An(W.stroke||null),W.fill=An(W.fill||null),W._stroke=W._fill=W._paths=W._focus=null;let ee=F2e(Us(1,W.width),1),te=W.points=Si({},{size:ee,width:Us(1,ee*.2),stroke:W.stroke,space:ee*2,paths:J2e,_stroke:null,_fill:null},W.points);te.show=An(te.show),te.filter=An(te.filter),te.fill=An(te.fill),te.stroke=An(te.stroke),te.paths=An(te.paths),te.pxAlign=W.pxAlign}if(J){let ee=Xe(W,K);Oe.splice(K,0,ee[0]),Ye.splice(K,0,ee[1]),V.values.push(null)}if(ne){U.splice(K,0,null);let ee=null;_t?K==0&&(ee=Gr(W,K)):K>0&&(ee=Gr(W,K)),Tt.splice(K,0,ee),on.splice(K,0,0),Vr.splice(K,0,0)}oi("addSeries",K)}function jr(W,K){K=K??A.length,W=i==1?xO(W,K,y9,j9):xO(W,K,{},S9),A.splice(K,0,W),_i(A[K],K)}r.addSeries=jr;function Pi(W){if(A.splice(W,1),J){V.values.splice(W,1),Ye.splice(W,1);let K=Oe.splice(W,1)[0];Ge(null,K.firstChild),K.remove()}ne&&(U.splice(W,1),Tt.splice(W,1)[0].remove(),on.splice(W,1),Vr.splice(W,1)),oi("delSeries",W)}r.delSeries=Pi;const vs=[!1,!1,!1,!1];function ud(W,K){if(W._show=W.show,W.show){let ee=W.side%2,te=j[W.scale];te==null&&(W.scale=ee?A[1].scale:k,te=j[W.scale]);let ue=te.time;W.size=An(W.size),W.space=An(W.space),W.rotate=An(W.rotate),yh(W.incrs)&&W.incrs.forEach(Fe=>{!td.has(Fe)&&td.set(Fe,nV(Fe))}),W.incrs=An(W.incrs||(te.distr==2?u2e:ue?w==1?d2e:m2e:zd)),W.splits=An(W.splits||(ue&&te.distr==1?q:te.distr==3?gO:te.distr==4?D2e:R2e)),W.stroke=An(W.stroke),W.grid.stroke=An(W.grid.stroke),W.ticks.stroke=An(W.ticks.stroke),W.border.stroke=An(W.border.stroke);let be=W.values;W.values=yh(be)&&!yh(be[0])?An(be):ue?yh(be)?m9(B,p9(be,F)):u9(be)?b2e(B,be):be||X:be||M2e,W.filter=An(W.filter||(te.distr>=3&&te.log==10?L2e:te.distr==3&&te.log==2?B2e:eV)),W.font=E9(W.font),W.labelFont=E9(W.labelFont),W._size=W.size(r,null,K,0),W._space=W._rotate=W._incrs=W._found=W._splits=W._values=null,W._size>0&&(vs[K]=!0,W._el=uo(xwe,m))}}function xl(W,K,ee,te){let[ue,be,Fe,Ke]=ee,rt=K%2,gt=0;return rt==0&&(Ke||be)&&(gt=K==0&&!ue||K==2&&!Fe?Oi(b9.size/3):0),rt==1&&(ue||Fe)&&(gt=K==1&&!be||K==3&&!Ke?Oi(A9.size/2):0),gt}const mc=r.padding=(t.padding||[xl,xl,xl,xl]).map(W=>An(Bn(W,xl))),Aa=r._padding=mc.map((W,K)=>W(r,K,vs,0));let Cr,Ir=null,kn=null;const Gs=i==1?A[0].idxs:null;let mi=null,Xs=!1;function Hr(W,K){if(e=W??[],r.data=r._data=e,i==2){Cr=0;for(let ee=1;ee<A.length;ee++)Cr+=e[ee][0].length}else{e.length==0&&(r.data=r._data=e=[[]]),mi=e[0],Cr=mi.length;let ee=e;if(L==2){ee=e.slice();let te=ee[0]=Array(Cr);for(let ue=0;ue<Cr;ue++)te[ue]=ue}r._data=e=ee}if(xs(!0),oi("setData"),L==2&&(Ht=!0),K!==!1){let ee=D;ee.auto(r,Xs)?_u():Ks(k,ee.min,ee.max),cn=cn||G.left>=0,bn=!0,zt()}}r.setData=Hr;function _u(){Xs=!0;let W,K;i==1&&(Cr>0?(Ir=Gs[0]=0,kn=Gs[1]=Cr-1,W=e[0][Ir],K=e[0][kn],L==2?(W=Ir,K=kn):W==K&&(L==3?[W,K]=yS(W,W,D.log,!1):L==4?[W,K]=L4(W,W,D.log,!1):D.time?K=W+Oi(86400/w):[W,K]=yw(W,K,B4,!0))):(Ir=Gs[0]=W=null,kn=Gs[1]=K=null)),Ks(k,W,K)}let Za,bs,Je,Et,nn,Mn,_r,gi,Ji,Gn;function Xn(W,K,ee,te,ue,be){W??(W=YB),ee??(ee=F4),te??(te="butt"),ue??(ue=YB),be??(be="round"),W!=Za&&(p.strokeStyle=Za=W),ue!=bs&&(p.fillStyle=bs=ue),K!=Je&&(p.lineWidth=Je=K),be!=nn&&(p.lineJoin=nn=be),te!=Mn&&(p.lineCap=Mn=te),ee!=Et&&p.setLineDash(Et=ee)}function ys(W,K,ee,te){K!=bs&&(p.fillStyle=bs=K),W!=_r&&(p.font=_r=W),ee!=gi&&(p.textAlign=gi=ee),te!=Ji&&(p.textBaseline=Ji=te)}function Tu(W,K,ee,te,ue=0){if(te.length>0&&W.auto(r,Xs)&&(K==null||K.min==null)){let be=Bn(Ir,0),Fe=Bn(kn,te.length-1),Ke=ee.min==null?Lwe(te,be,Fe,ue,W.distr==3):[ee.min,ee.max];W.min=tl(W.min,ee.min=Ke[0]),W.max=Us(W.max,ee.max=Ke[1])}}const gc={min:null,max:null};function hd(){for(let te in j){let ue=j[te];H[te]==null&&(ue.min==null||H[k]!=null&&ue.auto(r,Xs))&&(H[te]=gc)}for(let te in j){let ue=j[te];H[te]==null&&ue.from!=null&&H[ue.from]!=null&&(H[te]=gc)}H[k]!=null&&xs(!0);let W={};for(let te in H){let ue=H[te];if(ue!=null){let be=W[te]=Zm(j[te],Uwe);if(ue.min!=null)Si(be,ue);else if(te!=k||i==2)if(Cr==0&&be.from==null){let Fe=be.range(r,null,null,te);be.min=Fe[0],be.max=Fe[1]}else be.min=dr,be.max=-dr}}if(Cr>0){A.forEach((te,ue)=>{if(i==1){let be=te.scale,Fe=H[be];if(Fe==null)return;let Ke=W[be];if(ue==0){let rt=Ke.range(r,Ke.min,Ke.max,be);Ke.min=rt[0],Ke.max=rt[1],Ir=Ko(Ke.min,e[0]),kn=Ko(Ke.max,e[0]),kn-Ir>1&&(e[0][Ir]<Ke.min&&Ir++,e[0][kn]>Ke.max&&kn--),te.min=mi[Ir],te.max=mi[kn]}else te.show&&te.auto&&Tu(Ke,Fe,te,e[ue],te.sorted);te.idxs[0]=Ir,te.idxs[1]=kn}else if(ue>0&&te.show&&te.auto){let[be,Fe]=te.facets,Ke=be.scale,rt=Fe.scale,[gt,bt]=e[ue],At=W[Ke],Ut=W[rt];At!=null&&Tu(At,H[Ke],be,gt,be.sorted),Ut!=null&&Tu(Ut,H[rt],Fe,bt,Fe.sorted),te.min=Fe.min,te.max=Fe.max}});for(let te in W){let ue=W[te],be=H[te];if(ue.from==null&&(be==null||be.min==null)){let Fe=ue.range(r,ue.min==dr?null:ue.min,ue.max==-dr?null:ue.max,te);ue.min=Fe[0],ue.max=Fe[1]}}}for(let te in W){let ue=W[te];if(ue.from!=null){let be=W[ue.from];if(be.min==null)ue.min=ue.max=null;else{let Fe=ue.range(r,be.min,be.max,te);ue.min=Fe[0],ue.max=Fe[1]}}}let K={},ee=!1;for(let te in W){let ue=W[te],be=j[te];if(be.min!=ue.min||be.max!=ue.max){be.min=ue.min,be.max=ue.max;let Fe=be.distr;be._min=Fe==3?ou(be.min):Fe==4?qT(be.min,be.asinh):Fe==100?be.fwd(be.min):be.min,be._max=Fe==3?ou(be.max):Fe==4?qT(be.max,be.asinh):Fe==100?be.fwd(be.max):be.max,K[te]=ee=!0}}if(ee){A.forEach((te,ue)=>{i==2?ue>0&&K.y&&(te._paths=null):K[te.scale]&&(te._paths=null)});for(let te in K)Ht=!0,oi("setScale",te);ne&&G.left>=0&&(cn=bn=!0)}for(let te in H)H[te]=null}function ku(W){let K=mO(Ir-1,0,Cr-1),ee=mO(kn+1,0,Cr-1);for(;W[K]==null&&K>0;)K--;for(;W[ee]==null&&ee<Cr-1;)ee++;return[K,ee]}function _0(){if(Cr>0){let W=A.some(K=>K._focus)&&Gn!=Pe.alpha;W&&(p.globalAlpha=Gn=Pe.alpha),A.forEach((K,ee)=>{if(ee>0&&K.show&&(es(ee,!1),es(ee,!0),K._paths==null)){let te=Gn;Gn!=K.alpha&&(p.globalAlpha=Gn=K.alpha);let ue=i==2?[0,e[ee][0].length-1]:ku(e[ee]);K._paths=K.paths(r,ee,ue[0],ue[1]),Gn!=te&&(p.globalAlpha=Gn=te)}}),A.forEach((K,ee)=>{if(ee>0&&K.show){let te=Gn;Gn!=K.alpha&&(p.globalAlpha=Gn=K.alpha),K._paths!=null&&Ou(ee,!1);{let ue=K._paths!=null?K._paths.gaps:null,be=K.points.show(r,ee,Ir,kn,ue),Fe=K.points.filter(r,ee,be,ue);(be||Fe)&&(K.points._paths=K.points.paths(r,ee,Ir,kn,Fe),Ou(ee,!0))}Gn!=te&&(p.globalAlpha=Gn=te),oi("drawSeries",ee)}}),W&&(p.globalAlpha=Gn=1)}}function es(W,K){let ee=K?A[W].points:A[W];ee._stroke=ee.stroke(r,W),ee._fill=ee.fill(r,W)}function Ou(W,K){let ee=K?A[W].points:A[W],{stroke:te,fill:ue,clip:be,flags:Fe,_stroke:Ke=ee._stroke,_fill:rt=ee._fill,_width:gt=ee.width}=ee._paths;gt=fr(gt*Hn,3);let bt=null,At=gt%2/2;K&&rt==null&&(rt=gt>0?"#fff":Ke);let Ut=ee.pxAlign==1&&At>0;if(Ut&&p.translate(At,At),!K){let Rn=lt-gt/2,Yt=tn-gt/2,Jt=Bt+gt,Ft=Lt+gt;bt=new Path2D,bt.rect(Rn,Yt,Jt,Ft)}K?ai(Ke,gt,ee.dash,ee.cap,rt,te,ue,Fe,be):vc(W,Ke,gt,ee.dash,ee.cap,rt,te,ue,Fe,bt,be),Ut&&p.translate(-At,-At)}function vc(W,K,ee,te,ue,be,Fe,Ke,rt,gt,bt){let At=!1;rt!=0&&_.forEach((Ut,Rn)=>{if(Ut.series[0]==W){let Yt=A[Ut.series[1]],Jt=e[Ut.series[1]],Ft=(Yt._paths||dv).band;yh(Ft)&&(Ft=Ut.dir==1?Ft[0]:Ft[1]);let Mt,ir=null;Yt.show&&Ft&&Pwe(Jt,Ir,kn)?(ir=Ut.fill(r,Rn)||be,Mt=Yt._paths.clip):Ft=null,ai(K,ee,te,ue,ir,Fe,Ke,rt,gt,bt,Mt,Ft),At=!0}}),At||ai(K,ee,te,ue,be,Fe,Ke,rt,gt,bt)}const bc=Jm|bO;function ai(W,K,ee,te,ue,be,Fe,Ke,rt,gt,bt,At){Xn(W,K,ee,te,ue),(rt||gt||At)&&(p.save(),rt&&p.clip(rt),gt&&p.clip(gt)),At?(Ke&bc)==bc?(p.clip(At),bt&&p.clip(bt),Eo(ue,Fe),yc(W,be,K)):Ke&bO?(Eo(ue,Fe),p.clip(At),yc(W,be,K)):Ke&Jm&&(p.save(),p.clip(At),bt&&p.clip(bt),Eo(ue,Fe),p.restore(),yc(W,be,K)):(Eo(ue,Fe),yc(W,be,K)),(rt||gt||At)&&p.restore()}function yc(W,K,ee){ee>0&&(K instanceof Map?K.forEach((te,ue)=>{p.strokeStyle=Za=ue,p.stroke(te)}):K!=null&&W&&p.stroke(K))}function Eo(W,K){K instanceof Map?K.forEach((ee,te)=>{p.fillStyle=bs=te,p.fill(ee)}):K!=null&&W&&p.fill(K)}function Pt(W,K,ee,te){let ue=C[W],be;if(te<=0)be=[0,0];else{let Fe=ue._space=ue.space(r,W,K,ee,te),Ke=ue._incrs=ue.incrs(r,W,K,ee,te,Fe);be=sSe(K,ee,Ke,te,Fe)}return ue._found=be}function Eu(W,K,ee,te,ue,be,Fe,Ke,rt,gt){let bt=Fe%2/2;x==1&&p.translate(bt,bt),Xn(Ke,Fe,rt,gt,Ke),p.beginPath();let At,Ut,Rn,Yt,Jt=ue+(te==0||te==3?-be:be);ee==0?(Ut=ue,Yt=Jt):(At=ue,Rn=Jt);for(let Ft=0;Ft<W.length;Ft++)K[Ft]!=null&&(ee==0?At=Rn=W[Ft]:Ut=Yt=W[Ft],p.moveTo(At,Ut),p.lineTo(Rn,Yt));p.stroke(),x==1&&p.translate(-bt,-bt)}function Xr(W){let K=!0;return C.forEach((ee,te)=>{if(!ee.show)return;let ue=j[ee.scale];if(ue.min==null){ee._show&&(K=!1,ee._show=!1,xs(!1));return}else ee._show||(K=!1,ee._show=!0,xs(!1));let be=ee.side,Fe=be%2,{min:Ke,max:rt}=ue,[gt,bt]=Pt(te,Ke,rt,Fe==0?De:Ce);if(bt==0)return;let At=ue.distr==2,Ut=ee._splits=ee.splits(r,te,Ke,rt,gt,bt,At),Rn=ue.distr==2?Ut.map(Mt=>mi[Mt]):Ut,Yt=ue.distr==2?mi[Ut[1]]-mi[Ut[0]]:gt,Jt=ee._values=ee.values(r,ee.filter(r,Rn,te,bt,Yt),te,bt,Yt);ee._rotate=be==2?ee.rotate(r,Jt,te,bt):0;let Ft=ee._size;ee._size=mo(ee.size(r,Jt,te,W)),Ft!=null&&ee._size!=Ft&&(K=!1)}),K}function Pn(W){let K=!0;return mc.forEach((ee,te)=>{let ue=ee(r,te,vs,W);ue!=Aa[te]&&(K=!1),Aa[te]=ue}),K}function Al(){for(let W=0;W<C.length;W++){let K=C[W];if(!K.show||!K._show)continue;let ee=K.side,te=ee%2,ue,be,Fe=K.stroke(r,W),Ke=ee==0||ee==3?-1:1,[rt,gt]=K._found;if(K.label!=null){let Hi=K.labelGap*Ke,Cs=Oi((K._lpos+Hi)*Hn);ys(K.labelFont[0],Fe,"center",ee==2?Mg:WB),p.save(),te==1?(ue=be=0,p.translate(Cs,Oi(tn+Lt/2)),p.rotate((ee==3?-nA:nA)/2)):(ue=Oi(lt+Bt/2),be=Cs);let Cl=ZY(K.label)?K.label(r,W,rt,gt):K.label;p.fillText(Cl,ue,be),p.restore()}if(gt==0)continue;let bt=j[K.scale],At=te==0?Bt:Lt,Ut=te==0?lt:tn,Rn=K._splits,Yt=bt.distr==2?Rn.map(Hi=>mi[Hi]):Rn,Jt=bt.distr==2?mi[Rn[1]]-mi[Rn[0]]:rt,Ft=K.ticks,Mt=K.border,ir=Ft.show?Ft.size:0,Tr=Oi(ir*Hn),Zr=Oi((K.alignTo==2?K._size-ir-K.gap:K.gap)*Hn),Un=K._rotate*-nA/180,Zn=S(K._pos*Hn),ts=(Tr+Zr)*Ke,li=Zn+ts;be=te==0?li:0,ue=te==1?li:0;let Ss=K.font[0],Zs=K.align==1?Tp:K.align==2?$T:Un>0?Tp:Un<0?$T:te==0?"center":ee==3?$T:Tp,Fi=Un||te==1?"middle":ee==2?Mg:WB;ys(Ss,Fe,Zs,Fi);let vi=K.font[1]*K.lineGap,js=Rn.map(Hi=>S(l(Hi,bt,At,Ut))),Js=K._values;for(let Hi=0;Hi<Js.length;Hi++){let Cs=Js[Hi];if(Cs!=null){te==0?ue=js[Hi]:be=js[Hi],Cs=""+Cs;let Cl=Cs.indexOf(`
`)==-1?[Cs]:Cs.split(/\n/gm);for(let ns=0;ns<Cl.length;ns++){let gy=Cl[ns];Un?(p.save(),p.translate(ue,be+ns*vi),p.rotate(Un),p.fillText(gy,0,0),p.restore()):p.fillText(gy,ue,be+ns*vi)}}}Ft.show&&Eu(js,Ft.filter(r,Yt,W,gt,Jt),te,ee,Zn,Tr,fr(Ft.width*Hn,3),Ft.stroke(r,W),Ft.dash,Ft.cap);let $i=K.grid;$i.show&&Eu(js,$i.filter(r,Yt,W,gt,Jt),te,te==0?2:1,te==0?tn:lt,te==0?Lt:Bt,fr($i.width*Hn,3),$i.stroke(r,W),$i.dash,$i.cap),Mt.show&&Eu([Zn],[1],te==0?1:0,te==0?1:2,te==1?tn:lt,te==1?Lt:Bt,fr(Mt.width*Hn,3),Mt.stroke(r,W),Mt.dash,Mt.cap)}oi("drawAxes")}function xs(W){A.forEach((K,ee)=>{ee>0&&(K._paths=null,W&&(i==1?(K.min=null,K.max=null):K.facets.forEach(te=>{te.min=null,te.max=null})))})}let wl=!1,Ja=!1,it=[];function Ct(){Ja=!1;for(let W=0;W<it.length;W++)oi(...it[W]);it.length=0}function zt(){wl||(Zwe(mr),wl=!0)}function hn(W,K=!1){wl=!0,Ja=K,W(r),mr(),K&&it.length>0&&queueMicrotask(Ct)}r.batch=hn;function mr(){if(Wt&&(hd(),Wt=!1),Ht&&(Re(),Ht=!1),jt){if(Mr(v,Tp,ze),Mr(v,Mg,ht),Mr(v,Xg,De),Mr(v,Kg,Ce),Mr(y,Tp,ze),Mr(y,Mg,ht),Mr(y,Xg,De),Mr(y,Kg,Ce),Mr(m,Xg,ut),Mr(m,Kg,Ue),f.width=Oi(ut*Hn),f.height=Oi(Ue*Hn),C.forEach(({_el:W,_show:K,_size:ee,_pos:te,side:ue})=>{if(W!=null)if(K){let be=ue===3||ue===0?ee:0,Fe=ue%2==1;Mr(W,Fe?"left":"top",te-be),Mr(W,Fe?"width":"height",ee),Mr(W,Fe?"top":"left",Fe?ht:ze),Mr(W,Fe?"height":"width",Fe?Ce:De),fO(W,Yd)}else Ma(W,Yd)}),Za=bs=Je=nn=Mn=_r=gi=Ji=Et=null,Gn=1,md(!0),ze!=Rt||ht!=Tn||De!=fn||Ce!=Zt){xs(!1);let W=De/fn,K=Ce/Zt;if(ne&&!cn&&G.left>=0){G.left*=W,G.top*=K,eo&&Nl(eo,Oi(G.left),0,De,Ce),ws&&Nl(ws,0,Oi(G.top),De,Ce);for(let ee=0;ee<Tt.length;ee++){let te=Tt[ee];te!=null&&(on[ee]*=W,Vr[ee]*=K,Nl(te,mo(on[ee]),mo(Vr[ee]),De,Ce))}}if(Fn.show&&!qn&&Fn.left>=0&&Fn.width>0){Fn.left*=W,Fn.width*=W,Fn.top*=K,Fn.height*=K;for(let ee in R0)Mr(Du,ee,Fn[ee])}Rt=ze,Tn=ht,fn=De,Zt=Ce}oi("setSize"),jt=!1}ut>0&&Ue>0&&(p.clearRect(0,0,f.width,f.height),oi("drawClear"),R.forEach(W=>W()),oi("draw")),Fn.show&&qn&&(Nu(Fn),qn=!1),ne&&cn&&(wc(null,!0,!1),cn=!1),V.show&&V.live&&bn&&(E0(),bn=!1),c||(c=!0,r.status=1,oi("ready")),Xs=!1,wl=!1}r.redraw=(W,K)=>{Ht=K||!1,W!==!1?Ks(k,D.min,D.max):zt()};function As(W,K){let ee=j[W];if(ee.from==null){if(Cr==0){let te=ee.range(r,K.min,K.max,W);K.min=te[0],K.max=te[1]}if(K.min>K.max){let te=K.min;K.min=K.max,K.max=te}if(Cr>1&&K.min!=null&&K.max!=null&&K.max-K.min<1e-16)return;W==k&&ee.distr==2&&Cr>0&&(K.min=Ko(K.min,e[0]),K.max=Ko(K.max,e[0]),K.min==K.max&&K.max++),H[W]=K,Wt=!0,zt()}}r.setScale=As;let xc,Mu,eo,ws,Qf,Ru,Is,Sl,dd,T0,Qn,Kn,Mo=!1;const Dn=G.drag;let gr=Dn.x,zr=Dn.y;ne&&(G.x&&(xc=uo(wwe,y)),G.y&&(Mu=uo(Swe,y)),D.ori==0?(eo=xc,ws=Mu):(eo=Mu,ws=xc),Qn=G.left,Kn=G.top);const Fn=r.select=Si({show:!0,over:!0,left:0,width:0,top:0,height:0},t.select),Du=Fn.show?uo(Awe,Fn.over?y:v):null;function Nu(W,K){if(Fn.show){for(let ee in W)Fn[ee]=W[ee],ee in R0&&Mr(Du,ee,W[ee]);K!==!1&&oi("setSelect")}}r.setSelect=Nu;function k0(W){if(A[W].show)J&&fO(Oe[W],Yd);else if(J&&Ma(Oe[W],Yd),ne){let ee=_t?Tt[0]:Tt[W];ee!=null&&Nl(ee,-10,-10,De,Ce)}}function Ks(W,K,ee){As(W,{min:K,max:ee})}function Ls(W,K,ee,te){K.focus!=null&&NS(W),K.show!=null&&A.forEach((ue,be)=>{be>0&&(W==be||W==null)&&(ue.show=K.show,k0(be),i==2?(Ks(ue.facets[0].scale,null,null),Ks(ue.facets[1].scale,null,null)):Ks(ue.scale,null,null),zt())}),ee!==!1&&oi("setSeries",W,K),te&&Bu("setSeries",r,W,K)}r.setSeries=Ls;function sy(W,K){Si(_[W],K)}function MS(W,K){W.fill=An(W.fill||null),W.dir=Bn(W.dir,-1),K=K??_.length,_.splice(K,0,W)}function RS(W){W==null?_.length=0:_.splice(W,1)}r.addBand=MS,r.setBand=sy,r.delBand=RS;function DS(W,K){A[W].alpha=K,ne&&Tt[W]!=null&&(Tt[W].style.opacity=K),J&&Oe[W]&&(Oe[W].style.opacity=K)}let wa,jl,Ac;const Iu={focus:!0};function NS(W){if(W!=Ac){let K=W==null,ee=Pe.alpha!=1;A.forEach((te,ue)=>{if(i==1||ue>0){let be=K||ue==0||ue==W;te._focus=K?null:be,ee&&DS(ue,be?1:Pe.alpha)}}),Ac=W,ee&&zt()}}J&&nt&&Ve(XB,fe,W=>{G._lock||(Qt(W),Ac!=null&&Ls(null,Iu,!0,Kr.setSeries))});function to(W,K,ee){let te=j[K];ee&&(W=W/Hn-(te.ori==1?ht:ze));let ue=De;te.ori==1&&(ue=Ce,W=ue-W),te.dir==-1&&(W=ue-W);let be=te._min,Fe=te._max,Ke=W/ue,rt=be+(Fe-be)*Ke,gt=te.distr;return gt==3?Xm(10,rt):gt==4?$we(rt,te.asinh):gt==100?te.bwd(rt):rt}function ay(W,K){let ee=to(W,k,K);return Ko(ee,e[0],Ir,kn)}r.valToIdx=W=>Ko(W,e[0]),r.posToIdx=ay,r.posToVal=to,r.valToPos=(W,K,ee)=>j[K].ori==0?s(W,j[K],ee?Bt:De,ee?lt:0):o(W,j[K],ee?Lt:Ce,ee?tn:0),r.setCursor=(W,K,ee)=>{Qn=W.left,Kn=W.top,wc(null,K,ee)};function oy(W,K){Mr(Du,Tp,Fn.left=W),Mr(Du,Xg,Fn.width=K)}function ly(W,K){Mr(Du,Mg,Fn.top=W),Mr(Du,Kg,Fn.height=K)}let fd=D.ori==0?oy:ly,pd=D.ori==1?oy:ly;function O0(){if(J&&V.live)for(let W=i==2?1:0;W<A.length;W++){if(W==0&&Se)continue;let K=V.values[W],ee=0;for(let te in K)Ye[W][ee++].firstChild.nodeValue=K[te]}}function E0(W,K){if(W!=null&&(W.idxs?W.idxs.forEach((ee,te)=>{U[te]=ee}):Qwe(W.idx)||U.fill(W.idx),V.idx=U[0]),J&&V.live){for(let ee=0;ee<A.length;ee++)(ee>0||i==1&&!Se)&&IS(ee,U[ee]);O0()}bn=!1,K!==!1&&oi("setLegend")}r.setLegend=E0;function IS(W,K){let ee=A[W],te=W==0&&L==2?mi:e[W],ue;Se?ue=ee.values(r,W,K)??se:(ue=ee.value(r,K==null?null:te[K],W,K),ue=ue==null?se:{_:ue}),V.values[W]=ue}function wc(W,K,ee){dd=Qn,T0=Kn,[Qn,Kn]=G.move(r,Qn,Kn),G.left=Qn,G.top=Kn,ne&&(eo&&Nl(eo,Oi(Qn),0,De,Ce),ws&&Nl(ws,0,Oi(Kn),De,Ce));let te,ue=Ir>kn;wa=dr,jl=null;let be=D.ori==0?De:Ce,Fe=D.ori==1?De:Ce;if(Qn<0||Cr==0||ue){te=G.idx=null;for(let Ke=0;Ke<A.length;Ke++){let rt=Tt[Ke];rt!=null&&Nl(rt,-10,-10,De,Ce)}nt&&Ls(null,Iu,!0,W==null&&Kr.setSeries),V.live&&(U.fill(te),bn=!0)}else{let Ke,rt,gt;i==1&&(Ke=D.ori==0?Qn:Kn,rt=to(Ke,k),te=G.idx=Ko(rt,e[0],Ir,kn),gt=z(e[0][te],D,be,0));let bt=-10,At=-10,Ut=0,Rn=0,Yt=!0,Jt="",Ft="";for(let Mt=i==2?1:0;Mt<A.length;Mt++){let ir=A[Mt],Tr=U[Mt],Zr=Tr==null?null:i==1?e[Mt][Tr]:e[Mt][1][Tr],Un=G.dataIdx(r,Mt,te,rt),Zn=Un==null?null:i==1?e[Mt][Un]:e[Mt][1][Un];if(bn=bn||Zn!=Zr||Un!=Tr,U[Mt]=Un,Mt>0&&ir.show){let ts=Un==null?-10:Un==te?gt:z(i==1?e[0][Un]:e[Mt][0][Un],D,be,0),li=Zn==null?-10:P(Zn,i==1?j[ir.scale]:j[ir.facets[1].scale],Fe,0);if(nt&&Zn!=null){let Ss=D.ori==1?Qn:Kn,Zs=Ei(Pe.dist(r,Mt,Un,li,Ss));if(Zs<wa){let Fi=Pe.bias;if(Fi!=0){let vi=to(Ss,ir.scale),js=Zn>=0?1:-1,Js=vi>=0?1:-1;Js==js&&(Js==1?Fi==1?Zn>=vi:Zn<=vi:Fi==1?Zn<=vi:Zn>=vi)&&(wa=Zs,jl=Mt)}else wa=Zs,jl=Mt}}if(bn||_t){let Ss,Zs;D.ori==0?(Ss=ts,Zs=li):(Ss=li,Zs=ts);let Fi,vi,js,Js,$i,Hi,Cs=!0,Cl=tt.bbox;if(Cl!=null){Cs=!1;let ns=Cl(r,Mt);js=ns.left,Js=ns.top,Fi=ns.width,vi=ns.height}else js=Ss,Js=Zs,Fi=vi=tt.size(r,Mt);if(Hi=tt.fill(r,Mt),$i=tt.stroke(r,Mt),_t)Mt==jl&&wa<=Pe.prox&&(bt=js,At=Js,Ut=Fi,Rn=vi,Yt=Cs,Jt=Hi,Ft=$i);else{let ns=Tt[Mt];ns!=null&&(on[Mt]=js,Vr[Mt]=Js,r9(ns,Fi,vi,Cs),t9(ns,Hi,$i),Nl(ns,mo(js),mo(Js),De,Ce))}}}}if(_t){let Mt=Pe.prox,ir=Ac==null?wa<=Mt:wa>Mt||jl!=Ac;if(bn||ir){let Tr=Tt[0];Tr!=null&&(on[0]=bt,Vr[0]=At,r9(Tr,Ut,Rn,Yt),t9(Tr,Jt,Ft),Nl(Tr,mo(bt),mo(At),De,Ce))}}}if(Fn.show&&Mo)if(W!=null){let[Ke,rt]=Kr.scales,[gt,bt]=Kr.match,[At,Ut]=W.cursor.sync.scales,Rn=W.cursor.drag;if(gr=Rn._x,zr=Rn._y,gr||zr){let{left:Yt,top:Jt,width:Ft,height:Mt}=W.select,ir=W.scales[At].ori,Tr=W.posToVal,Zr,Un,Zn,ts,li,Ss=Ke!=null&&gt(Ke,At),Zs=rt!=null&&bt(rt,Ut);Ss&&gr?(ir==0?(Zr=Yt,Un=Ft):(Zr=Jt,Un=Mt),Zn=j[Ke],ts=z(Tr(Zr,At),Zn,be,0),li=z(Tr(Zr+Un,At),Zn,be,0),fd(tl(ts,li),Ei(li-ts))):fd(0,be),Zs&&zr?(ir==1?(Zr=Yt,Un=Ft):(Zr=Jt,Un=Mt),Zn=j[rt],ts=P(Tr(Zr,Ut),Zn,Fe,0),li=P(Tr(Zr+Un,Ut),Zn,Fe,0),pd(tl(ts,li),Ei(li-ts))):pd(0,Fe)}else D0()}else{let Ke=Ei(dd-Qf),rt=Ei(T0-Ru);if(D.ori==1){let Ut=Ke;Ke=rt,rt=Ut}gr=Dn.x&&Ke>=Dn.dist,zr=Dn.y&&rt>=Dn.dist;let gt=Dn.uni;gt!=null?gr&&zr&&(gr=Ke>=gt,zr=rt>=gt,!gr&&!zr&&(rt>Ke?zr=!0:gr=!0)):Dn.x&&Dn.y&&(gr||zr)&&(gr=zr=!0);let bt,At;gr&&(D.ori==0?(bt=Is,At=Qn):(bt=Sl,At=Kn),fd(tl(bt,At),Ei(At-bt)),zr||pd(0,Fe)),zr&&(D.ori==1?(bt=Is,At=Qn):(bt=Sl,At=Kn),pd(tl(bt,At),Ei(At-bt)),gr||fd(0,be)),!gr&&!zr&&(fd(0,0),pd(0,0))}if(Dn._x=gr,Dn._y=zr,W==null){if(ee){if(py!=null){let[Ke,rt]=Kr.scales;Kr.values[0]=Ke!=null?to(D.ori==0?Qn:Kn,Ke):null,Kr.values[1]=rt!=null?to(D.ori==1?Qn:Kn,rt):null}Bu(HT,r,Qn,Kn,De,Ce,te)}if(nt){let Ke=ee&&Kr.setSeries,rt=Pe.prox;Ac==null?wa<=rt&&Ls(jl,Iu,!0,Ke):wa>rt?Ls(null,Iu,!0,Ke):jl!=Ac&&Ls(jl,Iu,!0,Ke)}}bn&&(V.idx=te,E0()),K!==!1&&oi("setCursor")}let Ro=null;Object.defineProperty(r,"rect",{get(){return Ro==null&&md(!1),Ro}});function md(W=!1){W?Ro=null:(Ro=y.getBoundingClientRect(),oi("syncRect",Ro))}function cy(W,K,ee,te,ue,be,Fe){G._lock||Mo&&W!=null&&W.movementX==0&&W.movementY==0||(M0(W,K,ee,te,ue,be,Fe,!1,W!=null),W!=null?wc(null,!0,!0):wc(K,!0,!1))}function M0(W,K,ee,te,ue,be,Fe,Ke,rt){if(Ro==null&&md(!1),Qt(W),W!=null)ee=W.clientX-Ro.left,te=W.clientY-Ro.top;else{if(ee<0||te<0){Qn=-10,Kn=-10;return}let[gt,bt]=Kr.scales,At=K.cursor.sync,[Ut,Rn]=At.values,[Yt,Jt]=At.scales,[Ft,Mt]=Kr.match,ir=K.axes[0].side%2==1,Tr=D.ori==0?De:Ce,Zr=D.ori==1?De:Ce,Un=ir?be:ue,Zn=ir?ue:be,ts=ir?te:ee,li=ir?ee:te;if(Yt!=null?ee=Ft(gt,Yt)?l(Ut,j[gt],Tr,0):-10:ee=Tr*(ts/Un),Jt!=null?te=Mt(bt,Jt)?l(Rn,j[bt],Zr,0):-10:te=Zr*(li/Zn),D.ori==1){let Ss=ee;ee=te,te=Ss}}rt&&(K==null||K.cursor.event.type==HT)&&((ee<=1||ee>=De-1)&&(ee=Hd(ee,De)),(te<=1||te>=Ce-1)&&(te=Hd(te,Ce))),Ke?(Qf=ee,Ru=te,[Is,Sl]=G.move(r,ee,te)):(Qn=ee,Kn=te)}const R0={width:0,height:0,left:0,top:0};function D0(){Nu(R0,!1)}let uy,hy,dy,fy;function Uf(W,K,ee,te,ue,be,Fe){Mo=!0,gr=zr=Dn._x=Dn._y=!1,M0(W,K,ee,te,ue,be,Fe,!0,!1),W!=null&&(Ve(zT,hO,Lu,!1),Bu(VB,r,Is,Sl,De,Ce,null));let{left:Ke,top:rt,width:gt,height:bt}=Fn;uy=Ke,hy=rt,dy=gt,fy=bt}function Lu(W,K,ee,te,ue,be,Fe){Mo=Dn._x=Dn._y=!1,M0(W,K,ee,te,ue,be,Fe,!1,!0);let{left:Ke,top:rt,width:gt,height:bt}=Fn,At=gt>0||bt>0,Ut=uy!=Ke||hy!=rt||dy!=gt||fy!=bt;if(At&&Ut&&Nu(Fn),Dn.setScale&&At&&Ut){let Rn=Ke,Yt=gt,Jt=rt,Ft=bt;if(D.ori==1&&(Rn=rt,Yt=bt,Jt=Ke,Ft=gt),gr&&Ks(k,to(Rn,k),to(Rn+Yt,k)),zr)for(let Mt in j){let ir=j[Mt];Mt!=k&&ir.from==null&&ir.min!=dr&&Ks(Mt,to(Jt+Ft,Mt),to(Jt,Mt))}D0()}else G.lock&&(G._lock=!G._lock,wc(K,!0,W!=null));W!=null&&(Ge(zT,hO),Bu(zT,r,Qn,Kn,De,Ce,null))}function LS(W,K,ee,te,ue,be,Fe){if(G._lock)return;Qt(W);let Ke=Mo;if(Mo){let rt=!0,gt=!0,bt=10,At,Ut;D.ori==0?(At=gr,Ut=zr):(At=zr,Ut=gr),At&&Ut&&(rt=Qn<=bt||Qn>=De-bt,gt=Kn<=bt||Kn>=Ce-bt),At&&rt&&(Qn=Qn<Is?0:De),Ut&&gt&&(Kn=Kn<Sl?0:Ce),wc(null,!0,!0),Mo=!1}Qn=-10,Kn=-10,U.fill(null),wc(null,!0,!0),Ke&&(Mo=Ke)}function N0(W,K,ee,te,ue,be,Fe){G._lock||(Qt(W),_u(),D0(),W!=null&&Bu(KB,r,Qn,Kn,De,Ce,null))}function I0(){C.forEach(aSe),un(r.width,r.height,!0)}Sf(bw,cm,I0);const Sc={};Sc.mousedown=Uf,Sc.mousemove=cy,Sc.mouseup=Lu,Sc.dblclick=N0,Sc.setSeries=(W,K,ee,te)=>{let ue=Kr.match[2];ee=ue(r,K,ee),ee!=-1&&Ls(ee,te,!0,!1)},ne&&(Ve(VB,y,Uf),Ve(HT,y,cy),Ve(GB,y,W=>{Qt(W),md(!1)}),Ve(XB,y,LS),Ve(KB,y,N0),yO.add(r),r.syncRect=md);const gd=r.hooks=t.hooks||{};function oi(W,K,ee){Ja?it.push([W,K,ee]):W in gd&&gd[W].forEach(te=>{te.call(null,r,K,ee)})}(t.plugins||[]).forEach(W=>{for(let K in W.hooks)gd[K]=(gd[K]||[]).concat(W.hooks[K])});const jc=(W,K,ee)=>ee,Kr=Si({key:null,setSeries:!1,filters:{pub:l9,sub:l9},scales:[k,A[1]?A[1].scale:null],match:[c9,c9,jc],values:[null,null]},G.sync);Kr.match.length==2&&Kr.match.push(jc),G.sync=Kr;const py=Kr.key,L0=wV(py);function Bu(W,K,ee,te,ue,be,Fe){Kr.filters.pub(W,K,ee,te,ue,be,Fe)&&L0.pub(W,K,ee,te,ue,be,Fe)}L0.sub(r);function my(W,K,ee,te,ue,be,Fe){Kr.filters.sub(W,K,ee,te,ue,be,Fe)&&Sc[W](null,K,ee,te,ue,be,Fe)}r.pub=my;function vd(){L0.unsub(r),yO.delete(r),at.clear(),pO(bw,cm,I0),h.remove(),fe==null||fe.remove(),oi("destroy")}r.destroy=vd;function Cc(){oi("init",t,e),Hr(e||t.data,!1),H[k]?As(k,H[k]):_u(),qn=Fn.show&&(Fn.width>0||Fn.height>0),cn=bn=!0,un(t.width,t.height)}return A.forEach(_i),C.forEach(ud),n?n instanceof HTMLElement?(n.appendChild(h),Cc()):n(r,Cc):Cc(),r}Ni.assign=Si;Ni.fmtNum=P4;Ni.rangeNum=yw;Ni.rangeLog=yS;Ni.rangeAsinh=L4;Ni.orient=qf;Ni.pxRatio=Hn;Ni.join=Kwe;Ni.fmtDate=$4,Ni.tzDate=l2e;Ni.sync=wV;{Ni.addGap=Q2e,Ni.clipGaps=wS;let t=Ni.paths={points:kV};t.linear=EV,t.stepped=Y2e,t.bars=V2e,t.spline=X2e}const oSe=Object.freeze(Object.defineProperty({__proto__:null,default:Ni},Symbol.toStringTag,{value:"Module"})),lSe=jP(oSe);var cSe=tA.exports,M9;function uSe(){return M9||(M9=1,(function(t,e){(function(r,i){t.exports=i(cb(),lSe)})(cSe,(n,r)=>(()=>{var i={"./common/index.ts":((c,h,f)=>{f.r(h),f.d(h,{dataMatch:()=>v,optionsUpdateState:()=>m});var p=function(y,x){var S={};for(var w in y)Object.prototype.hasOwnProperty.call(y,w)&&x.indexOf(w)<0&&(S[w]=y[w]);if(y!=null&&typeof Object.getOwnPropertySymbols=="function")for(var A=0,w=Object.getOwnPropertySymbols(y);A<w.length;A++)x.indexOf(w[A])<0&&Object.prototype.propertyIsEnumerable.call(y,w[A])&&(S[w[A]]=y[w[A]]);return S};Object.is||Object.defineProperty(Object,"is",{value:function(x,S){return x===S&&(x!==0||1/x===1/S)||x!==x&&S!==S}});var m=function(x,S){var w=x.width,A=x.height,C=p(x,["width","height"]),j=S.width,_=S.height,k=p(S,["width","height"]),M="keep";if((A!==_||w!==j)&&(M="update"),Object.keys(C).length!==Object.keys(k).length)return"create";for(var R=0,N=Object.keys(C);R<N.length;R++){var I=N[R];if(!Object.is(C[I],k[I])){M="create";break}}return M},v=function(x,S){return x.length!==S.length?!1:x.every(function(w,A){var C=S[A];return w.length!==C.length?!1:w.every(function(j,_){return j===C[_]})})}}),react:(c=>{c.exports=n}),uplot:(c=>{c.exports=r})},s={};function o(c){var h=s[c];if(h!==void 0)return h.exports;var f=s[c]={exports:{}};return i[c](f,f.exports,o),f.exports}o.n=c=>{var h=c&&c.__esModule?()=>c.default:()=>c;return o.d(h,{a:h}),h},o.d=(c,h)=>{for(var f in h)o.o(h,f)&&!o.o(c,f)&&Object.defineProperty(c,f,{enumerable:!0,get:h[f]})},o.o=(c,h)=>Object.prototype.hasOwnProperty.call(c,h),o.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var l={};return(()=>{/*!*******************************!*\
  !*** ./react/uplot-react.tsx ***!
  \*******************************/o.r(l),o.d(l,{default:()=>v});var c=o("react"),h=o.n(c),f=o("uplot"),p=o.n(f),m=o("./common/index.ts");function v(y){var x=y.options,S=y.data,w=y.target,A=y.onDelete,C=y.onCreate,j=y.resetScales,_=j===void 0?!0:j,k=y.className,M=(0,c.useRef)(null),R=(0,c.useRef)(null),N=(0,c.useRef)(x),I=(0,c.useRef)(w),D=(0,c.useRef)(S),L=(0,c.useRef)(C),z=(0,c.useRef)(A);(0,c.useEffect)(function(){L.current=C,z.current=A});var P=(0,c.useCallback)(function(B){var F;B&&((F=z.current)===null||F===void 0||F.call(z,B),B.destroy(),M.current=null)},[]),H=(0,c.useCallback)(function(){var B,F=new(p())(N.current,D.current,I.current||R.current);M.current=F,(B=L.current)===null||B===void 0||B.call(L,F)},[]);return(0,c.useEffect)(function(){return H(),function(){P(M.current)}},[H,P]),(0,c.useEffect)(function(){if(N.current!==x){var B=(0,m.optionsUpdateState)(N.current,x);N.current=x,!M.current||B==="create"?(P(M.current),H()):B==="update"&&M.current.setSize({width:x.width,height:x.height})}},[x,H,P]),(0,c.useEffect)(function(){D.current!==S&&(M.current?(0,m.dataMatch)(D.current,S)||(_?M.current.setData(S,!0):(M.current.setData(S,!1),M.current.redraw())):(D.current=S,H()),D.current=S)},[S,_,H]),(0,c.useEffect)(function(){return I.current!==w&&(I.current=w,H()),function(){return P(M.current)}},[w,H,P]),w?null:h().createElement("div",{ref:R,className:k})}})(),l=l.default,l})())})(tA)),tA.exports}var hSe=uSe();const dSe=pl(hSe),NV=t=>t===null?"scalar":vS(t.__name__||"")?`{"${$h(t.__name__)}",${Object.entries(t).filter(([e])=>e!=="__name__").map(([e,n])=>`${ed(e)}="${$h(n)}"`).join(", ")}}`:`${t.__name__||""}{${Object.entries(t).filter(([e])=>e!=="__name__").map(([e,n])=>`${ed(e)}="${$h(n)}"`).join(", ")}}`,R9=(t,e)=>{const n=D9[t%D9.length];return e?n:FP(n,.4)},D9=["#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"],YT=(t,e=2)=>{if(t===null)return"null";const n=Math.abs(t);if(n>=1e24)return(t/1e24).toFixed(e)+"Y";if(n>=1e21)return(t/1e21).toFixed(e)+"Z";if(n>=1e18)return(t/1e18).toFixed(e)+"E";if(n>=1e15)return(t/1e15).toFixed(e)+"P";if(n>=1e12)return(t/1e12).toFixed(e)+"T";if(n>=1e9)return(t/1e9).toFixed(e)+"G";if(n>=1e6)return(t/1e6).toFixed(e)+"M";if(n>=1e3)return(t/1e3).toFixed(e)+"k";if(n>=1)return t.toFixed(e);if(n===0)return t.toFixed(e);if(n<1e-23)return(t/1e-24).toFixed(e)+"y";if(n<1e-20)return(t/1e-21).toFixed(e)+"z";if(n<1e-17)return(t/1e-18).toFixed(e)+"a";if(n<1e-14)return(t/1e-15).toFixed(e)+"f";if(n<1e-11)return(t/1e-12).toFixed(e)+"p";if(n<1e-8)return(t/1e-9).toFixed(e)+"n";if(n<1e-5)return(t/1e-6).toFixed(e)+"µ";if(n<.01)return(t/.001).toFixed(e)+"m";if(n<=1)return t.toFixed(e);throw Error("couldn't format a value, this is a bug")},N9=8,I9=t=>new Set(t).size!==t.length,fSe=t=>{const e=t.map(n=>YT(n));if(!I9(e))return e;for(let n=3;n<=N9;n++){const r=t.map(i=>YT(i,n));if(!I9(r))return r}return t.map(n=>YT(n,N9))},rA=t=>{const e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};return String(t).replace(/[&<>"'/]/g,function(n){return e[n]})},pSe=t=>`
            <div class="labels">
              ${Object.keys(t).length===0?'<div class="no-labels">no labels</div>':""}
              ${t.__name__?`<div><strong>${rA(t.__name__)}</strong></div>`:""}
              ${Object.keys(t).filter(e=>e!=="__name__").map(e=>`<div><strong>${rA(e)}</strong>: ${rA(t[e])}</div>`).join("")}
            </div>`,mSe=(t,e)=>{let n,r=null;const i=document.createElement("div");return i.className="u-tooltip",i.style.display="none",{hooks:{init:s=>{n=s.over,n.addEventListener("mouseenter",()=>{i.style.display="block"}),n.addEventListener("mouseleave",()=>{i.style.display="none"}),document.body.appendChild(i)},destroy:()=>{i.remove()},setSeries:(s,o,l)=>{r=o},setCursor:s=>{const{left:o,top:l,idx:c}=s.cursor;if(c==null||o===null||o===void 0||l===null||l===void 0||r===null)return;const h=s.data[0][c],f=e[r][c],p=s.series[r],m=p.labels;if(typeof p.stroke!="function")throw new Error("series.stroke is not a function");const v=p.stroke(s,r),y=n.getBoundingClientRect(),x=o+y.left,S=l+y.top;i.innerHTML=`
            <div class="date">${bf(h,t)}</div>
            <div class="series-value">
              <span class="detail-swatch" style="background-color: ${v}"></span>
              <span>${m.__name__?rA(m.__name__)+": ":" "}<strong>${f}</strong></span>
            </div>
            ${pSe(m)}
          `.trimEnd(),w7({getBoundingClientRect(){return{width:0,height:0,x,y:S,left:x,right:x,top:S,bottom:S}}},i,{placement:"right-start",middleware:[y7(5),A7(),x7()]}).then(({x:A,y:C})=>{Object.assign(i.style,{top:`${C}px`,left:`${A}px`})})}}}},gSe=(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,c)=>c.length>l.length?c:l,"");return o!=""&&(t.ctx.font=i.font[0],s+=t.ctx.measureText(o).width/devicePixelRatio),Math.ceil(s)},vSe=(t,e,n,r)=>{const i=[],s=t.series[e];if(!n&&r&&r.length){const[o,l]=s.idxs,c=t.data[0],h=t.data[e],f=Math.round(t.valToPos(c[o],"x",!0)),p=Math.round(t.valToPos(c[l],"x",!0));r[0][0]===f&&i.push(o);for(let m=0;m<r.length;m++){const v=r[m],y=r[m+1];if(y&&v[1]===y[0]){let x=t.posToIdx(v[1],!0);if(h[x]==null)for(let S=1;S<100;S++){if(h[x+S]!=null){x+=S;break}if(h[x-S]!=null){x-=S;break}}i.push(x)}}r[r.length-1][1]===p&&i.push(l)}return i.length?i:null},bSe=(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=>Ni.tzDate(new Date(l*1e3),"Etc/UTC"),plugins:[mSe(r,t)],legend:{show:!0,live:!1,isolate:!0,markers:{fill:(l,c)=>R9(c-1,s)}},drawOrder:["series","axes"],focus:{alpha:1},scales:i!==null?{y:{range:(l,c,h)=>{const f=Ni.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,c)=>fSe(c),ticks:{stroke:s?"#00000010":"#ffffff20"},grid:{show:!0,stroke:s?"#00000010":"#ffffff20",width:2,dash:[]},labelGap:8,labelSize:28,stroke:s?"#333":"#eee",size:gSe}],series:[{},...n.map((l,c)=>({points:{filter:vSe},label:NV(l.metric),width:1.5,labels:l.metric,stroke:R9(c,s)}))],hooks:{setSelect:[l=>{const c=l.posToVal(l.select.left,"x"),h=Math.max(l.posToVal(l.select.left+l.select.width,"x"),c+1);o(c,h)}]}}),L9=t=>{const e=parseFloat(t);return isNaN(e)?null:e},ySe=(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 c=[];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?(c.push(L9(m[1])),h++):v&&l.length>f&&v[0]<p+r/100?(c.push(L9(v[1].sum)),f++):c.push(null)}return c});return[i,...s]};function B9(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,c)=>s[c]+=+(l||0)));for(let o=1;o<t.length;o++)e(o)||r.push({series:[t.findIndex((l,c)=>c>o&&!e(c)),o]});return r=r.filter(o=>o.series[1]>-1),{data:[t[0]].concat(n),bands:r}}function xSe(t,e){const n=B9(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=FP(r.stroke,.6)),r.points.filter=(i,s,o,l)=>{if(o){const c=[];return e[s].forEach((h,f)=>{h!=null&&c.push(f)}),c}return null}}),t.scales=t.scales||{},t.scales.y={range:(r,i,s)=>[0,Ni.rangeNum(0,s,.1,!0)[1]]},t.hooks=t.hooks||{},t.hooks.setSeries=t.hooks.setSeries||[],t.hooks.setSeries.push((r,i,s)=>{if(s.show!=null){const o=B9(e,l=>!r.series[l].show);r.delBand(null),o.bands.forEach(l=>r.addBand(l)),r.setData(o.data)}}),{opts:t,data:n.data}}const ASe=({data:t,range:{startTime:e,endTime:n,resolution:r},width:i,displayMode:s,yAxisMin:o,onSelectRange:l})=>{const[c,h]=O.useState(null),[f,p]=O.useState(null),{useLocalTime:m}=fi(),v=Ow();if(O.useEffect(()=>{if(i===0)return;const y=ySe(t,e,n,r),x=bSe(y,i,t,m,o,v==="light",l);s===Fm.Stacked?p(xSe(x,y).data):p(y),h(x)},[i,t,s,e,n,r,m,v,l,o]),!(c===null||f===null))return a.jsxs(a.Fragment,{children:[a.jsx(dSe,{options:c,data:f,className:YY.uplotChart}),a.jsxs(pt,{fz:"xs",c:"dimmed",ml:40,mt:-25,mb:"lg",children:["Click: show single series,"," ",navigator.userAgent.includes("Mac")?"⌘":"Ctrl"," + click: hide single series"]})]})},wSe=({expr:t,node:e,endTime:n,range:r,resolution:i,showExemplars:s,displayMode:o,yAxisMin:l,retriggerIdx:c,onSelectRange:h})=>{const{ref:f,width:p}=yK(),[m,v]=O.useState(!0),{showQueryWarnings:y,showQueryInfoNotices:x}=fi(),S=e===null?t:cs(e.type===xt.matrixSelector?{type:xt.vectorSelector,name:e.name,matchers:e.matchers,offset:e.offset,timestamp:e.timestamp,startOrEnd:e.startOrEnd,anchored:e.anchored,smoothed:e.smoothed}:e),w=(n!==null?n:Date.now())/1e3,A=w-r/1e3,C=Bx(i,r)/1e3,{data:j,error:_,isFetching:k,isLoading:M,refetch:R}=Zh({key:[O.useId()],path:"/query_range",params:{query:S,step:C.toString(),start:A.toString(),end:w.toString()},enabled:S!==""}),[N,I]=O.useState(null),D=(z,P)=>a.jsxs(a.Fragment,{children:[y&&(z==null?void 0:z.map((H,B)=>a.jsx(Nt,{color:"red",title:"Query warning",icon:a.jsx(Di,{}),children:H},B))),x&&(P==null?void 0:P.map((H,B)=>a.jsx(Nt,{color:"yellow",title:"Query notice",icon:a.jsx(nr,{}),children:H},B)))]});if(O.useEffect(()=>{j!==void 0&&I({data:j,range:{startTime:A,endTime:w,resolution:C}})},[j]),O.useEffect(()=>{S!==""&&R()},[c,R,S,n,r,i]),O.useEffect(()=>{N!==null&&m&&v(!1)},[N,m,v]),M)return a.jsx(ve,{children:Array.from(Array(5),(z,P)=>a.jsx(Wa,{height:30,mb:15},P))});if(_)return a.jsx(Nt,{color:"red",title:"Error executing query",icon:a.jsx(Di,{}),children:_.message});if(N===null)return a.jsx(Nt,{variant:"transparent",children:"No data queried yet"});const{result:L}=N.data.data;return L.length===0?a.jsxs(_n,{children:[a.jsx(Nt,{title:"Empty query result",icon:a.jsx(nr,{}),children:"This query returned no data."}),D(N.data.warnings)]}):a.jsxs(_n,{children:[e!==null&&e.type===xt.matrixSelector&&a.jsxs(Nt,{color:"orange",title:"Graphing modified expression",icon:a.jsx(Di,{}),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:YY.chartWrapper,children:[a.jsx(n2,{visible:k,zIndex:1e3,h:570,overlayProps:{radius:"sm",blur:.5},loaderProps:{type:"dots",color:"gray.6"}}),a.jsx(ASe,{data:N.data.data.result,range:N.range,width:p,showExemplars:s,displayMode:o,yAxisMin:l,onSelectRange:h})]})]})},SSe=({resolution:t,range:e,onChangeResolution:n})=>{const[r,i]=O.useState(Yn(Bx(t,e))),s=o=>{const l=x6(o);t.type==="custom"&&l===t.step||(l===null?i(Yn(Bx(t,e))):n({type:"custom",step:l}))};return a.jsxs(a.Fragment,{children:[a.jsx(p0,{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=Bx(t,e);n({type:"custom",step:h}),i(Yn(h));return}const c=parseInt(l.value);if(!isNaN(c))n({type:"fixed",step:c});else throw new Error("Invalid resolution value")}}),t.type==="custom"&&a.jsx(cc,{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 iA={exports:{}},jSe=iA.exports,P9;function CSe(){return P9||(P9=1,(function(t,e){(function(n,r){t.exports=r()})(jSe,(function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(i,s,o){var l,c=function(m,v,y){y===void 0&&(y={});var x=new Date(m),S=(function(w,A){A===void 0&&(A={});var C=A.timeZoneName||"short",j=w+"|"+C,_=r[j];return _||(_=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:w,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:C}),r[j]=_),_})(v,y);return S.formatToParts(x)},h=function(m,v){for(var y=c(m,v),x=[],S=0;S<y.length;S+=1){var w=y[S],A=w.type,C=w.value,j=n[A];j>=0&&(x[j]=parseInt(C,10))}var _=x[3],k=_===24?0:_,M=x[0]+"-"+x[1]+"-"+x[2]+" "+k+":"+x[4]+":"+x[5]+":000",R=+m;return(o.utc(M).valueOf()-(R-=R%1e3))/6e4},f=s.prototype;f.tz=function(m,v){m===void 0&&(m=l);var y,x=this.utcOffset(),S=this.toDate(),w=S.toLocaleString("en-US",{timeZone:m}),A=Math.round((S-new Date(w))/1e3/60),C=15*-Math.round(S.getTimezoneOffset()/15)-A;if(!Number(C))y=this.utcOffset(0,v);else if(y=o(w,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(C,!0),v){var j=y.utcOffset();y=y.add(x-j,"minute")}return y.$x.$timezone=m,y},f.offsetName=function(m){var v=this.$x.$timezone||o.tz.guess(),y=c(this.valueOf(),v,{timeZoneName:m}).find((function(x){return x.type.toLowerCase()==="timezonename"}));return y&&y.value};var p=f.startOf;f.startOf=function(m,v){if(!this.$x||!this.$x.$timezone)return p.call(this,m,v);var y=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return p.call(y,m,v).tz(this.$x.$timezone,!0)},o.tz=function(m,v,y){var x=y&&v,S=y||v||l,w=h(+o(),S);if(typeof m!="string")return o(m).tz(S);var A=(function(k,M,R){var N=k-60*M*1e3,I=h(N,R);if(M===I)return[N,M];var D=h(N-=60*(I-M)*1e3,R);return I===D?[N,I]:[k-60*Math.min(I,D)*1e3,Math.max(I,D)]})(o.utc(m,x).valueOf(),w,S),C=A[0],j=A[1],_=o(C).utcOffset(j);return _.$x.$timezone=S,_},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(m){l=m}}}))})(iA)),iA.exports}var _Se=CSe();const IV=pl(_Se),TSe="_metricName_13uqi_1",kSe="_labelPair_13uqi_4",OSe="_labelName_13uqi_14",ESe="_labelValue_13uqi_18",Dg={metricName:TSe,labelPair:kSe,labelName:OSe,labelValue:ESe},MSe=t=>{"clipboard"in navigator?navigator.clipboard.writeText(t).then(()=>ll.show({title:"Copied matcher!",message:`Label matcher ${t} copied to clipboard`})).catch(()=>ll.show({color:"red",title:"Failed to copy matcher!",message:"Label matcher could not be copied to clipboard."})):ll.show({color:"red",title:"Failed to copy matcher!",message:"Clipboard API is not supported in this context (most likely due to non-HTTPS origin)."})},um=({labels:t,format:e})=>{const n=()=>{const r=t&&vS(t.__name__||""),i=[];let s=!0;r&&(i.push(a.jsx("span",{children:a.jsxs("span",{className:Dg.labelValue,children:['"',$h(t.__name__),'"']})},"__name__")),s=!1);for(const o in t)o!=="__name__"&&(i.push(a.jsxs("span",{children:[!s&&", ",a.jsxs("span",{className:Dg.labelPair,onDoubleClick:l=>MSe(l.currentTarget.innerText),title:"Double click to copy label matcher",children:[a.jsx("span",{className:Dg.labelName,children:ed(o)}),"=",a.jsxs("span",{className:Dg.labelValue,children:['"',$h(t[o]),'"']})]})]},o)),s&&(s=!1));return a.jsxs("span",{children:[!r&&a.jsx("span",{className:Dg.metricName,children:t?t.__name__:""}),"{",i,"}"]})};return t===null?a.jsx(a.Fragment,{children:"scalar"}):e?n():a.jsx(a.Fragment,{children:NV(t)})},RSe="_tableWrapper_n77eh_1",DSe="_numberCell_n77eh_7",vx={tableWrapper:RSe,numberCell:DSe};function NSe(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 ISe(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 LSe(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 BSe(t,e,n,r,i,s,o,l,c){return t==="linear"?(0-e)/(n-e)*100+"%":i===0?"0%":r===0?"100%":s===-1?o/l*100+"%":(o+.5*c)/l>0?(o+.5*c)/l*100+"%":"0%"}function PSe(t){const e=parseFloat(t.slice(0,-1));return 5<e&&e<95}function FSe(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 $Se=t=>t===3||t===1?"[":"(",HSe=t=>t===3||t===0?"]":")",LV=([t,e,n,r])=>`${$Se(t)}${e} -> ${n}${HSe(t)}`,zSe="_histogramYWrapper_4ql1n_1",qSe="_histogramYLabels_4ql1n_10",QSe="_histogramYLabel_4ql1n_10",USe="_histogramXWrapper_4ql1n_22",WSe="_histogramXLabels_4ql1n_29",YSe="_histogramXLabel_4ql1n_29",VSe="_histogramContainer_4ql1n_40",GSe="_histogramAxes_4ql1n_46",XSe="_histogramYGrid_4ql1n_55",KSe="_histogramYTick_4ql1n_61",ZSe="_histogramXGrid_4ql1n_69",JSe="_histogramXTick_4ql1n_76",eje="_histogramBucketSlot_4ql1n_84",tje="_histogramBucket_4ql1n_84",Qi={histogramYWrapper:zSe,histogramYLabels:qSe,histogramYLabel:QSe,histogramXWrapper:USe,histogramXLabels:WSe,histogramXLabel:YSe,histogramContainer:VSe,histogramAxes:GSe,histogramYGrid:XSe,histogramYTick:KSe,histogramXGrid:ZSe,histogramXTick:JSe,histogramBucketSlot:eje,histogramBucket:tje},nje=({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 L=parseFloat(D[1]),z=parseFloat(D[2]),P=parseFloat(D[3]),H=z-L;if(H===0){s.push(0);continue}s.push(P/H)}const o=Math.max(...s),l=r[0],c=r[r.length-1],h=parseFloat(c[2]),f=parseFloat(l[1]),p=Math.max(...r.map(D=>parseFloat(D[3]))),m=NSe(c,r),v=h>0?h:0,y=ISe(r),x=LSe(r),S=parseFloat(l[1])<0?parseFloat(l[1]):0,w=S!==0?-Math.log(Math.abs(S)):0,A=x!==0?-Math.log(Math.abs(x)):0,C=y!==0?Math.log(y):0,j=v!==0?Math.log(v):0,_=A-w,k=j-C,M=_+m+k,R=FSe(r),N=BSe(n,f,h,y,x,R,_,M,m),I=PSe(N);return a.jsxs("div",{className:Qi.histogramYWrapper,children:[a.jsxs("div",{className:Qi.histogramYLabels,children:[[1,.75,.5,.25].map(D=>a.jsx("div",{className:Qi.histogramYLabel,children:n==="linear"?"":i.format(p*D)},D)),a.jsx("div",{className:Qi.histogramYLabel,style:{height:0},children:"0"},0)]}),a.jsxs("div",{className:Qi.histogramXWrapper,children:[a.jsxs("div",{className:Qi.histogramContainer,children:[[0,.25,.5,.75,1].map(D=>a.jsxs(zn.Fragment,{children:[a.jsx("div",{className:Qi.histogramYGrid,style:{bottom:D*100+"%"}}),a.jsx("div",{className:Qi.histogramYTick,style:{bottom:D*100+"%"}}),a.jsx("div",{className:Qi.histogramXGrid,style:{left:D*100+"%"}})]},D)),a.jsx("div",{className:Qi.histogramXTick,style:{left:"0%"}}),a.jsx("div",{className:Qi.histogramXTick,style:{left:N}}),a.jsx("div",{className:Qi.histogramXGrid,style:{left:N}}),a.jsx("div",{className:Qi.histogramXTick,style:{left:"100%"}}),a.jsx(rje,{buckets:r,scale:n,rangeMin:f,rangeMax:h,index:t,fds:s,fdMax:o,countMax:p,defaultExpBucketWidth:m,minPositive:y,maxNegative:x,startPositive:C,startNegative:w,xWidthNegative:_,xWidthTotal:M}),a.jsx("div",{className:Qi.histogramAxes})]}),a.jsx("div",{className:Qi.histogramXLabels,children:a.jsx("div",{className:Qi.histogramXLabel,children:a.jsxs(zn.Fragment,{children:[a.jsx("div",{style:{position:"absolute",left:0},children:i.format(f)}),f<0&&I&&a.jsx("div",{style:{position:"absolute",left:N},children:"0"}),a.jsx("div",{style:{position:"absolute",right:0},children:i.format(h)})]})})})]})]})},rje=({buckets:t,scale:e,rangeMin:n,rangeMax:r,index:i,fds:s,fdMax:o,countMax:l,defaultExpBucketWidth:c,minPositive:h,maxNegative:f,startPositive:p,startNegative:m,xWidthNegative:v,xWidthTotal:y})=>a.jsx(zn.Fragment,{children:t.map((x,S)=>{const w=parseFloat(x[1]),A=parseFloat(x[2]),C=parseFloat(x[3]),j=`bucket-${i}-${S}-${Math.ceil(parseFloat(x[3])*100)}`,_=Math.abs(Math.log(Math.abs(A))-Math.log(Math.abs(w))),k=_===0?c:_;let M="",R="",N="";switch(e){case"linear":{M=(A-w)/(r-n)*100+"%",R=(w-n)/(r-n)*100+"%",w===0&&A===0&&(R="0%",M="0%"),N=s[S]/o*100+"%";break}case"exponential":{let I=0;(h===0||f===0)&&(I=c),M=k/(y-I)*100+"%",w<0?R=-(Math.log(Math.abs(w))+m)/(y-I)*100+"%":R=(Math.log(w)-p+c+v-I)/(y-I)*100+"%",w<0&&A>0&&(R=v/y*100+"%"),w===0&&A===0&&(R="0%",M="0%"),N=C/l*100+"%";break}default:throw new Error("Invalid scale")}return a.jsx(qr,{label:`range: ${LV(x)}`,children:a.jsx("div",{id:j,className:Qi.histogramBucketSlot,style:{left:R,width:M},children:a.jsx("div",{id:j,className:Qi.histogramBucket,style:{height:N}})})},S)})});$e.extend(IV);const F9=1e3,Aw=1e4,$9=(t,e)=>e&&t.length>Aw?t.slice(0,Aw):t,ije=({data:t,limitResults:e,setLimitResults:n})=>{const[r,i]=O.useState("exponential"),{useLocalTime:s}=fi(),{result:o,resultType:l}=t,c=o.length<=F9;return a.jsxs(_n,{gap:"lg",mt:0,children:[e&&["vector","matrix"].includes(l)&&o.length>Aw&&a.jsxs(Nt,{color:"orange",icon:a.jsx(Di,{}),title:"Showing limited results",children:["Fetched ",t.result.length," metrics, only displaying first"," ",Aw," for performance reasons.",a.jsx(Wr,{ml:"md",fz:"1em",onClick:()=>n(!1),children:"Show all results"})]}),!c&&a.jsxs(Nt,{title:"Formatting turned off",icon:a.jsx(nr,{}),children:["Showing more than ",F9," series, turning off label formatting to improve rendering performance."]}),a.jsx(ve,{pos:"relative",className:vx.tableWrapper,children:a.jsx(le,{fz:"xs",children:a.jsx(le.Tbody,{children:l==="vector"?$9(o,e).map((h,f)=>a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:a.jsx(um,{labels:h.metric,format:c})}),a.jsxs(le.Td,{className:vx.numberCell,children:[h.value&&h.value[1],h.histogram&&a.jsxs(_n,{children:[a.jsx(nje,{histogram:h.histogram[1],index:f,scale:r}),a.jsxs(ft,{justify:"space-between",align:"center",p:10,children:[a.jsxs(ft,{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(ft,{align:"center",gap:"1rem",children:[a.jsx("span",{children:"x-axis scale:"}),a.jsx(f0,{size:"xs",value:r,onChange:i,data:["exponential","linear"]})]})]}),sje(h.histogram[1])]})]})]},f)):l==="matrix"?$9(o,e).map((h,f)=>a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:a.jsx(um,{labels:h.metric,format:c})}),a.jsx(le.Td,{className:vx.numberCell,children:h.values&&h.values.map((p,m)=>a.jsxs("div",{children:[p[1]," ",a.jsxs(pt,{span:!0,c:"gray.7",size:"1em",title:bf(p[0],s),children:["@ ",p[0]]})]},m))})]},f)):l==="scalar"?a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:"Scalar value"}),a.jsx(le.Td,{className:vx.numberCell,children:o[1]})]}):l==="string"?a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:"String value"}),a.jsx(le.Td,{children:o[1]})]}):a.jsx(Nt,{color:"red",title:"Invalid query response",icon:a.jsx(Di,{}),children:"Invalid result value type"})})})})]})},sje=t=>{var e;return a.jsx(le,{withTableBorder:!0,fz:"xs",children:a.jsxs(le.Tbody,{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[a.jsxs(le.Tr,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[a.jsx(le.Th,{children:"Bucket range"}),a.jsx(le.Th,{children:"Count"})]}),a.jsx(ga,{w:"100%",h:265,children:(e=t.buckets)==null?void 0:e.map((n,r)=>a.jsxs(le.Tr,{children:[a.jsx(le.Td,{style:{textAlign:"left"},children:LV(n)}),a.jsx(le.Td,{children:n[3]})]},r))})]})})},H9=t=>a.jsx(le,{withRowBorders:!1,children:a.jsx(le.Tbody,{children:Object.entries(t).map(([e,n])=>a.jsxs(le.Tr,{children:[a.jsx(le.Td,{pl:0,py:3,c:"dimmed",children:e}),a.jsx(le.Td,{pr:0,py:3,ta:"right",children:n})]},e))})}),aje=({numResults:t,responseTime:e,stats:n})=>a.jsx(qr,{label:a.jsxs(ve,{p:"xs",children:[a.jsx(pt,{mb:"xs",children:"Timing stats (s):"}),H9(n.timings),a.jsx(pt,{mt:"sm",mb:"xs",children:"Sample stats:"}),H9(n.samples)]}),children:a.jsxs(pt,{size:"xs",c:"gray",children:["Load time: ",e,"ms   Result series: ",t]})});$e.extend(IV);const oje=({panelIdx:t,retriggerIdx:e,expr:n})=>{var w,A;const[r,i]=O.useState(0),[s,o]=O.useState(!0),{visualizer:l}=hc(C=>C.queryPage.panels[t]),c=Au(),{showQueryWarnings:h,showQueryInfoNotices:f}=fi(),{endTime:p,range:m}=l,{data:v,error:y,isFetching:x,refetch:S}=Zh({key:[O.useId()],path:"/query",params:{query:n,time:`${(p!==null?p:Date.now())/1e3}`,stats:"true"},enabled:n!=="",recordResponseTime:i});return O.useEffect(()=>{n!==""&&S()},[e,S,n,p]),O.useLayoutEffect(()=>{o(!0)},[v,x]),a.jsxs(_n,{gap:"lg",mt:"sm",children:[a.jsxs(ft,{justify:"space-between",children:[a.jsx(Lq,{time:p,range:m,description:"Evaluation time",onChangeTime:C=>c(uh({idx:t,visualizer:{...l,endTime:C}}))}),!x&&v!==void 0&&a.jsx(aje,{numResults:v.data.result.length,responseTime:r,stats:v.data.stats})]}),x?a.jsx(ve,{children:Array.from(Array(5),(C,j)=>a.jsx(Wa,{height:30,mb:15},j))}):y!==null?a.jsx(Nt,{color:"red",title:"Error executing query",icon:a.jsx(Di,{}),children:y.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(nr,{}),children:"This query returned no data."}),h&&((w=v.warnings)==null?void 0:w.map((C,j)=>a.jsx(Nt,{color:"red",title:"Query warning",icon:a.jsx(Di,{}),children:C},j))),f&&((A=v.infos)==null?void 0:A.map((C,j)=>a.jsx(Nt,{color:"yellow",title:"Query notice",icon:a.jsx(nr,{}),children:C},j))),a.jsx(ije,{data:v.data,limitResults:s,setLimitResults:o})]})]})},lje="_nodeText_1076s_1",cje="_nodeTextSelected_1076s_10",uje="_nodeTextError_1076s_27",hje="_errorText_1076s_34",bx={nodeText:lje,nodeTextSelected:cje,nodeTextError:uje,errorText:hje},dje={abs:{argTypes:[ce.vector],returnType:ce.vector},absent:{argTypes:[ce.vector],returnType:ce.vector},absent_over_time:{argTypes:[ce.matrix],returnType:ce.vector},acos:{argTypes:[ce.vector],returnType:ce.vector},acosh:{argTypes:[ce.vector],returnType:ce.vector},asin:{argTypes:[ce.vector],returnType:ce.vector},asinh:{argTypes:[ce.vector],returnType:ce.vector},atan:{argTypes:[ce.vector],returnType:ce.vector},atanh:{argTypes:[ce.vector],returnType:ce.vector},avg_over_time:{argTypes:[ce.matrix],returnType:ce.vector},ceil:{argTypes:[ce.vector],returnType:ce.vector},changes:{argTypes:[ce.matrix],returnType:ce.vector},clamp:{argTypes:[ce.vector,ce.scalar,ce.scalar],returnType:ce.vector},clamp_max:{argTypes:[ce.vector,ce.scalar],returnType:ce.vector},clamp_min:{argTypes:[ce.vector,ce.scalar],returnType:ce.vector},cos:{argTypes:[ce.vector],returnType:ce.vector},cosh:{argTypes:[ce.vector],returnType:ce.vector},count_over_time:{argTypes:[ce.matrix],returnType:ce.vector},day_of_month:{argTypes:[ce.vector],returnType:ce.vector},day_of_week:{argTypes:[ce.vector],returnType:ce.vector},day_of_year:{argTypes:[ce.vector],returnType:ce.vector},days_in_month:{argTypes:[ce.vector],returnType:ce.vector},deg:{argTypes:[ce.vector],returnType:ce.vector},delta:{argTypes:[ce.matrix],returnType:ce.vector},deriv:{argTypes:[ce.matrix],returnType:ce.vector},double_exponential_smoothing:{argTypes:[ce.matrix,ce.scalar,ce.scalar],returnType:ce.vector},end:{returnType:ce.scalar},exp:{argTypes:[ce.vector],returnType:ce.vector},first_over_time:{argTypes:[ce.matrix],returnType:ce.vector},floor:{argTypes:[ce.vector],returnType:ce.vector},histogram_avg:{argTypes:[ce.vector],returnType:ce.vector},histogram_count:{argTypes:[ce.vector],returnType:ce.vector},histogram_fraction:{argTypes:[ce.scalar,ce.scalar,ce.vector],returnType:ce.vector},histogram_quantile:{argTypes:[ce.scalar,ce.vector],returnType:ce.vector},histogram_quantiles:{argTypes:[ce.vector,ce.string,ce.scalar,ce.scalar],returnType:ce.vector},histogram_stddev:{argTypes:[ce.vector],returnType:ce.vector},histogram_stdvar:{argTypes:[ce.vector],returnType:ce.vector},histogram_sum:{argTypes:[ce.vector],returnType:ce.vector},hour:{argTypes:[ce.vector],returnType:ce.vector},idelta:{argTypes:[ce.matrix],returnType:ce.vector},increase:{argTypes:[ce.matrix],returnType:ce.vector},info:{argTypes:[ce.vector,ce.vector],returnType:ce.vector},irate:{argTypes:[ce.matrix],returnType:ce.vector},label_join:{argTypes:[ce.vector,ce.string,ce.string,ce.string],returnType:ce.vector},label_replace:{argTypes:[ce.vector,ce.string,ce.string,ce.string,ce.string],returnType:ce.vector},last_over_time:{name:"last_over_time",argTypes:[ce.matrix],variadic:0,returnType:ce.vector},ln:{argTypes:[ce.vector],returnType:ce.vector},log10:{argTypes:[ce.vector],returnType:ce.vector},log2:{argTypes:[ce.vector],returnType:ce.vector},mad_over_time:{argTypes:[ce.matrix],returnType:ce.vector},max_of:{argTypes:[ce.scalar,ce.scalar],returnType:ce.scalar},max_over_time:{argTypes:[ce.matrix],returnType:ce.vector},min_of:{argTypes:[ce.scalar,ce.scalar],returnType:ce.scalar},min_over_time:{argTypes:[ce.matrix],returnType:ce.vector},minute:{argTypes:[ce.vector],returnType:ce.vector},month:{argTypes:[ce.vector],returnType:ce.vector},pi:{returnType:ce.scalar},predict_linear:{argTypes:[ce.matrix,ce.scalar],returnType:ce.vector},present_over_time:{argTypes:[ce.matrix],returnType:ce.vector},quantile_over_time:{argTypes:[ce.scalar,ce.matrix],returnType:ce.vector},rad:{argTypes:[ce.vector],returnType:ce.vector},range:{returnType:ce.scalar},rate:{argTypes:[ce.matrix],returnType:ce.vector},resets:{argTypes:[ce.matrix],returnType:ce.vector},round:{argTypes:[ce.vector,ce.scalar],returnType:ce.vector},scalar:{argTypes:[ce.vector],returnType:ce.scalar},sgn:{argTypes:[ce.vector],returnType:ce.vector},sin:{argTypes:[ce.vector],returnType:ce.vector},sinh:{argTypes:[ce.vector],returnType:ce.vector},sort:{argTypes:[ce.vector],returnType:ce.vector},sort_by_label:{argTypes:[ce.vector,ce.string],returnType:ce.vector},sort_by_label_desc:{argTypes:[ce.vector,ce.string],returnType:ce.vector},sort_desc:{argTypes:[ce.vector],returnType:ce.vector},sqrt:{argTypes:[ce.vector],returnType:ce.vector},start:{returnType:ce.scalar},stddev_over_time:{argTypes:[ce.matrix],returnType:ce.vector},stdvar_over_time:{argTypes:[ce.matrix],returnType:ce.vector},step:{returnType:ce.scalar},sum_over_time:{argTypes:[ce.matrix],returnType:ce.vector},tan:{argTypes:[ce.vector],returnType:ce.vector},tanh:{argTypes:[ce.vector],returnType:ce.vector},time:{returnType:ce.scalar},timestamp:{argTypes:[ce.vector],returnType:ce.vector},ts_of_first_over_time:{argTypes:[ce.matrix],returnType:ce.vector},ts_of_last_over_time:{argTypes:[ce.matrix],returnType:ce.vector},ts_of_max_over_time:{argTypes:[ce.matrix],returnType:ce.vector},ts_of_min_over_time:{argTypes:[ce.matrix],returnType:ce.vector},vector:{argTypes:[ce.scalar],returnType:ce.vector},year:{argTypes:[ce.vector],returnType:ce.vector}},Ng=20,VT=10,z9=10,GT={width:me(18),height:me(18)},fje=t=>t.includes("error")?"error":t.includes("waiting")?"waiting":t.includes("running")?"running":"success",sA=({node:t,selectedNode:e,setSelectedNode:n,parentEl:r,reportNodeState:i,reverse:s,childIdx:o})=>{const l=Ii(),[c,h]=O.useState(null),f=O.useCallback(D=>h(D),[]),[p,m]=O.useState({borderColor:"light-dark(var(--mantine-color-gray-4), var(--mantine-color-dark-3))",borderLeftStyle:"solid",borderLeftWidth:2,width:Ng-7,left:-Ng+7}),[v,y]=O.useState(0),[x,S]=O.useState({numSeries:0,labelExamples:{},sortedLabelCards:[]});O.useEffect(()=>{r===void 0&&n({id:l,node:t})},[r,n,l,t]),O.useEffect(()=>()=>{n(null)},[n]);const w=zAe(t),[A,C]=O.useState(w.map(()=>"waiting")),j=O.useMemo(()=>fje(A),[A]);let _=t;if(_.type===xt.matrixSelector){const D={..._};D.anchored=!1,D.smoothed=!1,_={type:xt.call,func:dje.last_over_time,args:[D]}}const{data:k,error:M,isFetching:R}=Zh({key:[Ii()],path:"/query",params:{query:cs(_)},recordResponseTime:y,enabled:j==="success"});O.useEffect(()=>{j==="error"&&i&&i(o,"error")},[j,i,o]),O.useEffect(()=>{M&&i&&i(o,"error")},[M,i,o]),O.useEffect(()=>{R&&i&&i(o,"running")},[R,i,o]);const N=O.useCallback((D,L)=>{C(z=>{const P=[...z];return P[D]=L,P})},[C]);O.useLayoutEffect(()=>{if(r===void 0||r===null||c===null)return;const D=r.getBoundingClientRect(),L=c.getBoundingClientRect();m(s?z=>({...z,top:"calc(50% - 1px)",bottom:L.bottom-D.top,borderTopLeftRadius:3,borderTopStyle:"solid",borderBottomLeftRadius:void 0}):z=>({...z,top:D.bottom-L.top,bottom:"calc(50% - 1px)",borderBottomLeftRadius:3,borderBottomStyle:"solid",borderTopLeftRadius:void 0}))},[r,c,s,f,m]),O.useEffect(()=>{if(!k)return;i&&i(o,"success");let D=0;const L={},{resultType:z,result:P}=k.data;z==="scalar"||z==="string"?D=1:P&&P.length>0&&(D=P.length,P.forEach(F=>{Object.entries(F.metric).forEach(([q,X])=>{q!=="__name__"&&(L[q]||(L[q]={}),L[q][X]=(L[q][X]||0)+1)})}));const H={},B={};Object.entries(L).forEach(([F,q])=>{H[F]=Object.keys(q).length,B[F]=Object.entries(q).sort(([,X],[,Y])=>Y-X).slice(0,z9).map(([X,Y])=>({value:X,count:Y}))}),S({numSeries:D,sortedLabelCards:Object.entries(H).sort((F,q)=>q[1]-F[1]),labelExamples:B})},[k,i,o]);const I=a.jsxs(ft,{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:$r(bx.nodeText,{[bx.nodeTextError]:M,[bx.nodeTextSelected]:(e==null?void 0:e.id)===l}),onClick:()=>{(e==null?void 0:e.id)===l?n(null):n({id:l,node:t})},children:Ho(t,!1,1)}),j==="waiting"?a.jsx(ft,{c:"gray",children:a.jsx(a_,{style:GT})}):j==="running"?a.jsx(So,{size:14,color:"gray",type:"dots"}):j==="error"?a.jsxs(ft,{c:"orange.7",gap:5,fz:"xs",wrap:"nowrap",children:[a.jsx(a_,{style:GT})," Blocked on child query error"]}):R?a.jsx(So,{size:14,color:"gray"}):M?a.jsxs(ft,{gap:5,wrap:"nowrap",style:{flexShrink:0},className:bx.errorText,children:[a.jsx(a_,{style:GT}),a.jsxs(pt,{fz:"xs",children:[a.jsx("strong",{children:"Error executing query:"})," ",M.message]})]}):a.jsxs(ft,{gap:0,wrap:"nowrap",children:[a.jsxs(pt,{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(ft,{gap:"xs",wrap:"nowrap",children:[x.sortedLabelCards.slice(0,VT).map(([D,L])=>a.jsx(qr,{position:"bottom",withArrow:!0,color:"dark.6",label:a.jsx(ve,{p:"xs",children:a.jsxs(tr,{fz:"xs",children:[x.labelExamples[D].map(({value:z,count:P})=>a.jsxs(tr.Item,{py:1,children:[a.jsx(e2,{c:"red.3",bg:"gray.8",children:us(z)})," ","(",P,"x)"]},z)),L>z9&&a.jsx("li",{children:"..."})]})}),children:a.jsxs("span",{style:{cursor:"pointer",whiteSpace:"nowrap"},children:[a.jsx(pt,{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(pt,{component:"span",fz:"xs",c:"dimmed",children:[": ",L]})]})},D)),x.sortedLabelCards.length>VT?a.jsxs(pt,{component:"span",c:"dimmed",fz:"xs",style:{whiteSpace:"nowrap"},children:["...",x.sortedLabelCards.length-VT," more..."]}):null]})]})]});return t.type===xt.binaryExpr?a.jsxs("div",{children:[a.jsx(ve,{ml:Ng,children:a.jsx(sA,{node:w[0],selectedNode:e,setSelectedNode:n,parentEl:c,reverse:!0,childIdx:0,reportNodeState:N})}),I,a.jsx(ve,{ml:Ng,children:a.jsx(sA,{node:w[1],selectedNode:e,setSelectedNode:n,parentEl:c,reverse:!1,childIdx:1,reportNodeState:N})})]}):a.jsxs("div",{children:[I,w.map((D,L)=>a.jsx(ve,{ml:Ng,children:a.jsx(sA,{node:D,selectedNode:e,setSelectedNode:n,parentEl:c,reverse:!1,childIdx:L,reportNodeState:N})},L))]})},pje=({panelIdx:t,selectedNode:e,setSelectedNode:n,closeTreeView:r})=>{const{expr:i}=hc(o=>o.queryPage.panels[t]),{data:s}=Ci({path:"/parse_query",params:{query:i}});return a.jsxs(Qr,{withBorder:!0,fz:"sm",style:{overflowX:"auto"},pl:"sm",children:[a.jsx(ml,{"aria-label":"Close tree view",title:"Close tree view",pos:"absolute",top:7,size:"sm",right:7,onClick:r}),a.jsx(sA,{childIdx:0,node:s.data,selectedNode:e,setSelectedNode:n,reverse:!1})]})},mje={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 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 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."]})]}),end: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:"end()"})," returns the end timestamp of the current query range evaluation as the number of seconds since January 1, 1970 UTC. For instant queries, this is equal to the evaluation timestamp."]})]}),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 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 native 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 native 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 native 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_quantiles: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:"histogram_quantiles(v instant-vector, quantile_label string, φ_1 scalar, φ_2 scalar, ...)"})," ","calculates multiple (between 1 and 10) φ-quantiles (0 ≤ φ ≤ 1) from a"," ",a.jsx("a",{href:"https://prometheus.io/docs/concepts/metric_types/#histogram",children:"classic histogram"})," or from a native histogram. Quantile calculation works the same way as in ",a.jsx("code",{children:"histogram_quantile()"}),". The second argument (a string) specifies the label name that is used to identify different quantiles in the query result."]}),a.jsx("pre",{children:a.jsxs("code",{children:['histogram_quantiles(sum(rate(foo[1m])), "quantile", 0.9, 0.99) # => ',"{",'quantile="0.9"',"}"," 123","{",'quantile="0.99"',"}"," 128"]})})]}),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 native 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 variance of observations for each native 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 native 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 variance of observations for each native 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 native 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 native 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:["If there is no matching info series for a given time series in ",a.jsx("code",{children:"v"})," at a particular timestamp (e.g. because the info series has gone stale), the behavior depends on the data label matchers: If the"," ",a.jsx("code",{children:"data-label-selector"}),"contains any matcher that does not match the empty string (e.g.",a.jsxs("code",{children:["{",'data=~".+"',"}"]}),"), then that time series is dropped from the result at that timestamp, because the required enrichment is unavailable. If all matchers match the empty string (e.g."," ",a.jsxs("code",{children:["{",'data=~".*"',"}"]}),"), or if no ",a.jsx("code",{children:"data-label-selector"}),"is provided, the time series is returned without enrichment."]}),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:["When only negated ",a.jsx("code",{children:"__name__"})," matchers are provided (e.g.",a.jsxs("code",{children:["{",'__name__!="target_info"',"}"]}),"), ",a.jsx("code",{children:"info"})," considers all metrics matching",a.jsx("code",{children:".+_info"})," and then applies the negated matchers as filters. This is because negated matchers alone cannot positively identify which info metrics to consider."]}),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 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 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_of: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:"max_of(a scalar, b scalar)"})," returns the larger of the two scalar values ",a.jsx("code",{children:"a"}),"and ",a.jsx("code",{children:"b"}),"."]})]}),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 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_of: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:"min_of(a scalar, b scalar)"})," returns the smaller of the two scalar values ",a.jsx("code",{children:"a"}),"and ",a.jsx("code",{children:"b"}),"."]})]}),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 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 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 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"}),"."]})]})]}),range: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:"range()"})," returns the range duration of the current query range evaluation in seconds and is equivalent to ",a.jsx("code",{children:"end() - start()"}),". For instant queries, this returns ",a.jsx("code",{children:"0"}),"."]})]}),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."]})}),start: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:"start()"})," returns the start timestamp of the current query range evaluation as the number of seconds since January 1, 1970 UTC. For instant queries, this is equal to the evaluation timestamp."]})]}),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 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 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."]})]}),step: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:"step()"})," returns the query resolution step as the number of seconds. For instant queries, this returns ",a.jsx("code",{children:"0"}),"."]})]}),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 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 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 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 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 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."]})})},gje="_funcDoc_mrib5_1",vje={funcDoc:gje},bje=(t,e)=>a.jsxs(tr,{fz:"sm",my:"md",withPadding:!0,children:[t.length>0&&a.jsxs(tr.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 xo.equal:return a.jsxs(tr.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:['"',us(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:['"',us(n.value),'"']}),"."]});case xo.notEqual:return a.jsxs(tr.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:['"',us(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:['"',us(n.value),'"']}),"."]});case xo.matchRegexp:return a.jsxs(tr.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:['"',us(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:['"',us(n.value),'"']}),"."]});case xo.matchNotRegexp:return a.jsxs(tr.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:['"',us(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:['"',us(n.value),'"']}),"."]});default:throw new Error("invalid matcher type")}})]}),q9=({node:t})=>{const e=t.name.replace(/(_count|_sum|_bucket|_total)$/,""),{lookbackDelta:n}=fi(),{data:r}=Ci({path:"/metadata",params:{metric:t.name}}),{data:i}=Ci({path:"/metadata",params:{metric:e}}),s=r.data[t.name]??i.data[e];return a.jsxs(Qr,{withBorder:!0,children:[a.jsxs(pt,{fz:"lg",fw:600,mb:"md",children:[t.type===xt.vectorSelector?"Instant":"Range"," vector selector"]}),a.jsx(pt,{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(o0,{my:"md"}),a.jsxs(pt,{fz:"sm",children:[t.type===xt.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:Yn(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:Yn(t.offset)})," ","into the past,"]}):a.jsxs(a.Fragment,{children:[", time-shifted"," ",a.jsx("span",{className:"promql-code promql-duration",children:Yn(-t.offset)})," ","into the future,"]})," ","for any series that match all of the following criteria:"]}),bje(t.name,t.matchers),a.jsxs(pt,{fz:"sm",children:["If a series has no values in the last"," ",a.jsx("span",{className:"promql-code promql-duration",children:t.type===xt.vectorSelector?n:Yn(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:Yn(t.offset)})," ","in the past)"]}),", the series will not be returned."]})]})},nd=t=>{switch(t){case"+Inf":return 1/0;case"-Inf":return-1/0;default:return parseFloat(t)}},fv=t=>{switch(t){case 1/0:return"+Inf";case-1/0:return"-Inf";default:return t.toString()}},yje=(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 ",da([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 (${nd(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})," (",nd(e.val)*100,"%) of the input series"]});default:throw new Error(`invalid aggregation type ${t}`)}},xje=(t,e)=>e?a.jsxs(a.Fragment,{children:["aggregating away the [",da(t),"] label dimensions"]}):t.length===1?a.jsxs(a.Fragment,{children:["grouped by their ",da(t)," label dimension"]}):t.length>1?a.jsxs(a.Fragment,{children:["grouped by their [",da(t),"] label dimensions"]}):"aggregating away any label dimensions",Aje=({node:t})=>a.jsxs(Qr,{withBorder:!0,children:[a.jsx(pt,{fz:"lg",fw:600,mb:"md",children:"Aggregation"}),a.jsxs(pt,{fz:"sm",children:["This node ",yje(t.op,t.param),","," ",xje(t.grouping,t.without),"."]})]}),BV="filtered";var Jg=(t=>(t.multipleMatchesForOneToOneMatching="multipleMatchesForOneToOneMatching",t.multipleMatchesOnBothSides="multipleMatchesOnBothSides",t.multipleMatchesOnOneSide="multipleMatchesOnOneSide",t))(Jg||{});const Q9=16777619,wje=2166136261,Sje=55296,U9=t=>{let e=wje;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*=Q9;n<t.length-1&&(e^=Sje,e*=Q9)}return e.toString()},jje=(t,e)=>(e.sort(),t?n=>U9(e.map(r=>n[r])):n=>U9(Object.keys(n).filter(r=>!e.includes(r)&&r!=="__name__").map(r=>n[r]))),W9=(t,e,n)=>{const r={};for(const i in t)n.includes(i)===e&&(e||i!=="__name__")&&(r[i]=t[i]);return r},Cje=(t,e,n)=>{const{value:r,keep:i}=ww(t,e,n);return R4(t)?Number(i):r},ww=(t,e,n)=>{switch(t){case en.add:return{value:e+n,keep:!0};case en.sub:return{value:e-n,keep:!0};case en.mul:return{value:e*n,keep:!0};case en.div:return{value:e/n,keep:!0};case en.pow:return{value:Math.pow(e,n),keep:!0};case en.mod:return{value:e%n,keep:!0};case en.eql:return{value:e,keep:e===n};case en.neq:return{value:e,keep:e!==n};case en.gtr:return{value:e,keep:e>n};case en.lss:return{value:e,keep:e<n};case en.gte:return{value:e,keep:e>=n};case en.lte:return{value:e,keep:e<=n};case en.atan2:return{value:Math.atan2(e,n),keep:!0};default:throw new Error("invalid binop")}},_je=t=>[en.add,en.sub,en.mul,en.div,en.pow,en.mod,en.atan2].includes(t),Tje=(t,e,n,r)=>{const i={};for(const s in t)i[s]=t[s];if(_je(n)&&delete i.__name__,r.card===Rr.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},kje=(t,e,n,r,i,s)=>{[r,i]=e.card===Rr.oneToMany?[i,r]:[r,i];const o={},l=jje(e.on,e.labels),c=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){c.add(f);return}o[f]={groupLabels:W9(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){c.add(f);return}o[f]={groupLabels:W9(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,fv(e.fillValues.lhs)],filled:!0}),h.lhsCount=1),h.rhs.length===0&&e.fillValues.rhs!==null&&(h.rhs.push({metric:h.groupLabels,value:[0,fv(e.fillValues.rhs)],filled:!0}),h.rhsCount=1)}),Object.values(o).forEach(h=>{switch(e.card){case Rr.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 Rr.oneToMany:case Rr.manyToOne:h.rhs.length>1&&(h.error={type:"multipleMatchesOnOneSide"});break;case Rr.manyToMany:if(!cO(t))throw new Error("unexpected many-to-many matching for non-set operator");break;default:throw new Error("unknown vector matching cardinality")}h.error||(cO(t)?(h.lhs.forEach((f,p)=>{(t===en.and&&h.rhs.length>0||t===en.unless&&h.rhs.length===0||t===en.or)&&h.result.push({sample:{metric:f.metric,value:f.value},manySideIdx:p})}),t===en.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,y]=e.card!==Rr.oneToMany?[p.value[1],f.value[1]]:[f.value[1],p.value[1]];let{value:x,keep:S}=ww(t,nd(v),nd(y));const w=Tje(p.metric,f.metric,t,e);n&&(x=S?1:0,delete w.__name__),h.result.push({sample:{metric:w,value:[p.value[0],S||n?fv(x):BV]},manySideIdx:m})})}))}),e.card===Rr.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+c.size}},Y9=({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(le,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,fz:"xs",children:[a.jsx(le.Thead,{children:a.jsxs(le.Tr,{children:[!r&&a.jsx(le.Th,{children:"Left labels"}),a.jsx(le.Th,{children:"Left value"}),a.jsx(le.Th,{children:"Operator"}),r&&a.jsx(le.Th,{children:"Right labels"}),a.jsx(le.Th,{children:"Right value"}),a.jsx(le.Th,{}),a.jsx(le.Th,{children:"Result"})]})}),a.jsx(le.Tbody,{children:n.map((i,s)=>{if(!i.value)throw new Error("Native histograms are not supported yet");const o=nd(i.value[1]),l=nd(e[1]);let{value:c,keep:h}=r?ww(t.op,l,o):ww(t.op,o,l);R4(t.op)&&r&&(c=o),t.bool&&(c=Number(h),h=!0);const f=a.jsx(le.Td,{ta:"right",children:e[1]}),p=a.jsxs(a.Fragment,{children:[a.jsx(le.Td,{children:a.jsx(um,{labels:i.metric,format:!0})}),a.jsx(le.Td,{ta:"right",children:i.value[1]})]});return a.jsxs(le.Tr,{children:[r?f:p,a.jsxs(le.Td,{ta:"center",children:[t.op,t.bool&&" bool"]}),r?p:f,a.jsx(le.Td,{ta:"center",children:"="}),a.jsx(le.Td,{ta:"right",children:h?fv(c):a.jsx(pt,{c:"dimmed",children:"dropped"})})]},s)})})]}),tb=["#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"],V9=tb.length/2+3,XT=(t,e)=>`${tb[(t+(e||0))%tb.length]}80`,KT=t=>a.jsx(ve,{display:"inline-block",w:12,h:12,bg:t,style:{borderRadius:2,flexShrink:0}}),Oje=(t,e,n)=>{const r={};for(const i in t)n.includes(i)===e&&(e||i!=="__name__")||(r[i]=t[i]);return r},Eje=t=>{const e=t.matching,[n,r]=e.card===Rr.oneToMany?["left","right"]:["right","left"];return a.jsxs(a.Fragment,{children:[a.jsx(pt,{size:"sm",children:R4(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(tr,{my:"md",fz:"sm",withPadding:!0,children:[(e.labels.length>0||e.on)&&(e.on?a.jsxs(tr.Item,{children:[a.jsx("span",{className:"promql-code promql-keyword",children:"on"}),"(",da(e.labels),"):"," ",e.labels.length>0?a.jsxs(a.Fragment,{children:["series on both sides are matched on the labels"," ",da(e.labels)]}):a.jsx(a.Fragment,{children:"all series from one side are matched to all series on the other side."})]}):a.jsxs(tr.Item,{children:[a.jsx("span",{className:"promql-code promql-keyword",children:"ignoring"}),"(",da(e.labels),"): series on both sides are matched on all of their labels, except"," ",da(e.labels),"."]})),e.card===Rr.oneToOne?a.jsx(tr.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(tr.Item,{children:[a.jsxs("span",{className:"promql-code promql-keyword",children:["group_",r]}),"(",da(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 ",da(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(tr.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(tr.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(tr.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(tr.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."]})]})]})},Mje=(t,e,n)=>{const r=a.jsxs(a.Fragment,{children:[a.jsx(pt,{size:"sm",children:a.jsx("strong",{children:"Possible fixes:"})}),a.jsxs(tr,{withPadding:!0,my:"md",fz:"sm",children:[n.type===Jg.multipleMatchesForOneToOneMatching&&a.jsxs(tr.Item,{children:[a.jsxs(pt,{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(pt,{size:"sm",ta:"center",my:"md",children:Ho({...t,matching:{...t.matching?t.matching:{labels:[],on:!1,include:[],fillValues:{lhs:null,rhs:null}},card:n.dupeSide==="left"?Rr.manyToOne:Rr.oneToMany}},!0,1)})]}),a.jsxs(tr.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(tr.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 Jg.multipleMatchesForOneToOneMatching:return a.jsxs(a.Fragment,{children:[a.jsxs(pt,{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 Jg.multipleMatchesOnBothSides:return a.jsxs(a.Fragment,{children:[a.jsxs(pt,{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 Jg.multipleMatchesOnOneSide:{const[i,s]=t.matching.card===Rr.oneToMany?["left","right"]:["right","left"];return a.jsxs(a.Fragment,{children:[a.jsxs(pt,{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")}},Rje=({node:t,lhs:e,rhs:n})=>{const[r,i]=fb({key:"queryPage.explain.binaryOperators.showSampleValues",defaultValue:!1}),[s,o]=O.useState(100),[l,c]=O.useState(100),{matching:h}=t;if(h===null)throw new Error("missing matching parameters in vector-to-vector binop");const{groups:f,numGroups:p}=kje(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(pt,{size:"sm",children:Eje(t)}),a.jsx(ft,{my:"lg",justify:"flex-end",gap:"xl",children:a.jsx(Nb,{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(Di,{}),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(Wr,{fz:"sm",onClick:()=>o(void 0),children:"Show all groups"})]}),m>0&&a.jsxs(Nt,{color:"yellow",mb:"md",icon:a.jsx(Di,{}),children:["Found matching issues in ",m," match group",m>1?"s":"",". See below for per-group error details."]}),a.jsx(le,{fz:"xs",withRowBorders:!1,children:a.jsx(le.Tbody,{children:Object.values(f).map((v,y)=>{const{groupLabels:x,lhs:S,lhsCount:w,rhs:A,rhsCount:C,result:j,error:_}=v,k=L=>a.jsx(le.Tr,{ta:"center",children:a.jsx(le.Td,{colSpan:2,style:{backgroundColor:`${L}25`},children:a.jsx(um,{labels:x,format:!0})})}),M=(L,z,P,H)=>a.jsx(ve,{style:{borderRadius:3,border:"2px solid",borderColor:z===0?"light-dark(var(--mantine-color-gray-4), var(--mantine-color-gray-7))":P},children:a.jsx(le,{fz:"xs",withRowBorders:!1,verticalSpacing:5,children:a.jsxs(le.Tbody,{children:[z===0?a.jsx(le.Tr,{children:a.jsx(le.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:[k(P),L.map((B,F)=>{if(B.value===void 0)throw new Error("Native histograms are not supported yet");return a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:a.jsxs(ft,{wrap:"nowrap",gap:7,align:"center",children:[KT(XT(F,H)),a.jsx(um,{labels:Oje(B.metric,h.on,h.labels),format:!0}),B.filled&&a.jsx(pt,{size:"sm",c:"dimmed",children:"no match, filling in default value"})]})}),r&&a.jsx(le.Td,{ta:"right",children:B.value[1]})]},F)})]}),z>L.length&&a.jsx(le.Tr,{children:a.jsxs(le.Td,{ta:"center",py:"md",fw:"bold",c:"gray.6",children:[z-L.length," more series omitted   –  ",a.jsx(Wr,{size:"xs",onClick:()=>c(void 0),children:"Show all series"})]})})]})})}),R=tb[y%tb.length],N=M(S,w,R),I=M(A,C,R,V9),D=a.jsx(ve,{style:{borderRadius:3,border:"2px solid",borderColor:j.length===0||_!==null?"light-dark(var(--mantine-color-gray-4), var(--mantine-color-gray-7))":R},children:a.jsx(le,{fz:"xs",withRowBorders:!1,verticalSpacing:5,children:a.jsx(le.Tbody,{children:_!==null?a.jsx(le.Tr,{children:a.jsx(le.Td,{ta:"center",c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-5))",py:"md",fw:"bold",children:"error, result omitted"})}):j.length===0?a.jsx(le.Tr,{children:a.jsx(le.Td,{ta:"center",c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-5))",py:"md",fw:"bold",children:"dropped"})}):_!==null?a.jsx(le.Tr,{children:a.jsx(le.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:j.map(({sample:L,manySideIdx:z},P)=>{if(L.value===void 0)throw new Error("Native histograms are not supported yet");const H=L.value[1]===BV,[B,F]=h.card===Rr.oneToMany?[0,z]:[z,0];return a.jsxs(le.Tr,{children:[a.jsx(le.Td,{style:{opacity:H?.5:1},title:H?"Series has been filtered by comparison operator":void 0,children:a.jsxs(ft,{wrap:"nowrap",gap:"xs",align:"flex-start",children:[a.jsxs(ft,{wrap:"nowrap",gap:0,children:[KT(XT(B)),a.jsx("span",{style:{color:"#aaa"},children:"–"}),KT(XT(F,V9))]}),a.jsx(um,{labels:L.metric,format:!0})]})}),r&&a.jsx(le.Td,{ta:"right",children:H?a.jsx("span",{style:{color:"grey"},children:"filtered"}):a.jsx("span",{children:L.value[1]})})]},P)})})})})});return a.jsxs(zn.Fragment,{children:[y!==0&&a.jsx("tr",{style:{height:30}}),a.jsx(le.Tr,{children:a.jsx(le.Td,{colSpan:5,children:_&&a.jsx(Nt,{color:"red",mb:"md",title:"Error in match group below",icon:a.jsx(Di,{}),children:Mje(t,v,_)})})}),a.jsxs(le.Tr,{children:[a.jsx(le.Td,{valign:"middle",p:0,children:N}),a.jsxs(le.Td,{ta:"center",fw:cO(t.op)?"bold":void 0,children:[t.op,t.bool&&" bool"]}),a.jsx(le.Td,{valign:"middle",p:0,children:I}),a.jsx(le.Td,{ta:"center",children:"="}),a.jsx(le.Td,{valign:"middle",p:0,children:D})]})]},y)})})})]})},Dje=({node:t,lhs:e,rhs:n})=>{const[r,i]=[nd(e[1]),nd(n[1])];return a.jsxs(le,{withColumnBorders:!0,withTableBorder:!0,children:[a.jsx(le.Thead,{children:a.jsxs(le.Tr,{children:[a.jsx(le.Th,{children:"Left value"}),a.jsx(le.Th,{children:"Operator"}),a.jsx(le.Th,{children:"Right value"}),a.jsx(le.Th,{}),a.jsx(le.Th,{children:"Result"})]})}),a.jsx(le.Tbody,{children:a.jsxs(le.Tr,{children:[a.jsx(le.Td,{className:"number-cell",children:e[1]}),a.jsxs(le.Td,{className:"op-cell",children:[t.op,t.bool&&" bool"]}),a.jsx(le.Td,{className:"number-cell",children:n[1]}),a.jsx(le.Td,{className:"op-cell",children:"="}),a.jsx(le.Td,{className:"number-cell",children:fv(Cje(t.op,r,i))})]})})]})},Nje=({node:t})=>{const{data:e}=Ci({path:"/query",params:{query:cs(t.lhs)}}),{data:n}=Ci({path:"/query",params:{query:cs(t.rhs)}});if(e.data.resultType!==qp(t.lhs)||n.data.resultType!==qp(t.rhs))return null;if(e.data.resultType==="scalar"&&n.data.resultType==="scalar")return a.jsxs(Qr,{withBorder:!0,children:[a.jsx(pt,{fz:"lg",fw:600,mb:"md",children:"Scalar-to-scalar binary operation"}),a.jsx(Dje,{node:t,lhs:e.data.result,rhs:n.data.result})]});if(e.data.resultType==="scalar"&&n.data.resultType==="vector")return a.jsxs(Qr,{withBorder:!0,children:[a.jsx(pt,{fz:"lg",fw:600,mb:"md",children:"Scalar-to-vector binary operation"}),a.jsx(Y9,{node:t,vector:n.data.result,scalar:e.data.result,scalarLeft:!0})]});if(e.data.resultType==="vector"&&n.data.resultType==="scalar")return a.jsxs(Qr,{withBorder:!0,children:[a.jsx(pt,{fz:"lg",fw:600,mb:"md",children:"Vector-to-scalar binary operation"}),a.jsx(Y9,{node:t,scalar:n.data.result,vector:e.data.result,scalarLeft:!1})]});if(e.data.resultType==="vector"&&n.data.resultType==="vector")return a.jsxs(Qr,{withBorder:!0,children:[a.jsx(pt,{fz:"lg",fw:600,mb:"md",children:"Vector-to-vector binary operation"}),a.jsx(Rje,{node:t,lhs:e.data.result,rhs:n.data.result})]});throw new Error("invalid binary operator argument types")},Ije=({node:t,treeShown:e,showTree:n})=>{if(t===null)return a.jsxs(Nt,{title:"How to use the Explain view",icon:a.jsx(nr,{}),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(Wr,{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 xt.aggregation:return a.jsx(Aje,{node:t});case xt.binaryExpr:return a.jsx(Nje,{node:t});case xt.call:return a.jsxs(Qr,{withBorder:!0,children:[a.jsx(pt,{fz:"lg",fw:600,mb:"md",children:"Function call"}),a.jsxs(pt,{fz:"sm",children:["This node calls the"," ",a.jsx(Wr,{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(o0,{my:"md"}),a.jsx(pt,{fz:"sm",className:vje.funcDoc,children:mje[t.func.name]})]});case xt.matrixSelector:return a.jsx(q9,{node:t});case xt.subquery:return a.jsxs(Qr,{withBorder:!0,children:[a.jsx(pt,{fz:"lg",fw:600,mb:"md",children:"Subquery"}),a.jsxs(pt,{fz:"sm",children:["This node evaluates the passed expression as a subquery over the last"," ",a.jsx("span",{className:"promql-code promql-duration",children:Yn(t.range)})," ","at a query resolution"," ",t.step>0?a.jsxs(a.Fragment,{children:["of"," ",a.jsx("span",{className:"promql-code promql-duration",children:Yn(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:Yn(t.offset)})," ","into the past"]}):a.jsxs(a.Fragment,{children:[", time-shifted"," ",a.jsx("span",{className:"promql-code promql-duration",children:Yn(-t.offset)})," ","into the future"]}),"."]})]});case xt.numberLiteral:return a.jsxs(Qr,{withBorder:!0,children:[a.jsx(pt,{fz:"lg",fw:600,mb:"md",children:"Number literal"}),a.jsxs(pt,{fz:"sm",children:["A scalar number literal with the value"," ",a.jsx("span",{className:"promql-code promql-number",children:t.val}),"."]})]});case xt.parenExpr:return a.jsxs(Qr,{withBorder:!0,children:[a.jsx(pt,{fz:"lg",fw:600,mb:"md",children:"Parentheses"}),a.jsx(pt,{fz:"sm",children:"Parentheses that contain a sub-expression to be evaluated."})]});case xt.stringLiteral:return a.jsxs(Qr,{withBorder:!0,children:[a.jsx(pt,{fz:"lg",fw:600,mb:"md",children:"String literal"}),a.jsxs(pt,{fz:"sm",children:["A string literal with the value"," ",a.jsxs("span",{className:"promql-code promql-string",children:['"',us(t.val),'"']}),"."]})]});case xt.unaryExpr:return a.jsxs(Qr,{withBorder:!0,children:[a.jsx(pt,{fz:"lg",fw:600,mb:"md",children:"Unary expression"}),a.jsxs(pt,{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 xt.vectorSelector:return a.jsx(q9,{node:t});default:throw new Error("invalid node type")}},Ig={width:"0.9rem",height:"0.9rem"},Lje=({idx:t,metricNames:e})=>{const[n,r]=O.useState(0),i=hc(f=>f.queryPage.panels[t]),s=Au(),[o,l]=O.useState(null),c=O.useMemo(()=>o!==null?cs(o.node):i.expr,[o,i.expr]),h=O.useCallback((f,p)=>s(uh({idx:t,visualizer:{...i.visualizer,range:(p-f)*1e3,endTime:p*1e3}})),[s,t,i.visualizer]);return a.jsxs(_n,{gap:"lg",children:[a.jsx(cwe,{initialExpr:i.expr,metricNames:e,executeQuery:f=>{r(p=>p+1),s(Mue({idx:t,expr:f})),!e.includes(f)&&f.trim()!==""&&s(tq(f))},treeShown:i.showTree,setShowTree:f=>{s(v_({idx:t,showTree:f})),f||l(null)},duplicatePanel:f=>{s(Eue({idx:t,expr:f}))},removePanel:()=>{s(Oue(t))}}),i.expr.trim()!==""&&i.showTree&&a.jsx(Df,{title:"Error showing tree view",children:a.jsx(O.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(20),(f,p)=>a.jsx(Wa,{height:30,mb:15,width:"100%"},p))}),children:a.jsx(pje,{panelIdx:t,selectedNode:o,setSelectedNode:l,closeTreeView:()=>{s(v_({idx:t,showTree:!1})),l(null)}})})},n),a.jsxs(la,{value:i.visualizer.activeTab,onChange:f=>s(uh({idx:t,visualizer:{...i.visualizer,activeTab:f}})),keepMounted:!1,children:[a.jsxs(la.List,{children:[a.jsx(la.Tab,{value:"table",leftSection:a.jsx(qH,{style:Ig}),children:"Table"}),a.jsx(la.Tab,{value:"graph",leftSection:a.jsx(Mse,{style:Ig}),children:"Graph"}),a.jsx(la.Tab,{value:"explain",leftSection:a.jsx(nr,{style:Ig}),children:"Explain"})]}),a.jsx(la.Panel,{pt:"sm",value:"table",children:a.jsx(oje,{expr:c,panelIdx:t,retriggerIdx:n})}),a.jsxs(la.Panel,{pt:"sm",value:"graph",children:[a.jsxs(ft,{mt:"xs",justify:"space-between",children:[a.jsxs(ft,{children:[a.jsx(Hhe,{range:i.visualizer.range,onChangeRange:f=>s(uh({idx:t,visualizer:{...i.visualizer,range:f}}))}),a.jsx(Lq,{time:i.visualizer.endTime,range:i.visualizer.range,description:"End time",onChangeTime:f=>s(uh({idx:t,visualizer:{...i.visualizer,endTime:f}}))}),a.jsx(SSe,{resolution:i.visualizer.resolution,range:i.visualizer.range,onChangeResolution:f=>{s(uh({idx:t,visualizer:{...i.visualizer,resolution:f}}))}})]}),a.jsxs(ft,{gap:"lg",children:[a.jsx(f0,{onChange:f=>s(uh({idx:t,visualizer:{...i.visualizer,displayMode:f}})),value:i.visualizer.displayMode,data:[{value:Fm.Lines,label:a.jsxs(xv,{fw:500,children:[a.jsx(rse,{style:Ig}),a.jsx(ve,{ml:10,children:"Unstacked"})]})},{value:Fm.Stacked,label:a.jsxs(xv,{fw:500,children:[a.jsx(Tae,{style:Ig}),a.jsx(ve,{ml:10,children:"Stacked"})]})}]}),a.jsxs(Cn,{position:"bottom",withArrow:!0,shadow:"md",children:[a.jsx(Cn.Target,{children:a.jsx(Sr,{variant:"light",color:"gray",size:32,title:"Graph settings",children:a.jsx($ie,{style:gu,stroke:1.5})})}),a.jsx(Cn.Dropdown,{p:"lg",children:a.jsx(Hs,{size:"xs",checked:i.visualizer.yAxisMin!==null,label:"Start Y axis at 0",onChange:f=>s(uh({idx:t,visualizer:{...i.visualizer,yAxisMin:f.currentTarget.checked?0:null}}))})})]})]})]}),a.jsx(AH,{h:"lg"}),a.jsx(wSe,{expr:c,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(la.Panel,{pt:"sm",value:"explain",children:a.jsx(Df,{title:"Error showing explain view",children:a.jsx(O.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(20),(f,p)=>a.jsx(Wa,{height:30,mb:15,width:"100%"},p))}),children:a.jsx(Ije,{node:(o==null?void 0:o.node)??null,treeShown:i.showTree,showTree:()=>{s(v_({idx:t,showTree:!0}))}})})},o==null?void 0:o.id)})]})]})};function PV(){const t=hc(c=>c.queryPage.panels),e=Au(),[n,r]=O.useState(0);O.useEffect(()=>{const c=()=>{const h=Cue(window.location.search);h.length>0&&e(rN(h))};return c(),window.addEventListener("popstate",c),()=>{window.removeEventListener("popstate",c)}},[e]),O.useEffect(()=>()=>{e(rN([I2()]))},[e]);const{data:i,error:s}=Zh({path:"/label/__name__/values"}),{data:o,error:l}=Zh({path:"/query",params:{query:"time()"}});return O.useEffect(()=>{if(!o)return;if(o.data.resultType!=="scalar")throw new Error("Unexpected result type from time query");const c=new Date().getTime()/1e3,h=o.data.result[0];r(Math.abs(c-h))},[o]),a.jsxs(ve,{mt:"xs",children:[s&&a.jsxs(Nt,{mb:"sm",icon:a.jsx(Di,{}),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(Di,{}),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(zie,{}),onClose:()=>r(0),children:["Detected a time difference of"," ",a.jsx("strong",{children:Gp(n*1e3)})," between your browser and the server. You may see unexpected time-shifted query results due to the time drift."]}),a.jsx(_n,{gap:"xl",children:t.map((c,h)=>a.jsx(Lje,{idx:h,metricNames:(i==null?void 0:i.data)||[]},c.id))}),a.jsx(Ri,{variant:"light",mt:"xl",leftSection:a.jsx($H,{style:Gg}),onClick:()=>e(kue()),children:"Add query"})]})}const Bje="_statsBadge_w76va_1",Pje="_labelBadge_w76va_9",Fje="_healthOk_w76va_35",$je="_healthErr_w76va_43",Hje="_healthWarn_w76va_51",zje="_healthInfo_w76va_62",qje="_healthUnknown_w76va_70",gn={statsBadge:Bje,labelBadge:Pje,healthOk:Fje,healthErr:$je,healthWarn:Hje,healthInfo:zje,healthUnknown:qje},Qje="_panelHealthOk_p1xoy_1",Uje="_panelHealthErr_p1xoy_6",Wje="_panelHealthWarn_p1xoy_11",Yje="_panelHealthUnknown_p1xoy_16",Ih={panelHealthOk:Qje,panelHealthErr:Uje,panelHealthWarn:Wje,panelHealthUnknown:Yje},Vje="_codebox_b9wnp_1",Gje="_queryButton_b9wnp_8",G9={codebox:Vje,queryButton:Gje},e0=({labels:t,wrapper:e=ft,style:n})=>a.jsx(e,{gap:"xs",children:Object.entries(t).map(([r,i])=>a.jsxs("span",{className:gn.labelBadge,style:n,children:[ed(r),'="',$h(i),'"']},r))}),Xje=new _W,FV=({rule:t})=>{const e=Ow(),{pathPrefix:n}=fi();return a.jsxs(a.Fragment,{children:[a.jsxs(Qr,{p:"xs",className:G9.codebox,fz:"sm",shadow:"none",children:[a.jsx(S4,{basicSetup:!1,value:t.query,editable:!1,extensions:[yY,xY,aS(e==="light"?AY:wY),Xje.asExtension(),ot.lineWrapping]}),a.jsx(qr,{label:"Query rule expression",withArrow:!0,position:"top",children:a.jsx(Sr,{pos:"absolute",top:7,right:7,variant:"light",onClick:()=>{window.open(`${n}/query?g0.expr=${encodeURIComponent(t.query)}&g0.tab=1`,"_blank")},className:G9.queryButton,children:a.jsx(od,{style:gu})})})]}),t.type==="alerting"&&a.jsxs(ft,{mt:"lg",gap:"xs",children:[t.duration&&a.jsxs(Br,{variant:"light",styles:{label:{textTransform:"none"}},leftSection:a.jsx(mse,{style:el}),children:["for: ",Yn(t.duration*1e3)]}),t.keepFiringFor&&a.jsxs(Br,{variant:"light",styles:{label:{textTransform:"none"}},leftSection:a.jsx(vse,{style:el}),children:["keep_firing_for: ",Yn(t.keepFiringFor*1e3)]})]}),t.labels&&Object.keys(t.labels).length>0&&a.jsx(ve,{mt:"lg",children:a.jsx(e0,{labels:t.labels})}),t.type==="alerting"&&Object.keys(t.annotations).length>0&&a.jsx(le,{mt:"lg",fz:"sm",children:a.jsx(le.Tbody,{children:Object.entries(t.annotations).map(([r,i])=>a.jsxs(le.Tr,{children:[a.jsx(le.Th,{c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-4))",children:r}),a.jsx(le.Td,{children:i})]},r))})})]})};function X9({value:t,onRemove:e,...n}){return a.jsx(Wl,{fw:600,style:{textTransform:"uppercase",fontWeight:600},onRemove:e,...n,withRemoveButton:!!e,children:t})}const _S=({options:t,optionClass:e,optionCount:n,placeholder:r,values:i,onChange:s})=>{const o=Yw({onDropdownClose:()=>o.resetSelectedOption(),onDropdownOpen:()=>o.updateSelectedOptionIndex("active")}),l=f=>s(i.includes(f)?i.filter(p=>p!==f):[...i,f]),c=f=>s(i.filter(p=>p!==f)),h=i.map(f=>a.jsx(X9,{value:n?`${f} (${n(f)})`:f,className:e(f),onRemove:()=>c(f)},f));return a.jsxs(ln,{store:o,onOptionSubmit:l,withinPortal:!1,children:[a.jsx(ln.DropdownTarget,{children:a.jsx(Yp,{pointer:!0,onClick:()=>o.toggleDropdown(),miw:200,leftSection:a.jsx(BH,{style:zf}),rightSection:i.length>0?a.jsx(dE,{onClear:()=>s([])}):a.jsx(_b,{}),children:a.jsxs(Wl.Group,{children:[h.length>0?h:a.jsx(Yp.Field,{placeholder:r,mt:1}),a.jsx(ln.EventsTarget,{children:a.jsx(Yp.Field,{type:"hidden",onBlur:()=>o.closeDropdown(),onKeyDown:f=>{f.key==="Backspace"&&(f.preventDefault(),c(i[i.length-1]))}})})]})})}),a.jsx(ln.Dropdown,{children:a.jsx(ln.Options,{children:t.map(f=>a.jsx(ln.Option,{value:f,active:i.includes(f),children:a.jsxs(ft,{gap:"sm",children:[i.includes(f)?a.jsx(Nm,{size:12,color:"gray"}):null,a.jsx(X9,{value:n?`${f} (${n(f)})`:f,className:e(f)})]})},f))})})]})};function tc(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 $V(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 Kje(t){return t==null||t instanceof Array?t:t===""?[]:[t]}function Zje(t){return t==null?t:String(t)}function Jje(t){const e=$V(t);return e==null?e:e===""?null:+e}function eCe(t){return t==null?t:String(t)}function tCe(t){const e=$V(t,!0);return e==null?e:String(e)}function nCe(t){return t==null,t}function rCe(t){const e=Kje(t);return e==null,e}const rd={encode:eCe,decode:tCe},HV={encode:Zje,decode:Jje},TS={encode:nCe,decode:rCe};function iCe(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 sCe(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 aCe(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 oCe{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 aA=new oCe;function lCe(t,e){var n,r,i;const s={};let o=!1;const l=Object.keys(t);let c=l;if(e.includeKnownParams||e.includeKnownParams!==!1&&l.length===0){const f=Object.keys((n=e.params)!=null?n:{});c.push(...f)}for(const f of c){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:rd}return o?s:t}function zV(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 cCe=Object.prototype.hasOwnProperty;function K9(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function qV(t,e,n){var r,i;if(K9(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 c=(i=(r=void 0)==null?void 0:r.equals)!=null?i:K9;if(!cCe.call(e,s[l])||!c(t[s[l]],e[s[l]]))return!1}return!0}function QV(t,e,n){const r={},i=Object.keys(e);for(const s of i){const o=e[s],l=t[s];let c;if(n.has(s,l,o.decode))c=n.get(s);else{if(c=o.decode(l),o.equals&&n.has(s,l)){const h=n.get(s);o.equals(c,h)&&(c=h)}c!==void 0&&n.set(s,l,c,o.decode)}c===void 0&&o.default!==void 0&&(c=o.default),r[s]=c}return r}function uCe(){let t;function e(n,r,i){const s=QV(n,r,i);return t!=null&&qV(t,s)?t:(t=s,s)}return e}function hCe(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 dCe(t){if(t)return Object.fromEntries(t.split(`
`).map(e=>e.split("\0")))}function fCe(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 Z9,J9,eP,ZT={};const UV=(t,e,n)=>{if(Z9===e&&eP===t&&J9===n)return ZT;Z9=e,eP=t;const r=t(e??"");J9=n;const i=dCe(n);for(let[s,o]of Object.entries(r)){i!=null&&i[s]&&(delete r[s],s=i[s],r[s]=o);const l=ZT[s];qV(o,l)&&(r[s]=l)}return ZT=r,r},pCe={searchStringToObject:aCe,objectToSearchString:iCe,updateType:"pushIn",includeKnownParams:void 0,includeAllParams:!1,removeDefaultsFromUrl:!1,enableBatching:!1,skipUpdateWhenNoChange:!0};function WV(t,e){e==null&&(e={});const n={...t,...e};return e.params&&t.params&&(n.params={...t.params,...e.params}),n}const YV={adapter:{},options:pCe},AO=O.createContext(YV);function mCe(){const t=O.useContext(AO);if(t===void 0||t===YV)throw new Error("useQueryParams must be used within a QueryParamProvider");return t}function tP({children:t,adapter:e,options:n}){const{adapter:r,options:i}=O.useContext(AO),s=O.useMemo(()=>({adapter:e??r,options:WV(i,n)}),[e,n,r,i]);return O.createElement(AO.Provider,{value:s},t)}function gCe({children:t,adapter:e,options:n}){const r=e;return r?O.createElement(r,null,i=>O.createElement(tP,{adapter:i,options:n},t)):O.createElement(tP,{options:n},t)}function vCe(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 bCe({changes:t,updateType:e,currentSearchString:n,paramConfigMap:r,options:i}){const{searchStringToObject:s,objectToSearchString:o}=i;e==null&&(e=i.updateType);let l;const c=UV(s,n),h=zV(r,Object.keys(t),i.params);let f;if(typeof t=="function"){const m=QV(c,h,aA);f=t(m)}else f=t;l=sCe(h,f),i.removeDefaultsFromUrl&&vCe(l,h),l=fCe(l,h);let p;return e==="push"||e==="replace"?p=o(l):p=o({...c,...l}),p!=null&&p.length&&p[0]!=="?"&&(p=`?${p}`),p??""}function yCe({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 xCe=t=>t(),ACe=t=>setTimeout(()=>t(),0),yx=[];function wCe(t,{immediate:e}={}){yx.push(t);let n=e?xCe:ACe;yx.length===1&&n(()=>{const r=yx.slice();yx.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=bCe(l)}t.options.skipUpdateWhenNoChange&&s===i||yCe({searchString:s??"",adapter:r[r.length-1].adapter,navigate:!0,updateType:r[r.length-1].updateType})})}function SCe(t,e){const{adapter:n,options:r}=mCe(),[i]=O.useState(uCe),{paramConfigMap:s,options:o}=CCe(t,e),l=O.useMemo(()=>WV(r,o),[r,o]);let c=lCe(s,l);const h=UV(l.searchStringToObject,n.location.search,hCe(c));l.includeAllParams&&(c=zV(c,Object.keys(h),l.params,rd));const f=i(h,c,aA),p=Object.keys(c).join("\0");O.useEffect(()=>{const x=p.split("\0");return aA.registerParams(x),()=>{aA.unregisterParams(x)}},[p]);const m={adapter:n,paramConfigMap:c,options:l},v=O.useRef(m);v.current==null&&(v.current=m),O.useEffect(()=>{v.current.adapter=n,v.current.paramConfigMap=c,v.current.options=l},[n,c,l]);const[y]=O.useState(()=>(S,w)=>{const{adapter:A,paramConfigMap:C,options:j}=v.current;w==null&&(w=j.updateType),wCe({changes:S,updateType:w,currentSearchString:A.location.search,paramConfigMap:C,options:j,adapter:A},{immediate:!j.enableBatching})});return[f,y]}var jCe=SCe;function CCe(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 Ao=(t,e,n)=>{const r=O.useMemo(()=>({[t]:e??"inherit"}),[t,e]),[i,s]=jCe(r,n),o=i[t],l=O.useCallback((c,h)=>s(typeof c=="function"?f=>{const p=c(f[t]);return{[t]:p}}:{[t]:c},h),[t,s]);return[o,l]};function _Ce(t,e,n,r){let i=[];for(const s of e){const o=Y4(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 Y4(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 _Ce(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 c of Object.keys(i))if(o.test(c)){const h=Y4(t,i[c],s+1,r.concat([c]));h!==null&&(Array.isArray(h)?l=l.concat(h):l.push(h))}return l}}return{path:r,value:i}}function TCe(t){return t.right!==void 0}function kCe(t){return t.keyPath!==void 0}function Sw(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 OCe(t,e){const n=t;for(const[r,i]of Object.entries(e)){const s=r;n[s]!==void 0?n[s]=Sw(n[s],i):n[s]=i}}function ECe(t,e){const n={};for(const[r,i]of Object.entries(e)){const s=r;t[s]!==void 0&&(n[s]=Sw(t[s],i))}return n}function MCe(t,e,n){return C0(t,e,(r,i)=>r===i,n)}function RCe(t,e,n){return C0(t,e,(r,i)=>r!==i,n)}function DCe(t,e,n){return C0(t,e,(r,i)=>r>i,n)}function NCe(t,e,n){return C0(t,e,(r,i)=>r>=i,n)}function ICe(t,e,n){return C0(t,e,(r,i)=>r<i,n)}function LCe(t,e,n){return C0(t,e,(r,i)=>r<=i,n)}function C0(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 nP(t,e){const n={match:"fuzzy",pattern:t,keyPath:[]};return Array.isArray(e)?n.keyPath=n.keyPath.concat(e):n.keyPath=[e],n}class ny{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=nP(e,i[0]);if(s===1)return this.filterWithQuery(o,n,r);const l={operator:"or",left:o,right:o};let c=l;for(let h=1;h<s;h++){const f=nP(e,i[h]);if(h+1<s){const p={operator:"or",left:f,right:f};c.right=p,c=p}else c.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,c=[{current:e,depth:0}],h=[];for(;c.length>0;){const p=c.shift();if(!p)break;const m=p.current;if(TCe(m)){c.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(kCe(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(),y=h.pop();if(!v||!y)break;m==="or"?(OCe(v.result,y.result),h.push({result:v.result,depth:p.depth})):h.push({result:ECe(v.result,y.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 c of n)this.renderingWalk(c,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 c={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=yL(e.value,e.intervals,c);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]=yL(s[h],e.intervals,c)}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 c=this.internalMatch(e,l,i);c!==null&&(c.index=o,c.original=l,s[o]=c)}return s}internalMatch(e,n,r){const i=Y4(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=Sw(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=Sw(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 MCe(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 RCe(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=lAe(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 DCe(r.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null;case"greaterEqual":return NCe(r.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null;case"less":return ICe(r.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null;case"lessEqual":return LCe(r.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null}}}const BCe="_item_11v54_1",PCe={item:BCe},FCe=new ny({shouldSort:!0,indexedKeys:["name","labels",["labels",/.*/]]}),$Ce=(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:FCe.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(c=>c.state==="firing").length,pending:l.alerts.filter(c=>c.state==="pending").length}}))})}return r},HCe=[];function VV(){const{data:t}=Ci({path:"/rules",params:{type:"alert"}}),{showAnnotations:e}=fi(),[n,r]=Ao("state",tc(TS,HCe)),[i,s]=Ao("search",tc(rd,"")),[o]=db(i.trim(),250),[l,c]=fb({key:"alertsPage.showEmptyGroups",defaultValue:!1}),{alertGroupsPerPage:h}=fi(),[f,p]=Ao("page",tc(HV,1)),m=O.useMemo(()=>$Ce(t.data,o,n),[t,n,o]),v=O.useMemo(()=>l?m.groups:m.groups.filter(A=>A.rules.length>0),[m.groups,l]),y=Math.ceil(v.length/h),x=Math.max(1,Math.min(f,y));O.useEffect(()=>{x!==f&&p(x)},[x,f,p]);const S=O.useMemo(()=>v.slice((x-1)*h,x*h),[v,x,h]),w=O.useMemo(()=>S.map(A=>a.jsxs(Qr,{shadow:"xs",withBorder:!0,p:"md",children:[a.jsxs(ft,{mb:"sm",justify:"space-between",children:[a.jsxs(ft,{align:"baseline",children:[a.jsx(pt,{fz:"xl",fw:600,c:"var(--mantine-primary-color-filled)",children:A.name}),a.jsx(pt,{fz:"sm",c:"gray.6",children:A.file})]}),a.jsxs(ft,{children:[A.counts.firing>0&&a.jsxs(Br,{className:gn.healthErr,children:["firing (",A.counts.firing,")"]}),A.counts.pending>0&&a.jsxs(Br,{className:gn.healthWarn,children:["pending (",A.counts.pending,")"]}),A.counts.unknown>0&&a.jsxs(Br,{className:gn.healthUnknown,children:["unknown (",A.counts.unknown,")"]}),A.counts.inactive>0&&a.jsxs(Br,{className:gn.healthOk,children:["inactive (",A.counts.inactive,")"]})]})]}),A.counts.total===0?a.jsxs(Nt,{title:"No rules",icon:a.jsx(nr,{}),children:["No rules in this group.",a.jsx(Wr,{ml:"md",fz:"1em",onClick:()=>c(!1),children:"Hide empty groups"})]}):A.rules.length===0?a.jsxs(Nt,{title:"No matching rules",icon:a.jsx(nr,{}),children:["No rules in this group match your filter criteria (omitted"," ",A.counts.total," filtered rules).",a.jsx(Wr,{ml:"md",fz:"1em",onClick:()=>c(!1),children:"Hide empty groups"})]}):a.jsx(Gm,{allItems:A.rules,child:({items:C})=>a.jsx(Ur,{multiple:!0,variant:"separated",keepMounted:!1,classNames:PCe,children:C.map((j,_)=>a.jsxs(Ur.Item,{mt:me(5),value:_.toString(),className:j.counts.firing>0?Ih.panelHealthErr:j.counts.pending>0?Ih.panelHealthWarn:j.rule.state==="unknown"?Ih.panelHealthUnknown:Ih.panelHealthOk,children:[a.jsx(Ur.Control,{styles:{label:{paddingBlock:me(10)}},children:a.jsxs(ft,{wrap:"nowrap",justify:"space-between",mr:"lg",children:[a.jsx(pt,{children:j.rule.name}),a.jsxs(ft,{gap:"xs",children:[j.counts.firing>0&&a.jsxs(Br,{className:gn.healthErr,children:["firing (",j.counts.firing,")"]}),j.counts.pending>0&&a.jsxs(Br,{className:gn.healthWarn,children:["pending (",j.counts.pending,")"]})]})]})}),a.jsxs(Ur.Panel,{children:[a.jsx(FV,{rule:j.rule}),j.rule.alerts.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(o0,{my:"md"}),a.jsx(Gm,{allItems:j.rule.alerts,child:({items:k})=>a.jsxs(le,{mt:"lg",children:[a.jsx(le.Thead,{children:a.jsxs(le.Tr,{style:{whiteSpace:"nowrap"},children:[a.jsx(le.Th,{children:"Alert labels"}),a.jsx(le.Th,{children:"State"}),a.jsx(le.Th,{children:"Active Since"}),a.jsx(le.Th,{children:"Value"})]})}),a.jsx(le.Tbody,{children:k.map((M,R)=>a.jsxs(O.Fragment,{children:[a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:a.jsx(e0,{labels:M.labels})}),a.jsx(le.Td,{children:a.jsx(Br,{className:M.state==="firing"?gn.healthErr:gn.healthWarn,children:M.state})}),a.jsx(le.Td,{style:{whiteSpace:"nowrap"},children:a.jsx(qr,{label:M.activeAt,children:a.jsx(ve,{children:NA(M.activeAt,DA(),"")})})}),a.jsx(le.Td,{style:{whiteSpace:"nowrap"},children:isNaN(Number(M.value))?M.value:Number(M.value)})]}),e&&a.jsx(le.Tr,{children:a.jsx(le.Td,{colSpan:4,children:a.jsx(le,{mt:"md",mb:"xl",children:a.jsx(le.Tbody,{children:Object.entries(M.annotations).map(([N,I])=>a.jsxs(le.Tr,{children:[a.jsx(le.Th,{c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-4))",children:N}),a.jsx(le.Td,{children:I})]},N))})})})})]},R))})]})})]})]})]},_))})})]},`${A.file}-${A.name}`)),[S,e,c]);return a.jsxs(_n,{mt:"xs",children:[a.jsxs(ft,{children:[a.jsx(_S,{options:["inactive","pending","firing","unknown"],optionClass:A=>A==="inactive"?gn.healthOk:A==="pending"?gn.healthWarn:A==="firing"?gn.healthErr:gn.healthUnknown,optionCount:A=>m.globalCounts[A],placeholder:"Filter by rule group state",values:(n==null?void 0:n.filter(A=>A!==null))||[],onChange:A=>r(A)}),a.jsx(cc,{flex:1,leftSection:a.jsx(od,{style:zf}),placeholder:"Filter by rule name or labels",value:i||"",onChange:A=>s(A.currentTarget.value||null)})]}),m.groups.length===0?a.jsx(Nt,{title:"No rules found",icon:a.jsx(nr,{}),children:"No rules found."}):!l&&m.groups.length!==v.length&&a.jsxs(Nt,{title:"Hiding groups with no matching rules",icon:a.jsx(nr,{}),children:["Hiding ",m.groups.length-v.length," empty groups due to filters or no rules.",a.jsx(Wr,{ml:"md",fz:"1em",onClick:()=>c(!0),children:"Show empty groups"})]}),a.jsx(Xa,{total:y,value:x,onChange:p,hideWithOnePage:!0}),w]})}const zCe="_item_11v54_1",qCe={item:zCe},QCe=new ny({shouldSort:!0,indexedKeys:["name","labels",["labels",/.*/]]}),UCe=(t,e,n)=>({groups:t.groups.map(i=>({...i,prefilterRulesCount:i.rules.length,rules:(e===""?i.rules:QCe.filter(e,i.rules).map(s=>s.original)).filter(s=>n.length===0||n.includes(s.health))}))}),WCe=t=>{switch(t){case"ok":return gn.healthOk;case"err":return gn.healthErr;case"unknown":return gn.healthUnknown;default:throw new Error("Unknown rule health state")}},YCe=[];function VCe(){const{data:t}=Ci({path:"/rules"}),[e,n]=Ao("health",tc(TS,YCe)),[r,i]=Ao("search",tc(rd,"")),[s]=db(r.trim(),250),[o,l]=fb({key:"alertsPage.showEmptyGroups",defaultValue:!1}),{ruleGroupsPerPage:c}=fi(),[h,f]=Ao("page",tc(HV,1)),p=O.useMemo(()=>UCe(t.data,s,e),[t,e,s]),m=O.useMemo(()=>o?p.groups:p.groups.filter(w=>w.rules.length>0),[p.groups,o]),v=Math.ceil(m.length/c),y=Math.max(1,Math.min(h,v));O.useEffect(()=>{y!==h&&f(y)},[y,h,f]);const x=O.useMemo(()=>m.slice((y-1)*c,y*c),[m,y,c]),S=O.useMemo(()=>x.map(w=>a.jsxs(Qr,{shadow:"xs",withBorder:!0,p:"md",children:[a.jsxs(ft,{mb:"sm",justify:"space-between",children:[a.jsxs(ft,{align:"baseline",children:[a.jsx(pt,{fz:"xl",fw:600,c:"var(--mantine-primary-color-filled)",children:w.name}),a.jsx(pt,{fz:"sm",c:"gray.6",children:w.file})]}),a.jsxs(ft,{children:[a.jsx(qr,{label:"Last group evaluation",withArrow:!0,children:a.jsxs(Br,{variant:"light",className:gn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(A3,{style:el}),children:["last run ",NA(w.lastEvaluation,DA())]})}),a.jsx(qr,{label:"Duration of last group evaluation",withArrow:!0,children:a.jsxs(Br,{variant:"light",className:gn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(x3,{style:el}),children:["took ",Gp(parseFloat(w.evaluationTime)*1e3)]})}),a.jsx(qr,{label:"Group evaluation interval",withArrow:!0,children:a.jsxs(Br,{variant:"transparent",className:gn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(HH,{style:el}),children:["every ",Gp(parseFloat(w.interval)*1e3)," "]})})]})]}),w.prefilterRulesCount===0?a.jsxs(Nt,{title:"No rules",icon:a.jsx(nr,{}),children:["No rules in this group.",a.jsx(Wr,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty groups"})]}):w.rules.length===0?a.jsxs(Nt,{title:"No matching rules",icon:a.jsx(nr,{}),children:["No rules in this group match your filter criteria (omitted"," ",w.prefilterRulesCount," filtered rules).",a.jsx(Wr,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty groups"})]}):a.jsx(Gm,{allItems:w.rules,child:({items:A})=>a.jsx(Ur,{multiple:!0,variant:"separated",keepMounted:!1,classNames:qCe,children:A.map((C,j)=>a.jsxs(Ur.Item,{mt:me(5),value:j.toString(),style:{borderLeft:C.health==="err"?"5px solid var(--mantine-color-red-4)":C.health==="unknown"?"5px solid var(--mantine-color-gray-5)":"5px solid var(--mantine-color-green-4)"},children:[a.jsx(Ur.Control,{styles:{label:{paddingBlock:me(10)}},children:a.jsxs(ft,{justify:"space-between",mr:"lg",children:[a.jsxs(ft,{gap:"xs",wrap:"nowrap",children:[C.type==="alerting"?a.jsx(qr,{label:"Alerting rule",withArrow:!0,children:a.jsx(XE,{style:{width:me(15),height:me(15)}})}):a.jsx(qr,{label:"Recording rule",withArrow:!0,children:a.jsx(pae,{style:{width:me(15),height:me(15)}})}),a.jsx(pt,{children:C.name})]}),a.jsxs(ft,{gap:"xs",children:[a.jsxs(ft,{gap:"xs",wrap:"wrap",children:[a.jsx(qr,{label:"Last rule evaluation",withArrow:!0,children:a.jsx(Br,{variant:"light",className:gn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(A3,{style:el}),children:NA(C.lastEvaluation,DA())})}),a.jsx(qr,{label:"Duration of last rule evaluation",withArrow:!0,children:a.jsx(Br,{variant:"light",className:gn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(x3,{style:el}),children:Gp(parseFloat(C.evaluationTime)*1e3)})})]}),a.jsx(Br,{className:WCe(C.health),children:C.health})]})]})}),a.jsxs(Ur.Panel,{children:[a.jsx(FV,{rule:C}),C.lastError&&a.jsxs(Nt,{color:"red",mt:"sm",title:"Rule failed to evaluate",icon:a.jsx(Di,{}),children:[a.jsx("strong",{children:"Error:"})," ",C.lastError]})]})]},j))})})]},`${w.file}-${w.name}`)),[x,l]);return a.jsxs(_n,{mt:"xs",children:[a.jsxs(ft,{children:[a.jsx(_S,{options:["ok","unknown","err"],optionClass:w=>w==="ok"?gn.healthOk:w==="unknown"?gn.healthWarn:gn.healthErr,placeholder:"Filter by rule health",values:(e==null?void 0:e.filter(w=>w!==null))||[],onChange:w=>n(w)}),a.jsx(cc,{flex:1,leftSection:a.jsx(od,{style:zf}),placeholder:"Filter by rule name or labels",value:r||"",onChange:w=>i(w.currentTarget.value||null)})]}),p.groups.length===0?a.jsx(Nt,{title:"No rules found",icon:a.jsx(nr,{}),children:"No rules found."}):!o&&p.groups.length!==m.length&&a.jsxs(Nt,{title:"Hiding groups with no matching rules",icon:a.jsx(nr,{}),children:["Hiding ",p.groups.length-m.length," empty groups due to filters or no rules.",a.jsx(Wr,{ml:"md",fz:"1em",onClick:()=>l(!0),children:"Show empty groups"})]}),a.jsx(Xa,{total:v,value:y,onChange:f,hideWithOnePage:!0}),S]})}const GV="targetsPage.collapsedPools",GCe={collapsedPools:Ra(GV,[]),showLimitAlert:!1},XV=R2({name:"targetsPage",initialState:GCe,reducers:{setCollapsedPools:(t,{payload:e})=>{t.collapsedPools=e},setShowLimitAlert:(t,{payload:e})=>{t.showLimitAlert=e}}}),{setCollapsedPools:V4,setShowLimitAlert:wO}=XV.actions,XCe=XV.reducer,SO=({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:c}=n,h=Array.from(c.entries()),f=i?t.replace(r,""):`${l}//${s}${o}`;return a.jsxs(_n,{gap:0,children:[a.jsx(Wr,{size:"sm",href:e,target:"_blank",children:f}),h.length>0&&a.jsx(ft,{gap:"xs",mt:"md",children:h.map(([p,m])=>a.jsx(Br,{size:"sm",variant:"light",color:"gray",style:{textTransform:"none"},children:`${p}="${m}"`},`${p}/${m}`))})]})},KCe=({discoveredLabels:t,labels:e})=>{const[n,{toggle:r}]=Cw(!1);return a.jsxs(_n,{children:[a.jsxs(ft,{wrap:"nowrap",align:"flex-start",children:[a.jsx(e0,{labels:e}),a.jsx(Sr,{size:"xs",color:"gray",variant:"light",onClick:r,title:`${n?"Hide":"Show"} discovered (pre-relabeling) labels`,children:n?a.jsx(KE,{style:gu}):a.jsx(Sv,{style:gu})})]}),a.jsx(Mw,{expanded:n,children:n&&a.jsxs(a.Fragment,{children:[a.jsx(pt,{fw:700,size:"1em",my:"lg",c:"gray.7",children:"Discovered labels:"}),a.jsx(e0,{labels:t,style:{color:"var(--mantine-color-blue-light-color)",backgroundColor:"var(--mantine-color-blue-light)"}})]})})]})},ZCe=({target:t})=>{const[e,{toggle:n}]=Cw(!1);return a.jsxs(_n,{gap:"xs",children:[a.jsxs(ft,{wrap:"nowrap",align:"flex-start",children:[a.jsxs(ft,{gap:"xs",wrap:"wrap",children:[a.jsx(qr,{label:"Last target scrape",withArrow:!0,children:a.jsx(Br,{variant:"light",className:gn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(A3,{style:el}),children:NA(t.lastScrape,DA())})}),a.jsx(qr,{label:"Duration of last target scrape",withArrow:!0,children:a.jsx(Br,{variant:"light",className:gn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(x3,{style:el}),children:Gp(t.lastScrapeDuration*1e3)})})]}),a.jsx(Sr,{size:"xs",color:"gray",variant:"light",onClick:n,title:`${e?"Hide":"Show"} additional timing info`,children:e?a.jsx(KE,{style:gu}):a.jsx(Sv,{style:gu})})]}),a.jsx(Mw,{expanded:e,children:e&&a.jsxs(ft,{gap:"xs",wrap:"wrap",children:[a.jsx(qr,{label:"Scrape interval",withArrow:!0,children:a.jsxs(Br,{variant:"light",className:gn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(HH,{style:el}),children:["every ",t.scrapeInterval]})}),a.jsx(qr,{label:"Scrape timeout",withArrow:!0,children:a.jsxs(Br,{variant:"light",className:gn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:a.jsx(Qse,{style:el}),children:["after ",t.scrapeTimeout]})})]})})]})},JCe=t=>t.count>0&&t.downCount===t.count?Ih.panelHealthErr:t.downCount>=1?Ih.panelHealthWarn:t.unknownCount===t.count?Ih.panelHealthUnknown:Ih.panelHealthOk,e_e=t=>{switch(t.toLowerCase()){case"up":return gn.healthOk;case"down":return gn.healthErr;case"unknown":return gn.healthUnknown;default:return gn.healthWarn}},t_e=new ny({shouldSort:!0,indexedKeys:["labels","scrapePool",["labels",/.*/]]}),n_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:t_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},r_e=O.memo(({poolNames:t,selectedPool:e,healthFilter:n,searchFilter:r})=>{const{data:{data:{activeTargets:i}}}=Ci({path:"/targets",params:{state:"active",scrapePool:e===null?"":e}}),s=Au(),[o,l]=fb({key:"targetsPage.showEmptyPools",defaultValue:!1}),{collapsedPools:c,showLimitAlert:h}=hc(v=>v.targetsPage),f=O.useMemo(()=>n_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(_n,{children:[p.length===0?a.jsx(Nt,{title:"No scrape pools found",icon:a.jsx(nr,{}),children:"No scrape pools found."}):!o&&p.length!==m.length&&a.jsxs(Nt,{title:"Hiding pools with no matching targets",icon:a.jsx(nr,{}),children:["Hiding ",p.length-m.length," empty pools due to filters or no targets.",a.jsx(Wr,{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(nr,{}),withCloseButton:!0,onClose:()=>s(wO(!1)),children:["There are more than ",KV," scrape pools. Showing only the first one. Use the dropdown to select a different pool."]}),a.jsx(Ur,{multiple:!0,variant:"separated",keepMounted:!1,value:p.filter(v=>!c.includes(v)),onChange:v=>s(V4(p.filter(y=>!v.includes(y)))),children:m.map(v=>{const y=f[v];return a.jsxs(Ur.Item,{value:v,className:JCe(y),children:[a.jsx(Ur.Control,{children:a.jsxs(ft,{wrap:"nowrap",justify:"space-between",mr:"lg",children:[a.jsx(pt,{children:v}),a.jsxs(ft,{gap:"xs",children:[a.jsxs(pt,{c:"gray.6",children:[y.upCount," / ",y.count," up"]}),a.jsx(Db,{size:25,thickness:5,sections:y.count===0?[]:[{value:y.upCount/y.count*100,color:"green.4"},{value:y.unknownCount/y.count*100,color:"gray.4"},{value:y.downCount/y.count*100,color:"red.5"}]})]})]})}),a.jsx(Ur.Panel,{children:y.count===0?a.jsxs(Nt,{title:"No targets",icon:a.jsx(nr,{}),children:["No active targets in this scrape pool.",a.jsx(Wr,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty pools"})]}):y.targets.length===0?a.jsxs(Nt,{title:"No matching targets",icon:a.jsx(nr,{}),children:["No targets in this pool match your filter criteria (omitted ",y.count," filtered targets).",a.jsx(Wr,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty pools"})]}):a.jsx(Gm,{allItems:y.targets,child:({items:x})=>a.jsxs(le,{children:[a.jsx(le.Thead,{children:a.jsxs(le.Tr,{children:[a.jsx(le.Th,{w:"25%",children:"Endpoint"}),a.jsx(le.Th,{children:"Labels"}),a.jsx(le.Th,{w:230,children:"Last scrape"}),a.jsx(le.Th,{w:100,children:"State"})]})}),a.jsx(le.Tbody,{children:x.map((S,w)=>a.jsxs(zn.Fragment,{children:[a.jsxs(le.Tr,{style:{borderBottom:S.lastError?"none":void 0},children:[a.jsx(le.Td,{valign:"top",children:a.jsx(SO,{endpoint:S.scrapeUrl,globalUrl:S.globalUrl})}),a.jsx(le.Td,{valign:"top",children:a.jsx(KCe,{labels:S.labels,discoveredLabels:S.discoveredLabels})}),a.jsx(le.Td,{valign:"top",children:a.jsx(ZCe,{target:S})}),a.jsx(le.Td,{valign:"top",children:a.jsx(Br,{className:e_e(S.health),children:S.health})})]}),S.lastError&&a.jsx(le.Tr,{children:a.jsx(le.Td,{colSpan:5,valign:"top",children:a.jsxs(Nt,{color:"red",mb:"sm",icon:a.jsx(Di,{}),children:[a.jsx("strong",{children:"Error scraping target:"})," ",S.lastError]})})})]},w))})]})})})]},v)})})]})}),KV=20,i_e=[];function s_e(){const{data:{data:{scrapePools:t}}}=Ci({path:"/scrape_pools"}),e=Au(),n="Select scrape pool",[r,i]=Ao("pool",rd),[s,o]=O.useState(n),[l,c]=O.useState(!1),[h,f]=Ao("health",tc(TS,i_e)),[p,m]=Ao("search",tc(rd,"")),[v]=db(p.trim(),250),{collapsedPools:y,showLimitAlert:x}=hc(w=>w.targetsPage),S=t.length>KV&&r===void 0;return S&&(i(t[0]),e(wO(!0))),a.jsxs(a.Fragment,{children:[a.jsxs(ft,{mb:"md",mt:"xs",children:[a.jsx(p0,{placeholder:s,data:[{label:"All pools",value:""},...t],value:l?null:S&&t[0]||r||null,onChange:w=>{i(w),x&&e(wO(!1))},onDropdownOpen:()=>{o(r||n),c(!0)},onDropdownClose:()=>{o(n),c(!1)},searchable:!0}),a.jsx(_S,{options:["unknown","up","down"],optionClass:w=>w==="unknown"?gn.healthUnknown:w==="up"?gn.healthOk:gn.healthErr,placeholder:"Filter by target health",values:(h==null?void 0:h.filter(w=>w!==null))||[],onChange:w=>f(w)}),a.jsx(cc,{flex:1,leftSection:a.jsx(od,{style:zf}),placeholder:"Filter by endpoint or labels",value:p||"",onChange:w=>m(w.currentTarget.value||null)}),a.jsx(Sr,{size:"input-sm",title:y.length>0?"Expand all pools":"Collapse all pools",variant:"light",onClick:()=>e(V4(y.length>0?[]:t)),children:y.length>0?a.jsx(FH,{style:vw}):a.jsx(PH,{style:vw})})]}),a.jsx(Df,{title:"Error showing target pools",children:a.jsx(O.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(10),(w,A)=>a.jsx(Wa,{height:40,mb:15,width:1e3,mx:"auto"},A))}),children:a.jsx(r_e,{poolNames:t,selectedPool:S&&t[0]||r||null,healthFilter:h,searchFilter:v})})},location.pathname)]})}const cu=({children:t,title:e,icon:n})=>a.jsxs(Qr,{shadow:"xs",withBorder:!0,p:"md",children:[e&&a.jsxs(ft,{wrap:"nowrap",align:"center",ml:"xs",mb:"sm",gap:"xs",fz:"xl",fw:600,children:[n&&a.jsx(n,{style:XAe}),e]}),t]}),ry=({children:t})=>a.jsx(_n,{gap:"lg",maw:1e3,mx:"auto",mt:"xs",children:t});function a_e(){const{data:t}=Ci({path:"/status/buildinfo"}),{data:e}=Ci({path:"/status/runtimeinfo"}),{useLocalTime:n}=fi(),r={startTime:{title:"Start time",formatValue:i=>bf(new Date(i).valueOf()/1e3,n)},CWD:{title:"Working directory"},hostname:{title:"Hostname"},serverTime:{title:"Server Time",formatValue:i=>bf(new Date(i).valueOf()/1e3,n)},reloadConfigSuccess:{title:"Configuration reload",formatValue:i=>i?"Successful":"Unsuccessful"},lastConfigTime:{title:"Last successful configuration reload",formatValue:i=>bf(new Date(i).valueOf()/1e3,n)},corruptionCount:{title:"WAL corruptions"},goroutineCount:{title:"Goroutines"},storageRetention:{title:"Storage retention"}};return a.jsxs(ry,{children:[a.jsx(cu,{title:"Build information",icon:vae,children:a.jsx(le,{layout:"fixed",children:a.jsx(le.Tbody,{children:Object.entries(t.data).map(([i,s])=>a.jsxs(le.Tr,{children:[a.jsx(le.Th,{style:{textTransform:"capitalize"},children:i}),a.jsx(le.Td,{children:s})]},i))})})}),a.jsx(cu,{title:"Runtime information",icon:Xse,children:a.jsx(le,{layout:"fixed",children:a.jsx(le.Tbody,{children:Object.entries(e.data).map(([i,s])=>{const{title:o=i,formatValue:l=c=>c}=r[i]||{};return a.jsxs(le.Tr,{children:[a.jsx(le.Th,{style:{textTransform:"capitalize"},children:o}),a.jsx(le.Td,{children:l(s)})]},i)})})})})]})}$e.extend(Kz);function o_e(){const{data:{data:{headStats:t,labelValueCountByLabelName:e,seriesCountByMetricName:n,memoryInBytesByLabelName:r,seriesCountByLabelValuePair:i}}}=Ci({path:"/status/tsdb"}),{useLocalTime:s,pathPrefix:o}=fi(),l=q=>{const X=bf(q,s);return X==="Invalid Date"?h===0?"No datapoints yet":`Error parsing time (${q})`:X},{chunkCount:c,numSeries:h,numLabelPairs:f,minTime:p,maxTime:m}=t,v=[{name:"Number of Series",value:h},{name:"Number of Chunks",value:c},{name:"Number of Label Pairs",value:f},{name:"Current Min Time",value:`${l(p/1e3)}`},{name:"Current Max Time",value:`${l(m/1e3)}`}],[y,x]=O.useState(""),[S,w]=O.useState(null),[A,C]=O.useState(null),[j,_]=O.useState(null),[k,M]=O.useState(null),[R,N]=O.useState(!1),[I,D]=O.useState(null),[L,z]=O.useState(null),[P,H]=O.useState(!1),B=async()=>{var Y;_(null),M(null);const q=y.split(`
`).map(U=>U.trim()).filter(U=>U!=="");if(q.length===0){_("Provide at least one match[] selector.");return}const X=new URLSearchParams;for(const U of q)X.append("match[]",U);S!==null&&X.append("start",(S/1e3).toString()),A!==null&&X.append("end",(A/1e3).toString()),N(!0);try{const U=await fetch(`${o}/${iO}/admin/tsdb/delete_series?${X.toString()}`,{method:"POST",credentials:"same-origin"});if(!U.ok){if((Y=U.headers.get("content-type"))!=null&&Y.startsWith("application/json")){const V=await U.json();throw new Error(V.error||U.statusText)}throw new Error(U.statusText)}M(`Successfully deleted series matching: ${q.join(", ")}`),x(""),w(null),C(null)}catch(U){_(U instanceof Error?U.message:"Unknown error")}finally{N(!1)}},F=async()=>{var q;D(null),z(null),H(!0);try{const X=await fetch(`${o}/${iO}/admin/tsdb/clean_tombstones`,{method:"POST",credentials:"same-origin"});if(!X.ok){if((q=X.headers.get("content-type"))!=null&&q.startsWith("application/json")){const Y=await X.json();throw new Error(Y.error||X.statusText)}throw new Error(X.statusText)}z("Tombstones cleaned successfully.")}catch(X){D(X instanceof Error?X.message:"Unknown error")}finally{H(!1)}};return a.jsxs(ry,{children:[[{title:"TSDB Head Status",stats:v,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:q,unit:X="Count",stats:Y,formatAsCode:U})=>a.jsx(cu,{title:q,children:a.jsxs(le,{layout:"fixed",children:[a.jsx(le.Thead,{children:a.jsxs(le.Tr,{children:[a.jsx(le.Th,{children:"Name"}),a.jsx(le.Th,{children:X})]})}),a.jsx(le.Tbody,{children:Y.map(({name:V,value:G})=>a.jsxs(le.Tr,{children:[a.jsx(le.Td,{style:{wordBreak:"break-all"},children:U?a.jsx("code",{children:V}):V}),a.jsx(le.Td,{children:G})]},V))})]})})),a.jsx(cu,{title:"Delete Series",icon:w3,children:a.jsxs(_n,{gap:"md",children:[a.jsx(Nt,{icon:a.jsx(Di,{size:16}),color:"yellow",title:"Warning",children:'This operation marks matching series for deletion. Deleted data cannot be recovered. Use "Clean Tombstones" afterwards to reclaim disk space.'}),j&&a.jsx(Nt,{color:"red",title:"Error",withCloseButton:!0,onClose:()=>_(null),children:j}),k&&a.jsx(Nt,{icon:a.jsx(yA,{size:16}),color:"green",title:"Success",withCloseButton:!0,onClose:()=>M(null),children:k}),a.jsx(kE,{label:"Series selector(s)",description:'PromQL series selectors, one per line. Example: up{job="prometheus"}',placeholder:'up{job="prometheus"}',value:y,onChange:q=>x(q.currentTarget.value),autosize:!0,minRows:2,maxRows:6}),a.jsxs(ft,{grow:!0,children:[a.jsx(Mv,{label:"Start time",description:"Optional",placeholder:"Select start time",valueFormat:"YYYY-MM-DD HH:mm:ss",withSeconds:!0,value:S!==null?s?$e(S).format():$e(S).subtract($e().utcOffset(),"minutes").format():void 0,onChange:q=>w(q?s?new Date(q).getTime():$e.utc(q).valueOf():null),clearable:!0}),a.jsx(Mv,{label:"End time",description:"Optional",placeholder:"Select end time",valueFormat:"YYYY-MM-DD HH:mm:ss",withSeconds:!0,value:A!==null?s?$e(A).format():$e(A).subtract($e().utcOffset(),"minutes").format():void 0,onChange:q=>C(q?s?new Date(q).getTime():$e.utc(q).valueOf():null),clearable:!0})]}),a.jsx(ft,{children:a.jsx(Ri,{color:"red",leftSection:a.jsx(w3,{size:16}),onClick:B,loading:R,disabled:!y.trim(),children:"Delete series"})})]})}),a.jsx(cu,{title:"Clean Tombstones",children:a.jsxs(_n,{gap:"md",children:[I&&a.jsx(Nt,{color:"red",title:"Error",withCloseButton:!0,onClose:()=>D(null),children:I}),L&&a.jsx(Nt,{icon:a.jsx(yA,{size:16}),color:"green",title:"Success",withCloseButton:!0,onClose:()=>z(null),children:L}),a.jsx(pt,{size:"sm",c:"dimmed",children:"After deleting series, tombstones mark the data for deletion but do not free disk space immediately. Use this to remove tombstones and reclaim storage."}),a.jsx(ft,{children:a.jsx(Ri,{variant:"outline",onClick:F,loading:P,children:"Clean tombstones"})})]})})]})}const l_e="_th_1w9xk_1",c_e="_control_1w9xk_5",u_e="_icon_1w9xk_17",JT={th:l_e,control:c_e,icon:u_e};function rP({children:t,reversed:e,sorted:n,onSort:r}){const i=n?e?KE:Sv:Jse;return a.jsx(le.Th,{className:JT.th,children:a.jsx(Nr,{onClick:r,className:JT.control,children:a.jsxs(ft,{justify:"space-between",children:[a.jsx(pt,{fw:600,fz:"sm",children:t}),a.jsx(xv,{className:JT.icon,children:a.jsx(i,{style:{width:me(16),height:me(16)},stroke:1.5})})]})})})}function iP(t,e){const n=e.toLowerCase().trim();return t.filter(r=>ri(t[0]).some(i=>r[i].toLowerCase().includes(n)))}function sP(t,e){const{sortBy:n}=e;return iP(n?[...t].sort((r,i)=>e.reversed?i[n].localeCompare(r[n]):r[n].localeCompare(i[n])):t,e.search)}function h_e(){const{data:t}=Ci({path:"/status/flags"}),e=Object.entries(t.data).map(([v,y])=>({flag:v,value:y})),[n,r]=O.useState(""),[i,s]=O.useState(e),[o,l]=O.useState(null),[c,h]=O.useState(!1),f=v=>{const y=v===o?!c:!1;h(y),l(v),s(sP(e,{sortBy:v,reversed:y,search:n}))},p=v=>{const{value:y}=v.currentTarget;r(y),s(sP(e,{sortBy:o,reversed:c,search:y}))},m=i.map(v=>a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:a.jsxs("code",{children:["--",v.flag]})}),a.jsx(le.Td,{children:a.jsx("code",{children:v.value})})]},v.flag));return a.jsx(ry,{children:a.jsxs(cu,{children:[a.jsx(cc,{placeholder:"Filter by flag name or value",mb:"md",autoFocus:!0,leftSection:a.jsx(od,{style:zf}),value:n,onChange:p}),a.jsxs(le,{horizontalSpacing:"md",verticalSpacing:"xs",miw:700,layout:"fixed",children:[a.jsx(le.Tbody,{children:a.jsxs(le.Tr,{children:[a.jsx(rP,{sorted:o==="flag",reversed:c,onSort:()=>f("flag"),children:"Flag"}),a.jsx(rP,{sorted:o==="value",reversed:c,onSort:()=>f("value"),children:"Value"})]})}),a.jsx(le.Tbody,{children:m.length>0?m:a.jsx(le.Tr,{children:a.jsx(le.Td,{colSpan:2,children:a.jsx(pt,{fw:500,ta:"center",children:"Nothing found"})})})})]})]})})}const jO={getHighlighter:()=>({code:t})=>({highlightedCode:t,isHighlighted:!1})},ZV=O.createContext({adapter:jO,highlight:jO.getHighlighter(null)});function d_e({adapter:t,children:e}){const[n,r]=O.useState(null),i=O.useMemo(()=>t.getHighlighter(n),[t,n]);return O.useEffect(()=>{t.loadContext&&t.loadContext().then(r)},[t]),a.jsx(ZV,{value:{adapter:t,highlight:i},children:e})}function f_e(){var t;return((t=O.use(ZV))==null?void 0:t.highlight)||jO.getHighlighter(null)}const[p_e,m_e]=Ki("CodeHighlightProvider was not found in the component tree"),kS=Zi(t=>{const{children:e,vars:n,tooltipLabel:r,...i}=xe("CodeHighlightControl",null,t),s=m_e(),o=s.getStyles("controlTooltip"),l=a.jsx(Sr,{...s.getStyles("control"),...i,variant:"none","data-code-color-scheme":s.codeColorScheme,children:e});return r?a.jsx(qr,{label:r,fz:"sm",position:"bottom",classNames:{tooltip:o.className},styles:{tooltip:o.style},"data-code-color-scheme":s.codeColorScheme,transitionProps:{duration:0},children:l}):l});kS.displayName="@mantine/code-highlight/CodeHighlightControl";function JV({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"})]})})}JV.displayName="@mantine/code-highlight/CopyIcon";function eG({code:t,copyLabel:e="Copy",copiedLabel:n="Copied"}){const r=EP();return a.jsx(kS,{onClick:()=>r.copy(t.trim()),variant:"none",tooltipLabel:r.copied?n:e,"aria-label":r.copied?n:`${e} code`,children:a.jsx(JV,{copied:r.copied})})}eG.displayName="@mantine/code-highlight/CopyCodeButton";function tG({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"})]})})}tG.displayName="@mantine/code-highlight/ExpandIcon";function nG({expanded:t,onExpand:e,expandCodeLabel:n="Expand code",collapseCodeLabel:r="Collapse code"}){return a.jsx(kS,{onClick:()=>e(!t),tooltipLabel:t?r:n,"aria-label":t?r:n,children:a.jsx(tG,{expanded:t})})}nG.displayName="@mantine/code-highlight/ExpandCodeButton";var rG={root:"m_5cb1b9c8",codeHighlight:"m_e597c321",inlineCodeHighlight:"m_dfe9c588",pre:"m_2c47c4fd",code:"m_5caae6d3",controls:"m_be7e9c9c",control:"m_d498bab7",controlTooltip:"m_4c3d814c",codeWrapper:"m_9f507240",lineNumbers:"m_15f77410",scrollarea:"m_f744fd40",showCodeButton:"m_c9378bc2",file:"m_5cac2e62",fileIcon:"m_b46cddfb",filesScrollarea:"m_7b14120b",files:"m_38d99e51"};const g_e={withCopyButton:!0,expandCodeLabel:"Expand code",collapseCodeLabel:"Collapse code"},iG=(t,{maxCollapsedHeight:e,background:n,radius:r})=>({codeHighlight:{"--ch-max-height":me(e),"--ch-background":n?wr(n,t):void 0,"--ch-radius":typeof r<"u"?rr(r):void 0}}),iy=Ie(t=>{var V,G,J,ne;const e=xe("CodeHighlight",g_e,t),{classNames:n,className:r,style:i,styles:s,unstyled:o,vars:l,code:c,copiedLabel:h,copyLabel:f,defaultExpanded:p,expanded:m,onExpandedChange:v,maxCollapsedHeight:y,withCopyButton:x,withExpandButton:S,expandCodeLabel:w,collapseCodeLabel:A,radius:C,background:j,withBorder:_,withLineNumbers:k,controls:M,language:R,codeColorScheme:N,__withOffset:I,__inline:D,__staticSelector:L,attributes:z,...P}=e,H=mt({name:L||"CodeHighlight",classes:rG,props:e,className:r,style:i,classNames:n,styles:s,unstyled:o,attributes:z,vars:l,varsResolver:iG,rootSelector:"codeHighlight"}),[B,F]=si({value:m,defaultValue:p,finalValue:!0,onChange:v}),q=M&&M.length>0||S||x,X=Ow(),Y=f_e()({code:c.trim(),language:R,colorScheme:N??X}),U=Y.isHighlighted?{dangerouslySetInnerHTML:{__html:Y.highlightedCode}}:{children:c.trim()};return D?a.jsx(ve,{component:"code",...P,...Y.codeElementProps,...H("codeHighlight",{className:$r((V=Y.codeElementProps)==null?void 0:V.className,r),style:[{...(G=Y.codeElementProps)==null?void 0:G.style},i]}),"data-with-border":_||void 0,...U}):a.jsx(p_e,{value:{getStyles:H,codeColorScheme:N},children:a.jsxs(ve,{...H("codeHighlight"),...P,dir:"ltr","data-code-color-scheme":N,"data-with-border":_||void 0,children:[q&&a.jsxs("div",{...H("controls"),"data-with-offset":I||void 0,children:[M,S&&a.jsx(nG,{expanded:B,onExpand:F,expandCodeLabel:w,collapseCodeLabel:A}),x&&a.jsx(eG,{code:c,copiedLabel:h,copyLabel:f})]}),a.jsx(ga,{type:"hover",scrollbarSize:4,dir:"ltr",offsetScrollbars:!1,"data-collapsed":!B||void 0,styles:{viewport:{overscrollBehaviorInline:"none"}},...H("scrollarea"),children:a.jsxs("div",{...H("codeWrapper"),children:[k&&a.jsx("div",{...H("lineNumbers"),"data-with-offset":I||void 0,children:c.trim().split(`
`).map((de,fe)=>a.jsx("div",{children:fe+1},fe))}),a.jsx("pre",{...H("pre"),"data-with-offset":I||void 0,children:a.jsx("code",{...Y.codeElementProps,...H("code",{className:(J=Y.codeElementProps)==null?void 0:J.className,style:(ne=Y.codeElementProps)==null?void 0:ne.style}),...U})})]})}),a.jsx(Nr,{...H("showCodeButton"),mod:{hidden:B},onClick:()=>F(!0),"data-code-color-scheme":N,children:w})]})})});iy.displayName="@mantine/code-highlight/CodeHighlight";iy.classes=rG;iy.varsResolver=iG;iy.Control=kS;function v_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 b_e(){const{data:{data:{yaml:t}}}=Ci({path:"/status/config"});return a.jsx(iy,{code:t,language:"yaml",miw:"50vw",w:"fit-content",maw:"calc(100vw - 75px)",mx:"auto",mt:"xs"})}const y_e=()=>a.jsx(ry,{children:a.jsxs(cu,{title:"Prometheus Agent",icon:oae,children:[a.jsxs(pt,{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(pt,{p:"md",children:"Some features are not available in this mode, such as querying and alerting."})]})}),x_e=()=>{const{colorScheme:t,setColorScheme:e}=$P(),n={style:{width:me(20),height:me(20),display:"block"},stroke:1.5};return a.jsx(Sr,{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(Rae,{...n}):t==="dark"?a.jsx(Oae,{...n}):a.jsx(Cae,{...n})})},A_e=()=>{const{useLocalTime:t,enableQueryHistory:e,enableAutocomplete:n,enableSyntaxHighlighting:r,enableLinter:i,showAnnotations:s,showQueryWarnings:o,showQueryInfoNotices:l,ruleGroupsPerPage:c,alertGroupsPerPage:h}=fi(),f=Au();return a.jsxs(Cn,{position:"bottom",withArrow:!0,shadow:"md",children:[a.jsx(Cn.Target,{children:a.jsx(Sr,{color:"gray",title:"Settings","aria-label":"Settings",size:32,children:a.jsx(sae,{style:gu})})}),a.jsx(Cn.Dropdown,{children:a.jsxs(ft,{align:"flex-start",children:[a.jsxs(_n,{children:[a.jsx(Gd,{p:"md",legend:"Global settings",children:a.jsx(Hs,{checked:t,label:"Use local time",onChange:p=>f(ho({useLocalTime:p.currentTarget.checked}))})}),a.jsx(Gd,{p:"md",legend:"Query page settings",children:a.jsxs(_n,{children:[a.jsx(Hs,{checked:e,label:"Enable query history",onChange:p=>f(ho({enableQueryHistory:p.currentTarget.checked}))}),a.jsx(Hs,{checked:n,label:"Enable autocomplete",onChange:p=>f(ho({enableAutocomplete:p.currentTarget.checked}))}),a.jsx(Hs,{checked:r,label:"Enable syntax highlighting",onChange:p=>f(ho({enableSyntaxHighlighting:p.currentTarget.checked}))}),a.jsx(Hs,{checked:i,label:"Enable linter",onChange:p=>f(ho({enableLinter:p.currentTarget.checked}))}),a.jsx(Hs,{checked:o,label:"Show query warnings",onChange:p=>f(ho({showQueryWarnings:p.currentTarget.checked}))}),a.jsx(Hs,{checked:l,label:"Show query info notices",onChange:p=>f(ho({showQueryInfoNotices:p.currentTarget.checked}))})]})})]}),a.jsxs(_n,{children:[a.jsx(Gd,{p:"md",legend:"Alerts page settings",children:a.jsxs(_n,{children:[a.jsx(Hs,{checked:s,label:"Show expanded annotations",onChange:p=>f(ho({showAnnotations:p.currentTarget.checked}))}),a.jsx(wv,{min:1,allowDecimal:!1,label:"Alert groups per page",value:h,onChange:p=>{typeof p=="number"&&f(ho({alertGroupsPerPage:p}))}})]})}),a.jsx(Gd,{p:"md",legend:"Rules page settings",children:a.jsx(wv,{min:1,allowDecimal:!1,label:"Rule groups per page",value:c,onChange:p=>{typeof p=="number"&&f(ho({ruleGroupsPerPage:p}))}})})]})]})})]})},aP="is starting up...",w_e="is shutting down...",S_e="is not ready...",j_e=()=>{const{pathPrefix:t,agentMode:e}=fi(),n=Au(),[r,i]=O.useState(0),[s,o]=O.useState(""),{data:l}=wz({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(w_e):o(aP),!1;default:throw new Error(m.statusText)}}catch{throw new Error("Unexpected error while fetching ready status")}}}),c=s===aP,{data:h,isSuccess:f}=Ci({path:"/status/walreplay",key:["walreplay",r]});return O.useEffect(()=>{l&&n(ho({ready:l}))},[l,n]),O.useEffect(()=>{const p=setInterval(()=>i(m=>m+1),1e3);return()=>clearInterval(p)},[]),a.jsx(Nt,{color:"yellow",title:"Prometheus "+(e&&"Agent "||"")+(s||S_e),icon:a.jsx(Di,{}),maw:500,mx:"auto",mt:"lg",children:c&&f&&h&&a.jsxs(_n,{children:[a.jsxs("strong",{children:["Replaying WAL (",h.data.current,"/",h.data.max,")"]}),a.jsx(d0,{size:"xl",animated:!0,color:"yellow",value:(h.data.current-h.data.min+1)/(h.data.max-h.data.min+1)*100})]})})},xx=({children:t})=>{const{ready:e}=fi();return e?a.jsx(a.Fragment,{children:t}):a.jsx(j_e,{})},C_e={notifications:[],isConnectionError:!1},sG=O.createContext(C_e),__e=()=>O.useContext(sG);async function T_e(t,e){const n=t.getReader();let r;for(;!(r=await n.read()).done;)e(r.value)}function k_e(t){let e,n,r,i=!1;return function(o){e===void 0?(e=o,n=0,r=-1):e=E_e(e,o);const l=e.length;let c=0;for(;n<l;){i&&(e[n]===10&&(c=++n),i=!1);let h=-1;for(;n<l&&h===-1;++n)switch(e[n]){case 58:r===-1&&(r=n-c);break;case 13:i=!0;case 10:h=n;break}if(h===-1)break;t(e.subarray(c,h),r),c=n,r=-1}c===l?e=void 0:c!==0&&(e=e.subarray(c),n-=c)}}function O_e(t,e,n){let r=oP();const i=new TextDecoder;return function(o,l){if(o.length===0)n==null||n(r),r=oP();else if(l>0){const c=i.decode(o.subarray(0,l)),h=l+(o[l+1]===32?2:1),f=i.decode(o.subarray(h));switch(c){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 E_e(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function oP(){return{data:"",event:"",id:"",retry:void 0}}var M_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 CO="text/event-stream",R_e=1e3,lP="last-event-id";function D_e(t,e){var{signal:n,headers:r,onopen:i,onmessage:s,onclose:o,onerror:l,openWhenHidden:c,fetch:h}=e,f=M_e(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((p,m)=>{const v=Object.assign({},r);v.accept||(v.accept=CO);let y;function x(){y.abort(),document.hidden||_()}c||document.addEventListener("visibilitychange",x);let S=R_e,w=0;function A(){document.removeEventListener("visibilitychange",x),window.clearTimeout(w),y.abort()}n==null||n.addEventListener("abort",()=>{A(),p()});const C=h??window.fetch,j=i??N_e;async function _(){var k;y=new AbortController;try{const M=await C(t,Object.assign(Object.assign({},f),{headers:v,signal:y.signal}));await j(M),await T_e(M.body,k_e(O_e(R=>{R?v[lP]=R:delete v[lP]},R=>{S=R},s))),o==null||o(),A(),p()}catch(M){if(!y.signal.aborted)try{const R=(k=l==null?void 0:l(M))!==null&&k!==void 0?k:S;window.clearTimeout(w),w=window.setTimeout(_,R)}catch(R){A(),m(R)}}}_()})}function N_e(t){const e=t.headers.get("content-type");if(!(e!=null&&e.startsWith(CO)))throw new Error(`Expected content-type to be ${CO}, Actual: ${e}`)}const I_e=({children:t})=>{const{pathPrefix:e}=fi(),[n,r]=O.useState([]),[i,s]=O.useState(!1),[o,l]=O.useState(!1),{data:c,isError:h}=Zh({path:"/notifications",enabled:o,refetchInterval:1e4});return O.useEffect(()=>{c&&c.data&&r(c.data),s(h)},[c,h]),O.useEffect(()=>{const f=new AbortController;return D_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 y=[...v.filter(x=>x.text!==m.text)];return m.active&&y.push(m),y})},onclose(){throw new Error("Server closed the connection")},onerror(){return s(!0),5e3}}),()=>{f.abort()}},[e]),a.jsx(sG.Provider,{value:{notifications:n,isConnectionError:i},children:t})},L_e=()=>{const{notifications:t,isConnectionError:e}=__e(),{useLocalTime:n}=fi();return t.length===0&&!e?null:a.jsx(t2,{color:"red",size:16,label:e?"!":t.length,children:a.jsxs(Cn,{position:"bottom-end",shadow:"md",withArrow:!0,children:[a.jsx(Cn.Target,{children:a.jsx(Sr,{color:"gray",title:"Notifications","aria-label":"Notifications",size:32,children:a.jsx(Pse,{style:gu})})}),a.jsx(Cn.Dropdown,{children:a.jsxs(_n,{gap:"xs",children:[a.jsx(pt,{fw:700,size:"xs",c:"dimmed",ta:"center",children:"Notifications"}),a.jsx(ga.Autosize,{mah:200,children:e?a.jsx(Qr,{p:"xs",color:"red",children:a.jsxs(ft,{wrap:"nowrap",children:[a.jsx(zse,{color:"red",style:{width:me(20),height:me(20)}}),a.jsxs(_n,{gap:"0",children:[a.jsx(pt,{size:"sm",fw:500,children:"Real-time notifications interrupted."}),a.jsx(pt,{size:"xs",c:"dimmed",children:"Please refresh the page or check your connection."})]})]})}):t.length===0?a.jsx(pt,{ta:"center",c:"dimmed",children:"No notifications"}):t.map((r,i)=>a.jsx(Qr,{p:"xs",children:a.jsxs(ft,{wrap:"nowrap",align:"flex-start",children:[a.jsx(Di,{color:"red",style:{width:me(20),height:me(20),marginTop:me(3)}}),a.jsxs(_n,{maw:250,gap:5,children:[a.jsx(pt,{size:"sm",fw:500,children:r.text}),a.jsx(pt,{size:"xs",c:"dimmed",children:bf(new Date(r.date).valueOf()/1e3,n)})]})]})},i))})]})})]})})},B_e=({children:t})=>{var e;const{navigator:n}=O.useContext(xa),r=t6(),i=(e=O.useContext(Bf))==null?void 0:e.router,s=ko();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,c,h;return(h=(c=(l=i==null?void 0:i.state)==null?void 0:l.location)!=null?c:n==null?void 0:n.location)!=null?h:s}})},aG="serviceDiscovery.collapsedPools",P_e={collapsedPools:Ra(aG,[]),showLimitAlert:!1},oG=R2({name:"serviceDiscoveryPage",initialState:P_e,reducers:{setCollapsedPools:(t,{payload:e})=>{t.collapsedPools=e},setShowLimitAlert:(t,{payload:e})=>{t.showLimitAlert=e}}}),{setCollapsedPools:G4,setShowLimitAlert:_O}=oG.actions,F_e=oG.reducer,tf={width:Rs(18),height:Rs(18),verticalAlign:"middle"},$_e=(t,e)=>a.jsxs(le,{w:"60%",withTableBorder:!0,withColumnBorders:!0,bg:"light-dark(var(--mantine-color-gray-0), var(--mantine-color-gray-8))",children:[a.jsx(le.Thead,{children:a.jsx(le.Tr,{bg:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-gray-7))",children:a.jsx(le.Th,{colSpan:2,children:a.jsxs(ft,{gap:"xs",children:[a.jsx(zH,{style:tf})," Rule ",e+1]})})})}),a.jsx(le.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(le.Tr,{children:[a.jsx(le.Th,{children:a.jsx("code",{children:n})}),a.jsx(le.Td,{children:a.jsx("code",{children:typeof r=="object"?JSON.stringify(r):String(r)})})]},n))})]}),cP=(t,e)=>t===null?a.jsx(pt,{c:"dimmed",children:"dropped"}):a.jsxs(le,{w:"50%",withTableBorder:!0,children:[a.jsx(le.Thead,{children:a.jsx(le.Tr,{bg:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-gray-7))",children:a.jsx(le.Th,{colSpan:3,children:a.jsxs(ft,{gap:"xs",children:[a.jsx(uae,{style:tf})," Labels"]})})})}),a.jsx(le.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(le.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(le.Td,{w:40,children:i?a.jsx(fse,{style:tf}):s?a.jsx(zH,{style:tf}):o?a.jsx(hse,{style:tf}):null}),a.jsx(le.Th,{children:a.jsx("code",{children:n})}),a.jsx(le.Td,{children:a.jsx("code",{children:r})})]},n)})})]}),H_e=({labels:t,pool:e})=>{const{data:n}=Ci({path:"/targets/relabel_steps",params:{labels:JSON.stringify(t),scrapePool:e}});return a.jsxs(_n,{align:"center",children:[cP(t,null),n.data.steps.map((r,i)=>a.jsxs(zn.Fragment,{children:[a.jsx(m5,{style:tf}),$_e(r.rule,i),a.jsx(m5,{style:tf}),r.keep?cP(r.output,i===0?t:n.data.steps[i-1].output):a.jsx(pt,{c:"dimmed",children:"dropped"})]},i))]})},z_e=new ny({shouldSort:!0,indexedKeys:["labels","discoveredLabels",["discoveredLabels",/.*/],["labels",/.*/]]}),q_e=new ny({shouldSort:!0,indexedKeys:["discoveredLabels",["discoveredLabels",/.*/]]}),Q_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 c=r.length!==0&&!r.includes("active")?[]:n===""?i:z_e.filter(n,i).map(f=>f.original);for(const f of c)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:q_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},U_e=({poolNames:t,selectedPool:e,stateFilter:n,searchFilter:r})=>{const i=Au(),[s,o]=fb({key:"serviceDiscoveryPage.showEmptyPools",defaultValue:!1}),[l,c]=O.useState(null),{data:{data:h}}=Ci({path:"/targets",params:{scrapePool:e===null?"":e}}),{collapsedPools:f,showLimitAlert:p}=hc(S=>S.serviceDiscoveryPage),[m]=db(r,250),v=O.useMemo(()=>Q_e(e?[e]:t,h,m,n),[e,t,h,m,n]),y=Object.keys(v),x=s?y:y.filter(S=>v[S].targets.length!==0);return a.jsxs(_n,{children:[y.length===0?a.jsx(Nt,{title:"No scrape pools found",icon:a.jsx(nr,{}),children:"No scrape pools found."}):!s&&y.length!==x.length&&a.jsxs(Nt,{title:"Hiding pools with no matching targets",icon:a.jsx(nr,{}),children:["Hiding ",y.length-x.length," empty pools due to filters or no targets.",a.jsx(Wr,{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(nr,{}),withCloseButton:!0,onClose:()=>i(_O(!1)),children:["There are more than ",lG," scrape pools. Showing only the first one. Use the dropdown to select a different pool."]}),a.jsx(Ur,{multiple:!0,variant:"separated",keepMounted:!1,value:y.filter(S=>!f.includes(S)),onChange:S=>i(G4(y.filter(w=>!S.includes(w)))),children:x.map(S=>{const w=v[S];return a.jsxs(Ur.Item,{value:S,children:[a.jsx(Ur.Control,{children:a.jsxs(ft,{wrap:"nowrap",justify:"space-between",mr:"lg",children:[a.jsx(pt,{children:S}),a.jsxs(ft,{gap:"xs",children:[a.jsxs(pt,{c:"gray.6",children:[w.active," / ",w.serverTotal]}),a.jsx(Db,{size:25,thickness:5,sections:w.serverTotal===0?[]:[{value:w.active/w.serverTotal*100,color:"green.4"},{value:(w.serverTotal-w.active)/w.serverTotal*100,color:"blue.6"}]})]})]})}),a.jsxs(Ur.Panel,{children:[w.total!==w.serverTotal&&a.jsxs(Nt,{title:"Only showing partial dropped targets",icon:a.jsx(nr,{}),color:"yellow",mb:"sm",children:[w.serverTotal-w.total," further dropped targets are not shown here because the server only kept details on a maximum of ",w.total-w.active," dropped targets (",a.jsx("code",{children:"keep_dropped_targets"})," configuration setting)."]}),w.total===0?a.jsxs(Nt,{title:"No targets",icon:a.jsx(nr,{}),children:["No targets in this scrape pool.",a.jsx(Wr,{ml:"md",fz:"1em",onClick:()=>o(!1),children:"Hide empty pools"})]}):w.targets.length===0?a.jsxs(Nt,{title:"No matching targets",icon:a.jsx(nr,{}),children:["No targets in this pool match your filter criteria (omitted"," ",w.total," filtered targets).",a.jsx(Wr,{ml:"md",fz:"1em",onClick:()=>o(!1),children:"Hide empty pools"})]}):a.jsx(Gm,{allItems:w.targets,child:({items:A})=>a.jsxs(le,{children:[a.jsx(le.Thead,{children:a.jsxs(le.Tr,{children:[a.jsx(le.Th,{w:"50%",children:"Discovered labels"}),a.jsx(le.Th,{w:"50%",children:"Target labels"})]})}),a.jsx(le.Tbody,{children:A.map((C,j)=>a.jsxs(le.Tr,{children:[a.jsx(le.Td,{py:"lg",valign:"top",children:a.jsx(e0,{labels:C.discoveredLabels,wrapper:_n})}),a.jsx(le.Td,{py:"lg",valign:C.isDropped?"middle":"top",children:a.jsxs(_n,{children:[C.isDropped?a.jsx(pt,{c:"dimmed",fw:"bold",children:"dropped"}):a.jsx(e0,{labels:C.labels,wrapper:_n}),a.jsx(Wr,{inherit:!0,onClick:()=>{c({labels:C.discoveredLabels,pool:S})},children:"show relabeling"})]})})]},j))})]})})]})]},S)})}),a.jsx(Ga,{size:"95%",opened:l!==null,onClose:()=>c(null),title:"Relabeling steps for target",children:a.jsx(Df,{title:"Error showing relabeling steps",children:a.jsx(O.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(20),(S,w)=>a.jsx(Wa,{height:30,mb:15,width:"100%"},w))}),children:a.jsx(H_e,{pool:(l==null?void 0:l.pool)||"",labels:(l==null?void 0:l.labels)||{}})})},location.pathname)})]})},lG=20;function W_e(){const{data:{data:{scrapePools:t}}}=Ci({path:"/scrape_pools"}),e=Au(),[n,r]=Ao("pool",rd),[i,s]=Ao("state",tc(TS,[])),[o,l]=Ao("search",tc(rd,"")),{collapsedPools:c,showLimitAlert:h}=hc(p=>p.serviceDiscoveryPage),f=t.length>lG&&n===void 0;return f&&(r(t[0]),e(_O(!0))),a.jsxs(a.Fragment,{children:[a.jsxs(ft,{mb:"md",mt:"xs",children:[a.jsx(p0,{placeholder:"Select scrape pool",data:[{label:"All pools",value:""},...t],value:f&&t[0]||n||null,onChange:p=>{r(p),h&&e(_O(!1))},searchable:!0}),a.jsx(_S,{options:["active","dropped"],optionClass:p=>p==="active"?gn.healthOk:gn.healthInfo,placeholder:"Filter by state",values:(i==null?void 0:i.filter(p=>p!==null))||[],onChange:p=>s(p)}),a.jsx(cc,{flex:1,leftSection:a.jsx(od,{style:zf}),placeholder:"Filter by labels",value:o||"",onChange:p=>l(p.currentTarget.value)}),a.jsx(Sr,{size:"input-sm",title:c.length>0?"Expand all pools":"Collapse all pools",variant:"light",onClick:()=>e(G4(c.length>0?[]:t)),children:c.length>0?a.jsx(FH,{style:vw}):a.jsx(PH,{style:vw})})]}),a.jsx(Df,{title:"Error showing target pools",children:a.jsx(O.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(10),(p,m)=>a.jsx(Wa,{height:40,mb:15,width:1e3,mx:"auto"},m))}),children:a.jsx(U_e,{poolNames:t,selectedPool:f&&t[0]||n||null,stateFilter:i,searchFilter:o})})},location.pathname)]})}function Y_e(){const{data:{data:{activeAlertmanagers:t,droppedAlertmanagers:e}}}=Ci({path:"/alertmanagers"});return a.jsxs(ry,{children:[a.jsx(cu,{title:"Active Alertmanagers",icon:XE,children:t.length===0?a.jsx(Nt,{title:"No active alertmanagers",icon:a.jsx(nr,{}),children:"No active alertmanagers found."}):a.jsx(le,{layout:"fixed",children:a.jsx(le.Tbody,{children:t.map(n=>a.jsx(le.Tr,{children:a.jsx(le.Td,{children:a.jsx(SO,{endpoint:n.url,globalUrl:n.url})})},n.url))})})}),a.jsx(cu,{title:"Dropped Alertmanagers",icon:Xie,children:e.length===0?a.jsx(Nt,{title:"No dropped alertmanagers",icon:a.jsx(nr,{}),children:"No dropped alertmanagers found."}):a.jsx(le,{layout:"fixed",children:a.jsx(le.Tbody,{children:e.map(n=>a.jsx(le.Tr,{children:a.jsx(le.Td,{children:a.jsx(SO,{endpoint:n.url,globalUrl:n.url})})},n.url))})})})]})}var e3,uP;function V_e(){if(uP)return e3;uP=1;function t(re){return re instanceof Map?re.clear=re.delete=re.set=function(){throw new Error("map is read-only")}:re instanceof Set&&(re.add=re.clear=re.delete=function(){throw new Error("set is read-only")}),Object.freeze(re),Object.getOwnPropertyNames(re).forEach(Re=>{const ye=re[Re],We=typeof ye;(We==="object"||We==="function")&&!Object.isFrozen(ye)&&t(ye)}),re}class e{constructor(Re){Re.data===void 0&&(Re.data={}),this.data=Re.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(re){return re.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r(re,...Re){const ye=Object.create(null);for(const We in re)ye[We]=re[We];return Re.forEach(function(We){for(const qt in We)ye[qt]=We[qt]}),ye}const i="</span>",s=re=>!!re.scope,o=(re,{prefix:Re})=>{if(re.startsWith("language:"))return re.replace("language:","language-");if(re.includes(".")){const ye=re.split(".");return[`${Re}${ye.shift()}`,...ye.map((We,qt)=>`${We}${"_".repeat(qt+1)}`)].join(" ")}return`${Re}${re}`};class l{constructor(Re,ye){this.buffer="",this.classPrefix=ye.classPrefix,Re.walk(this)}addText(Re){this.buffer+=n(Re)}openNode(Re){if(!s(Re))return;const ye=o(Re.scope,{prefix:this.classPrefix});this.span(ye)}closeNode(Re){s(Re)&&(this.buffer+=i)}value(){return this.buffer}span(Re){this.buffer+=`<span class="${Re}">`}}const c=(re={})=>{const Re={children:[]};return Object.assign(Re,re),Re};class h{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Re){this.top.children.push(Re)}openNode(Re){const ye=c({scope:Re});this.add(ye),this.stack.push(ye)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Re){return this.constructor._walk(Re,this.rootNode)}static _walk(Re,ye){return typeof ye=="string"?Re.addText(ye):ye.children&&(Re.openNode(ye),ye.children.forEach(We=>this._walk(Re,We)),Re.closeNode(ye)),Re}static _collapse(Re){typeof Re!="string"&&Re.children&&(Re.children.every(ye=>typeof ye=="string")?Re.children=[Re.children.join("")]:Re.children.forEach(ye=>{h._collapse(ye)}))}}class f extends h{constructor(Re){super(),this.options=Re}addText(Re){Re!==""&&this.add(Re)}startScope(Re){this.openNode(Re)}endScope(){this.closeNode()}__addSublanguage(Re,ye){const We=Re.root;ye&&(We.scope=`language:${ye}`),this.add(We)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(re){return re?typeof re=="string"?re:re.source:null}function m(re){return x("(?=",re,")")}function v(re){return x("(?:",re,")*")}function y(re){return x("(?:",re,")?")}function x(...re){return re.map(ye=>p(ye)).join("")}function S(re){const Re=re[re.length-1];return typeof Re=="object"&&Re.constructor===Object?(re.splice(re.length-1,1),Re):{}}function w(...re){return"("+(S(re).capture?"":"?:")+re.map(We=>p(We)).join("|")+")"}function A(re){return new RegExp(re.toString()+"|").exec("").length-1}function C(re,Re){const ye=re&&re.exec(Re);return ye&&ye.index===0}const j=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function _(re,{joinWith:Re}){let ye=0;return re.map(We=>{ye+=1;const qt=ye;let Qt=p(We),tt="";for(;Qt.length>0;){const Pe=j.exec(Qt);if(!Pe){tt+=Qt;break}tt+=Qt.substring(0,Pe.index),Qt=Qt.substring(Pe.index+Pe[0].length),Pe[0][0]==="\\"&&Pe[1]?tt+="\\"+String(Number(Pe[1])+qt):(tt+=Pe[0],Pe[0]==="("&&ye++)}return tt}).map(We=>`(${We})`).join(Re)}const k=/\b\B/,M="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",N="\\b\\d+(\\.\\d+)?",I="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",D="\\b(0b[01]+)",L="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",z=(re={})=>{const Re=/^#![ ]*\//;return re.binary&&(re.begin=x(Re,/.*\b/,re.binary,/\b.*/)),r({scope:"meta",begin:Re,end:/$/,relevance:0,"on:begin":(ye,We)=>{ye.index!==0&&We.ignoreMatch()}},re)},P={begin:"\\\\[\\s\\S]",relevance:0},H={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[P]},B={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[P]},F={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/},q=function(re,Re,ye={}){const We=r({scope:"comment",begin:re,end:Re,contains:[]},ye);We.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 qt=w("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 We.contains.push({begin:x(/[ ]+/,"(",qt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),We},X=q("//","$"),Y=q("/\\*","\\*/"),U=q("#","$"),V={scope:"number",begin:N,relevance:0},G={scope:"number",begin:I,relevance:0},J={scope:"number",begin:D,relevance:0},ne={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[P,{begin:/\[/,end:/\]/,relevance:0,contains:[P]}]},de={scope:"title",begin:M,relevance:0},fe={scope:"title",begin:R,relevance:0},ke={begin:"\\.\\s*"+R,relevance:0};var Oe=Object.freeze({__proto__:null,APOS_STRING_MODE:H,BACKSLASH_ESCAPE:P,BINARY_NUMBER_MODE:J,BINARY_NUMBER_RE:D,COMMENT:q,C_BLOCK_COMMENT_MODE:Y,C_LINE_COMMENT_MODE:X,C_NUMBER_MODE:G,C_NUMBER_RE:I,END_SAME_AS_BEGIN:function(re){return Object.assign(re,{"on:begin":(Re,ye)=>{ye.data._beginMatch=Re[1]},"on:end":(Re,ye)=>{ye.data._beginMatch!==Re[1]&&ye.ignoreMatch()}})},HASH_COMMENT_MODE:U,IDENT_RE:M,MATCH_NOTHING_RE:k,METHOD_GUARD:ke,NUMBER_MODE:V,NUMBER_RE:N,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:B,REGEXP_MODE:ne,RE_STARTERS_RE:L,SHEBANG:z,TITLE_MODE:de,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:fe});function Ye(re,Re){re.input[re.index-1]==="."&&Re.ignoreMatch()}function ie(re,Re){re.className!==void 0&&(re.scope=re.className,delete re.className)}function Se(re,Re){Re&&re.beginKeywords&&(re.begin="\\b("+re.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",re.__beforeBegin=Ye,re.keywords=re.keywords||re.beginKeywords,delete re.beginKeywords,re.relevance===void 0&&(re.relevance=0))}function se(re,Re){Array.isArray(re.illegal)&&(re.illegal=w(...re.illegal))}function _e(re,Re){if(re.match){if(re.begin||re.end)throw new Error("begin & end are not supported with match");re.begin=re.match,delete re.match}}function et(re,Re){re.relevance===void 0&&(re.relevance=1)}const Te=(re,Re)=>{if(!re.beforeMatch)return;if(re.starts)throw new Error("beforeMatch cannot be used with starts");const ye=Object.assign({},re);Object.keys(re).forEach(We=>{delete re[We]}),re.keywords=ye.keywords,re.begin=x(ye.beforeMatch,m(ye.begin)),re.starts={relevance:0,contains:[Object.assign(ye,{endsParent:!0})]},re.relevance=0,delete ye.beforeMatch},Xe=["of","and","for","in","not","or","if","then","parent","list","value"],at="keyword";function Ve(re,Re,ye=at){const We=Object.create(null);return typeof re=="string"?qt(ye,re.split(" ")):Array.isArray(re)?qt(ye,re):Object.keys(re).forEach(function(Qt){Object.assign(We,Ve(re[Qt],Re,Qt))}),We;function qt(Qt,tt){Re&&(tt=tt.map(Pe=>Pe.toLowerCase())),tt.forEach(function(Pe){const nt=Pe.split("|");We[nt[0]]=[Qt,Ge(nt[0],nt[1])]})}}function Ge(re,Re){return Re?Number(Re):ut(re)?0:1}function ut(re){return Xe.includes(re.toLowerCase())}const Ue={},De=re=>{console.error(re)},Ce=(re,...Re)=>{console.log(`WARN: ${re}`,...Re)},ze=(re,Re)=>{Ue[`${re}/${Re}`]||(console.log(`Deprecated as of ${re}. ${Re}`),Ue[`${re}/${Re}`]=!0)},ht=new Error;function Rt(re,Re,{key:ye}){let We=0;const qt=re[ye],Qt={},tt={};for(let Pe=1;Pe<=Re.length;Pe++)tt[Pe+We]=qt[Pe],Qt[Pe+We]=!0,We+=A(Re[Pe-1]);re[ye]=tt,re[ye]._emit=Qt,re[ye]._multi=!0}function Tn(re){if(Array.isArray(re.begin)){if(re.skip||re.excludeBegin||re.returnBegin)throw De("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ht;if(typeof re.beginScope!="object"||re.beginScope===null)throw De("beginScope must be object"),ht;Rt(re,re.begin,{key:"beginScope"}),re.begin=_(re.begin,{joinWith:""})}}function fn(re){if(Array.isArray(re.end)){if(re.skip||re.excludeEnd||re.returnEnd)throw De("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ht;if(typeof re.endScope!="object"||re.endScope===null)throw De("endScope must be object"),ht;Rt(re,re.end,{key:"endScope"}),re.end=_(re.end,{joinWith:""})}}function Zt(re){re.scope&&typeof re.scope=="object"&&re.scope!==null&&(re.beginScope=re.scope,delete re.scope)}function lt(re){Zt(re),typeof re.beginScope=="string"&&(re.beginScope={_wrap:re.beginScope}),typeof re.endScope=="string"&&(re.endScope={_wrap:re.endScope}),Tn(re),fn(re)}function tn(re){function Re(tt,Pe){return new RegExp(p(tt),"m"+(re.case_insensitive?"i":"")+(re.unicodeRegex?"u":"")+(Pe?"g":""))}class ye{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Pe,nt){nt.position=this.position++,this.matchIndexes[this.matchAt]=nt,this.regexes.push([nt,Pe]),this.matchAt+=A(Pe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Pe=this.regexes.map(nt=>nt[1]);this.matcherRe=Re(_(Pe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Pe){this.matcherRe.lastIndex=this.lastIndex;const nt=this.matcherRe.exec(Pe);if(!nt)return null;const _t=nt.findIndex((on,Vr)=>Vr>0&&on!==void 0),Tt=this.matchIndexes[_t];return nt.splice(0,_t),Object.assign(nt,Tt)}}class We{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Pe){if(this.multiRegexes[Pe])return this.multiRegexes[Pe];const nt=new ye;return this.rules.slice(Pe).forEach(([_t,Tt])=>nt.addRule(_t,Tt)),nt.compile(),this.multiRegexes[Pe]=nt,nt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Pe,nt){this.rules.push([Pe,nt]),nt.type==="begin"&&this.count++}exec(Pe){const nt=this.getMatcher(this.regexIndex);nt.lastIndex=this.lastIndex;let _t=nt.exec(Pe);if(this.resumingScanAtSamePosition()&&!(_t&&_t.index===this.lastIndex)){const Tt=this.getMatcher(0);Tt.lastIndex=this.lastIndex+1,_t=Tt.exec(Pe)}return _t&&(this.regexIndex+=_t.position+1,this.regexIndex===this.count&&this.considerAll()),_t}}function qt(tt){const Pe=new We;return tt.contains.forEach(nt=>Pe.addRule(nt.begin,{rule:nt,type:"begin"})),tt.terminatorEnd&&Pe.addRule(tt.terminatorEnd,{type:"end"}),tt.illegal&&Pe.addRule(tt.illegal,{type:"illegal"}),Pe}function Qt(tt,Pe){const nt=tt;if(tt.isCompiled)return nt;[ie,_e,lt,Te].forEach(Tt=>Tt(tt,Pe)),re.compilerExtensions.forEach(Tt=>Tt(tt,Pe)),tt.__beforeBegin=null,[Se,se,et].forEach(Tt=>Tt(tt,Pe)),tt.isCompiled=!0;let _t=null;return typeof tt.keywords=="object"&&tt.keywords.$pattern&&(tt.keywords=Object.assign({},tt.keywords),_t=tt.keywords.$pattern,delete tt.keywords.$pattern),_t=_t||/\w+/,tt.keywords&&(tt.keywords=Ve(tt.keywords,re.case_insensitive)),nt.keywordPatternRe=Re(_t,!0),Pe&&(tt.begin||(tt.begin=/\B|\b/),nt.beginRe=Re(nt.begin),!tt.end&&!tt.endsWithParent&&(tt.end=/\B|\b/),tt.end&&(nt.endRe=Re(nt.end)),nt.terminatorEnd=p(nt.end)||"",tt.endsWithParent&&Pe.terminatorEnd&&(nt.terminatorEnd+=(tt.end?"|":"")+Pe.terminatorEnd)),tt.illegal&&(nt.illegalRe=Re(tt.illegal)),tt.contains||(tt.contains=[]),tt.contains=[].concat(...tt.contains.map(function(Tt){return Lt(Tt==="self"?tt:Tt)})),tt.contains.forEach(function(Tt){Qt(Tt,nt)}),tt.starts&&Qt(tt.starts,Pe),nt.matcher=qt(nt),nt}if(re.compilerExtensions||(re.compilerExtensions=[]),re.contains&&re.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return re.classNameAliases=r(re.classNameAliases||{}),Qt(re)}function Bt(re){return re?re.endsWithParent||Bt(re.starts):!1}function Lt(re){return re.variants&&!re.cachedVariants&&(re.cachedVariants=re.variants.map(function(Re){return r(re,{variants:null},Re)})),re.cachedVariants?re.cachedVariants:Bt(re)?r(re,{starts:re.starts?r(re.starts):null}):Object.isFrozen(re)?r(re):re}var Wt="11.11.1";class jt extends Error{constructor(Re,ye){super(Re),this.name="HTMLInjectionError",this.html=ye}}const Ht=n,cn=r,qn=Symbol("nomatch"),bn=7,un=function(re){const Re=Object.create(null),ye=Object.create(null),We=[];let qt=!0;const Qt="Could not find the language '{}', did you forget to load/include a language module?",tt={disableAutodetect:!0,name:"Plain text",contains:[]};let Pe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function nt(Je){return Pe.noHighlightRe.test(Je)}function _t(Je){let Et=Je.className+" ";Et+=Je.parentNode?Je.parentNode.className:"";const nn=Pe.languageDetectRe.exec(Et);if(nn){const Mn=kn(nn[1]);return Mn||(Ce(Qt.replace("{}",nn[1])),Ce("Falling back to no-highlight mode for this block.",Je)),Mn?nn[1]:"no-highlight"}return Et.split(/\s+/).find(Mn=>nt(Mn)||kn(Mn))}function Tt(Je,Et,nn){let Mn="",_r="";typeof Et=="object"?(Mn=Je,nn=Et.ignoreIllegals,_r=Et.language):(ze("10.7.0","highlight(lang, code, ...args) has been deprecated."),ze("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),_r=Je,Mn=Et),nn===void 0&&(nn=!0);const gi={code:Mn,language:_r};Za("before:highlight",gi);const Ji=gi.result?gi.result:on(gi.language,gi.code,nn);return Ji.code=gi.code,Za("after:highlight",Ji),Ji}function on(Je,Et,nn,Mn){const _r=Object.create(null);function gi(it,Ct){return it.keywords[Ct]}function Ji(){if(!Pt.keywords){Xr.addText(Pn);return}let it=0;Pt.keywordPatternRe.lastIndex=0;let Ct=Pt.keywordPatternRe.exec(Pn),zt="";for(;Ct;){zt+=Pn.substring(it,Ct.index);const hn=ai.case_insensitive?Ct[0].toLowerCase():Ct[0],mr=gi(Pt,hn);if(mr){const[As,xc]=mr;if(Xr.addText(zt),zt="",_r[hn]=(_r[hn]||0)+1,_r[hn]<=bn&&(Al+=xc),As.startsWith("_"))zt+=Ct[0];else{const Mu=ai.classNameAliases[As]||As;ys(Ct[0],Mu)}}else zt+=Ct[0];it=Pt.keywordPatternRe.lastIndex,Ct=Pt.keywordPatternRe.exec(Pn)}zt+=Pn.substring(it),Xr.addText(zt)}function Gn(){if(Pn==="")return;let it=null;if(typeof Pt.subLanguage=="string"){if(!Re[Pt.subLanguage]){Xr.addText(Pn);return}it=on(Pt.subLanguage,Pn,!0,Eu[Pt.subLanguage]),Eu[Pt.subLanguage]=it._top}else it=Gr(Pn,Pt.subLanguage.length?Pt.subLanguage:null);Pt.relevance>0&&(Al+=it.relevance),Xr.__addSublanguage(it._emitter,it.language)}function Xn(){Pt.subLanguage!=null?Gn():Ji(),Pn=""}function ys(it,Ct){it!==""&&(Xr.startScope(Ct),Xr.addText(it),Xr.endScope())}function Tu(it,Ct){let zt=1;const hn=Ct.length-1;for(;zt<=hn;){if(!it._emit[zt]){zt++;continue}const mr=ai.classNameAliases[it[zt]]||it[zt],As=Ct[zt];mr?ys(As,mr):(Pn=As,Ji(),Pn=""),zt++}}function gc(it,Ct){return it.scope&&typeof it.scope=="string"&&Xr.openNode(ai.classNameAliases[it.scope]||it.scope),it.beginScope&&(it.beginScope._wrap?(ys(Pn,ai.classNameAliases[it.beginScope._wrap]||it.beginScope._wrap),Pn=""):it.beginScope._multi&&(Tu(it.beginScope,Ct),Pn="")),Pt=Object.create(it,{parent:{value:Pt}}),Pt}function hd(it,Ct,zt){let hn=C(it.endRe,zt);if(hn){if(it["on:end"]){const mr=new e(it);it["on:end"](Ct,mr),mr.isMatchIgnored&&(hn=!1)}if(hn){for(;it.endsParent&&it.parent;)it=it.parent;return it}}if(it.endsWithParent)return hd(it.parent,Ct,zt)}function ku(it){return Pt.matcher.regexIndex===0?(Pn+=it[0],1):(Ja=!0,0)}function _0(it){const Ct=it[0],zt=it.rule,hn=new e(zt),mr=[zt.__beforeBegin,zt["on:begin"]];for(const As of mr)if(As&&(As(it,hn),hn.isMatchIgnored))return ku(Ct);return zt.skip?Pn+=Ct:(zt.excludeBegin&&(Pn+=Ct),Xn(),!zt.returnBegin&&!zt.excludeBegin&&(Pn=Ct)),gc(zt,it),zt.returnBegin?0:Ct.length}function es(it){const Ct=it[0],zt=Et.substring(it.index),hn=hd(Pt,it,zt);if(!hn)return qn;const mr=Pt;Pt.endScope&&Pt.endScope._wrap?(Xn(),ys(Ct,Pt.endScope._wrap)):Pt.endScope&&Pt.endScope._multi?(Xn(),Tu(Pt.endScope,it)):mr.skip?Pn+=Ct:(mr.returnEnd||mr.excludeEnd||(Pn+=Ct),Xn(),mr.excludeEnd&&(Pn=Ct));do Pt.scope&&Xr.closeNode(),!Pt.skip&&!Pt.subLanguage&&(Al+=Pt.relevance),Pt=Pt.parent;while(Pt!==hn.parent);return hn.starts&&gc(hn.starts,it),mr.returnEnd?0:Ct.length}function Ou(){const it=[];for(let Ct=Pt;Ct!==ai;Ct=Ct.parent)Ct.scope&&it.unshift(Ct.scope);it.forEach(Ct=>Xr.openNode(Ct))}let vc={};function bc(it,Ct){const zt=Ct&&Ct[0];if(Pn+=it,zt==null)return Xn(),0;if(vc.type==="begin"&&Ct.type==="end"&&vc.index===Ct.index&&zt===""){if(Pn+=Et.slice(Ct.index,Ct.index+1),!qt){const hn=new Error(`0 width match regex (${Je})`);throw hn.languageName=Je,hn.badRule=vc.rule,hn}return 1}if(vc=Ct,Ct.type==="begin")return _0(Ct);if(Ct.type==="illegal"&&!nn){const hn=new Error('Illegal lexeme "'+zt+'" for mode "'+(Pt.scope||"<unnamed>")+'"');throw hn.mode=Pt,hn}else if(Ct.type==="end"){const hn=es(Ct);if(hn!==qn)return hn}if(Ct.type==="illegal"&&zt==="")return Pn+=`
`,1;if(wl>1e5&&wl>Ct.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Pn+=zt,zt.length}const ai=kn(Je);if(!ai)throw De(Qt.replace("{}",Je)),new Error('Unknown language: "'+Je+'"');const yc=tn(ai);let Eo="",Pt=Mn||yc;const Eu={},Xr=new Pe.__emitter(Pe);Ou();let Pn="",Al=0,xs=0,wl=0,Ja=!1;try{if(ai.__emitTokens)ai.__emitTokens(Et,Xr);else{for(Pt.matcher.considerAll();;){wl++,Ja?Ja=!1:Pt.matcher.considerAll(),Pt.matcher.lastIndex=xs;const it=Pt.matcher.exec(Et);if(!it)break;const Ct=Et.substring(xs,it.index),zt=bc(Ct,it);xs=it.index+zt}bc(Et.substring(xs))}return Xr.finalize(),Eo=Xr.toHTML(),{language:Je,value:Eo,relevance:Al,illegal:!1,_emitter:Xr,_top:Pt}}catch(it){if(it.message&&it.message.includes("Illegal"))return{language:Je,value:Ht(Et),illegal:!0,relevance:0,_illegalBy:{message:it.message,index:xs,context:Et.slice(xs-100,xs+100),mode:it.mode,resultSoFar:Eo},_emitter:Xr};if(qt)return{language:Je,value:Ht(Et),illegal:!1,relevance:0,errorRaised:it,_emitter:Xr,_top:Pt};throw it}}function Vr(Je){const Et={value:Ht(Je),illegal:!1,relevance:0,_top:tt,_emitter:new Pe.__emitter(Pe)};return Et._emitter.addText(Je),Et}function Gr(Je,Et){Et=Et||Pe.languages||Object.keys(Re);const nn=Vr(Je),Mn=Et.filter(kn).filter(mi).map(Xn=>on(Xn,Je,!1));Mn.unshift(nn);const _r=Mn.sort((Xn,ys)=>{if(Xn.relevance!==ys.relevance)return ys.relevance-Xn.relevance;if(Xn.language&&ys.language){if(kn(Xn.language).supersetOf===ys.language)return 1;if(kn(ys.language).supersetOf===Xn.language)return-1}return 0}),[gi,Ji]=_r,Gn=gi;return Gn.secondBest=Ji,Gn}function _i(Je,Et,nn){const Mn=Et&&ye[Et]||nn;Je.classList.add("hljs"),Je.classList.add(`language-${Mn}`)}function jr(Je){let Et=null;const nn=_t(Je);if(nt(nn))return;if(Za("before:highlightElement",{el:Je,language:nn}),Je.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Je);return}if(Je.children.length>0&&(Pe.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(Je)),Pe.throwUnescapedHTML))throw new jt("One of your code blocks includes unescaped HTML.",Je.innerHTML);Et=Je;const Mn=Et.textContent,_r=nn?Tt(Mn,{language:nn,ignoreIllegals:!0}):Gr(Mn);Je.innerHTML=_r.value,Je.dataset.highlighted="yes",_i(Je,nn,_r.language),Je.result={language:_r.language,re:_r.relevance,relevance:_r.relevance},_r.secondBest&&(Je.secondBest={language:_r.secondBest.language,relevance:_r.secondBest.relevance}),Za("after:highlightElement",{el:Je,result:_r,text:Mn})}function Pi(Je){Pe=cn(Pe,Je)}const vs=()=>{mc(),ze("10.6.0","initHighlighting() deprecated.  Use highlightAll() now.")};function ud(){mc(),ze("10.6.0","initHighlightingOnLoad() deprecated.  Use highlightAll() now.")}let xl=!1;function mc(){function Je(){mc()}if(document.readyState==="loading"){xl||window.addEventListener("DOMContentLoaded",Je,!1),xl=!0;return}document.querySelectorAll(Pe.cssSelector).forEach(jr)}function Aa(Je,Et){let nn=null;try{nn=Et(re)}catch(Mn){if(De("Language definition for '{}' could not be registered.".replace("{}",Je)),qt)De(Mn);else throw Mn;nn=tt}nn.name||(nn.name=Je),Re[Je]=nn,nn.rawDefinition=Et.bind(null,re),nn.aliases&&Gs(nn.aliases,{languageName:Je})}function Cr(Je){delete Re[Je];for(const Et of Object.keys(ye))ye[Et]===Je&&delete ye[Et]}function Ir(){return Object.keys(Re)}function kn(Je){return Je=(Je||"").toLowerCase(),Re[Je]||Re[ye[Je]]}function Gs(Je,{languageName:Et}){typeof Je=="string"&&(Je=[Je]),Je.forEach(nn=>{ye[nn.toLowerCase()]=Et})}function mi(Je){const Et=kn(Je);return Et&&!Et.disableAutodetect}function Xs(Je){Je["before:highlightBlock"]&&!Je["before:highlightElement"]&&(Je["before:highlightElement"]=Et=>{Je["before:highlightBlock"](Object.assign({block:Et.el},Et))}),Je["after:highlightBlock"]&&!Je["after:highlightElement"]&&(Je["after:highlightElement"]=Et=>{Je["after:highlightBlock"](Object.assign({block:Et.el},Et))})}function Hr(Je){Xs(Je),We.push(Je)}function _u(Je){const Et=We.indexOf(Je);Et!==-1&&We.splice(Et,1)}function Za(Je,Et){const nn=Je;We.forEach(function(Mn){Mn[nn]&&Mn[nn](Et)})}function bs(Je){return ze("10.7.0","highlightBlock will be removed entirely in v12.0"),ze("10.7.0","Please use highlightElement now."),jr(Je)}Object.assign(re,{highlight:Tt,highlightAuto:Gr,highlightAll:mc,highlightElement:jr,highlightBlock:bs,configure:Pi,initHighlighting:vs,initHighlightingOnLoad:ud,registerLanguage:Aa,unregisterLanguage:Cr,listLanguages:Ir,getLanguage:kn,registerAliases:Gs,autoDetection:mi,inherit:cn,addPlugin:Hr,removePlugin:_u}),re.debugMode=function(){qt=!1},re.safeMode=function(){qt=!0},re.versionString=Wt,re.regex={concat:x,lookahead:m,either:w,optional:y,anyNumberOfTimes:v};for(const Je in Oe)typeof Oe[Je]=="object"&&t(Oe[Je]);return Object.assign(re,Oe),re},ct=un({});return ct.newInstance=()=>un({}),e3=ct,ct.HighlightJS=ct,ct.default=ct,e3}var G_e=V_e();const cG=pl(G_e);function X_e(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},y={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},x={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},S=[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},y,x,s,o],w=[...S];return w.pop(),w.push(l),v.contains=w,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:S}}cG.registerLanguage("yaml",X_e);const K_e=v_e(cG),Z_e=new Dle,J_e=[{title:"Query",path:"/query",icon:a.jsx(od,{style:qs}),element:a.jsx(PV,{}),inAgentMode:!1},{title:"Alerts",path:"/alerts",icon:a.jsx(Sae,{style:qs}),element:a.jsx(VV,{}),inAgentMode:!1}],uG=[{title:"Target health",path:"/targets",icon:a.jsx(BH,{style:qs}),element:a.jsx(s_e,{}),inAgentMode:!0},{title:"Rule health",path:"/rules",icon:a.jsx(qH,{style:qs}),element:a.jsx(VCe,{}),inAgentMode:!1},{title:"Service discovery",path:"/service-discovery",icon:a.jsx(yse,{style:qs}),element:a.jsx(W_e,{}),inAgentMode:!0}],hG=[{title:"Runtime & build information",path:"/status",icon:a.jsx(nr,{style:qs}),element:a.jsx(a_e,{}),inAgentMode:!0},{title:"TSDB status",path:"/tsdb-status",icon:a.jsx(Sse,{style:qs}),element:a.jsx(o_e,{}),inAgentMode:!1},{title:"Command-line flags",path:"/flags",icon:a.jsx(Ose,{style:qs}),element:a.jsx(h_e,{}),inAgentMode:!0},{title:"Configuration",path:"/config",icon:a.jsx(tae,{style:qs}),element:a.jsx(b_e,{}),inAgentMode:!0},{title:"Alertmanager discovery",path:"/alertmanager-discovery",icon:a.jsx(XE,{style:qs}),element:a.jsx(Y_e,{}),inAgentMode:!1}],hP=[...uG,...hG],eTe={defaultRadius:"sm",colors:{"codebox-bg":["#f5f5f5","#e7e7e7","#cdcdcd","#b2b2b2","#9a9a9a","#8b8b8b","#848484","#717171","#656565","#575757"]}},Ax="md";function tTe(){const[t,{toggle:e}]=Cw(),{agentMode:n,consolesLink:r,pathPrefix:i}=fi(),s=a.jsxs(a.Fragment,{children:[r&&a.jsx(Ri,{component:"a",href:r,className:y1.link,leftSection:a.jsx(Cse,{style:qs}),px:Ax,children:"Consoles"}),J_e.filter(l=>!n||l.inAgentMode).map(l=>a.jsx(Ri,{component:Pg,to:l.path,className:y1.link,leftSection:l.icon,px:Ax,children:l.title},l.path)),a.jsxs(Ln,{shadow:"md",width:240,children:[a.jsxs(w5,{children:[hP.filter(l=>!n||l.inAgentMode).map(l=>a.jsx(lh,{path:l.path,element:a.jsx(Ln.Target,{children:a.jsxs(Ri,{component:Pg,to:l.path,className:y1.link,leftSection:l.icon,rightSection:a.jsx(Sv,{style:qs}),px:Ax,onClick:c=>c.preventDefault(),children:["Status ",a.jsx(IH,{style:qs})," ",l.title]})})},l.path)),a.jsx(lh,{path:"*",element:a.jsx(Ln.Target,{children:a.jsx(Ri,{className:y1.link,leftSection:a.jsx(rae,{style:qs}),rightSection:a.jsx(Sv,{style:qs}),px:Ax,children:"Status"})})})]}),a.jsxs(Ln.Dropdown,{children:[a.jsx(Ln.Label,{children:"Monitoring status"}),uG.filter(l=>!n||l.inAgentMode).map(l=>a.jsx(Ln.Item,{component:Pg,to:l.path,leftSection:l.icon,children:l.title},l.path)),a.jsx(Ln.Divider,{}),a.jsx(Ln.Label,{children:"Server status"}),hG.filter(l=>!n||l.inAgentMode).map(l=>a.jsx(Ln.Item,{component:Pg,to:l.path,leftSection:l.icon,children:l.title},l.path))]})]})]}),o=a.jsxs(a.Fragment,{children:[a.jsx(x_e,{}),a.jsx(L_e,{}),a.jsx(A_e,{}),a.jsx(Sr,{component:"a",href:"https://prometheus.io/docs/prometheus/latest/getting_started/",target:"_blank",color:"gray",title:"Documentation","aria-label":"Documentation",size:me(32),children:a.jsx(tse,{style:gu})})]});return a.jsx(ele,{basename:i,children:a.jsx(gCe,{adapter:B_e,children:a.jsx(UP,{defaultColorScheme:"auto",theme:eTe,children:a.jsxs(d_e,{adapter:K_e,children:[a.jsx(pc,{position:"top-right"}),a.jsx(Ile,{client:Z_e,children:a.jsxs(Ha,{header:{height:56},navbar:{width:300,breakpoint:"sm",collapsed:{desktop:!0,mobile:!t}},padding:"md",children:[a.jsxs(I_e,{children:[a.jsx(Ha.Header,{bg:"rgb(65, 73, 81)",c:"#fff",children:a.jsxs(ft,{h:"100%",px:"md",wrap:"nowrap",children:[a.jsxs(ft,{style:{flex:1},justify:"space-between",wrap:"nowrap",children:[a.jsxs(ft,{gap:40,wrap:"nowrap",children:[a.jsx(l6,{to:"/",style:{textDecoration:"none",color:"white"},children:a.jsxs(ft,{gap:10,wrap:"nowrap",children:[a.jsx("img",{src:UX,height:30}),a.jsx(pt,{hiddenFrom:"sm",fz:20,children:"Prometheus"}),a.jsx(pt,{visibleFrom:"md",fz:20,children:"Prometheus"}),a.jsx(pt,{fz:20,children:n&&"Agent"})]})}),a.jsx(ft,{gap:12,visibleFrom:"sm",wrap:"nowrap",children:s})]}),a.jsx(ft,{visibleFrom:"xs",wrap:"nowrap",gap:"xs",children:o})]}),a.jsx(Xw,{opened:t,onClick:e,hiddenFrom:"sm",size:"sm",color:"gray.2"})]})}),a.jsxs(Ha.Navbar,{py:"md",px:4,bg:"rgb(65, 73, 81)",c:"#fff",children:[s,a.jsx(ft,{mt:"md",hiddenFrom:"xs",justify:"center",children:o})]})]}),a.jsx(Ha.Main,{children:a.jsx(Df,{children:a.jsx(O.Suspense,{fallback:a.jsx(ve,{mt:"lg",children:Array.from(Array(10),(l,c)=>a.jsx(Wa,{height:40,mb:15,width:1e3,mx:"auto"},c))}),children:a.jsxs(w5,{children:[a.jsx(lh,{path:"/",element:a.jsx(Ooe,{to:n?"/agent":"/query",replace:!0})}),n?a.jsx(lh,{path:"/agent",element:a.jsx(xx,{children:a.jsx(y_e,{})})}):a.jsxs(a.Fragment,{children:[a.jsx(lh,{path:"/query",element:a.jsx(xx,{children:a.jsx(PV,{})})}),a.jsx(lh,{path:"/alerts",element:a.jsx(xx,{children:a.jsx(VV,{})})})]}),hP.map(l=>a.jsx(lh,{path:l.path,element:a.jsx(xx,{children:l.element})},l.path))]})})},location.pathname)})]})})]})})})})}const OS=(t,e)=>{localStorage.setItem(t,JSON.stringify(e))},dG=pue(),ES=dG.startListening.withTypes();ES({actionCreator:V4,effect:({payload:t})=>{OS(GV,t)}});ES({actionCreator:G4,effect:({payload:t})=>{OS(aG,t)}});ES({actionCreator:tq,effect:(t,{getState:e})=>{OS(Jz,e().queryPage.queryHistory)}});ES({actionCreator:ho,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 OS(`settings.${e}`,n)}})}});const nTe=Qce({reducer:{settings:$he,queryPage:Rue,targetsPage:XCe,serviceDiscoveryPage:F_e},middleware:t=>t().prepend(dG.middleware)});qX.createRoot(document.getElementById("root")).render(a.jsx(zn.StrictMode,{children:a.jsx(lce,{store:nTe,children:a.jsx(tTe,{})})}));
